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

Hack to update title without turbo drive

Oliver Günther93d003d3d363
diff --git a/app/helpers/work_packages/split_view_helper.rb b/app/helpers/work_packages/split_view_helper.rb
index b4e80d882d5..5f82668bd19 100644
--- a/app/helpers/work_packages/split_view_helper.rb
+++ b/app/helpers/work_packages/split_view_helper.rb
@@ -1,10 +1,6 @@
module WorkPackages::SplitViewHelper
- def optional_work_package_split_view
- return unless params[:work_package_split_view]
-
- content_for :content_body_right do
- render split_view_instance
- end
+ def render_work_package_split_view?
+ params[:work_package_split_view].present?
end
def split_view_instance
diff --git a/app/views/notifications/index.html.erb b/app/views/notifications/index.html.erb
index 3e975299c18..c41256b4058 100644
--- a/app/views/notifications/index.html.erb
+++ b/app/views/notifications/index.html.erb
@@ -11,7 +11,11 @@
<% content_for :content_body do %>
<%= angular_component_tag "opce-notification-center" %>
-
+dd
<% end %>
-<% optional_work_package_split_view %>
+<% content_for :content_body_right do %>
+ <%# When we update the split screen from a turbo frame requset, the title is not correctly updated (Hack for #57705) %>
+ <%= turbo_stream.set_title(title: page_title(*html_title_parts)) if turbo_frame_request? %>
+ <%= render(split_view_instance) if render_work_package_split_view? %>
+<% end %>
diff --git a/spec/features/notifications/notification_center/split_screen_spec.rb b/spec/features/notifications/notification_center/split_screen_spec.rb
index c91d16638e6..1749a2e354d 100644
--- a/spec/features/notifications/notification_center/split_screen_spec.rb
+++ b/spec/features/notifications/notification_center/split_screen_spec.rb
@@ -91,10 +91,7 @@ RSpec.describe "Split screen in the notification center", :js, :with_cuprite do
# The split view should be closed and html title should change to the previous title
split_screen.close
- ##
- # TODO: This got broken with frame-based navigation
- # global_html_title.expect_first_segment "Notifications"
- ##
+ global_html_title.expect_first_segment "Notifications"
# Html title should be updated with next WP data after making the current one as read
second_title = "#{second_work_package.type.name}: #{second_work_package.subject} (##{second_work_package.id})"