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
Commit for Olivers debug
Aleix Suau8e5fe6fcda93
diff --git a/frontend/npm-shrinkwrap.json b/frontend/npm-shrinkwrap.jsonindex 7f51c8f7971..915b03b122f 100644--- a/frontend/npm-shrinkwrap.json+++ b/frontend/npm-shrinkwrap.json@@ -4714,7 +4714,7 @@},"camelcase-keys": {"version": "2.1.0",- "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz",+ "resolved": "http://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz","integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=","requires": {"camelcase": "^2.0.0",@@ -9050,7 +9050,7 @@},"load-json-file": {"version": "1.1.0",- "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",+ "resolved": "http://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz","integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=","requires": {"graceful-fs": "^4.1.2",@@ -9070,7 +9070,7 @@},"pify": {"version": "2.3.0",- "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",+ "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz","integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="}}@@ -9330,7 +9330,7 @@},"meow": {"version": "3.7.0",- "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz",+ "resolved": "http://registry.npmjs.org/meow/-/meow-3.7.0.tgz","integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=","requires": {"camelcase-keys": "^2.0.0",@@ -9892,7 +9892,7 @@"dependencies": {"semver": {"version": "5.3.0",- "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz",+ "resolved": "http://registry.npmjs.org/semver/-/semver-5.3.0.tgz","integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8="},"tar": {@@ -9990,7 +9990,7 @@},"chalk": {"version": "1.1.3",- "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",+ "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz","integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=","requires": {"ansi-styles": "^2.2.1",@@ -10573,7 +10573,7 @@},"os-homedir": {"version": "1.0.2",- "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",+ "resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz","integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M="},"os-tmpdir": {@@ -12062,7 +12062,7 @@},"pify": {"version": "2.3.0",- "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",+ "resolved": "http://registry.npmjs.org/pify/-/pify-2.3.0.tgz","integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="}}@@ -12560,7 +12560,7 @@"dependencies": {"source-map": {"version": "0.4.4",- "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz",+ "resolved": "http://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz","integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=","requires": {"amdefine": ">=0.0.4"@@ -13455,7 +13455,7 @@},"strip-ansi": {"version": "3.0.1",- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",+ "resolved": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz","integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=","requires": {"ansi-regex": "^2.0.0"diff --git a/frontend/src/app/components/wp-list/wp-list.service.ts b/frontend/src/app/components/wp-list/wp-list.service.tsindex 708b96dce3a..ae5f2db8ce3 100644--- a/frontend/src/app/components/wp-list/wp-list.service.ts+++ b/frontend/src/app/components/wp-list/wp-list.service.ts@@ -204,6 +204,7 @@ export class WorkPackagesListService {* Load the query from the given state params*/public loadCurrentQueryFromParams(projectIdentifier?:string) {+ console.log('loadCurrentQueryFromParams: ', projectIdentifier);return this.fromQueryParams(this.$state.params as any, projectIdentifier).toPromise();diff --git a/frontend/src/app/components/wp-list/wp-states-initialization.service.ts b/frontend/src/app/components/wp-list/wp-states-initialization.service.tsindex b72f4465d5a..d2d2b278e8f 100644--- a/frontend/src/app/components/wp-list/wp-states-initialization.service.ts+++ b/frontend/src/app/components/wp-list/wp-states-initialization.service.ts@@ -54,6 +54,7 @@ export class WorkPackageStatesInitializationService {* @param results*/public initialize(query:QueryResource, results:WorkPackageCollectionResource) {+ console.log('WorkPackageStatesInitializationService initialize: ', query, results);this.clearStates();// Update the (global) wp query states@@ -132,6 +133,7 @@ export class WorkPackageStatesInitializationService {}public initializeFromQuery(query:QueryResource, results:WorkPackageCollectionResource) {+ // console.log('WorkPackageStatesInitializationService initializeFromQuery: ', JSON.stringify(query.columns), results);this.querySpace.query.putValue(query);this.wpTableSum.initialize(query);diff --git 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.tsindex 8cdf3231491..06275a6eaa3 100644--- 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,4 +1,4 @@-import {ChangeDetectionStrategy, Component, OnInit} from "@angular/core";+import {ChangeDetectionStrategy, Component, OnInit, AfterViewChecked} 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";@@ -9,8 +9,9 @@ import {DragAndDropService} from "core-app/modules/common/drag-and-drop/drag-andimport {CausedUpdatesService} from "core-app/modules/boards/board/caused-updates/caused-updates.service";import {bimSplitViewIdentifier, 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} from "core-app/modules/work_packages/routing/wp-view-base/view-services/wp-view-display-representation.service";+import {wpDisplayCardRepresentation, wpDisplayListRepresentation} 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';@Component({templateUrl: '/app/modules/work_packages/routing/wp-list-view/wp-list-view.component.html',@@ -23,17 +24,24 @@ import {IfcModelsDataService} from "core-app/modules/bim/ifc_models/pages/viewer],changeDetection: ChangeDetectionStrategy.OnPush})-export class BcfListContainerComponent extends WorkPackageListViewComponent implements OnInit {+export class BcfListContainerComponent extends WorkPackageListViewComponent implements OnInit, AfterViewChecked {@InjectField() bimView:BimViewService;@InjectField() ifcModelsService:IfcModelsDataService;+ @InjectField() wpTableColumns:WorkPackageViewColumnsService;public wpTableConfiguration = {dragAndDropEnabled: false};-+protected updateViewRepresentation(query:QueryResource) {- this.wpDisplayRepresentation.setDisplayRepresentation(wpDisplayCardRepresentation);- this.showListView = false;+ console.log('updateViewRepresentation: ', this.wpTableColumns.id, this.wpTableColumns.getColumns(), query);+ this.wpTableColumns.addColumn('bcfThumbnail', 2);++ if (this.wpDisplayRepresentation.current === null) {+ this.wpDisplayRepresentation.setDisplayRepresentation(wpDisplayCardRepresentation);+ }++ super.updateViewRepresentation(query);}protected showResizerInCardView():boolean {@@ -43,4 +51,9 @@ export class BcfListContainerComponent extends WorkPackageListViewComponent implreturn this.bimView.currentViewerState() === bimSplitViewIdentifier;}}++ ngAfterViewChecked() {+ console.log('COLUMNS: ', this.wpTableColumns.getColumns());+ // this.wpTableColumns.addColumn('bcfThumbnail', 2);+ }}diff --git a/frontend/src/app/modules/bim/ifc_models/ifc-viewer/ifc-viewer.service.ts b/frontend/src/app/modules/bim/ifc_models/ifc-viewer/ifc-viewer.service.tsindex aa08c950c0d..d5f1bbebfde 100644--- a/frontend/src/app/modules/bim/ifc_models/ifc-viewer/ifc-viewer.service.ts+++ b/frontend/src/app/modules/bim/ifc_models/ifc-viewer/ifc-viewer.service.ts@@ -33,7 +33,7 @@ export interface BCFLoadOptions {@Injectable()export class IFCViewerService extends ViewerBridgeService {- public shouldShowViewer = true;+ public shouldShowViewer = false;private _viewer:any;private $loaded = new Subject<void>();diff --git a/frontend/src/app/modules/bim/ifc_models/pages/viewer/bim-view.service.ts b/frontend/src/app/modules/bim/ifc_models/pages/viewer/bim-view.service.tsindex d9f9fc5e3aa..a54ac1c733f 100644--- a/frontend/src/app/modules/bim/ifc_models/pages/viewer/bim-view.service.ts+++ b/frontend/src/app/modules/bim/ifc_models/pages/viewer/bim-view.service.ts@@ -35,10 +35,11 @@ import {takeUntil} from "rxjs/operators";export const bimListViewIdentifier = 'list';-export const bimViewerViewIdentifier = 'viewer';+export const bimTableViewIdentifier = 'table';export const bimSplitViewIdentifier = 'split';+export const bimViewerViewIdentifier = 'viewer';-export type BimViewState = 'list'|'viewer'|'split';+export type BimViewState = 'list'|'viewer'|'split'|'table';@Injectable()export class BimViewService implements OnDestroy {@@ -47,13 +48,15 @@ export class BimViewService implements OnDestroy {public text:any = {list: this.I18n.t('js.views.card'),viewer: this.I18n.t('js.ifc_models.views.viewer'),- split: this.I18n.t('js.ifc_models.views.split')+ split: this.I18n.t('js.ifc_models.views.split'),+ table: this.I18n.t('js.views.list'),};public icon:any = {list: 'icon-view-card',viewer: 'icon-view-model',- split: 'icon-view-split2'+ split: 'icon-view-split2',+ table: 'icon-view-list',};private transitionFn:Function;diff --git a/frontend/src/app/modules/bim/ifc_models/toolbar/view-toggle/bim-view-toggle-dropdown.directive.ts b/frontend/src/app/modules/bim/ifc_models/toolbar/view-toggle/bim-view-toggle-dropdown.directive.tsindex 6d04d61f3ca..8c38815abbd 100644--- a/frontend/src/app/modules/bim/ifc_models/toolbar/view-toggle/bim-view-toggle-dropdown.directive.ts+++ b/frontend/src/app/modules/bim/ifc_models/toolbar/view-toggle/bim-view-toggle-dropdown.directive.ts@@ -34,23 +34,30 @@ import {StateService} from "@uirouter/core";import {WorkPackageFiltersService} from "core-components/filters/wp-filters/wp-filters.service";import {- bimListViewIdentifier, bimSplitViewIdentifier,+ bimListViewIdentifier, bimSplitViewIdentifier, bimTableViewIdentifier,bimViewerViewIdentifier,BimViewService} from "core-app/modules/bim/ifc_models/pages/viewer/bim-view.service";import {ViewerBridgeService} from "core-app/modules/bim/bcf/bcf-viewer-bridge/viewer-bridge.service";+import {+ WorkPackageViewDisplayRepresentationService,+ wpDisplayCardRepresentation,+ wpDisplayListRepresentation,+} from "core-app/modules/work_packages/routing/wp-view-base/view-services/wp-view-display-representation.service";@Directive({selector: '[bimViewDropdown]'})export class BimViewToggleDropdownDirective extends OpContextMenuTrigger {+constructor(readonly elementRef:ElementRef,readonly opContextMenu:OPContextMenuService,readonly bimView:BimViewService,readonly I18n:I18nService,readonly state:StateService,readonly wpFiltersService:WorkPackageFiltersService,- readonly viewerBridgeService:ViewerBridgeService) {+ readonly viewerBridgeService:ViewerBridgeService,+ readonly wpDisplayRepresentation:WorkPackageViewDisplayRepresentationService) {super(elementRef, opContextMenu);}@@ -72,7 +79,7 @@ export class BimViewToggleDropdownDirective extends OpContextMenuTrigger {const viewRoute = this.state.current.data.viewRoute;let items = this.viewerBridgeService.shouldShowViewer ?[bimViewerViewIdentifier, bimListViewIdentifier, bimSplitViewIdentifier] :- [bimListViewIdentifier];+ [bimListViewIdentifier, bimTableViewIdentifier];this.items = items.map(key => {@@ -88,7 +95,18 @@ export class BimViewToggleDropdownDirective extends OpContextMenuTrigger {switch (key) {case bimListViewIdentifier:- this.state.go('bim.partitioned.list');+ console.log('this.state.current: ', this.state.current);+ this.wpDisplayRepresentation.setDisplayRepresentation(wpDisplayCardRepresentation);+ if (this.state.current.name !== 'bim.partitioned.list') {+ this.state.go('bim.partitioned.list');+ }+ break;+ case bimTableViewIdentifier:+ console.log('this.state.current 2: ', this.state.current);+ this.wpDisplayRepresentation.setDisplayRepresentation(wpDisplayListRepresentation);+ if (this.state.current.name !== 'bim.partitioned.list') {+ this.state.go('bim.partitioned.list');+ }break;case bimViewerViewIdentifier:this.state.go('bim.partitioned.model');diff --git 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.tsindex c8a99ffb3f3..7fad70b9c7b 100644--- 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@@ -26,7 +26,7 @@// See docs/COPYRIGHT.rdoc for more details.// ++-import {ChangeDetectionStrategy, ChangeDetectorRef, Component, Injector, OnInit} from "@angular/core";+import {ChangeDetectionStrategy, ChangeDetectorRef, Component, Injector, OnInit, OnChanges, SimpleChanges} from "@angular/core";import {take} from "rxjs/operators";import {CausedUpdatesService} from "core-app/modules/boards/board/caused-updates/caused-updates.service";import {DragAndDropService} from "core-app/modules/common/drag-and-drop/drag-and-drop.service";@@ -44,6 +44,9 @@ import {CurrentProjectService} from "core-components/projects/current-project.seimport {WorkPackageViewFiltersService} from "core-app/modules/work_packages/routing/wp-view-base/view-services/wp-view-filters.service";import {UntilDestroyedMixin} from "core-app/helpers/angular/until-destroyed.mixin";import {QueryResource} from "core-app/modules/hal/resources/query-resource";+import {WorkPackageViewColumnsService} from 'core-app/modules/work_packages/routing/wp-view-base/view-services/wp-view-columns.service';+import {InjectField} from "core-app/helpers/angular/inject-field.decorator";+@Component({selector: 'wp-list-view',@@ -57,7 +60,8 @@ import {QueryResource} from "core-app/modules/hal/resources/query-resource";CausedUpdatesService]})-export class WorkPackageListViewComponent extends UntilDestroyedMixin implements OnInit {+export class WorkPackageListViewComponent extends UntilDestroyedMixin implements OnInit, OnChanges {+ @InjectField() wpTableColumns:WorkPackageViewColumnsService;text = {'jump_to_pagination': this.I18n.t('js.work_packages.jump_marks.pagination'),@@ -100,6 +104,7 @@ export class WorkPackageListViewComponent extends UntilDestroyedMixin implementsthis.querySpace.query.values$().pipe(this.untilDestroyed()).subscribe((query) => {+ console.log('this.querySpace: ', query, this.wpTableColumns.getColumns());// Update the visible representationthis.updateViewRepresentation(query);this.noResults = query.results.total === 0;@@ -107,6 +112,10 @@ export class WorkPackageListViewComponent extends UntilDestroyedMixin implements});}+ ngOnChanges(changes: SimpleChanges) {+ console.log('changes: ', changes);+ }+protected setupInformationLoadedListener() {this.querySpace@@ -114,6 +123,7 @@ export class WorkPackageListViewComponent extends UntilDestroyedMixin implements.values$().pipe(take(1)).subscribe(() => {+ // console.log('this.querySpace 2: ', this.wpTableColumns.getColumns());this.tableInformationLoaded = true;this.cdRef.detectChanges();});diff --git a/frontend/src/app/modules/work_packages/routing/wp-view-base/view-services/wp-view-base.service.ts b/frontend/src/app/modules/work_packages/routing/wp-view-base/view-services/wp-view-base.service.tsindex c4289ce4820..043e9575a4d 100644--- a/frontend/src/app/modules/work_packages/routing/wp-view-base/view-services/wp-view-base.service.ts+++ b/frontend/src/app/modules/work_packages/routing/wp-view-base/view-services/wp-view-base.service.ts@@ -37,6 +37,7 @@ import {Injectable} from "@angular/core";@Injectable()export abstract class WorkPackageViewBaseService<T> {+ id = Math.random();/** Internal state to push non-persisted updates */protected updatesState = input<T>();@@ -64,10 +65,13 @@ export abstract class WorkPackageViewBaseService<T> {*/public initialize(query:QueryResource, results:WorkPackageCollectionResource, schema?:QuerySchemaResource) {const initial = this.valueFromQuery(query, results)!;+ // console.log('WorkPackageViewBaseService initialize: ', this.id, query, results);this.pristineState.putValue(initial);}public update(value:T) {+ console.log('WorkPackageViewBaseService update: ', value);+this.updatesState.putValue(value);}diff --git a/frontend/src/app/modules/work_packages/routing/wp-view-base/view-services/wp-view-columns.service.ts b/frontend/src/app/modules/work_packages/routing/wp-view-base/view-services/wp-view-columns.service.tsindex 6765ac15d50..5de27e869a4 100644--- a/frontend/src/app/modules/work_packages/routing/wp-view-base/view-services/wp-view-columns.service.ts+++ b/frontend/src/app/modules/work_packages/routing/wp-view-base/view-services/wp-view-columns.service.ts@@ -39,6 +39,12 @@ export class WorkPackageViewColumnsService extends WorkPackageQueryStateService<public constructor(readonly states:States, readonly querySpace:IsolatedQuerySpace) {super(querySpace);+ console.log('WorkPackageViewColumnsService: ', states, querySpace);+ }++ public initialize(query:any, results:any, schema?:any) {+ super.initialize(query, results, schema);+ console.log('--WorkPackageViewColumnsService initialize: ', this.lastUpdatedState.getValueOr([]), query, results);}public valueFromQuery(query:QueryResource):QueryColumn[] {@@ -149,6 +155,7 @@ export class WorkPackageViewColumnsService extends WorkPackageQueryStateService<* Update the selected columns to a new set of columns.*/public setColumns(columns:QueryColumn[]) {+ // console.log('setColumns: ', columns);// Don't publish if this is the same contentif (this.isCurrentlyEqualTo(columns)) {return;@@ -203,6 +210,7 @@ export class WorkPackageViewColumnsService extends WorkPackageQueryStateService<*/public addColumn(id:string, position?:number) {let columns = this.getColumns();+ // console.log('addColumn: ', columns, this.all);if (position === undefined) {position = columns.length;@@ -240,6 +248,7 @@ export class WorkPackageViewColumnsService extends WorkPackageQueryStateService<// Get the available stateprotected get availableState() {+ // console.log('availableState: ', this.states.queries.columns, this.states.queries.columns.getValueOr([]));return this.states.queries.columns;}