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

Apply CSS grid for WpList Component

Henriette Dinger0f786f0c2112
diff --git a/app/assets/stylesheets/layout/work_packages/_print.sass b/app/assets/stylesheets/layout/work_packages/_print.sass
index 5c703074a14..c52ce9ea4f4 100644
--- a/app/assets/stylesheets/layout/work_packages/_print.sass
+++ b/app/assets/stylesheets/layout/work_packages/_print.sass
@@ -27,34 +27,33 @@
.work-packages-list-view--container
padding-left: 0
- .work-packages-split-view
+
+ .work-packages-split-view--tabletimeline-side
+ .work-packages-split-view--tabletimeline-content
+ .wp-table--hierarchy-aditional-row,
+ tr.-checked,
+ .row-hovered
+ // Remove highlighting of first and selected rows:
+ background-color: transparent
+
+ .work-packages-tabletimeline--table-side
+ contain: initial // For printing in Chrome
overflow: visible
- .work-packages-split-view--tabletimeline-side
- .work-packages-split-view--tabletimeline-content
- .wp-table--hierarchy-aditional-row,
- tr.-checked,
- .row-hovered
- // Remove highlighting of first and selected rows:
- background-color: transparent
-
- .work-packages-tabletimeline--table-side
- contain: initial // For printing in Chrome
- overflow: visible
-
- &:not(.-timeline-visible)
- // Only repeat table header when only table visible and no
- // timelines.
- thead.-sticky th
- position: initial
-
- &.-timeline-visible
- // Do not show table on timelines print outs.
- display: none
-
- .work-packages-tabletimeline--timeline-side
- contain: initial // For printing in Chrome
- border-left: none
+ &:not(.-timeline-visible)
+ // Only repeat table header when only table visible and no
+ // timelines.
+ thead.-sticky th
+ position: initial
+
+ &.-timeline-visible
+ // Do not show table on timelines print outs.
+ display: none
+
+ .work-packages-tabletimeline--timeline-side
+ contain: initial // For printing in Chrome
+ border-left: none
+ flex-basis: 100% !important
.work-package-table--container,
.generic-table--results-container
diff --git a/app/assets/stylesheets/layout/work_packages/_table.sass b/app/assets/stylesheets/layout/work_packages/_table.sass
index 9f4505af28f..0a57893ead8 100644
--- a/app/assets/stylesheets/layout/work_packages/_table.sass
+++ b/app/assets/stylesheets/layout/work_packages/_table.sass
@@ -51,30 +51,12 @@
height: 100%
.work-packages-list-view--container
- // Flexbox for the toolbar, filters and work package split view
- display: flex
- flex-direction: column
- height: 100%
-
> .toolbar-container
margin-top: 5px
input[type="text"].toolbar--editable-toolbar
font-size: 24px
- .work-packages--filters-optional-container
- // not flex-item
- height: auto
- overflow: auto
- flex-shrink: 0
-
-// Outer Flex container for (table+timeline)|details
-.work-packages-split-view
- flex: 1 1 auto
- display: flex
- // Required for correctly scrolling the inner containers
- overflow: hidden
-
// Match both rows and timeline specifically
tr.row-hovered,
div.row-hovered
diff --git a/frontend/src/app/components/resizer/wp-resizer.component.ts b/frontend/src/app/components/resizer/wp-resizer.component.ts
index 9751e41782b..05a235f25a0 100644
--- a/frontend/src/app/components/resizer/wp-resizer.component.ts
+++ b/frontend/src/app/components/resizer/wp-resizer.component.ts
@@ -42,6 +42,7 @@ export class WpResizerDirective implements OnInit, OnDestroy {
@Input() elementClass:string;
@Input() resizeEvent:string;
@Input() localStorageKey:string;
+ @Input() resizeStyle:'flexBasis'|'width' = 'flexBasis';
private resizingElement:HTMLElement;
private elementFlex:number;
@@ -66,12 +67,15 @@ export class WpResizerDirective implements OnInit, OnDestroy {
this.elementFlex = localStorageValue ? parseInt(localStorageValue,
10) : this.resizingElement.offsetWidth;
+ // ToDo:
+ // Rename variables to width
+
// This case only happens when the timeline is loaded but not displayed.
// Therefor the flexbasis will be set to 50%, just in px
if (this.elementFlex === 0 && this.resizingElement.parentElement) {
this.elementFlex = this.resizingElement.parentElement.offsetWidth / 2;
}
- this.resizingElement.style.flexBasis = this.elementFlex + 'px';
+ this.resizingElement.style[this.resizeStyle] = this.elementFlex + 'px';
// Wait until dom content is loaded and initialize column layout
// Otherwise function will be executed with empty list
@@ -99,7 +103,7 @@ export class WpResizerDirective implements OnInit, OnDestroy {
ngOnDestroy() {
// Reset the style when killing this directive, otherwise the style remains
- this.resizingElement.style.flexBasis = null;
+ this.resizingElement.style[this.resizeStyle] = '';
}
@HostListener('mousedown', ['$event'])
@@ -187,7 +191,7 @@ export class WpResizerDirective implements OnInit, OnDestroy {
this.applyColumnLayout(element, newValue);
// Set new width
- element.style.flexBasis = newValue + 'px';
+ element.style[this.resizeStyle] = newValue + 'px';
}
private applyColumnLayout(element:HTMLElement, newWidth:number) {
diff --git a/frontend/src/app/components/wp-new/wp-new-split-view.html b/frontend/src/app/components/wp-new/wp-new-split-view.html
index f32620511f6..24b9fdab2d5 100644
--- a/frontend/src/app/components/wp-new/wp-new-split-view.html
+++ b/frontend/src/app/components/wp-new/wp-new-split-view.html
@@ -29,7 +29,8 @@
<div class="work-packages--details--resizer hidden-for-mobile hide-when-print">
<wp-resizer [elementClass]="'work-packages-split-view--details-side'"
- [localStorageKey]="'openProject-splitViewFlexBasis'"></wp-resizer>
+ [localStorageKey]="'openProject-splitViewFlexBasis'"
+ resizeStyle="width"></wp-resizer>
</div>
</edit-form>
</div>
diff --git a/frontend/src/app/modules/work_packages/routing/wp-list/wp-list.component.sass b/frontend/src/app/modules/work_packages/routing/wp-list/wp-list.component.sass
index cb36e2397e3..8b38761b6a1 100644
--- a/frontend/src/app/modules/work_packages/routing/wp-list/wp-list.component.sass
+++ b/frontend/src/app/modules/work_packages/routing/wp-list/wp-list.component.sass
@@ -15,3 +15,30 @@
// Ensure the WP cards span the complete width on mobile
// --> Move scrollbar out of visible area
min-width: calc(100vw + 10px)
+
+.work-packages-list-view--container
+ height: 100%
+ overflow: hidden
+ display: grid
+ grid-template-columns: 1fr auto
+ grid-template-rows: 60px auto minmax(200px, 1fr)
+ grid-column-gap: 10px
+
+ &.-split
+ grid-template-areas: "header header" "filter filter" "content-left content-right"
+ &.-right-only
+ grid-template-areas: "header header" "filter filter" "content-right content-right"
+ &.-left-only
+ grid-template-areas: "header header" "filter filter" "content-left content-left"
+
+ .toolbar-container
+ grid-area: header
+
+ filter-container
+ grid-area: filter
+
+ .work-packages-split-view--tabletimeline-side
+ grid-area: content-left
+
+ .work-packages-split-view--details-side
+ grid-area: content-right
diff --git a/frontend/src/app/modules/work_packages/routing/wp-list/wp-list.component.ts b/frontend/src/app/modules/work_packages/routing/wp-list/wp-list.component.ts
index dfa1a1a59f2..a612dbe4a51 100644
--- a/frontend/src/app/modules/work_packages/routing/wp-list/wp-list.component.ts
+++ b/frontend/src/app/modules/work_packages/routing/wp-list/wp-list.component.ts
@@ -26,7 +26,7 @@
// See docs/COPYRIGHT.rdoc for more details.
// ++
-import {ChangeDetectionStrategy, Component, OnDestroy} from "@angular/core";
+import {ChangeDetectionStrategy, Component, HostBinding, OnDestroy} 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";
@@ -96,6 +96,11 @@ export class WorkPackagesListComponent extends WorkPackagesViewBase implements O
dragAndDropEnabled: true
};
+ // ToDo: Return correct value
+ public currentPartition():string {
+ return '-split';
+ }
+
ngOnInit() {
super.ngOnInit();
diff --git a/frontend/src/app/modules/work_packages/routing/wp-list/wp.list.component.html b/frontend/src/app/modules/work_packages/routing/wp-list/wp.list.component.html
index 3f4f12891b6..67ce58ddf07 100644
--- a/frontend/src/app/modules/work_packages/routing/wp-list/wp.list.component.html
+++ b/frontend/src/app/modules/work_packages/routing/wp-list/wp.list.component.html
@@ -1,4 +1,5 @@
-<div class="work-packages-list-view--container">
+<div class="work-packages-list-view--container"
+ [ngClass]="currentPartition()">
<div class="toolbar-container -editable">
<div class="toolbar">
<editable-toolbar-title [title]="selectedTitle"
@@ -68,7 +69,6 @@
</accessible-by-keyboard>
<!-- (TABLE + TIMELINE) + DETAILS view -->
- <div class="work-packages-split-view">
<!-- (TABLE + TIMELINE) and FOOTER vertical split-->
<div class="work-packages-split-view--tabletimeline-side loading-indicator--location"
@@ -97,5 +97,4 @@
<!-- Details view -->
<div class="work-packages-split-view--details-side" ui-view></div>
- </div>
</div>
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.html
index ec66767ce31..0c0b791624d 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
@@ -60,6 +60,7 @@
<div class="work-packages--details--resizer hidden-for-mobile hide-when-print">
<wp-resizer [elementClass]="'work-packages-split-view--details-side'"
- [localStorageKey]="'openProject-splitViewFlexBasis'"></wp-resizer>
+ [localStorageKey]="'openProject-splitViewFlexBasis'"
+ resizeStyle="width"></wp-resizer>
</div>
</div>