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

remove unfinished view toggle component

ulferts837ad8365d73
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 dd2a14cb593..1e85eb2ed04 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,8 +33,6 @@ 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";
@NgModule({
@@ -55,10 +53,6 @@ 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/pages/viewer/ifc-viewer-page.component.html b/frontend/src/app/modules/ifc_models/pages/viewer/ifc-viewer-page.component.html
index aadbdcbf34f..ec92e1d9a21 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,9 +5,6 @@
</h2>
</div>
<ul class="toolbar-items">
- <li class="toolbar-item">
- <bim-view-toggle-button></bim-view-toggle-button>
- </li>
<li class="toolbar-item"
*ngIf="manageAllowed">
<a class="button"
diff --git a/frontend/src/app/modules/ifc_models/view-toggle/bim-view-toggle-dropdown.directive.ts b/frontend/src/app/modules/ifc_models/view-toggle/bim-view-toggle-dropdown.directive.ts
deleted file mode 100644
index 99ae9b51a5d..00000000000
--- a/frontend/src/app/modules/ifc_models/view-toggle/bim-view-toggle-dropdown.directive.ts
+++ /dev/null
@@ -1,91 +0,0 @@
-//-- 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 {OPContextMenuService} from "core-components/op-context-menu/op-context-menu.service";
-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 {
- bimListViewIdentifier,
- bimSplitViewIdentifier,
- bimViewerViewIdentifier
-} from "core-app/modules/ifc_models/view-toggle/bim-view-toggle.component";
-import {StateService} from "@uirouter/core";
-
-@Directive({
- selector: '[bimViewDropdown]'
-})
-export class BimViewToggleDropdownDirective extends OpContextMenuTrigger {
- constructor(readonly elementRef:ElementRef,
- readonly opContextMenu:OPContextMenuService,
- readonly I18n:I18nService,
- readonly state:StateService) {
-
- super(elementRef, opContextMenu);
- }
-
- protected open(evt:JQuery.TriggeredEvent) {
- this.buildItems();
- this.opContextMenu.show(this, evt);
- }
-
- public get locals() {
- return {
- items: this.items,
- contextMenuId: 'bim-view-context-menu'
- };
- }
-
- private buildItems() {
- this.items = [bimViewerViewIdentifier, bimListViewIdentifier, bimSplitViewIdentifier]
- .map(key => {
- return {
- // Card View
- linkText: this.I18n.t('js.ifc_models.views.' + key),
- onClick: (evt:any) => {
- switch (key) {
- // TODO: actually make switching states work
- // TODO: differentiate between defaults and single model
- case bimListViewIdentifier:
- this.state.go('bim.space.list');
- break;
- case bimViewerViewIdentifier:
- this.state.go('bim.space.default.model');
- break;
- case bimSplitViewIdentifier:
- this.state.go('bim.space.default');
- break;
- }
-
- return true;
- }
- };
- });
- }
-}
-
diff --git a/frontend/src/app/modules/ifc_models/view-toggle/bim-view-toggle.component.ts b/frontend/src/app/modules/ifc_models/view-toggle/bim-view-toggle.component.ts
deleted file mode 100644
index b6948a7014b..00000000000
--- a/frontend/src/app/modules/ifc_models/view-toggle/bim-view-toggle.component.ts
+++ /dev/null
@@ -1,100 +0,0 @@
-// -- 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, ChangeDetectorRef, Component, OnDestroy, OnInit} 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} from "rxjs";
-import {StateService, TransitionService} from "@uirouter/core";
-
-
-export const bimListViewIdentifier = 'list';
-export const bimViewerViewIdentifier = 'viewer';
-export const bimSplitViewIdentifier = 'split';
-
-@Component({
- template: `
- <button class="button"
- id="bim-view-toggle-button"
- bimViewDropdown>
- <span class="button--text"
- aria-hidden="true"
- [textContent]="text[view]">
- </span>
- <op-icon icon-classes="button--icon icon-small icon-pulldown"></op-icon>
- </button>
-`,
- changeDetection: ChangeDetectionStrategy.OnPush,
- selector: 'bim-view-toggle-button',
-})
-export class BimViewToggleComponent implements OnInit, OnDestroy {
- public view:string;
-
- public text:any = {
- list: this.I18n.t('js.ifc_models.views.list'),
- viewer: this.I18n.t('js.ifc_models.views.viewer'),
- split: this.I18n.t('js.ifc_models.views.split')
- };
-
- private transitionFn:Function;
-
- constructor(readonly I18n:I18nService,
- readonly transitions:TransitionService,
- readonly state:StateService,
- readonly cdRef:ChangeDetectorRef) {
- }
-
- ngOnInit() {
- this.detectView();
-
- this.transitionFn = this.transitions.onSuccess({}, (transition) => {
- this.detectView();
- });
- }
-
- private detectView() {
- if (this.state.current.name === 'bim.space.list') {
- this.view = bimListViewIdentifier;
- } else if (this.state.includes('bim.**.model')) {
- this.view = bimViewerViewIdentifier;
- } else {
- this.view = bimSplitViewIdentifier;
- }
- }
-
- ngOnDestroy() {
- this.transitionFn();
- }
-}