[30249] Change default order of wp table

https://community.openproject.com/wp/30249
pull/7323/head
Oliver Günther 6 years ago
parent 2ae8eb2f19
commit 8fd64d06ff
No known key found for this signature in database
GPG Key ID: A3A8BDAD7C0C552C
  1. 2
      config/settings.yml
  2. 14
      modules/xls_export/spec/lib/work_package_xls_export_spec.rb
  3. 10
      spec/features/accessibility/work_packages/work_package_query_spec.rb

@ -259,9 +259,9 @@ mail_suffix_separators:
work_package_list_default_columns:
serialized: true
default:
- type
- id
- subject
- type
- status
- assigned_to
- updated_on

@ -88,7 +88,7 @@ describe "WorkPackageXlsExport" do
RELATED_SUBJECT = 12
it 'produces the correct result' do
expect(query.columns.map(&:name)).to eq [:id, :subject, :type, :status, :assigned_to]
expect(query.columns.map(&:name)).to eq [:type, :id, :subject, :status, :assigned_to]
# the first header row devides the sheet into work packages and relation columns
expect(sheet.rows.first.take(7)).to eq ['Work packages', nil, nil, nil, nil, nil, 'Relations']
@ -96,14 +96,14 @@ describe "WorkPackageXlsExport" do
# the second header row includes the column names for work packages and relations
expect(sheet.rows[1])
.to eq [
nil, 'ID', 'Subject', 'Type', 'Status', 'Assignee',
nil, 'Type', 'ID', 'Subject', 'Status', 'Assignee',
nil, 'Relation type', 'Delay', 'Description', 'ID', 'Type', 'Subject',
nil
]
# duplicates rows for each relation
c2id = child_2.id
expect(sheet.column(1).drop(2))
expect(sheet.column(2).drop(2))
.to eq [parent.id, parent.id, child_1.id, c2id, c2id, c2id, single.id, followed.id, child_2_child.id]
# marks Parent as parent of Child 1 and 2
@ -140,20 +140,20 @@ describe "WorkPackageXlsExport" do
# exports the correct data (examples)
expect(sheet.row(PARENT))
.to eq [
nil, parent.id, parent.subject, parent.type.name, parent.status.name, parent.assigned_to,
nil, parent.type.name, parent.id, parent.subject, parent.status.name, parent.assigned_to,
nil, 'parent of', nil, nil, child_1.id, child_1.type.name, child_1.subject
] # delay nil as this is a parent-child relation not represented by an actual Relation record
expect(sheet.row(SINGLE))
.to eq [
nil, single.id, single.subject, single.type.name, single.status.name, single.assigned_to
nil, single.type.name, single.id, single.subject, single.status.name, single.assigned_to
]
expect(sheet.row(FOLLOWED))
.to eq [
nil, followed.id, followed.subject, followed.type.name, followed.status.name,
nil, followed.type.name, followed.id, followed.subject, followed.status.name,
followed.assigned_to,
nil, 'precedes', 0, relation.description, child_2.id, child_2.type.name, child_2.subject
nil, 'precedes', 0, relation.description, child_2.id, child_2.type.name, child_2.subject
]
end

@ -115,7 +115,7 @@ describe 'Work package index accessibility', type: :feature, selenium: true do
describe 'id column' do
let(:link_caption) { 'ID' }
let(:column_header_selector) { '.work-package-table--container th:nth-of-type(1)' }
let(:column_header_selector) { '.work-package-table--container th:nth-of-type(2)' }
let(:column_header_link_selector) { column_header_selector + ' a' }
it_behaves_like 'sortable column'
@ -123,7 +123,7 @@ describe 'Work package index accessibility', type: :feature, selenium: true do
describe 'subject column' do
let(:link_caption) { 'Subject' }
let(:column_header_selector) { '.work-package-table--container th:nth-of-type(2)' }
let(:column_header_selector) { '.work-package-table--container th:nth-of-type(3)' }
let(:column_header_link_selector) { column_header_selector + ' #subject' }
it_behaves_like 'sortable column'
@ -131,7 +131,7 @@ describe 'Work package index accessibility', type: :feature, selenium: true do
describe 'type column' do
let(:link_caption) { 'Type' }
let(:column_header_selector) { '.work-package-table--container th:nth-of-type(3)' }
let(:column_header_selector) { '.work-package-table--container th:nth-of-type(1)' }
let(:column_header_link_selector) { column_header_selector + ' a' }
it_behaves_like 'sortable column'
@ -165,10 +165,10 @@ describe 'Work package index accessibility', type: :feature, selenium: true do
context 'focus' do
let(:first_link_selector) do
".wp-row-#{work_package.id} td.id a"
".wp-row-#{work_package.id} .wp-table--cell-span.type"
end
let(:second_link_selector) do
".wp-row-#{another_work_package.id} td.id a"
".wp-row-#{another_work_package.id} .wp-table--cell-span.type"
end
it 'navigates with J and K' do

Loading…
Cancel
Save