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.ts index 1e85eb2ed0..94ccfc6b67 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,7 +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"; @NgModule({ imports: [ @@ -43,8 +46,6 @@ import {EmptyComponent} from "core-app/modules/ifc_models/empty/empty-component" states: IFC_ROUTES }) ], - providers: [ - ], declarations: [ // Pages IFCViewerPageComponent, @@ -53,6 +54,10 @@ import {EmptyComponent} from "core-app/modules/ifc_models/empty/empty-component" EmptyComponent, BCFContainerComponent, + // View selector + BimViewToggleComponent, + BimViewToggleDropdownDirective, + IFCViewerComponent ], exports: [ 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 892bd86c5b..95d08c9747 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 @@ -50,6 +50,9 @@ export const IFC_ROUTES:Ng2StateDeclaration[] = [ name: 'bim.space.list', url: '/list', component: IFCViewerPageComponent, + data: { + viewRoute: 'bim.space.defaults', + }, views: { list: { component: BCFContainerComponent } } @@ -58,6 +61,9 @@ export const IFC_ROUTES:Ng2StateDeclaration[] = [ name: 'bim.space.defaults', url: '/defaults', component: IFCViewerPageComponent, + data: { + viewRoute: 'bim.space.defaults', + }, views: { viewer: { component: IFCViewerComponent }, list: { component: BCFContainerComponent } @@ -67,6 +73,9 @@ export const IFC_ROUTES:Ng2StateDeclaration[] = [ name: 'bim.space.defaults.model', url: '/model', component: IFCViewerPageComponent, + data: { + viewRoute: 'bim.space.defaults', + }, views: { // Retarget and by that override the grandparent views // https://ui-router.github.io/guide/views#relative-parent-state @@ -77,6 +86,9 @@ export const IFC_ROUTES:Ng2StateDeclaration[] = [ name: 'bim.space.show', url: '/{model_id:[0-9]+}', component: IFCViewerPageComponent, + data: { + viewRoute: 'bim.space.show', + }, views: { viewer: { component: IFCViewerComponent }, list: { component: BCFContainerComponent } @@ -86,6 +98,9 @@ export const IFC_ROUTES:Ng2StateDeclaration[] = [ name: 'bim.space.show.model', url: '/model', component: IFCViewerPageComponent, + data: { + viewRoute: 'bim.space.show', + }, views: { // Retarget and by that override the grandparent views // https://ui-router.github.io/guide/views#relative-parent-state diff --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.html index ec92e1d9a2..aadbdcbf34 100644 --- 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.html @@ -5,6 +5,9 @@