Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Add the body classes on turbo Load as we rely on them for the styling

Henriette Dargef0acca9abb16
diff --git a/frontend/src/app/core/routing/openproject.routes.ts b/frontend/src/app/core/routing/openproject.routes.ts
index ebb4709e386..f49f0ce12c2 100644
--- a/frontend/src/app/core/routing/openproject.routes.ts
+++ b/frontend/src/app/core/routing/openproject.routes.ts
@@ -181,6 +181,9 @@ export function initializeUiRouterListeners(injector:Injector) {
// Re-find the current app-base
openprojectBaseApp = document.querySelector(appBaseSelector);
uiRouter.urlService.sync();
+
+ // Re-apply the body classes
+ bodyClass(_.get(uiRouter.globals.current, 'data.bodyClasses'), 'add');
});
// Uncomment to trace route changes
diff --git a/spec/features/work_packages/tabs/relations_children_spec.rb b/spec/features/work_packages/tabs/relations_children_spec.rb
index 077bc28f2fa..9cac8a1cd4c 100644
--- a/spec/features/work_packages/tabs/relations_children_spec.rb
+++ b/spec/features/work_packages/tabs/relations_children_spec.rb
@@ -64,6 +64,34 @@ RSpec.describe "Relations children tab", :js, :with_cuprite do
end
end
+ context "when being on the split screen" do
+ let(:wp_split_page) { Pages::SplitWorkPackage.new(work_package, project) }
+
+ it "can render the page correctly after creation (regression #60629)" do
+ wp_split_page.visit_tab!("relations")
+ relations_tab.expect_add_relation_button
+ relations_tab.expect_new_relation_type("New child")
+ relations_tab.expect_new_relation_type("Existing child")
+
+ relations_tab.select_relation_type "New child"
+
+ create_dialog.select_type "Risk"
+ create_dialog.set_subject "Hello there"
+ create_dialog.set_custom_field(required_cf, "Custom value")
+
+ create_dialog.submit
+
+ wait_for_network_idle
+
+ page.within("#work-package-relations-tab-content") do
+ expect(page).to have_content("Hello there")
+ expect(page).to have_content("RISK")
+ end
+
+ expect(page).to have_css("body.router--work-packages-partitioned-split-view-details")
+ end
+ end
+
context "when work package is a milestone and user does not have manage_work_package_relations permission" do
let(:work_package) { create(:work_package, type: type_milestone, project:, subject: "Milestone") }