[#38032] BCF module: Change default order to ID DESC. (#9651)

- Adopt spec. CSS class for ID link in WP cards changed

https://community.openproject.org/work_packages/38032
pull/9680/head
Wieland Lindenthal 3 years ago committed by GitHub
parent 468b5602d1
commit 0193b3fcfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      modules/bim/app/controllers/bim/ifc_models/ifc_models_controller.rb
  2. 13
      modules/bim/spec/features/show_default_spec.rb

@ -187,7 +187,8 @@ module Bim
end end
def frontend_redirect(model_ids) def frontend_redirect(model_ids)
redirect_to bcf_project_frontend_path(models: JSON.dump(Array(model_ids))) redirect_to bcf_project_frontend_path(models: JSON.dump(Array(model_ids)),
query_props: '{"t":"id:desc"}')
end end
def find_all_ifc_models def find_all_ifc_models

@ -67,16 +67,27 @@ describe 'show default model',
end end
context 'with everything ready' do context 'with everything ready' do
let(:old_work_package) { FactoryBot.create(:work_package, project: project) }
let(:new_work_package) { FactoryBot.create(:work_package, project: project) }
before do before do
old_work_package
new_work_package
show_default_page.visit! show_default_page.visit!
show_default_page.finished_loading show_default_page.finished_loading
end end
it 'loads and shows the viewer correctly' do it 'loads and shows the viewer and WPs correctly' do
show_default_page.model_viewer_visible true show_default_page.model_viewer_visible true
show_default_page.model_viewer_shows_a_toolbar true show_default_page.model_viewer_shows_a_toolbar true
show_default_page.page_shows_a_toolbar true show_default_page.page_shows_a_toolbar true
model_tree.sidebar_shows_viewer_menu true model_tree.sidebar_shows_viewer_menu true
# Check the order of work packages: Latest first
expect(show_default_page.find_all('.wp-card--id').map(&:text)).to(
eql(["##{new_work_package.id}", "##{old_work_package.id}"])
)
end end
end end

Loading…
Cancel
Save