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

Bim/feature/33941 show wp detail in full view (#8530)

Aleix Suau0dffec6f58e8
diff --git a/frontend/src/app/modules/bim/ifc_models/bcf/list-container/bcf-list-container.component.ts b/frontend/src/app/modules/bim/ifc_models/bcf/list-container/bcf-list-container.component.ts
index 24b96d56d30..7e44de0ac69 100644
--- a/frontend/src/app/modules/bim/ifc_models/bcf/list-container/bcf-list-container.component.ts
+++ b/frontend/src/app/modules/bim/ifc_models/bcf/list-container/bcf-list-container.component.ts
@@ -88,10 +88,7 @@ export class BcfListContainerComponent extends WorkPackageListViewComponent impl
}
if (event.double) {
- this.$state.go(
- splitViewRoute(this.$state),
- { workPackageId: event.workPackageId }
- );
+ this.goToWpDetailState(event.workPackageId, this.$state.params.cards);
}
}
@@ -103,10 +100,19 @@ export class BcfListContainerComponent extends WorkPackageListViewComponent impl
return;
}
- // Otherwise, always open all links in the details view
- this.$state.go(
- splitViewRoute(this.$state),
- { workPackageId: event.workPackageId, focus: true }
- );
+ this.goToWpDetailState(event.workPackageId, this.$state.params.cards, true);
+ }
+
+ goToWpDetailState(workPackageId:string, cards:boolean, focus?:boolean) {
+ // Show the split view when there is a viewer (browser)
+ // Show only wp details when there is no viewer, plugin environment (ie: Revit)
+ const stateToGo = this.viewer.shouldShowViewer ?
+ splitViewRoute(this.$state) :
+ 'bim.partitioned.show';
+ // Passing the card param to the new state because the router doesn't keep
+ // it when going to 'bim.partitioned.show'
+ const params = { workPackageId, cards, focus };
+
+ this.$state.go(stateToGo, params);
}
}
diff --git a/frontend/src/app/modules/bim/ifc_models/openproject-ifc-models.routes.ts b/frontend/src/app/modules/bim/ifc_models/openproject-ifc-models.routes.ts
index 7441ab608a9..6b5b4e2077e 100644
--- a/frontend/src/app/modules/bim/ifc_models/openproject-ifc-models.routes.ts
+++ b/frontend/src/app/modules/bim/ifc_models/openproject-ifc-models.routes.ts
@@ -111,6 +111,25 @@ export const IFC_ROUTES:Ng2StateDeclaration[] = [
'content-left': { component: IFCViewerComponent }
}
},
+ {
+ name: 'bim.partitioned.show',
+ url: '/show/{workPackageId:[0-9]+}?{cards:bool}',
+ data: {
+ baseRoute: 'bim.partitioned.list',
+ partition: '-left-only'
+ },
+ reloadOnSearch: false,
+ redirectTo: 'bim.partitioned.show.details',
+ },
+ // BCF single view for list
+ ...makeSplitViewRoutes(
+ 'bim.partitioned.list',
+ undefined,
+ WorkPackageSplitViewComponent,
+ undefined,
+ true,
+ 'bim.partitioned.show',
+ ),
// BCF single view for list
...makeSplitViewRoutes(
'bim.partitioned.list',
diff --git a/frontend/src/app/modules/bim/ifc_models/pages/viewer/bim-view.service.ts b/frontend/src/app/modules/bim/ifc_models/pages/viewer/bim-view.service.ts
index 7389322529c..eaa7d100f57 100644
--- a/frontend/src/app/modules/bim/ifc_models/pages/viewer/bim-view.service.ts
+++ b/frontend/src/app/modules/bim/ifc_models/pages/viewer/bim-view.service.ts
@@ -94,6 +94,10 @@ export class BimViewService implements OnDestroy {
bimTableViewIdentifier;
} else if (this.state.includes('bim.**.model')) {
return bimViewerViewIdentifier;
+ } else if (this.state.includes('bim.partitioned.show')) {
+ return this.state.params?.cards || this.state.params?.cards == null ?
+ bimListViewIdentifier :
+ bimTableViewIdentifier;
} else {
return this.state.params?.cards || this.state.params?.cards == null ?
bimSplitViewCardsIdentifier :
diff --git a/frontend/src/app/modules/bim/ifc_models/toolbar/view-toggle/bim-view-toggle-dropdown.directive.ts b/frontend/src/app/modules/bim/ifc_models/toolbar/view-toggle/bim-view-toggle-dropdown.directive.ts
index 7a5e8442ec6..2ec95a57bae 100644
--- a/frontend/src/app/modules/bim/ifc_models/toolbar/view-toggle/bim-view-toggle-dropdown.directive.ts
+++ b/frontend/src/app/modules/bim/ifc_models/toolbar/view-toggle/bim-view-toggle-dropdown.directive.ts
@@ -76,7 +76,6 @@ export class BimViewToggleDropdownDirective extends OpContextMenuTrigger {
private buildItems() {
const current = this.bimView.current;
- const viewRoute = this.state.current.data.viewRoute;
let items = this.viewerBridgeService.shouldShowViewer ?
[bimViewerViewIdentifier, bimListViewIdentifier, bimSplitViewCardsIdentifier, bimSplitViewListIdentifier, bimTableViewIdentifier] :
[bimListViewIdentifier, bimTableViewIdentifier];
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 c77d5423efe..4dae69751d0 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
@@ -57,70 +57,76 @@ import {WorkPackageCopySplitViewComponent} from "core-components/wp-copy/wp-copy
export function makeSplitViewRoutes(baseRoute:string,
menuItemClass:string|undefined,
showComponent:ComponentType<any>,
- newComponent:ComponentType<any> = WorkPackageNewSplitViewComponent):Ng2StateDeclaration[] {
+ newComponent:ComponentType<any> = WorkPackageNewSplitViewComponent,
+ makeFullWidth?:boolean,
+ routeName = baseRoute):Ng2StateDeclaration[] {
+ // makeFullWidth configuration
+ const views:any = makeFullWidth ?
+ {'content-left@^.^': { component: showComponent }} :
+ {'content-right@^.^': { component: showComponent }};
+ const partition = makeFullWidth ? '-left-only' : '-split';
+
return [
{
- name: baseRoute + '.details',
+ name: routeName + '.details',
url: '/details/{workPackageId:[0-9]+}',
- redirectTo: baseRoute + '.details.overview',
+ redirectTo: routeName + '.details.overview',
reloadOnSearch: false,
data: {
bodyClasses: 'router--work-packages-partitioned-split-view-details',
menuItem: menuItemClass,
// Remember the base route so we can route back to it anywhere
baseRoute: baseRoute,
- partition: '-split',
- newRoute: baseRoute + '.new',
+ newRoute: routeName + '.new',
+ partition,
},
- views: {
- // Retarget and by that override the grandparent views
- // https://ui-router.github.io/guide/views#relative-parent-state
- 'content-right@^.^': { component: showComponent }
- }
+ // Retarget and by that override the grandparent views
+ // https://ui-router.github.io/guide/views#relative-parent-state
+ views,
},
{
- name: baseRoute + '.details.overview',
+ name: routeName + '.details.overview',
url: '/overview',
component: WorkPackageOverviewTabComponent,
data: {
baseRoute: baseRoute,
menuItem: menuItemClass,
- parent: baseRoute + '.details'
+ parent: routeName + '.details'
}
},
{
- name: baseRoute + '.details.activity',
+ name: routeName + '.details.activity',
url: '/activity',
component: WorkPackageActivityTabComponent,
data: {
baseRoute: baseRoute,
menuItem: menuItemClass,
- parent: baseRoute + '.details'
+ parent: routeName + '.details'
}
},
{
- name: baseRoute + '.details.relations',
+ name: routeName + '.details.relations',
url: '/relations',
component: WorkPackageRelationsTabComponent,
data: {
baseRoute: baseRoute,
menuItem: menuItemClass,
- parent: baseRoute + '.details'
+ parent: routeName + '.details'
}
},
{
- name: baseRoute + '.details.watchers',
+ name: routeName + '.details.watchers',
url: '/watchers',
component: WorkPackageWatchersTabComponent,
data: {
baseRoute: baseRoute,
menuItem: menuItemClass,
- parent: baseRoute + '.details'
+ parent: routeName + '.details'
}
},
// Split create route
{
- name: baseRoute + '.new',
+ name: routeName + '.new',
url: '/create_new?{type:[0-9]+}&{parent_id:[0-9]+}',
reloadOnSearch: false,
data: {
@@ -139,7 +145,7 @@ export function makeSplitViewRoutes(baseRoute:string,
},
// Split copy route
{
- name: baseRoute + '.copy',
+ name: routeName + '.copy',
url: '/details/{copiedFromWorkPackageId:[0-9]+}/copy',
views: {
'content-right@^.^': { component: WorkPackageCopySplitViewComponent }