mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
Merge pull request #22721 from opf/bug/73448-closing-the-work-package-split-view-reloads-whole-page
Bug/73448 closing the work package split view reloads whole page
This commit is contained in:
@@ -85,7 +85,7 @@
|
||||
icon: :x,
|
||||
tag: :a,
|
||||
href: base_route,
|
||||
data: { turbo: true, target: "_top", turbo_action: "advance" },
|
||||
data: { turbo: true, turbo_action: "advance" },
|
||||
scheme: :invisible,
|
||||
test_selector: "wp-details-tab-component--close",
|
||||
aria: { label: I18n.t(:button_close) }
|
||||
|
||||
+12
-4
@@ -26,12 +26,14 @@
|
||||
// See COPYRIGHT and LICENSE files for more details.
|
||||
//++
|
||||
|
||||
import { ChangeDetectionStrategy, Component, ElementRef, Input } from '@angular/core';
|
||||
import { ChangeDetectionStrategy, Component, ElementRef, Input, OnDestroy, inject } from '@angular/core';
|
||||
import {
|
||||
WorkPackageIsolatedQuerySpaceDirective,
|
||||
} from 'core-app/features/work-packages/directives/query-space/wp-isolated-query-space.directive';
|
||||
import { populateInputsFromDataset } from 'core-app/shared/components/dataset-inputs';
|
||||
|
||||
const splitViewBodyClass = 'router--work-packages-partitioned-split-view-details';
|
||||
|
||||
/**
|
||||
* An entry component to be rendered by Rails which opens an isolated query space
|
||||
* for the work package split view
|
||||
@@ -48,14 +50,20 @@ import { populateInputsFromDataset } from 'core-app/shared/components/dataset-in
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: false,
|
||||
})
|
||||
export class WorkPackageSplitViewEntryComponent {
|
||||
export class WorkPackageSplitViewEntryComponent implements OnDestroy {
|
||||
@Input() workPackageId:string;
|
||||
@Input() activeTab:string;
|
||||
@Input() resizerClass:string;
|
||||
|
||||
constructor(readonly elementRef:ElementRef) {
|
||||
readonly elementRef = inject(ElementRef);
|
||||
|
||||
constructor() {
|
||||
populateInputsFromDataset(this);
|
||||
|
||||
document.body.classList.add('router--work-packages-partitioned-split-view-details');
|
||||
document.body.classList.add(splitViewBodyClass);
|
||||
}
|
||||
|
||||
ngOnDestroy():void {
|
||||
document.body.classList.remove(splitViewBodyClass);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,18 +32,17 @@ class RbMasterBacklogsController < RbApplicationController
|
||||
include WorkPackages::WithSplitView
|
||||
|
||||
# Without the feature flag, there is only the top level menu item, select it
|
||||
menu_item :backlogs_legacy
|
||||
menu_item :backlogs_legacy, only: :index
|
||||
|
||||
# With the feature flag, we have a proper menu, select the correct sub entry
|
||||
current_menu_item [:backlog] do
|
||||
:backlog
|
||||
end
|
||||
menu_item :backlog, only: %i[backlog details]
|
||||
|
||||
before_action :not_authorized_on_feature_flag_inactive, only: :backlog
|
||||
before_action :load_backlogs, only: %i[index backlog]
|
||||
|
||||
def backlog
|
||||
if turbo_frame_request?
|
||||
case turbo_frame_request_id
|
||||
when "backlogs_container"
|
||||
render partial: "backlog_list", layout: false
|
||||
else
|
||||
render :backlog
|
||||
@@ -74,6 +73,8 @@ class RbMasterBacklogsController < RbApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def split_view_base_route
|
||||
if OpenProject::FeatureDecisions.scrum_projects_active?
|
||||
backlog_backlogs_project_backlogs_path(request.query_parameters)
|
||||
@@ -82,8 +83,6 @@ class RbMasterBacklogsController < RbApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def load_backlogs
|
||||
@owner_backlogs = Backlog.owner_backlogs(@project)
|
||||
|
||||
|
||||
@@ -53,5 +53,7 @@ See COPYRIGHT and LICENSE files for more details.
|
||||
<% end %>
|
||||
|
||||
<% content_for :content_body_right do %>
|
||||
<%# copy of the hack from app/views/notifications/index.html.erb %>
|
||||
<%= 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 %>
|
||||
|
||||
Reference in New Issue
Block a user