diff --git a/app/components/projects/configure_view_modal_component.html.erb b/app/components/projects/configure_view_modal_component.html.erb index 5a67332542ba..691908997ac1 100644 --- a/app/components/projects/configure_view_modal_component.html.erb +++ b/app/components/projects/configure_view_modal_component.html.erb @@ -26,7 +26,9 @@ selected: selected_columns, protected: helpers.protected_projects_columns_options, name: COLUMN_HTML_NAME, - id: 'columns-select', + id: COLUMN_HTML_ID, + dragAreaName: "#{COLUMN_HTML_ID}_dragarea", + formControlId: "#{COLUMN_HTML_ID}_autocompleter", inputLabel: I18n.t(:'queries.configure_view.columns.input_label'), inputPlaceholder: I18n.t(:'queries.configure_view.columns.input_placeholder'), dragAreaLabel: I18n.t(:'queries.configure_view.columns.drag_area_label'), diff --git a/app/components/projects/configure_view_modal_component.rb b/app/components/projects/configure_view_modal_component.rb index 03dcf504b972..d802e188e9c5 100644 --- a/app/components/projects/configure_view_modal_component.rb +++ b/app/components/projects/configure_view_modal_component.rb @@ -34,6 +34,7 @@ class Projects::ConfigureViewModalComponent < ApplicationComponent MODAL_ID = "op-project-list-configure-dialog" QUERY_FORM_ID = "op-project-list-configure-query-form" COLUMN_HTML_NAME = "columns" + COLUMN_HTML_ID = "columns-select" options :query diff --git a/app/components/work_packages/details/tab_component.html.erb b/app/components/work_packages/details/tab_component.html.erb index f684953bf5cd..285ff7cfc933 100644 --- a/app/components/work_packages/details/tab_component.html.erb +++ b/app/components/work_packages/details/tab_component.html.erb @@ -62,8 +62,8 @@ flex.with_column(classes: "op-work-package-details-tab-component--action") do render(Primer::Beta::IconButton.new(icon: :x, tag: :a, - href: helpers.url_for_with_params(action: :close_split_view), - data: { turbo: true, 'turbo-stream': true }, + href: base_route, + data: { turbo: true, target: "_top", turbo_action: "advance" }, scheme: :invisible, test_selector: "wp-details-tab-component--close", aria: { label: I18n.t(:button_close) })) diff --git a/app/components/work_packages/split_view_component.html.erb b/app/components/work_packages/split_view_component.html.erb index a978b875dd7d..754c80dadea0 100644 --- a/app/components/work_packages/split_view_component.html.erb +++ b/app/components/work_packages/split_view_component.html.erb @@ -17,7 +17,7 @@ flex.with_row(flex: 1) do helpers.angular_component_tag "opce-wp-split-view", inputs: { - work_package_id: params[:work_package_id] || @work_package.id, + work_package_id: @id, resizerClass: "op-work-package-split-view", activeTab: @tab } diff --git a/app/components/work_packages/split_view_component.sass b/app/components/work_packages/split_view_component.sass index a6dfcb54e1ba..c9d6fd991206 100644 --- a/app/components/work_packages/split_view_component.sass +++ b/app/components/work_packages/split_view_component.sass @@ -7,3 +7,7 @@ @media screen and (max-width: $breakpoint-lg) // Unfortunately, we have to enforce this style via !important as the resizer writes the width directly on the element as inline style min-width: unset !important + + @media screen and (max-width: $breakpoint-sm) + .work-packages--details-toolbar-container + @include hide-button-texts diff --git a/app/controllers/concerns/work_packages/with_split_view.rb b/app/controllers/concerns/work_packages/with_split_view.rb index 73df17bedf52..736a5bfe4b0f 100644 --- a/app/controllers/concerns/work_packages/with_split_view.rb +++ b/app/controllers/concerns/work_packages/with_split_view.rb @@ -37,33 +37,5 @@ module WithSplitView def split_view_work_package_id params[:work_package_id].to_i end - - def close_split_view - respond_to do |format| - format.turbo_stream do - render turbo_stream: [ - turbo_stream.remove("work-package-details-#{split_view_work_package_id}"), - turbo_stream.push_state(url: split_view_base_route), - turbo_stream.set_title(title: helpers.page_title(I18n.t("js.notifications.title"))) - ] - end - format.html do - redirect_to split_view_base_route - end - end - end - - def respond_to_with_split_view(&format_block) - respond_to do |format| - format.turbo_stream do - render turbo_stream: [ - turbo_stream.update("content-bodyRight", helpers.split_view_instance.render_in(view_context)), - turbo_stream.push_state(url: request.fullpath) - ] - end - - yield(format) if format_block - end - end end end diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index e7cdb02293b4..394d8243cd0f 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -31,16 +31,20 @@ class NotificationsController < ApplicationController before_action :require_login before_action :filtered_query, only: :mark_all_read - no_authorization_required! :index, :split_view, :update_counter, :close_split_view, :mark_all_read, :date_alerts, :share_upsale + no_authorization_required! :index, :split_view, :update_counter, :mark_all_read, :date_alerts, :share_upsale def index render_notifications_layout end def split_view - respond_to_with_split_view do |format| + respond_to do |format| format.html do - render :index, layout: "notifications" + if turbo_frame_request? + render "work_packages/split_view", layout: false + else + render :index, layout: "notifications" + end end end end diff --git a/app/helpers/work_packages/split_view_helper.rb b/app/helpers/work_packages/split_view_helper.rb index 4f2d12e138d4..b4e80d882d51 100644 --- a/app/helpers/work_packages/split_view_helper.rb +++ b/app/helpers/work_packages/split_view_helper.rb @@ -10,6 +10,6 @@ def optional_work_package_split_view def split_view_instance WorkPackages::SplitViewComponent.new(id: params[:work_package_id], tab: params[:tab], - base_route: params[:base_route] || work_packages_path) + base_route: split_view_base_route) end end diff --git a/app/mailers/sharing_mailer.rb b/app/mailers/sharing_mailer.rb index 418bd0ba6393..22bbd9d77d77 100644 --- a/app/mailers/sharing_mailer.rb +++ b/app/mailers/sharing_mailer.rb @@ -15,7 +15,7 @@ def shared_work_package(sharer, membership, group = nil) @role_rights = derive_role_rights(role) @allowed_work_package_actions = derive_allowed_work_package_actions(role) @url = optionally_activated_url(work_package_url(@work_package.id), @invitation_token) - @notification_url = optionally_activated_url(details_notifications_url(@work_package.id), @invitation_token) + @notification_url = optionally_activated_url(details_notifications_url(@work_package.id, tab: :activity), @invitation_token) set_open_project_headers(@work_package) message_id(membership, sharer) diff --git a/app/views/layouts/base.html.erb b/app/views/layouts/base.html.erb index 24b25f64e042..47ac73419ed5 100644 --- a/app/views/layouts/base.html.erb +++ b/app/views/layouts/base.html.erb @@ -155,9 +155,9 @@ See COPYRIGHT and LICENSE files for more details. <%= yield %> <% end %> -