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

Avoid loading the same viewpoint on the viewer when clicking on a card

Aleix Suaua8cbfd40c91f
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 96d37141c0e..25e15b41bc1 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
@@ -39,6 +39,8 @@ export class BcfListContainerComponent extends WorkPackageListViewComponent impl
dragAndDropEnabled: false
};
+ public currentWorkPackageInViewer:string;
+
ngOnInit() {
super.ngOnInit();
@@ -81,14 +83,20 @@ export class BcfListContainerComponent extends WorkPackageListViewComponent impl
}
handleWorkPackageClicked(event:{ workPackageId:string; double:boolean }) {
- // Open the viewpoint if any
- const wp = this.states.workPackages.get(event.workPackageId).value;
- if (wp && this.viewer.viewerVisible() && wp.bcfViewpoints) {
- this.viewer.showViewpoint(wp, 0);
+ const {workPackageId, double} = event;
+
+ if (workPackageId !== this.currentWorkPackageInViewer) {
+ const wp = this.states.workPackages.get(workPackageId).value;
+
+ if (wp && this.viewer.viewerVisible() && wp.bcfViewpoints) {
+ this.viewer.showViewpoint(wp, 0);
+ }
+
+ this.currentWorkPackageInViewer = workPackageId;
}
- if (event.double) {
- this.goToWpDetailState(event.workPackageId, this.uIRouterGlobals.params.cards);
+ if (double) {
+ this.goToWpDetailState(workPackageId, this.uIRouterGlobals.params.cards);
}
}