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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Introduce partitioned-query-space into ifc module
Oliver Güntherf32d78850e59
diff --git a/frontend/src/app/modules/ifc_models/bcf/container/bcf-container.component.ts b/frontend/src/app/modules/ifc_models/bcf/container/bcf-container.component.tsindex 22e2bb85d2e..1caeb71aaba 100644--- a/frontend/src/app/modules/ifc_models/bcf/container/bcf-container.component.ts+++ b/frontend/src/app/modules/ifc_models/bcf/container/bcf-container.component.ts@@ -13,9 +13,6 @@ import {untilComponentDestroyed} from "ng2-rx-componentdestroyed";@Component({templateUrl: './bcf-container.component.html',- providers: [- QueryParamListenerService- ]})export class BCFContainerComponent implements OnInit, OnDestroy {@InjectField() public queryParamListener:QueryParamListenerService;diff --git a/frontend/src/app/modules/ifc_models/openproject-ifc-models.module.ts b/frontend/src/app/modules/ifc_models/openproject-ifc-models.module.tsindex 94ccfc6b67e..b5bb4f5a2cb 100644--- a/frontend/src/app/modules/ifc_models/openproject-ifc-models.module.ts+++ b/frontend/src/app/modules/ifc_models/openproject-ifc-models.module.ts@@ -33,10 +33,10 @@ import {IFCViewerComponent} from './ifc-viewer/ifc-viewer.component';import {IFC_ROUTES} from "core-app/modules/ifc_models/openproject-ifc-models.routes";import {IFCViewerPageComponent} from "core-app/modules/ifc_models/pages/viewer/ifc-viewer-page.component";import {BCFContainerComponent} from "core-app/modules/ifc_models/bcf/container/bcf-container.component";-import {BimViewToggleDropdownDirective} from "core-app/modules/ifc_models/view-toggle/bim-view-toggle-dropdown.directive";-import {BimViewToggleComponent} from "core-app/modules/ifc_models/view-toggle/bim-view-toggle.component";import {EmptyComponent} from "core-app/modules/ifc_models/empty/empty-component";-import {BimViewService} from "core-app/modules/ifc_models/view-toggle/bim-view.service";+import {BimViewToggleButtonComponent} from "core-app/modules/ifc_models/toolbar/view-toggle/bim-view-toggle-button.component";+import {BimViewToggleDropdownDirective} from "core-app/modules/ifc_models/toolbar/view-toggle/bim-view-toggle-dropdown.directive";+import {BimManageIfcModelsButtonComponent} from "core-app/modules/ifc_models/toolbar/manage-ifc-models-button/bim-manage-ifc-models-button.component";@NgModule({imports: [@@ -54,15 +54,18 @@ import {BimViewService} from "core-app/modules/ifc_models/view-toggle/bim-view.sEmptyComponent,BCFContainerComponent,- // View selector- BimViewToggleComponent,+ // Toolbar+ BimManageIfcModelsButtonComponent,+ BimViewToggleButtonComponent,BimViewToggleDropdownDirective,IFCViewerComponent],- exports: [- ],+ exports: [],entryComponents: [+ // Toolbar,+ BimViewToggleButtonComponent,+ BimViewToggleButtonComponent,]})export class OpenprojectIFCModelsModule {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.tsindex 0a9d103c90f..dad005119fd 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@@ -39,76 +39,81 @@ export const IFC_ROUTES:Ng2StateDeclaration[] = [url: '/ifc_models?query_props',abstract: true,component: WorkPackagesBaseComponent,+ redirectTo: 'bim.partitioned.defaults',params: {// Use custom encoder/decoder that ensures validity of URL stringquery_props: {type: 'opQueryString', dynamic: true}}},{- name: 'bim.space',+ name: 'bim.partitioned',url: '',- abstract: true,component: IFCViewerPageComponent},{- name: 'bim.space.list',+ name: 'bim.partitioned.list',url: '/list',- component: IFCViewerPageComponent,data: {- viewRoute: 'bim.space.defaults',+ viewRoute: 'bim.partitioned.defaults',+ partition: '-right-only'},+ reloadOnSearch: false,views: {- list: { component: BCFContainerComponent }+ 'content-right': { component: BCFContainerComponent }}},{- name: 'bim.space.defaults',+ name: 'bim.partitioned.defaults',url: '/defaults',- component: IFCViewerPageComponent,data: {- viewRoute: 'bim.space.defaults',+ viewRoute: 'bim.partitioned.defaults',+ partition: '-split'},+ reloadOnSearch: false,views: {- viewer: { component: IFCViewerComponent },- list: { component: BCFContainerComponent }+ 'content-left': { component: IFCViewerComponent },+ 'content-right': { component: BCFContainerComponent }}},{- name: 'bim.space.defaults.model',+ name: 'bim.partitioned.defaults.model',url: '/model',- component: IFCViewerPageComponent,data: {- viewRoute: 'bim.space.defaults',+ viewRoute: 'bim.partitioned.defaults',+ partition: '-left-only'},+ reloadOnSearch: false,views: {// Retarget and by that override the grandparent views// https://ui-router.github.io/guide/views#relative-parent-state- 'list@^.^': { component: EmptyComponent }+ 'content-right@^.^': { component: EmptyComponent }}},{- name: 'bim.space.show',+ name: 'bim.partitioned.show',url: '/{model_id:[0-9]+}',- component: IFCViewerPageComponent,data: {- viewRoute: 'bim.space.show',+ viewRoute: 'bim.partitioned.show',+ partition: '-split'},+ reloadOnSearch: false,views: {- viewer: { component: IFCViewerComponent },- list: { component: BCFContainerComponent }+ 'content-left': { component: IFCViewerComponent },+ 'content-right': { component: BCFContainerComponent }}},{- name: 'bim.space.show.model',+ name: 'bim.partitioned.show.model',url: '/model',- component: IFCViewerPageComponent,data: {- viewRoute: 'bim.space.show',+ viewRoute: 'bim.partitioned.show',+ partition: '-left-only'},+ reloadOnSearch: false,views: {// Retarget and by that override the grandparent views// https://ui-router.github.io/guide/views#relative-parent-state- 'list@^.^': { component: EmptyComponent }+ 'content-right@^.^': { component: EmptyComponent }}},];diff --git a/frontend/src/app/modules/ifc_models/view-toggle/bim-view.service.ts b/frontend/src/app/modules/ifc_models/pages/viewer/bim-view.service.tssimilarity index 73%rename from frontend/src/app/modules/ifc_models/view-toggle/bim-view.service.tsrename to frontend/src/app/modules/ifc_models/pages/viewer/bim-view.service.tsindex 1bbe4568091..b1cca15ed7e 100644--- a/frontend/src/app/modules/ifc_models/view-toggle/bim-view.service.ts+++ b/frontend/src/app/modules/ifc_models/pages/viewer/bim-view.service.ts@@ -26,20 +26,13 @@// See docs/COPYRIGHT.rdoc for more details.// ++-import {ChangeDetectionStrategy, ChangeDetectorRef, Component, Injectable, OnDestroy, OnInit} from '@angular/core';+import {Injectable, OnDestroy} from '@angular/core';import {I18nService} from 'core-app/modules/common/i18n/i18n.service';-import {DynamicBootstrapper} from "core-app/globals/dynamic-bootstrapper";-import {- WorkPackageViewDisplayRepresentationService,- wpDisplayCardRepresentation,- wpDisplayListRepresentation, wpDisplayRepresentation-} from "core-app/modules/work_packages/routing/wp-view-base/view-services/wp-view-display-representation.service";-import {untilComponentDestroyed} from "ng2-rx-componentdestroyed";-import {WorkPackageViewTimelineService} from "core-app/modules/work_packages/routing/wp-view-base/view-services/wp-view-timeline.service";-import {combineLatest, Observable} from "rxjs";+import {Observable} from "rxjs";import {StateService, TransitionService} from "@uirouter/core";import {input} from "reactivestates";import {OpenprojectIFCModelsModule} from "core-app/modules/ifc_models/openproject-ifc-models.module";+import {takeUntil} from "rxjs/operators";export const bimListViewIdentifier = 'list';@@ -48,9 +41,9 @@ export const bimSplitViewIdentifier = 'split';export type BimViewState = 'list'|'viewer'|'split';-@Injectable({ providedIn: OpenprojectIFCModelsModule })+@Injectable({providedIn: OpenprojectIFCModelsModule})export class BimViewService implements OnDestroy {- public view = input<BimViewState>();+ private _state = input<BimViewState>();public text:any = {list: this.I18n.t('js.ifc_models.views.list'),@@ -71,12 +64,20 @@ export class BimViewService implements OnDestroy {});}+ get view$():Observable<BimViewState> {+ return this._state.values$();+ }++ public observeUntil(unsubscribe:Observable<any>) {+ return this.view$.pipe(takeUntil(unsubscribe));+ }+get current():BimViewState {- return this.view.getValueOr(bimSplitViewIdentifier);+ return this._state.getValueOr(bimSplitViewIdentifier);}public currentViewerState():BimViewState {- if (this.state.current.name === 'bim.space.list') {+ if (this.state.current.name === 'bim.partitioned.list') {return bimListViewIdentifier;} else if (this.state.includes('bim.**.model')) {return bimViewerViewIdentifier;@@ -86,7 +87,7 @@ export class BimViewService implements OnDestroy {}private detectView() {- this.view.putValue(this.currentViewerState());+ this._state.putValue(this.currentViewerState());}ngOnDestroy() {diff --git a/frontend/src/app/modules/ifc_models/pages/viewer/ifc-models-data.service.ts b/frontend/src/app/modules/ifc_models/pages/viewer/ifc-models-data.service.tsnew file mode 100644index 00000000000..b91c86cc1ba--- /dev/null+++ b/frontend/src/app/modules/ifc_models/pages/viewer/ifc-models-data.service.ts@@ -0,0 +1,36 @@+import {Injectable} from "@angular/core";+import {OpenprojectIFCModelsModule} from "core-app/modules/ifc_models/openproject-ifc-models.module";+import {PathHelperService} from "core-app/modules/common/path-helper/path-helper.service";+import {GonService} from "core-app/modules/common/gon/gon.service";+import {CurrentProjectService} from "core-components/projects/current-project.service";++export interface IfcModelDefinition {+ name:string;+ id:string;+ saoEnabled:boolean;+}++@Injectable({ providedIn: OpenprojectIFCModelsModule })+export class IfcModelsDataService {++ constructor(readonly paths:PathHelperService,+ readonly currentProjectService:CurrentProjectService,+ readonly gon:GonService) {+ }++ public get models():IfcModelDefinition[] {+ return this.gonIFC['models'];+ }++ public get manageIFCPath() {+ return this.paths.ifcModelsPath(this.currentProjectService.identifier!);+ }++ public get manageAllowed() {+ return this.gonIFC.permissions.manage;+ }++ private get gonIFC() {+ return (this.gon.get('ifc_models') as any);+ }+}\ No newline at end of filediff --git a/frontend/src/app/modules/ifc_models/pages/viewer/ifc-viewer-page.component.html b/frontend/src/app/modules/ifc_models/pages/viewer/ifc-viewer-page.component.htmldeleted file mode 100644index 7e21fc6e870..00000000000--- a/frontend/src/app/modules/ifc_models/pages/viewer/ifc-viewer-page.component.html+++ /dev/null@@ -1,42 +0,0 @@-<div class="toolbar-container">- <div class="toolbar">- <div class="title-container">- <h2 [textContent]="title">- </h2>- </div>- <ul class="toolbar-items">- <li class="toolbar-item"- *ngIf="filterAllowed">- <wp-filter-button>- </wp-filter-button>- </li>- <li class="toolbar-item">- <bim-view-toggle-button></bim-view-toggle-button>- </li>- <li class="toolbar-item"- *ngIf="manageAllowed">- <a class="button"- [href]="manageIFCPath">- <op-icon icon-classes="button--icon icon-settings2"></op-icon>- <span class="button--text"- [textContent]="text.manage"- aria-hidden="true"></span>- </a>- </li>- <li class="toolbar-item hidden-for-mobile">- <zen-mode-toggle-button></zen-mode-toggle-button>- </li>- </ul>- </div>-</div>--<filter-container></filter-container>--<div class="ifc-model-viewer--container"- ui-view="viewer">-</div>--<div class="bcf-table--container loading-indicator--location"- data-indicator-name="ifc-table-container"- ui-view="list">-</div>diff --git a/frontend/src/app/modules/ifc_models/pages/viewer/ifc-viewer-page.component.sass b/frontend/src/app/modules/ifc_models/pages/viewer/ifc-viewer-page.component.sassdeleted file mode 100644index 3d45b981eda..00000000000--- a/frontend/src/app/modules/ifc_models/pages/viewer/ifc-viewer-page.component.sass+++ /dev/null@@ -1,28 +0,0 @@-*:host- height: 100%- overflow: hidden- display: grid- grid-template-columns: 1fr 500px- grid-template-rows: 60px auto minmax(200px, 1fr)- grid-column-gap: 10px-- &.-split- grid-template-areas: "header header" "filter filter" "viewer list"-- &.-viewer- grid-template-areas: "header header" "filter filter" "viewer viewer"-- &.-list- grid-template-areas: "header header" "filter filter" "list list"-- .toolbar-container- grid-area: header-- .ifc-model-viewer--container- grid-area: viewer-- .bcf-table--container- grid-area: list-- filter-container- grid-area: filterdiff --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.tsindex 36549c00d0e..0a8329d25b8 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@@ -1,69 +1,87 @@-import {ChangeDetectionStrategy, Component, HostBinding, Injector} from "@angular/core";+import {ChangeDetectionStrategy, Component, Injector} from "@angular/core";import {PathHelperService} from "core-app/modules/common/path-helper/path-helper.service";import {GonService} from "core-app/modules/common/gon/gon.service";-import {WorkPackagesViewBase} from "core-app/modules/work_packages/routing/wp-view-base/work-packages-view.base";import {- bimViewerViewIdentifier, BimViewService-} from "core-app/modules/ifc_models/view-toggle/bim-view.service";-import {InjectField} from "core-app/helpers/angular/inject-field.decorator";+ PartitionedQuerySpacePageComponent,+ ToolbarButtonComponentDefinition+} from "core-app/modules/work_packages/routing/partitioned-query-space-page/partitioned-query-space-page.component";+import {BcfImportButtonComponent} from "core-app/modules/bcf/bcf-buttons/bcf-import-button.component";+import {BcfExportButtonComponent} from "core-app/modules/bcf/bcf-buttons/bcf-export-button.component";+import {WorkPackageFilterButtonComponent} from "core-components/wp-buttons/wp-filter-button/wp-filter-button.component";+import {ZenModeButtonComponent} from "core-components/wp-buttons/zen-mode-toggle-button/zen-mode-toggle-button.component";+import {componentDestroyed} from "ng2-rx-componentdestroyed";+import {bimViewerViewIdentifier, BimViewService} from "core-app/modules/ifc_models/pages/viewer/bim-view.service";+import {BimViewToggleButtonComponent} from "core-app/modules/ifc_models/toolbar/view-toggle/bim-view-toggle-button.component";+import {IfcModelsDataService} from "core-app/modules/ifc_models/pages/viewer/ifc-models-data.service";+import {QueryParamListenerService} from "core-components/wp-query/query-param-listener.service";@Component({- templateUrl: './ifc-viewer-page.component.html',- styleUrls: ['./ifc-viewer-page.component.sass'],+ templateUrl: '/app/modules/work_packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.html',+ styleUrls: [+ // Absolute paths do not work for styleURLs :-(+ '../../../work_packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.sass'+ ],changeDetection: ChangeDetectionStrategy.OnPush,+ providers: [+ QueryParamListenerService+ ]})-export class IFCViewerPageComponent extends WorkPackagesViewBase {- @InjectField() bimView:BimViewService;+export class IFCViewerPageComponent extends PartitionedQuerySpacePageComponent {text = {title: this.I18n.t('js.ifc_models.models.default'),- manage: this.I18n.t('js.ifc_models.models.manage'),delete: this.I18n.t('js.button_delete'),edit: this.I18n.t('js.button_edit'),areYouSure: this.I18n.t('js.text_are_you_sure')};- constructor(readonly paths:PathHelperService,- readonly gon:GonService,+ toolbarButtonComponents:ToolbarButtonComponentDefinition[] = [+ {+ component: BcfImportButtonComponent,+ },+ {+ component: BcfExportButtonComponent,+ },+ {+ component: WorkPackageFilterButtonComponent+ },+ {+ component: BimViewToggleButtonComponent,+ containerClasses: 'hidden-for-mobile'+ },+ {+ component: ZenModeButtonComponent,+ containerClasses: 'hidden-for-mobile'+ }+ ];++ constructor(readonly ifcData:IfcModelsDataService,+ readonly bimView:BimViewService,readonly injector:Injector) {super(injector);}- @HostBinding('class')- get gridTemplateAreas() {- return '-' + this.bimView.currentViewerState();+ ngOnInit() {+ super.ngOnInit();++ this+ .bimView+ .observeUntil(componentDestroyed(this))+ .subscribe((view) => {+ this.filterAllowed = view !== bimViewerViewIdentifier;+ });}public get title() {if (this.$state.includes('bim.space.defaults')) {return this.I18n.t('js.ifc_models.models.default');} else {- return this.gonIFC['models'][0]['name'];+ return this.ifcData.models[0]['name'];}}- public get manageIFCPath() {- return this.paths.ifcModelsPath(this.projectIdentifier!);- }-- public get manageAllowed() {- return this.gonIFC.permissions.manage;- }-- public get filterAllowed():boolean {- return this.bimView.currentViewerState() !== bimViewerViewIdentifier;- }-- private get gonIFC() {- return (this.gon.get('ifc_models') as any);- }-- protected set loadingIndicator(promise:Promise<unknown>) {- this.loadingIndicatorService.indicator('ifc-table-container').promise = promise;- }-- public refresh(visibly:boolean, firstPage:boolean):Promise<unknown> {- return this.loadingIndicator =- this.wpListService.loadCurrentQueryFromParams(this.projectIdentifier);+ /** We do not have a mapping for html title in this module yet */+ protected shouldUpdateHtmlTitle():boolean {+ return false;}}diff --git a/frontend/src/app/modules/ifc_models/toolbar/manage-ifc-models-button/bim-manage-ifc-models-button.component.ts b/frontend/src/app/modules/ifc_models/toolbar/manage-ifc-models-button/bim-manage-ifc-models-button.component.tsnew file mode 100644index 00000000000..61dc9a2d8bb--- /dev/null+++ b/frontend/src/app/modules/ifc_models/toolbar/manage-ifc-models-button/bim-manage-ifc-models-button.component.ts@@ -0,0 +1,61 @@+// -- copyright+// OpenProject is an open source project management software.+// Copyright (C) 2012-2020 the OpenProject GmbH+//+// This program is free software; you can redistribute it and/or+// modify it under the terms of the GNU General Public License version 3.+//+// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:+// Copyright (C) 2006-2013 Jean-Philippe Lang+// Copyright (C) 2010-2013 the ChiliProject Team+//+// This program is free software; you can redistribute it and/or+// modify it under the terms of the GNU General Public License+// as published by the Free Software Foundation; either version 2+// of the License, or (at your option) any later version.+//+// This program is distributed in the hope that it will be useful,+// but WITHOUT ANY WARRANTY; without even the implied warranty of+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the+// GNU General Public License for more details.+//+// You should have received a copy of the GNU General Public License+// along with this program; if not, write to the Free Software+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.+//+// See docs/COPYRIGHT.rdoc for more details.+// ++++import {ChangeDetectionStrategy, Component} from '@angular/core';+import {I18nService} from 'core-app/modules/common/i18n/i18n.service';+import {IfcModelsDataService} from "core-app/modules/ifc_models/pages/viewer/ifc-models-data.service";+++@Component({+ template: `+ <a *ngIf="manageAllowed"+ class="button"+ [href]="manageIFCPath">+ <op-icon icon-classes="button--icon icon-settings2"></op-icon>+ <span class="button--text"+ - [textContent]="text.manage"+ - aria-hidden="true"></span>+ </a>++ `,+ changeDetection: ChangeDetectionStrategy.OnPush,+ selector: 'bim-view-toggle-button'+})+export class BimManageIfcModelsButtonComponent {++ text = {+ manage: this.I18n.t('js.ifc_models.models.manage'),+ };++ manageAllowed = this.ifcData.manageAllowed;+ manageIFCPath = this.ifcData.manageIFCPath;++ constructor(readonly I18n:I18nService,+ readonly ifcData:IfcModelsDataService) {+ }+}diff --git a/frontend/src/app/modules/ifc_models/view-toggle/bim-view-toggle.component.ts b/frontend/src/app/modules/ifc_models/toolbar/view-toggle/bim-view-toggle-button.component.tssimilarity index 92%rename from frontend/src/app/modules/ifc_models/view-toggle/bim-view-toggle.component.tsrename to frontend/src/app/modules/ifc_models/toolbar/view-toggle/bim-view-toggle-button.component.tsindex cf62fa7240b..b4a81a9d627 100644--- a/frontend/src/app/modules/ifc_models/view-toggle/bim-view-toggle.component.ts+++ b/frontend/src/app/modules/ifc_models/toolbar/view-toggle/bim-view-toggle-button.component.ts@@ -28,7 +28,7 @@import {ChangeDetectionStrategy, Component} from '@angular/core';import {I18nService} from 'core-app/modules/common/i18n/i18n.service';-import {BimViewService} from "core-app/modules/ifc_models/view-toggle/bim-view.service";+import {BimViewService} from "core-app/modules/ifc_models/pages/viewer/bim-view.service";@Component({@@ -48,9 +48,9 @@ import {BimViewService} from "core-app/modules/ifc_models/view-toggle/bim-view.schangeDetection: ChangeDetectionStrategy.OnPush,selector: 'bim-view-toggle-button'})-export class BimViewToggleComponent {+export class BimViewToggleButtonComponent {- view$ = this.bimView.view.values$();+ view$ = this.bimView.view$;constructor(readonly I18n:I18nService,readonly bimView:BimViewService) {diff --git a/frontend/src/app/modules/ifc_models/view-toggle/bim-view-toggle-dropdown.directive.ts b/frontend/src/app/modules/ifc_models/toolbar/view-toggle/bim-view-toggle-dropdown.directive.tssimilarity index 95%rename from frontend/src/app/modules/ifc_models/view-toggle/bim-view-toggle-dropdown.directive.tsrename to frontend/src/app/modules/ifc_models/toolbar/view-toggle/bim-view-toggle-dropdown.directive.tsindex 3ccb2212c04..0aeb0942768 100644--- a/frontend/src/app/modules/ifc_models/view-toggle/bim-view-toggle-dropdown.directive.ts+++ b/frontend/src/app/modules/ifc_models/toolbar/view-toggle/bim-view-toggle-dropdown.directive.ts@@ -31,13 +31,13 @@ import {Directive, ElementRef} from "@angular/core";import {OpContextMenuTrigger} from "core-components/op-context-menu/handlers/op-context-menu-trigger.directive";import {I18nService} from "core-app/modules/common/i18n/i18n.service";import {StateService} from "@uirouter/core";++import {WorkPackageFiltersService} from "core-components/filters/wp-filters/wp-filters.service";import {- bimListViewIdentifier,- bimSplitViewIdentifier,+ bimListViewIdentifier, bimSplitViewIdentifier,bimViewerViewIdentifier,BimViewService-} from "core-app/modules/ifc_models/view-toggle/bim-view.service";-import {WorkPackageFiltersService} from "core-components/filters/wp-filters/wp-filters.service";+} from "core-app/modules/ifc_models/pages/viewer/bim-view.service";@Directive({selector: '[bimViewDropdown]'@@ -82,7 +82,7 @@ export class BimViewToggleDropdownDirective extends OpContextMenuTrigger {switch (key) {case bimListViewIdentifier:- this.state.go('bim.space.list');+ this.state.go('bim.partitioned.list');break;case bimViewerViewIdentifier:this.state.go(viewRoute + '.model');diff --git a/frontend/src/app/modules/work_packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.html b/frontend/src/app/modules/work_packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.htmlindex e784e92b856..6864269f301 100644--- a/frontend/src/app/modules/work_packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.html+++ b/frontend/src/app/modules/work_packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.html@@ -1,5 +1,5 @@<div class="work-packages-list-view--container"- [ngClass]="currentPartition()">+ [ngClass]="currentPartition"><div class="toolbar-container -editable"><div class="toolbar"><editable-toolbar-title [title]="selectedTitle"@@ -26,7 +26,8 @@</div></div>- <filter-container (filtersCompleted)="updateResultVisibility($event)"></filter-container>+ <filter-container *ngIf="filterAllowed"+ (filtersCompleted)="updateResultVisibility($event)"></filter-container><!-- Left content view --><div class="work-packages-partitioned-page--content-left loading-indicator--location"diff --git a/frontend/src/app/modules/work_packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.ts b/frontend/src/app/modules/work_packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.tsindex b156a40be6d..5f4734c28f9 100644--- a/frontend/src/app/modules/work_packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.ts+++ b/frontend/src/app/modules/work_packages/routing/partitioned-query-space-page/partitioned-query-space-page.component.ts@@ -42,6 +42,7 @@ import {WorkPackageNotificationService} from "core-app/modules/work_packages/notimport {QueryParamListenerService} from "core-components/wp-query/query-param-listener.service";import {InjectField} from "core-app/helpers/angular/inject-field.decorator";import {ComponentType} from "@angular/cdk/overlay";+import {Ng2StateDeclaration} from "@uirouter/angular";export interface ToolbarButtonComponentDefinition {component:ComponentType<any>;@@ -51,6 +52,8 @@ export interface ToolbarButtonComponentDefinition {outputs?:{[outputName:string]:Function};}+export type ViewPartitionState = '-split'|'-left-only'|'-right-only';+@Component({selector: 'partitioned-query-space-page',templateUrl: './partitioned-query-space-page.component.html',@@ -71,9 +74,6 @@ export class PartitionedQuerySpacePageComponent extends WorkPackagesViewBase imp'text_jump_to_pagination': this.I18n.t('js.work_packages.jump_marks.label_pagination'),};- /** Transition state to listen for query changes */- transitionListenerState:string;-/** Whether the title can be edited */titleEditingEnabled:boolean;@@ -101,18 +101,22 @@ export class PartitionedQuerySpacePageComponent extends WorkPackagesViewBase imp/** The toolbar buttons to render */toolbarButtonComponents:ToolbarButtonComponentDefinition[] = [];- // ToDo: Return correct value- public currentPartition():string {- return '-split';- }+ /** Whether filtering is allowed */+ filterAllowed:boolean = true;++ /** We need to pass the correct partition state to the view to manage the grid */+ currentPartition:ViewPartitionState = '-split';ngOnInit() {super.ngOnInit();this.hasQueryProps = !!this.$state.params.query_props;+ this.setPartition(this.$state.current);this.removeTransitionSubscription = this.$transitions.onSuccess({}, (transition):any => {const params = transition.params('to');+ const toState = transition.to();this.hasQueryProps = !!params.query_props;+ this.setPartition(toState);});// If the query was loaded, reload invisibly@@ -132,8 +136,8 @@ export class PartitionedQuerySpacePageComponent extends WorkPackagesViewBase imp});// Update title on entering this state- this.unRegisterTitleListener = this.$transitions.onSuccess({to: this.transitionListenerState}, () => {- if (this.selectedTitle) {+ this.unRegisterTitleListener = this.$transitions.onSuccess( {}, () => {+ if (this.shouldUpdateHtmlTitle() && this.selectedTitle) {this.titleService.setFirstPart(this.selectedTitle);}});@@ -145,6 +149,16 @@ export class PartitionedQuerySpacePageComponent extends WorkPackagesViewBase imp});}+ /**+ * We need to set the current partition to the grid to ensure+ * either side gets expanded to full width if we're not in '-split' mode.+ *+ * @param state The current or entering state+ */+ protected setPartition(state:Ng2StateDeclaration) {+ this.currentPartition = state.data.partition || '-split';+ }+protected setupInformationLoadedListener() {this.querySpace@@ -202,7 +216,7 @@ export class PartitionedQuerySpacePageComponent extends WorkPackagesViewBase impthis.titleEditingEnabled = this.authorisationService.can('query', 'updateImmediately');// Update the title if we're in the list state alone- if (this.$state.current.name === 'work-packages.partitioned.list') {+ if (this.shouldUpdateHtmlTitle()) {this.titleService.setFirstPart(this.selectedTitle);}}@@ -236,4 +250,8 @@ export class PartitionedQuerySpacePageComponent extends WorkPackagesViewBase impprotected set loadingIndicator(promise:Promise<unknown>) {this.loadingIndicatorService.table.promise = promise;}++ protected shouldUpdateHtmlTitle():boolean {+ return true;+ }}diff --git a/frontend/src/app/modules/work_packages/routing/wp-view-page/wp-view-page.component.ts b/frontend/src/app/modules/work_packages/routing/wp-view-page/wp-view-page.component.tsindex 56d6ec237f5..734f31c2172 100644--- a/frontend/src/app/modules/work_packages/routing/wp-view-page/wp-view-page.component.ts+++ b/frontend/src/app/modules/work_packages/routing/wp-view-page/wp-view-page.component.ts@@ -64,8 +64,6 @@ import {WorkPackageSettingsButtonComponent} from "core-components/wp-buttons/wp-export class WorkPackageViewPageComponent extends PartitionedQuerySpacePageComponent implements OnInit {@InjectField() bcfDetectorService:BcfDetectorService;- transitionListenerState = 'work-packages.partitioned.list';-toolbarButtonComponents:ToolbarButtonComponentDefinition[] = [{component: WorkPackageCreateButtonComponent,@@ -118,4 +116,8 @@ export class WorkPackageViewPageComponent extends PartitionedQuerySpacePageComporeturn this.querySpace.tableRendered.valuesPromise() as Promise<unknown>;}}++ protected shouldUpdateHtmlTitle():boolean {+ return this.$state.current.name === 'work-packages.partitioned.list';+ }}