Merge pull request #7350 from opf/feature/30249/default-order

Change default order of wp table

[ci skip]
pull/7358/head
Oliver Günther 5 years ago committed by GitHub
commit 74bee90a18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      config/settings.yml
  2. 26
      modules/xls_export/spec/lib/work_package_xls_export_spec.rb
  3. 10
      spec/features/accessibility/work_packages/work_package_query_spec.rb

@ -259,12 +259,12 @@ mail_suffix_separators:
work_package_list_default_columns:
serialized: true
default:
- type
- id
- subject
- type
- status
- assigned_to
- updated_on
- priority
work_package_list_default_highlighting_mode:
default: 'inline'
work_package_list_default_highlighted_attributes:

@ -83,27 +83,27 @@ describe "WorkPackageXlsExport" do
CHILD_2 = 5
SINGLE = 8
FOLLOWED = 9
RELATION = 7
RELATION_DESCRIPTION = 9
RELATED_SUBJECT = 12
RELATION = 8
RELATION_DESCRIPTION = 10
RELATED_SUBJECT = 13
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, :priority]
# 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']
expect(sheet.rows.first.take(8)).to eq ['Work packages', nil, nil, nil, nil, nil, nil, 'Relations']
# 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', 'Priority',
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
@ -130,7 +130,7 @@ describe "WorkPackageXlsExport" do
expect(sheet.row(CHILD_2 + 2)[RELATED_SUBJECT]).to eq 'Followed'
# shows no relation information for Single
expect(sheet.row(SINGLE).drop(6).compact).to eq []
expect(sheet.row(SINGLE).drop(7).compact).to eq []
# shows Followed as preceding Child 2'
expect(sheet.row(FOLLOWED)[RELATION]).to eq 'precedes'
@ -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, parent.priority.name,
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, single.priority.name
]
expect(sheet.row(FOLLOWED))
.to eq [
nil, followed.id, followed.subject, followed.type.name, followed.status.name,
followed.assigned_to,
nil, 'precedes', 0, relation.description, child_2.id, child_2.type.name, child_2.subject
nil, followed.type.name, followed.id, followed.subject, followed.status.name,
followed.assigned_to, followed.priority.name,
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