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

Make work columns 150px width minimum

Christophe Bliard074bb3c0ba81
diff --git a/frontend/src/app/features/work-packages/components/wp-fast-table/builders/cell-builder.ts b/frontend/src/app/features/work-packages/components/wp-fast-table/builders/cell-builder.ts
index e9c2b06ed73..c886431540e 100644
--- a/frontend/src/app/features/work-packages/components/wp-fast-table/builders/cell-builder.ts
+++ b/frontend/src/app/features/work-packages/components/wp-fast-table/builders/cell-builder.ts
@@ -34,10 +34,14 @@ export class CellBuilder {
td.classList.add('-max');
}
- if (['startDate', 'dueDate', 'duration'].indexOf(attribute) !== -1) {
+ if (['startDate', 'dueDate', 'duration'].includes(attribute)) {
td.classList.add('-no-ellipsis');
}
+ if (['estimatedTime', 'remainingTime'].includes(attribute)) {
+ td.classList.add('-min-150');
+ }
+
const schema = this.schemaCache.of(workPackage);
const fieldSchema = schema.ofProperty(attribute);
if (fieldSchema && fieldSchema.type === 'User') {
diff --git a/frontend/src/app/features/work-packages/components/wp-table/wp-table.component.html b/frontend/src/app/features/work-packages/components/wp-table/wp-table.component.html
index 18d7fd62932..dba6b27aafc 100644
--- a/frontend/src/app/features/work-packages/components/wp-table/wp-table.component.html
+++ b/frontend/src/app/features/work-packages/components/wp-table/wp-table.component.html
@@ -30,7 +30,7 @@
</div>
</th>
<th *ngFor="let column of columns; trackBy:trackByHref"
- [ngClass]="{'-max': column.id === 'subject' }"
+ [ngClass]="{'-max': column.id === 'subject', '-min-150': ['estimatedTime', 'remainingTime'].includes(column.id) }"
class="wp-table--table-header">
<sortHeader [headerColumn]="column"
[locale]="column.custom_field && column.custom_field.name_locale || locale"
diff --git a/frontend/src/global_styles/content/_table.sass b/frontend/src/global_styles/content/_table.sass
index 35fe23cc376..4b773962941 100644
--- a/frontend/src/global_styles/content/_table.sass
+++ b/frontend/src/global_styles/content/_table.sass
@@ -215,6 +215,10 @@ table.generic-table
width: 100%
max-width: 500px
+ &.-min-150
+ @media screen
+ min-width: 150px
+
// The avatar image is not taken into the width calculation of the table cell by the browser.
// That is why we add the space manually.
&.-contains-avatar
diff --git a/frontend/src/global_styles/content/work_packages/inplace_editing/_display_fields.sass b/frontend/src/global_styles/content/work_packages/inplace_editing/_display_fields.sass
index c37330a3e60..36251b66298 100644
--- a/frontend/src/global_styles/content/work_packages/inplace_editing/_display_fields.sass
+++ b/frontend/src/global_styles/content/work_packages/inplace_editing/_display_fields.sass
@@ -28,11 +28,10 @@
@mixin wp-table--time-values
display: inline-block
- width: calc(50% - 0.5rem)
+ width: calc(50% - 0.5rem - 1px)
@mixin wp-table--actual-time-values
text-align: right
- padding-right: 0.25rem
@mixin wp-table--placeholder-time-values
display: inline-block
@@ -85,11 +84,11 @@
.-actual-value
@include wp-table--actual-time-values
- .-separator
- padding-right: 0.25rem
-
.-separator::before
content: "·"
+ display: inline-block
+ padding-left: 0.25rem
+ padding-right: 0.25rem
.-derived-value
color: var(--color-fg-muted)
@@ -100,7 +99,8 @@
.wp-table--cell-container
.inline-edit--display-field.-placeholder,
- &.estimatedTime
+ &.estimatedTime,
+ &.remainingTime
width: 100%
.-placeholder