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

Use the correct new route given the current route

Oliver Günthere4e3edb1838b
diff --git a/frontend/src/app/modules/ifc_models/openproject-ifc-models.routes.ts b/frontend/src/app/modules/ifc_models/openproject-ifc-models.routes.ts
index da1c889675b..03b7ddd490a 100644
--- a/frontend/src/app/modules/ifc_models/openproject-ifc-models.routes.ts
+++ b/frontend/src/app/modules/ifc_models/openproject-ifc-models.routes.ts
@@ -59,6 +59,7 @@ export const IFC_ROUTES:Ng2StateDeclaration[] = [
name: 'bim.partitioned.list',
url: '/list',
data: {
+ newRoute: 'bim.partitioned.list.new',
partition: '-left-only'
},
reloadOnSearch: false,
@@ -71,6 +72,7 @@ export const IFC_ROUTES:Ng2StateDeclaration[] = [
url: '/split',
data: {
partition: '-split',
+ newRoute: 'bim.partitioned.split.new',
bodyClasses: 'router--work-packages-partitioned-split-view'
},
reloadOnSearch: false,
@@ -83,7 +85,8 @@ export const IFC_ROUTES:Ng2StateDeclaration[] = [
name: 'bim.partitioned.model',
url: '/model',
data: {
- partition: '-left-only'
+ partition: '-left-only',
+ newRoute: 'bim.partitioned.split.new',
},
reloadOnSearch: false,
views: {
diff --git a/frontend/src/app/modules/ifc_models/pages/viewer/ifc-viewer-page.component.ts b/frontend/src/app/modules/ifc_models/pages/viewer/ifc-viewer-page.component.ts
index 868cf75aa43..73f6d89064e 100644
--- a/frontend/src/app/modules/ifc_models/pages/viewer/ifc-viewer-page.component.ts
+++ b/frontend/src/app/modules/ifc_models/pages/viewer/ifc-viewer-page.component.ts
@@ -20,6 +20,7 @@ import {QueryParamListenerService} from "core-components/wp-query/query-param-li
import {QueryResource} from "core-app/modules/hal/resources/query-resource";
import {BimManageIfcModelsButtonComponent} from "core-app/modules/ifc_models/toolbar/manage-ifc-models-button/bim-manage-ifc-models-button.component";
import {WorkPackageCreateButtonComponent} from "core-components/wp-buttons/wp-create-button/wp-create-button.component";
+import {StateService} from "@uirouter/core";
@Component({
templateUrl: '/app/modules/work_packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.html',
@@ -45,7 +46,7 @@ export class IFCViewerPageComponent extends PartitionedQuerySpacePageComponent {
{
component: WorkPackageCreateButtonComponent,
inputs: {
- stateName: ".new",
+ stateName: this.state.current.data.newRoute || 'bim.partitioned.split.new',
allowed: ['work_packages.createWorkPackage', 'work_package.copy']
}
},
@@ -76,6 +77,7 @@ export class IFCViewerPageComponent extends PartitionedQuerySpacePageComponent {
];
constructor(readonly ifcData:IfcModelsDataService,
+ readonly state:StateService,
readonly bimView:BimViewService,
readonly gon:GonService,
readonly injector:Injector) {
diff --git a/frontend/src/app/modules/work_packages/routing/split-view-routes.template.ts b/frontend/src/app/modules/work_packages/routing/split-view-routes.template.ts
index abf1daca2a5..7276ba87e84 100644
--- a/frontend/src/app/modules/work_packages/routing/split-view-routes.template.ts
+++ b/frontend/src/app/modules/work_packages/routing/split-view-routes.template.ts
@@ -68,7 +68,8 @@ export function makeSplitViewRoutes(baseRoute:string,
menuItem: menuItemClass,
// Remember the base route so we can route back to it anywhere
baseRoute: baseRoute,
- partition: '-split'
+ partition: '-split',
+ newRoute: baseRoute + '.new',
},
views: {
// Retarget and by that override the grandparent views