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

Merged with dev

Aleix Suau0323eb3015ec
diff --cc frontend/src/app/modules/bim/ifc_models/bcf/list-container/bcf-list-container.component.ts
index 84e2e1fbb88,7c0dcbdfc01..0b8ccdd8dfe
--- 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
@@@ -1,25 -1,28 +1,25 @@@
import {ChangeDetectionStrategy, Component, OnInit} from "@angular/core";
--import {WorkPackageViewHandlerToken} from "core-app/modules/work_packages/routing/wp-view-base/event-handling/event-handler-registry";
- import {BcfCardViewHandlerRegistry} from "core-app/modules/bim/ifc_models/ifc-base-view/event-handler/bcf-card-view-handler-registry";
import {WorkPackageListViewComponent} from "core-app/modules/work_packages/routing/wp-list-view/wp-list-view.component";
import {QueryResource} from "core-app/modules/hal/resources/query-resource";
import {HalResourceNotificationService} from "core-app/modules/hal/services/hal-resource-notification.service";
import {WorkPackageNotificationService} from "core-app/modules/work_packages/notifications/work-package-notification.service";
import {DragAndDropService} from "core-app/modules/common/drag-and-drop/drag-and-drop.service";
import {CausedUpdatesService} from "core-app/modules/boards/board/caused-updates/caused-updates.service";
- import {bimSplitViewCardsIdentifier, bimSplitViewListIdentifier, BimViewService} from "core-app/modules/bim/ifc_models/pages/viewer/bim-view.service";
-import {
- bimListViewIdentifier,
- bimSplitViewIdentifier,
- BimViewService
-} from "core-app/modules/bim/ifc_models/pages/viewer/bim-view.service";
++import {bimSplitViewCardsIdentifier, bimSplitViewListIdentifier, bimListViewIdentifier, BimViewService} from "core-app/modules/bim/ifc_models/pages/viewer/bim-view.service";
import {InjectField} from "core-app/helpers/angular/inject-field.decorator";
- import {wpDisplayCardRepresentation, wpDisplayListRepresentation} from "core-app/modules/work_packages/routing/wp-view-base/view-services/wp-view-display-representation.service";
-import {wpDisplayCardRepresentation} from "core-app/modules/work_packages/routing/wp-view-base/view-services/wp-view-display-representation.service";
import {IfcModelsDataService} from "core-app/modules/bim/ifc_models/pages/viewer/ifc-models-data.service";
+import {WorkPackageViewColumnsService} from 'core-app/modules/work_packages/routing/wp-view-base/view-services/wp-view-columns.service';
- import {UIRouterGlobals, UIRouter, TransitionService} from '@uirouter/core';
- import {pluck, distinctUntilChanged, filter} from "rxjs/operators";
++import {UIRouterGlobals} from '@uirouter/core';
++import {pluck, distinctUntilChanged} from "rxjs/operators";
+ import {IFCViewerService} from "core-app/modules/bim/ifc_models/ifc-viewer/ifc-viewer.service";
+ import {States} from "core-components/states.service";
+ import {BcfApiService} from "core-app/modules/bim/bcf/api/bcf-api.service";
+ import {splitViewRoute} from "core-app/modules/work_packages/routing/split-view-routes.helper";
@Component({
- templateUrl: '/app/modules/work_packages/routing/wp-list-view/wp-list-view.component.html',
- styleUrls: ['/app/modules/work_packages/routing/wp-list-view/wp-list-view.component.sass'],
+ templateUrl: '/app/modules/bim/ifc_models/bcf/list-container/bfc-list-container.component.html',
+ styleUrls: ['/app/modules/bim/ifc_models/bcf/list-container/bcf-list-container.component.sass'],
providers: [
- { provide: WorkPackageViewHandlerToken, useValue: BcfCardViewHandlerRegistry },
{ provide: HalResourceNotificationService, useClass: WorkPackageNotificationService },
DragAndDropService,
CausedUpdatesService
@@@ -29,8 -32,9 +29,11 @@@
export class BcfListContainerComponent extends WorkPackageListViewComponent implements OnInit {
@InjectField() bimView:BimViewService;
@InjectField() ifcModelsService:IfcModelsDataService;
+ @InjectField() wpTableColumns:WorkPackageViewColumnsService;
+ @InjectField() uIRouterGlobals:UIRouterGlobals;
+ @InjectField() viewer:IFCViewerService;
+ @InjectField() states:States;
+ @InjectField() bcfApi:BcfApiService;
public wpTableConfiguration = {
dragAndDropEnabled: false
@@@ -72,8 -49,37 +75,38 @@@
if (this.noResults && this.ifcModelsService.models.length === 0) {
return false;
} else {
- return this.bimView.currentViewerState() === bimSplitViewIdentifier;
+ return this.bimView.currentViewerState() === bimSplitViewCardsIdentifier ||
+ this.bimView.currentViewerState() === bimSplitViewListIdentifier;
}
}
+
+ 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);
+ }
+
+ if (event.double) {
+ this.$state.go(
+ splitViewRoute(this.$state),
+ { workPackageId: event.workPackageId }
+ );
+ }
+ }
+
+ openStateLink(event:{ workPackageId:string; requestedState:string }) {
+ // In case we're in a regular list without view,
+ // reuse the default list behavior
+ if (this.bimView.current === bimListViewIdentifier) {
+ super.openStateLink(event);
+ return;
+ }
+
+ // Otherwise, always open all links in the details view
+ this.$state.go(
+ splitViewRoute(this.$state),
+ { workPackageId: event.workPackageId, focus: true }
+ );
+ }
}
diff --cc frontend/src/app/modules/bim/ifc_models/bcf/list-container/bfc-list-container.component.html
index d7497112163,00000000000..b51880f89ca
mode 100644,000000..100644
--- a/frontend/src/app/modules/bim/ifc_models/bcf/list-container/bfc-list-container.component.html
+++ b/frontend/src/app/modules/bim/ifc_models/bcf/list-container/bfc-list-container.component.html
@@@ -1,33 -1,0 +1,37 @@@
+<div class="result-overlay"
+ *ngIf="(showResultOverlay$ | async) && showTableView"></div>
+
+<!-- TABLE + TIMELINE horizontal split -->
+<div class="work-packages-split-view--tabletimeline-container"
+ [ngClass]="{ '-with-resizer': showResizerInCardView() }"
+ *ngIf="tableInformationLoaded && showTableView">
+ <wp-resizer elementClass="work-packages-partitioned-page--content-right"
+ localStorageKey="openProject-splitViewFlexBasis">
+ </wp-resizer>
+
+ <wp-table [projectIdentifier]="CurrentProject.identifier"
+ [configuration]="wpTableConfiguration"
++ (itemClicked)="handleWorkPackageClicked($event)"
++ (stateLinkClicked)="openStateLink($event)"
+ class="work-packages-split-view--tabletimeline-content">
+ </wp-table>
+</div>
+
+<!-- GRID representation of the WP -->
+<div *ngIf="!showTableView"
+ class="work-packages--card-view-container"
+ [ngClass]="{ '-with-resizer': showResizerInCardView() }" >
+ <wp-grid [configuration]="wpTableConfiguration"
+ [showResizer]="showResizerInCardView()"
++ (itemClicked)="handleWorkPackageCardClicked($event)"
++ (stateLinkClicked)="openStateLink($event)"
+ resizerClass="work-packages-partitioned-page--content-right"
+ resizerStorageKey="openProject-splitViewFlexBasis">
+ </wp-grid>
+</div>
+
+<!-- Footer -->
+<div class="work-packages-split-view--tabletimeline-footer hide-when-print"
+ *ngIf="tableInformationLoaded">
+ <wp-table-pagination></wp-table-pagination>
+</div>
diff --cc frontend/src/app/modules/work_packages/routing/wp-list-view/wp-list-view.component.html
index d65af3c53a6,f759c41dd5c..4f2c4b0087d
--- a/frontend/src/app/modules/work_packages/routing/wp-list-view/wp-list-view.component.html
+++ b/frontend/src/app/modules/work_packages/routing/wp-list-view/wp-list-view.component.html
@@@ -1,15 -1,16 +1,17 @@@
<div class="result-overlay"
- *ngIf="(showResultOverlay$ | async) && showListView"></div>
+ *ngIf="(showResultOverlay$ | async) && showTableView"></div>
<!-- TABLE + TIMELINE horizontal split -->
-<wp-table *ngIf="tableInformationLoaded && showListView"
+<wp-table *ngIf="tableInformationLoaded && showTableView"
[projectIdentifier]="CurrentProject.identifier"
[configuration]="wpTableConfiguration"
+ (itemClicked)="handleWorkPackageClicked($event)"
+ (stateLinkClicked)="openStateLink($event)"
- class="work-packages-split-view--tabletimeline-content"></wp-table>
+ class="work-packages-split-view--tabletimeline-content">
+</wp-table>
<!-- GRID representation of the WP -->
-<div *ngIf="!showListView"
+<div *ngIf="!showTableView"
class="work-packages--card-view-container"
[ngClass]="{ '-with-resizer': showResizerInCardView() }" >
<wp-grid [configuration]="wpTableConfiguration"
diff --cc frontend/src/app/modules/work_packages/routing/wp-list-view/wp-list-view.component.ts
index be357034bfd,38a101a0a41..886e5b1371a
--- a/frontend/src/app/modules/work_packages/routing/wp-list-view/wp-list-view.component.ts
+++ b/frontend/src/app/modules/work_packages/routing/wp-list-view/wp-list-view.component.ts
@@@ -124,7 -128,39 +128,39 @@@ export class WorkPackageListViewCompone
}
protected updateViewRepresentation(query:QueryResource) {
- this.showListView = !(this.deviceService.isMobile ||
+ this.showTableView = !(this.deviceService.isMobile ||
this.wpDisplayRepresentation.valueFromQuery(query) === wpDisplayCardRepresentation);
}
+
+ handleWorkPackageClicked(event:{ workPackageId:string; double:boolean }) {
+ if (event.double) {
+ this.openInFullView(event.workPackageId);
+ }
+ }
+
+ openStateLink(event:{ workPackageId:string; requestedState:string }) {
+ this.$state.go(
+ (this.keepTab as any)[event.requestedState] || event.requestedState,
+ { workPackageId: event.workPackageId, focus: true }
+ );
+ }
+
+ /**
+ * Special handling for clicking on cards.
+ * If we are on mobile, a click on the card should directly open the full view
+ */
+ handleWorkPackageCardClicked(event:{ workPackageId:string; double:boolean }) {
+ if (this.deviceService.isMobile) {
+ this.openInFullView(event.workPackageId);
+ } else {
+ this.handleWorkPackageClicked(event);
+ }
+ }
+
+ private openInFullView(workPackageId:string) {
+ this.$state.go(
+ 'work-packages.show',
+ { workPackageId: workPackageId }
+ );
+ }
}