Skip to content

Commit 182bed8

Browse files
committed
Merge remote-tracking branch 'origin/release/15.5' into dev
2 parents 829d716 + 807b3e4 commit 182bed8

File tree

5 files changed

+29
-9
lines changed

5 files changed

+29
-9
lines changed

Gemfile.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ GEM
504504
concurrent-ruby (~> 1.0)
505505
dry-core (~> 1.1)
506506
zeitwerk (~> 2.6)
507-
dry-monads (1.8.2)
507+
dry-monads (1.8.3)
508508
concurrent-ruby (~> 1.0)
509509
dry-core (~> 1.1)
510510
zeitwerk (~> 2.6)
@@ -1593,7 +1593,7 @@ CHECKSUMS
15931593
dry-inflector (1.2.0) sha256=22f5d0b50fd57074ae57e2ca17e3b300e57564c218269dcf82ff3e42d3f38f2e
15941594
dry-initializer (3.2.0) sha256=37d59798f912dc0a1efe14a4db4a9306989007b302dcd5f25d0a2a20c166c4e3
15951595
dry-logic (1.6.0) sha256=da6fedbc0f90fc41f9b0cc7e6f05f5d529d1efaef6c8dcc8e0733f685745cea2
1596-
dry-monads (1.8.2) sha256=662e0b4515bc41048e0e2c033db86327839649a53bff383489096e47a71f22b0
1596+
dry-monads (1.8.3) sha256=5fbc06ae4ff76ae081922a902be998673703304d10b46b08931696f2c8decc06
15971597
dry-schema (1.14.1) sha256=2fcd7539a7099cacae6a22f6a3a2c1846fe5afeb1c841cde432c89c6cb9b9ff1
15981598
dry-types (1.8.2) sha256=c84e9ada69419c727c3b12e191e0ed7d2c6d58d040d55e79ea16e0ebf8b3ec0f
15991599
dry-validation (1.11.1) sha256=70900bb5a2d911c8aab566d3e360c6bff389b8bf92ea8e04885ce51c41ff8085

app/components/work_package_relations_tab/index_component.sass

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
// It can't be nested inside the BEM model as it's placed as a #top-layer element.
33
#new-relation-action-menu-list,
44
#new-child-action-menu-list
5-
max-height: 450px
5+
max-height: 470px
66
max-width: 280px

app/models/work_package_custom_field.rb

+9-4
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,15 @@ class WorkPackageCustomField < CustomField
4747
}
4848

4949
scope :visible_by_user, ->(user) {
50-
where(projects: { id: Project.visible(user) })
51-
.where(types: { id: Type.enabled_in(Project.visible(user)) })
52-
.or(where(is_for_all: true).references(:projects, :types))
53-
.includes(:projects, :types)
50+
# Prefer a subquery to a join to avoid the database query returning
51+
# the cross product of projects, types and custom fields.
52+
where(id:
53+
unscoped
54+
.where(projects: { id: Project.visible(user) })
55+
.where(types: { id: Type.enabled_in(Project.visible(user)) })
56+
.or(unscoped.where(is_for_all: true))
57+
.includes(:projects, :types)
58+
.select(:id))
5459
}
5560

5661
scope :usable_as_custom_action, -> {

frontend/src/app/core/routing/openproject.routes.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,10 @@ export function initializeUiRouterListeners(injector:Injector) {
182182
openprojectBaseApp = document.querySelector(appBaseSelector);
183183
uiRouter.urlService.sync();
184184

185-
// Re-apply the body classes
186-
bodyClass(_.get(uiRouter.globals.current, 'data.bodyClasses'), 'add');
185+
// Re-apply the body classes if the turbo load event is on the same page (e.g. when creating a child from the relations tab)
186+
if (stateService.href(uiRouter.globals.current) === window.location.pathname + window.location.search) {
187+
bodyClass(_.get(uiRouter.globals.current, 'data.bodyClasses'), 'add');
188+
}
187189
});
188190

189191
// Uncomment to trace route changes

spec/features/work_packages/navigation_spec.rb

+13
Original file line numberDiff line numberDiff line change
@@ -262,4 +262,17 @@
262262
expect(page).to have_css "li", text: "The requested resource could not be found"
263263
end
264264
end
265+
266+
# Introduced by regression #60629
267+
it "can navigate correctly to non-angular pages (regression #61790)" do
268+
global_work_packages = Pages::WorkPackagesTable.new
269+
global_work_packages.visit!
270+
271+
# Navigate to the administration
272+
page.find(".op-top-menu-user-avatar").click
273+
page.find_test_selector("op-menu--item-action", text: "Administration").click
274+
275+
# Expect classes to be gone
276+
expect(page).to have_no_css("body.router--work-packages-base")
277+
end
265278
end

0 commit comments

Comments
 (0)