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 state to target left and right views
Oliver Günthere76a568e6ab0
diff --git a/app/assets/stylesheets/layout/work_packages/_table.sass b/app/assets/stylesheets/layout/work_packages/_table.sassindex 0a57893ead8..e895b7aaa64 100644--- a/app/assets/stylesheets/layout/work_packages/_table.sass+++ b/app/assets/stylesheets/layout/work_packages/_table.sass@@ -68,6 +68,7 @@// Left part of the split view// == flex container for (table|timeline).work-packages-split-view--tabletimeline-side+ height: 100%flex: 2display: flexflex-direction: columndiff --git a/frontend/src/app/components/modals/wp-destroy-modal/wp-destroy.modal.ts b/frontend/src/app/components/modals/wp-destroy-modal/wp-destroy.modal.tsindex c5c882b357b..75d6e41ead2 100644--- a/frontend/src/app/components/modals/wp-destroy-modal/wp-destroy.modal.ts+++ b/frontend/src/app/components/modals/wp-destroy-modal/wp-destroy.modal.ts@@ -143,7 +143,7 @@ export class WpDestroyModal extends OpModalComponent implements OnInit {* Otherwise we expect a redirect to where we came from,* since the WP in view (split/full) does not exist any more.*/- if (this.$state.current.name !== 'work-packages.list') {+ if (this.$state.current.name !== 'work-packages.partitioned.list') {this.backRoutingService.goBack(true);}})diff --git a/frontend/src/app/components/op-context-menu/wp-context-menu/wp-view-context-menu.directive.ts b/frontend/src/app/components/op-context-menu/wp-context-menu/wp-view-context-menu.directive.tsindex 9874357292e..e3d65d6494b 100644--- a/frontend/src/app/components/op-context-menu/wp-context-menu/wp-view-context-menu.directive.ts+++ b/frontend/src/app/components/op-context-menu/wp-context-menu/wp-view-context-menu.directive.ts@@ -109,7 +109,7 @@ export class WorkPackageViewContextMenu extends OpContextMenuHandler {copiedFromWorkPackageId: selected[0].id};- this.$state.go('work-packages.list.copy', params);+ this.$state.go('work-packages.partitioned.list.copy', params);}private getSelectedWorkPackages() {@@ -171,7 +171,7 @@ export class WorkPackageViewContextMenu extends OpContextMenuHandler {disabled: false,icon: 'icon-view-split',class: 'detailsViewMenuItem',- href: this.$state.href('work-packages.list.details.overview', {workPackageId: this.workPackageId}),+ href: this.$state.href('work-packages.partitioned.list.details.overview', {workPackageId: this.workPackageId}),linkText: I18n.t('js.button_open_details'),onClick: ($event:JQuery.TriggeredEvent) => {if (LinkHandling.isClickedWithModifier($event)) {@@ -179,7 +179,7 @@ export class WorkPackageViewContextMenu extends OpContextMenuHandler {}this.$state.go(- 'work-packages.list.details.overview',+ 'work-packages.partitioned.list.details.overview',{workPackageId: this.workPackageId});return true;diff --git a/frontend/src/app/components/work-packages/work-package-authorization.service.ts b/frontend/src/app/components/work-packages/work-package-authorization.service.tsindex 2a1ec813748..8cd70a5ee9a 100644--- a/frontend/src/app/components/work-packages/work-package-authorization.service.ts+++ b/frontend/src/app/components/work-packages/work-package-authorization.service.ts@@ -50,7 +50,7 @@ export class WorkPackageAuthorization {public copyLink() {const stateName = this.$state.current.name as string;- if (stateName.indexOf('work-packages.list.details') === 0) {+ if (stateName.indexOf('work-packages.partitioned.list.details') === 0) {return this.PathHelper.workPackageDetailsCopyPath(this.project.identifier, this.workPackage.id!);} else {return this.PathHelper.workPackageCopyPath(this.workPackage.id!);diff --git a/frontend/src/app/components/work-packages/work-package.service.ts b/frontend/src/app/components/work-packages/work-package.service.tsindex 0feeb979f1c..04d8443cbe0 100644--- a/frontend/src/app/components/work-packages/work-package.service.ts+++ b/frontend/src/app/components/work-packages/work-package.service.ts@@ -71,7 +71,7 @@ export class WorkPackageService {if (this.$state.includes('**.list.details.**')&& ids.indexOf(this.$state.params.workPackageId) > -1) {- this.$state.go('work-packages.list', this.$state.params);+ this.$state.go('work-packages.partitioned.list', this.$state.params);}}).catch(() => {diff --git a/frontend/src/app/components/wp-buttons/wp-details-view-button/wp-details-view-button.component.ts b/frontend/src/app/components/wp-buttons/wp-details-view-button/wp-details-view-button.component.tsindex af79a25dc2a..cbc6e79678d 100644--- a/frontend/src/app/components/wp-buttons/wp-details-view-button/wp-details-view-button.component.ts+++ b/frontend/src/app/components/wp-buttons/wp-details-view-button/wp-details-view-button.component.ts@@ -42,8 +42,8 @@ import {I18nService} from "core-app/modules/common/i18n/i18n.service";export class WorkPackageDetailsViewButtonComponent extends AbstractWorkPackageButtonComponent implements OnDestroy {public projectIdentifier:string;public accessKey:number = 8;- public activeState:string = 'work-packages.list.details';- public listState:string = 'work-packages.list';+ public activeState:string = 'work-packages.partitioned.list.details';+ public listState:string = 'work-packages.partitioned.list';public buttonId:string = 'work-packages-details-view-button';public buttonClass:string = 'toolbar-icon';public iconClass:string = 'icon-info2';diff --git a/frontend/src/app/components/wp-card-view/wp-single-card/wp-single-card.component.ts b/frontend/src/app/components/wp-card-view/wp-single-card/wp-single-card.component.tsindex e6e77315d38..30573e1dbb2 100644--- a/frontend/src/app/components/wp-card-view/wp-single-card/wp-single-card.component.ts+++ b/frontend/src/app/components/wp-card-view/wp-single-card/wp-single-card.component.ts@@ -75,7 +75,7 @@ export class WorkPackageSingleCardComponent implements OnDestroy, OnInit {let classIdentifier = this.classIdentifier(wp);this.wpTableSelection.setSelection(wp.id!, this.cardView.findRenderedCard(classIdentifier));this.$state.go(- 'work-packages.list.details',+ 'work-packages.partitioned.list.details',{workPackageId: wp.id!});}diff --git a/frontend/src/app/components/wp-copy/wp-copy-split-view.component.ts b/frontend/src/app/components/wp-copy/wp-copy-split-view.component.tsindex 21aa43a361b..b69be7b74ca 100644--- a/frontend/src/app/components/wp-copy/wp-copy-split-view.component.ts+++ b/frontend/src/app/components/wp-copy/wp-copy-split-view.component.ts@@ -35,6 +35,6 @@ import {WorkPackageCopyController} from 'core-components/wp-copy/wp-copy.controltemplateUrl: '../wp-new/wp-new-split-view.html'})export class WorkPackageCopySplitViewComponent extends WorkPackageCopyController {- public successState = 'work-packages.list.details';+ public successState = 'work-packages.partitioned.list.details';}diff --git a/frontend/src/app/components/wp-new/wp-create.controller.ts b/frontend/src/app/components/wp-new/wp-create.controller.tsindex d4d49d5df7e..c0a4cd73361 100644--- a/frontend/src/app/components/wp-new/wp-create.controller.ts+++ b/frontend/src/app/components/wp-new/wp-create.controller.ts@@ -160,7 +160,7 @@ export class WorkPackageCreateController implements OnInit, OnDestroy {public cancelAndBackToList() {this.wpCreate.cancelCreation();- this.$state.go('work-packages.list', this.$state.params);+ this.$state.go('work-packages.partitioned.list', this.$state.params);}protected createdWorkPackage() {diff --git a/frontend/src/app/components/wp-new/wp-new-split-view.component.ts b/frontend/src/app/components/wp-new/wp-new-split-view.component.tsindex 5c421e53488..6b8ac3a8e0b 100644--- a/frontend/src/app/components/wp-new/wp-new-split-view.component.ts+++ b/frontend/src/app/components/wp-new/wp-new-split-view.component.ts@@ -34,5 +34,5 @@ import {Component} from '@angular/core';templateUrl: './wp-new-split-view.html'})export class WorkPackageNewSplitViewComponent extends WorkPackageCreateController {- public successState:string = 'work-packages.list.details';+ public successState:string = 'work-packages.partitioned.list.details';}diff --git a/frontend/src/app/components/wp-query-select/wp-query-select-dropdown.component.ts b/frontend/src/app/components/wp-query-select/wp-query-select-dropdown.component.tsindex f561719170d..d61875f9369 100644--- a/frontend/src/app/components/wp-query-select/wp-query-select-dropdown.component.ts+++ b/frontend/src/app/components/wp-query-select/wp-query-select-dropdown.component.ts@@ -435,7 +435,7 @@ export class WorkPackageQuerySelectDropdownComponent implements OnInit, OnDestroconst opts = {reload: true};this.$state.go(- 'work-packages.list',+ 'work-packages.partitioned.list',params,opts);@@ -464,7 +464,7 @@ export class WorkPackageQuerySelectDropdownComponent implements OnInit, OnDestro}const params = this.getQueryParams(item);- return this.$state.href('work-packages.list', params);+ return this.$state.href('work-packages.partitioned.list', params);}private highlightSelected(item:IAutocompleteItem) {diff --git a/frontend/src/app/components/wp-relations/wp-relations-hierarchy/wp-relations-hierarchy.service.ts b/frontend/src/app/components/wp-relations/wp-relations-hierarchy/wp-relations-hierarchy.service.tsindex fda78fb181c..a1ff5b2fa5b 100644--- a/frontend/src/app/components/wp-relations/wp-relations-hierarchy/wp-relations-hierarchy.service.ts+++ b/frontend/src/app/components/wp-relations/wp-relations-hierarchy/wp-relations-hierarchy.service.ts@@ -110,7 +110,7 @@ export class WorkPackageRelationsHierarchyService {workPackage.project.$load().then(() => {const args = [- 'work-packages.list.new',+ 'work-packages.partitioned.list.new',{parent_id: workPackage.id}diff --git a/frontend/src/app/components/wp-single-view-tabs/keep-tab/keep-tab.service.spec.ts b/frontend/src/app/components/wp-single-view-tabs/keep-tab/keep-tab.service.spec.tsindex 501336ee7e9..3ff5ec0569a 100644--- a/frontend/src/app/components/wp-single-view-tabs/keep-tab/keep-tab.service.spec.ts+++ b/frontend/src/app/components/wp-single-view-tabs/keep-tab/keep-tab.service.spec.ts@@ -53,7 +53,7 @@ describe('keepTab service', () => {defaults = {showTab: 'work-packages.show.activity',- detailsTab: 'work-packages.list.details.overview'+ detailsTab: 'work-packages.partitioned.list.details.overview'};});@@ -86,7 +86,7 @@ describe('keepTab service', () => {});it('should also update the value of currentDetailsTab', () => {- expect(keepTab.currentDetailsState).toEqual('work-packages.list.details.relations');+ expect(keepTab.currentDetailsState).toEqual('work-packages.partitioned.list.details.relations');});it('should propagate the previous change', () => {@@ -95,7 +95,7 @@ describe('keepTab service', () => {var expected = {active: 'relations',show: 'work-packages.show.relations',- details: 'work-packages.list.details.relations'+ details: 'work-packages.partitioned.list.details.relations'}keepTab.observable.subscribe(cb);@@ -103,14 +103,14 @@ describe('keepTab service', () => {});it('should correctly change when switching back', () => {- currentPathPrefix = 'work-packages.list.details.*';+ currentPathPrefix = 'work-packages.partitioned.list.details.*';- $state.current.name = 'work-packages.list.details.overview';+ $state.current.name = 'work-packages.partitioned.list.details.overview';keepTab.updateTabs();expect(keepTab.currentShowState).toEqual('work-packages.show.activity');expect(keepTab.currentShowTab).toEqual('activity');- expect(keepTab.currentDetailsState).toEqual('work-packages.list.details.overview');+ expect(keepTab.currentDetailsState).toEqual('work-packages.partitioned.list.details.overview');expect(keepTab.currentDetailsTab).toEqual('overview');});});@@ -126,22 +126,22 @@ describe('keepTab service', () => {});it('should set the tab to overview', () => {- expect(keepTab.currentDetailsState).toEqual('work-packages.list.details.overview');+ expect(keepTab.currentDetailsState).toEqual('work-packages.partitioned.list.details.overview');});});describe('when opening a details route', () => {beforeEach(() => {spyOn($state, 'includes').and.callFake((path:string) => {- return path === 'work-packages.list.details.*';+ return path === 'work-packages.partitioned.list.details.*';});- $state.current.name = 'work-packages.list.details.activity';+ $state.current.name = 'work-packages.partitioned.list.details.activity';keepTab.updateTabs();});it('should update the currentShowTab value', () => {- expect(keepTab.currentDetailsState).toEqual('work-packages.list.details.activity');+ expect(keepTab.currentDetailsState).toEqual('work-packages.partitioned.list.details.activity');expect(keepTab.currentDetailsTab).toEqual('activity');});@@ -155,7 +155,7 @@ describe('keepTab service', () => {var expected = {active: 'activity',- details: 'work-packages.list.details.activity',+ details: 'work-packages.partitioned.list.details.activity',show: 'work-packages.show.activity'};diff --git a/frontend/src/app/components/wp-single-view-tabs/keep-tab/keep-tab.service.ts b/frontend/src/app/components/wp-single-view-tabs/keep-tab/keep-tab.service.tsindex 0ffaca621e7..cbd2d6968ac 100644--- a/frontend/src/app/components/wp-single-view-tabs/keep-tab/keep-tab.service.ts+++ b/frontend/src/app/components/wp-single-view-tabs/keep-tab/keep-tab.service.ts@@ -65,11 +65,11 @@ export class KeepTabService {}public get currentDetailsState():string {- return 'work-packages.list.details.' + this.currentDetailsTab;+ return 'work-packages.partitioned.list.details.' + this.currentDetailsTab;}public isDetailsState(stateName:string) {- return stateName === 'work-packages.list.details';+ return stateName === 'work-packages.partitioned.list.details';}public get currentShowTab():string {@@ -110,7 +110,7 @@ export class KeepTabService {}if (stateName === 'details') {- return this.$state.includes('work-packages.list.details.*');+ return this.$state.includes('work-packages.partitioned.list.details.*');}return false;diff --git a/frontend/src/app/modules/common/back-routing/back-routing.service.ts b/frontend/src/app/modules/common/back-routing/back-routing.service.tsindex a0d7563d0a4..748ffd872bf 100644--- a/frontend/src/app/modules/common/back-routing/back-routing.service.ts+++ b/frontend/src/app/modules/common/back-routing/back-routing.service.ts@@ -52,11 +52,11 @@ export class BackRoutingService {// Default: back to list// When coming from a deep link or a create formif (!this.backRoute || this.backRoute.name.includes('new')) {- this.$state.go('work-packages.list', this.$state.params);+ this.$state.go('work-packages.partitioned.list', this.$state.params);} else {if (this.keepTab.isDetailsState(this.backRoute.parent)) {if (preferListOverSplit) {- this.$state.go('work-packages.list', this.$state.params);+ this.$state.go('work-packages.partitioned.list', this.$state.params);} else {this.$state.go(this.keepTab.currentDetailsState, this.$state.params);}diff --git a/frontend/src/app/modules/router/openproject.routes.ts b/frontend/src/app/modules/router/openproject.routes.tsindex afd6d725de1..6b697ad7fcf 100644--- a/frontend/src/app/modules/router/openproject.routes.ts+++ b/frontend/src/app/modules/router/openproject.routes.ts@@ -133,7 +133,11 @@ export function initializeUiRouterListeners(injector:Injector) {// componentlet wpBase = document.querySelector(appBaseSelector);- // Apply classes from bodyClasses in each state definition+ // Uncomment to trace route changes+ // const uiRouter = injector.get(UIRouter);+ // uiRouter.trace.enable();++ // Apply classes from bodyClasses in each state definition// This was defined as onEnter, onExit functions in each state before// but since AOT doesn't allow anonymous functions, we can't re-use them now.// The transition will only return the target state on `transition.to()`,@@ -164,7 +168,7 @@ export function initializeUiRouterListeners(injector:Injector) {const toState = transition.to();// Remove start_onboarding_tour param if set- if (toParams.start_onboarding_tour && toState.name !== 'work-packages.list') {+ if (toParams.start_onboarding_tour && toState.name !== 'work-packages.partitioned.list') {const paramsCopy = Object.assign({}, transition.params());paramsCopy.start_onboarding_tour = undefined;return $state.target(transition.to(), paramsCopy);diff --git a/frontend/src/app/modules/work_packages/openproject-work-packages.module.ts b/frontend/src/app/modules/work_packages/openproject-work-packages.module.tsindex a628ba8aa68..4c9477160b9 100644--- a/frontend/src/app/modules/work_packages/openproject-work-packages.module.ts+++ b/frontend/src/app/modules/work_packages/openproject-work-packages.module.ts@@ -164,6 +164,7 @@ import {WorkPackageChangeset} from "core-components/wp-edit/work-package-changesimport {WorkPackageSingleCardComponent} from "core-components/wp-card-view/wp-single-card/wp-single-card.component";import { TimeEntryChangeset } from 'core-app/components/time-entries/time-entry-changeset';import {WorkPackagePartitionedViewPageComponent} from "core-app/modules/work_packages/routing/wp-partitioned-view-page/wp-partitioned-view-page.component";+import {WorkPackageListViewComponent} from "core-app/modules/work_packages/routing/wp-list-view/wp-list-view.component";@NgModule({@@ -228,6 +229,9 @@ import {WorkPackagePartitionedViewPageComponent} from "core-app/modules/work_pacWorkPackagesBaseComponent,WorkPackagePartitionedViewPageComponent,+ // WP list side+ WorkPackageListViewComponent,+// Query injector isolationWorkPackageIsolatedQuerySpaceDirective,WorkPackageIsolatedGraphQuerySpaceDirective,@@ -378,6 +382,9 @@ import {WorkPackagePartitionedViewPageComponent} from "core-app/modules/work_pacWorkPackageViewToggleButton,],entryComponents: [+ // List view+ WorkPackageListViewComponent,+// Split viewWorkPackageSplitViewComponent,diff --git a/frontend/src/app/modules/work_packages/routing/work-packages-routes.ts b/frontend/src/app/modules/work_packages/routing/work-packages-routes.tsindex 543b0a82330..ca82a8c66a8 100644--- a/frontend/src/app/modules/work_packages/routing/work-packages-routes.ts+++ b/frontend/src/app/modules/work_packages/routing/work-packages-routes.ts@@ -39,6 +39,7 @@ import {WorkPackageSplitViewComponent} from "core-app/modules/work_packages/routimport {Ng2StateDeclaration} from "@uirouter/angular";import {WorkPackagesBaseComponent} from "core-app/modules/work_packages/routing/wp-base/wp--base.component";import {WorkPackagePartitionedViewPageComponent} from "core-app/modules/work_packages/routing/wp-partitioned-view-page/wp-partitioned-view-page.component";+import {WorkPackageListViewComponent} from "core-app/modules/work_packages/routing/wp-list-view/wp-list-view.component";const menuItemClass = 'work-packages-menu-item';@@ -48,7 +49,7 @@ export const WORK_PACKAGES_ROUTES:Ng2StateDeclaration[] = [parent: 'root',component: WorkPackagesBaseComponent,url: '/work_packages?query_id&query_props&start_onboarding_tour',- redirectTo: 'work-packages.list',+ redirectTo: 'work-packages.partitioned.list',data: {bodyClasses: 'router--work-packages-base',menuItem: menuItemClass@@ -131,44 +132,57 @@ export const WORK_PACKAGES_ROUTES:Ng2StateDeclaration[] = [}},{- name: 'work-packages.list',- url: '',+ name: 'work-packages.partitioned',component: WorkPackagePartitionedViewPageComponent,+ url: '',+ },+ {+ name: 'work-packages.partitioned.list',+ url: '',reloadOnSearch: false,+ views: {+ 'content-left': { component: WorkPackageListViewComponent }+ },data: {bodyClasses: 'router--work-packages-list-view',menuItem: menuItemClass}},{- name: 'work-packages.list.new',+ name: 'work-packages.partitioned.list.new',url: '/create_new?type&parent_id',- component: WorkPackageNewSplitViewComponent,+ views: {+ 'content-right@^.^': { component: WorkPackageNewSplitViewComponent }+ },reloadOnSearch: false,data: {allowMovingInEditMode: true,bodyClasses: 'router--work-packages-split-view-new',menuItem: menuItemClass,- parent: 'work-packages.list'+ parent: 'work-packages.partitioned.list'},},{- name: 'work-packages.list.copy',+ name: 'work-packages.partitioned.list.copy',url: '/details/{copiedFromWorkPackageId:[0-9]+}/copy',- component: WorkPackageCopySplitViewComponent,+ views: {+ 'content-right@^.^': { component: WorkPackageCopySplitViewComponent }+ },reloadOnSearch: false,data: {allowMovingInEditMode: true,bodyClasses: 'router--work-packages-split-view',menuItem: menuItemClass,- parent: 'work-packages.list'+ parent: 'work-packages.partitioned.list'},},{- name: 'work-packages.list.details',- redirectTo: 'work-packages.list.details.overview',+ name: 'work-packages.partitioned.list.details',+ redirectTo: 'work-packages.partitioned.list.details.overview',url: '/details/{workPackageId:[0-9]+}',- component: WorkPackageSplitViewComponent,+ views: {+ 'content-right@^.^': { component: WorkPackageSplitViewComponent }+ },reloadOnSearch: false,params: {focus: {@@ -182,47 +196,47 @@ export const WORK_PACKAGES_ROUTES:Ng2StateDeclaration[] = [},},{- name: 'work-packages.list.details.overview',+ name: 'work-packages.partitioned.list.details.overview',url: '/overview',component: WorkPackageOverviewTabComponent,data: {- parent: 'work-packages.list.details',+ parent: 'work-packages.partitioned.list.details',menuItem: menuItemClass}},{- name: 'work-packages.list.details.activity',+ name: 'work-packages.partitioned.list.details.activity',url: '/activity',component: WorkPackageActivityTabComponent,data: {- parent: 'work-packages.list.details',+ parent: 'work-packages.partitioned.list.details',menuItem: menuItemClass}},{- name: 'work-packages.list.details.activity.details',+ name: 'work-packages.partitioned.list.details.activity.details',url: '/activity/details/#{activity_no:\d+}',component: WorkPackageActivityTabComponent,data: {- parent: 'work-packages.list.details',+ parent: 'work-packages.partitioned.list.details',menuItem: menuItemClass}},{- name: 'work-packages.list.details.relations',+ name: 'work-packages.partitioned.list.details.relations',url: '/relations',component: WorkPackageRelationsTabComponent,data: {- parent: 'work-packages.list.details',+ parent: 'work-packages.partitioned.list.details',menuItem: menuItemClass}},{- name: 'work-packages.list.details.watchers',+ name: 'work-packages.partitioned.list.details.watchers',url: '/watchers',component: WorkPackageWatchersTabComponent,data: {- parent: 'work-packages.list.details',+ parent: 'work-packages.partitioned.list.details',menuItem: menuItemClass}},diff --git 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.htmlnew file mode 100644index 00000000000..1928e70b259--- /dev/null+++ b/frontend/src/app/modules/work_packages/routing/wp-list-view/wp-list-view.component.html@@ -0,0 +1,21 @@+<!-- (TABLE + TIMELINE) and FOOTER vertical split-->+<div class="result-overlay"+ *ngIf="showResultOverlay && showListView"></div>++<!-- TABLE + TIMELINE horizontal split -->+<wp-table *ngIf="tableInformationLoaded && showListView"+ [projectIdentifier]="projectIdentifier"+ [configuration]="wpTableConfiguration"+ class="work-packages-split-view--tabletimeline-content"></wp-table>++<!-- GRID representation of the WP -->+<div *ngIf="!showListView"+ class="work-packages--card-view-container">+ <wp-grid [configuration]="wpTableConfiguration"></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 --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.tsnew file mode 100644index 00000000000..17fec484019--- /dev/null+++ b/frontend/src/app/modules/work_packages/routing/wp-list-view/wp-list-view.component.ts@@ -0,0 +1,128 @@+// -- 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,+ HostBinding,+ Input,+ OnDestroy,+ OnInit+} from "@angular/core";+import {untilComponentDestroyed} from 'ng2-rx-componentdestroyed';+import {QueryResource} from 'core-app/modules/hal/resources/query-resource';+import {OpTitleService} from "core-components/html/op-title.service";+import {WorkPackagesViewBase} from "core-app/modules/work_packages/routing/wp-view-base/work-packages-view.base";+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";+import {BcfDetectorService} from "core-app/modules/bcf/helper/bcf-detector.service";+import {+ WorkPackageViewDisplayRepresentationService,+ wpDisplayCardRepresentation+} from "core-app/modules/work_packages/routing/wp-view-base/view-services/wp-view-display-representation.service";+import {WorkPackageTableConfigurationObject} from "core-components/wp-table/wp-table-configuration";+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 {QueryParamListenerService} from "core-components/wp-query/query-param-listener.service";+import {InjectField} from "core-app/helpers/angular/inject-field.decorator";+import {I18nService} from "core-app/modules/common/i18n/i18n.service";+import {IsolatedQuerySpace} from "core-app/modules/work_packages/query-space/isolated-query-space";+import {DeviceService} from "core-app/modules/common/browser/device.service";++@Component({+ selector: 'wp-list-view',+ templateUrl: './wp-list-view.component.html',+ host: { 'class': 'work-packages-split-view--tabletimeline-side' },+ changeDetection: ChangeDetectionStrategy.OnPush,+ providers: [+ DragAndDropService,+ CausedUpdatesService+ ]+})+export class WorkPackageListViewComponent implements OnInit, OnDestroy {+ /** An overlay over the table shown for example when the filters are invalid */+ @Input() showResultOverlay:boolean;++ /** Current project identifier */+ @Input() projectIdentifier:string|undefined;++ text = {+ 'jump_to_pagination': this.I18n.t('js.work_packages.jump_marks.pagination'),+ 'text_jump_to_pagination': this.I18n.t('js.work_packages.jump_marks.label_pagination'),+ 'button_settings': this.I18n.t('js.button_settings')+ };++ /** Determine when query is initially loaded */+ tableInformationLoaded = false;++ /** Switch between list and card view */+ showListView:boolean = true;++ /** */+ readonly wpTableConfiguration:WorkPackageTableConfigurationObject = {+ dragAndDropEnabled: true+ };++ constructor(private I18n:I18nService,+ private querySpace:IsolatedQuerySpace,+ private deviceService:DeviceService,+ private wpDisplayRepresentation:WorkPackageViewDisplayRepresentationService,+ private cdRef:ChangeDetectorRef) {+ }++ ngOnInit() {++ // Mark tableInformationLoaded when initially loading done+ this.setupInformationLoadedListener();++ this.querySpace.query.values$().pipe(+ untilComponentDestroyed(this)+ ).subscribe((query) => {+ // Update the visible representation+ this.showListView = !(this.deviceService.isMobile || this.wpDisplayRepresentation.valueFromQuery(query) === wpDisplayCardRepresentation);+ this.cdRef.detectChanges();+ });+ }+ ngOnDestroy():void {+ // Nothing to do+ }++ protected setupInformationLoadedListener() {+ this+ .querySpace+ .initialized+ .values$()+ .pipe(take(1))+ .subscribe(() => {+ this.tableInformationLoaded = true;+ this.cdRef.detectChanges();+ });+ }+}diff --git a/frontend/src/app/modules/work_packages/routing/wp-partitioned-view-page/wp-partitioned-view-page.component.html b/frontend/src/app/modules/work_packages/routing/wp-partitioned-view-page/wp-partitioned-view-page.component.htmlindex 67ce58ddf07..0ef537dfd67 100644--- a/frontend/src/app/modules/work_packages/routing/wp-partitioned-view-page/wp-partitioned-view-page.component.html+++ b/frontend/src/app/modules/work_packages/routing/wp-partitioned-view-page/wp-partitioned-view-page.component.html@@ -15,7 +15,7 @@<li class="toolbar-item"><wp-create-button[allowed]="allowed('work_packages', 'createWorkPackage')"- stateName="work-packages.list.new">+ stateName="work-packages.partitioned.list.new"></wp-create-button></li><li class="toolbar-item"@@ -68,33 +68,13 @@<span [textContent]="text.jump_to_pagination"></span></accessible-by-keyboard>- <!-- (TABLE + TIMELINE) + DETAILS view -->-- <!-- (TABLE + TIMELINE) and FOOTER vertical split-->- <div class="work-packages-split-view--tabletimeline-side loading-indicator--location"- data-indicator-name="table">- <div class="result-overlay"- *ngIf="showResultOverlay && showListView"></div>-- <!-- TABLE + TIMELINE horizontal split -->- <wp-table *ngIf="tableInformationLoaded && showListView"- [projectIdentifier]="projectIdentifier"- [configuration]="wpTableConfiguration"- class="work-packages-split-view--tabletimeline-content"></wp-table>-- <!-- GRID representation of the WP -->- <div *ngIf="!showListView"- class="work-packages--card-view-container">- <wp-grid [configuration]="wpTableConfiguration"></wp-grid>- </div>-- <!-- Footer -->- <div class="work-packages-split-view--tabletimeline-footer hide-when-print"- *ngIf="tableInformationLoaded">- <wp-table-pagination></wp-table-pagination>- </div>- </div>+ <!-- Left content view -->+ <div class="work-packages-partitioned-page--content-left loading-indicator--location"+ data-indicator-name="table"+ ui-view="content-left">+ </div>- <!-- Details view -->- <div class="work-packages-split-view--details-side" ui-view></div>+ <!-- Right content view -->+ <div class="work-packages-split-view--details-side"+ ui-view="content-right"></div></div>diff --git a/frontend/src/app/modules/work_packages/routing/wp-partitioned-view-page/wp-partitioned-view-page.component.sass b/frontend/src/app/modules/work_packages/routing/wp-partitioned-view-page/wp-partitioned-view-page.component.sassindex 8b38761b6a1..f42fc441f83 100644--- a/frontend/src/app/modules/work_packages/routing/wp-partitioned-view-page/wp-partitioned-view-page.component.sass+++ b/frontend/src/app/modules/work_packages/routing/wp-partitioned-view-page/wp-partitioned-view-page.component.sass@@ -37,7 +37,7 @@filter-containergrid-area: filter- .work-packages-split-view--tabletimeline-side+ .work-packages-partitioned-page--content-leftgrid-area: content-left.work-packages-split-view--details-sidediff --git a/frontend/src/app/modules/work_packages/routing/wp-partitioned-view-page/wp-partitioned-view-page.component.ts b/frontend/src/app/modules/work_packages/routing/wp-partitioned-view-page/wp-partitioned-view-page.component.tsindex f7c64a0876f..7de4726c00a 100644--- a/frontend/src/app/modules/work_packages/routing/wp-partitioned-view-page/wp-partitioned-view-page.component.ts+++ b/frontend/src/app/modules/work_packages/routing/wp-partitioned-view-page/wp-partitioned-view-page.component.ts@@ -50,8 +50,6 @@ import {InjectField} from "core-app/helpers/angular/inject-field.decorator";providers: [/** We need to provide the wpNotification service here to get correct save notifications for WP resources */{provide: HalResourceNotificationService, useClass: WorkPackageNotificationService},- DragAndDropService,- CausedUpdatesService,QueryParamListenerService]})@@ -127,7 +125,7 @@ export class WorkPackagePartitionedViewPageComponent extends WorkPackagesViewBasthis.setupInformationLoadedListener();// Update title on entering this state- this.unRegisterTitleListener = this.$transitions.onSuccess({to: 'work-packages.list'}, () => {+ this.unRegisterTitleListener = this.$transitions.onSuccess({to: 'work-packages.partitioned.list'}, () => {if (this.selectedTitle) {this.titleService.setFirstPart(this.selectedTitle);}@@ -204,7 +202,7 @@ export class WorkPackagePartitionedViewPageComponent extends WorkPackagesViewBasthis.titleEditingEnabled = this.authorisationService.can('query', 'updateImmediately');// Update the title if we're in the list state alone- if (this.$state.current.name === 'work-packages.list') {+ if (this.$state.current.name === 'work-packages.partitioned.list') {this.titleService.setFirstPart(this.selectedTitle);}}diff --git a/frontend/src/app/modules/work_packages/routing/wp-split-view/wp-split-view.component.ts b/frontend/src/app/modules/work_packages/routing/wp-split-view/wp-split-view.component.tsindex 6249b101cae..b53aad6fd0b 100644--- a/frontend/src/app/modules/work_packages/routing/wp-split-view/wp-split-view.component.ts+++ b/frontend/src/app/modules/work_packages/routing/wp-split-view/wp-split-view.component.ts@@ -67,7 +67,7 @@ export class WorkPackageSplitViewComponent extends WorkPackageSingleViewBase impif (!focusedWP) {// Focus on the work package if we're the first route- const isFirstRoute = this.firstRoute.name === 'work-packages.list.details.overview';+ const isFirstRoute = this.firstRoute.name === 'work-packages.partitioned.list.details.overview';const isSameID = this.firstRoute.params && wpId === this.firstRoute.params.workPackageI;this.wpTableFocus.updateFocus(wpId, (isFirstRoute && isSameID));} else {@@ -84,7 +84,7 @@ export class WorkPackageSplitViewComponent extends WorkPackageSingleViewBase imp).subscribe(newId => {const idSame = wpId.toString() === newId.toString();- if (!idSame && this.$state.includes('work-packages.list.details')) {+ if (!idSame && this.$state.includes('work-packages.partitioned.list.details')) {this.$state.go((this.$state.current.name as string),{workPackageId: newId, focus: false}@@ -95,7 +95,7 @@ export class WorkPackageSplitViewComponent extends WorkPackageSingleViewBase imppublic close() {- this.$state.go('work-packages.list', this.$state.params);+ this.$state.go('work-packages.partitioned.list', this.$state.params);}public switchToFullscreen() {diff --git a/frontend/src/app/modules/work_packages/routing/wp-split-view/wp-split-view.html b/frontend/src/app/modules/work_packages/routing/wp-split-view/wp-split-view.htmlindex 0c0b791624d..1f72f5b76e3 100644--- a/frontend/src/app/modules/work_packages/routing/wp-split-view/wp-split-view.html+++ b/frontend/src/app/modules/work_packages/routing/wp-split-view/wp-split-view.html@@ -5,21 +5,21 @@<ul class="tabrow"><!-- The hrefs with empty URLs are necessary for IE10 to focus these linksproperly. Thus, don't remove the hrefs or the empty URLs! -->- <li uiSref="work-packages.list.details.overview"+ <li uiSref="work-packages.partitioned.list.details.overview"uiSrefActive="selected"><a href="" [textContent]="text.tabs.overview"></a></li>- <li uiSref="work-packages.list.details.activity"+ <li uiSref="work-packages.partitioned.list.details.activity"uiSrefActive="selected"><a href="" [textContent]="text.tabs.activity"></a></li>- <li uiSref="work-packages.list.details.relations"+ <li uiSref="work-packages.partitioned.list.details.relations"uiSrefActive="selected"><a href="" [textContent]="text.tabs.relations"></a><wp-relations-count [wpId]="workPackage.id"></wp-relations-count></li><li *ngIf="canViewWorkPackageWatchers()"- uiSref="work-packages.list.details.watchers"+ uiSref="work-packages.partitioned.list.details.watchers"uiSrefActive="selected"><a href="" [textContent]="text.tabs.watchers"></a><wp-watchers-count [wpId]="workPackage.id"></wp-watchers-count>