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

Showing children duration clamp

Aleix Suau641538ab10f0
diff --git a/frontend/src/app/components/wp-table/timeline/cells/timeline-cell-renderer.ts b/frontend/src/app/components/wp-table/timeline/cells/timeline-cell-renderer.ts
index 965aa58ce6b..4fb67dae973 100644
--- a/frontend/src/app/components/wp-table/timeline/cells/timeline-cell-renderer.ts
+++ b/frontend/src/app/components/wp-table/timeline/cells/timeline-cell-renderer.ts
@@ -408,37 +408,28 @@ export class TimelineCellRenderer {
bar.classList.remove('-readonly');
}
- // Display the parent as clamp-style when it has children in the table
- if (this.isParentWithVisibleChildren(wp)) {
- bar.classList.add('-clamp-style');
- bar.style.borderStyle = 'solid';
- bar.style.borderWidth = '2px';
- bar.style.borderBottom = 'none';
- bar.style.background = 'none';
-
- // Display the children's duration bar
- if (wp.derivedStartDate && wp.derivedDueDate) {
- let derivedStartDate = moment(wp.derivedStartDate);
- let derivedDueDate = moment(wp.derivedDueDate);
- let startDate = moment(renderInfo.change.projectedResource.startDate);
- let dueDate = moment(renderInfo.change.projectedResource.dueDate);
- let previousChildrenDurationBar = row.querySelector('.children-duration-bar');
- const childrenDurationBar = document.createElement('div');
-
- childrenDurationBar.classList.add('children-duration-bar');
-
- if (derivedStartDate.isBefore(startDate) || derivedDueDate.isAfter(dueDate)) {
- childrenDurationBar.classList.add('-duration-overflow');
- }
-
- this.setElementPositionAndSize(childrenDurationBar, renderInfo, derivedStartDate, derivedDueDate);
-
- if (previousChildrenDurationBar) {
- previousChildrenDurationBar.remove();
- }
-
- row!.appendChild(childrenDurationBar);
+ // Display the children's duration clamp
+ if (wp.derivedStartDate && wp.derivedDueDate) {
+ let derivedStartDate = moment(wp.derivedStartDate);
+ let derivedDueDate = moment(wp.derivedDueDate);
+ let startDate = moment(renderInfo.change.projectedResource.startDate);
+ let dueDate = moment(renderInfo.change.projectedResource.dueDate);
+ let previousChildrenDurationBar = row.querySelector('.children-duration-bar');
+ const childrenDurationBar = document.createElement('div');
+
+ childrenDurationBar.classList.add('children-duration-bar', '-clamp-style');
+
+ if (derivedStartDate.isBefore(startDate) || derivedDueDate.isAfter(dueDate)) {
+ childrenDurationBar.classList.add('-duration-overflow');
}
+
+ this.setElementPositionAndSize(childrenDurationBar, renderInfo, derivedStartDate, derivedDueDate);
+
+ if (previousChildrenDurationBar) {
+ previousChildrenDurationBar.remove();
+ }
+
+ row!.appendChild(childrenDurationBar);
}
}
diff --git a/frontend/src/global_styles/content/work_packages/timelines/_timelines.sass b/frontend/src/global_styles/content/work_packages/timelines/_timelines.sass
index 1548b55f750..ba39313071b 100644
--- a/frontend/src/global_styles/content/work_packages/timelines/_timelines.sass
+++ b/frontend/src/global_styles/content/work_packages/timelines/_timelines.sass
@@ -84,8 +84,10 @@
position: absolute
z-index: 0
height: 0.9em
- margin-top: 0.1rem
- background: var(--gray-dark)
+ top: 1.9em
+ border: 1px solid
+ background: none
+ border-bottom: none
.-duration-overflow
- background-color: var(--warn)
+ border-color: var(--warn)