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

[#64541] added explainatory comment for BCF split screen hack

Eric Schubert4bc4f214f4ea
diff --git a/frontend/src/app/features/bim/ifc_models/pages/viewer/ifc-viewer-page.component.ts b/frontend/src/app/features/bim/ifc_models/pages/viewer/ifc-viewer-page.component.ts
index 08fed4a195d..28756bca6df 100644
--- a/frontend/src/app/features/bim/ifc_models/pages/viewer/ifc-viewer-page.component.ts
+++ b/frontend/src/app/features/bim/ifc_models/pages/viewer/ifc-viewer-page.component.ts
@@ -26,13 +26,7 @@
// See COPYRIGHT and LICENSE files for more details.
//++
-import {
- ChangeDetectionStrategy,
- Component,
- Injector,
- OnInit,
- ViewEncapsulation,
-} from '@angular/core';
+import { ChangeDetectionStrategy, Component, Injector, OnInit, ViewEncapsulation } from '@angular/core';
import {
PartitionedQuerySpacePageComponent,
ToolbarButtonComponentDefinition,
@@ -176,16 +170,17 @@ export class IFCViewerPageComponent extends PartitionedQuerySpacePageComponent i
.subscribe((query) => {
const dr = query.displayRepresentation || bcfSplitViewCardsIdentifier;
this.filterAllowed = dr !== bcfViewerViewIdentifier;
- this.hideSplitScreen(dr as BcfViewState);
+ // When changing the query space by selecting a dropdown option, handle the split screen
+ // and hide it for full views.
+ this.hideSplitScreenForFullViews(dr as BcfViewState);
this.cdRef.detectChanges();
});
this.$transitions.onSuccess({}, (transition):void => {
- const toState = transition.to();
-
- if (toState.name === 'bim.partitioned.list') {
+ // When going back from "details" route to "list" route handle the split screen right side
+ if (transition.to().name === 'bim.partitioned.list') {
const dr = this.querySpace.query.value?.displayRepresentation;
- this.hideSplitScreen((dr || bcfTableViewIdentifier) as BcfViewState);
+ this.hideSplitScreenForFullViews((dr || bcfTableViewIdentifier) as BcfViewState);
}
});
}
@@ -216,7 +211,7 @@ export class IFCViewerPageComponent extends PartitionedQuerySpacePageComponent i
});
}
- private hideSplitScreen(dr:BcfViewState):void {
+ private hideSplitScreenForFullViews(dr:BcfViewState):void {
if ([bcfViewerViewIdentifier, bcfCardsViewIdentifier, bcfTableViewIdentifier].includes(dr)) {
document.documentElement.style.setProperty('--split-screen-width', '0');
}