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

Parent box wrapping all children, grandchildren...

Aleix Suau263b6dfe46fd
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 82fa9ff8eaa..3032c686ce8 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
@@ -422,14 +422,14 @@ export class TimelineCellRenderer {
// 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 derivedStartDate = moment(wp.derivedStartDate);
+ const derivedDueDate = moment(wp.derivedDueDate);
+ const startDate = moment(renderInfo.change.projectedResource.startDate);
+ const dueDate = moment(renderInfo.change.projectedResource.dueDate);
+ const previousChildrenDurationBar = row.querySelector('.children-duration-bar');
const childrenDurationBar = document.createElement('div');
const childrenDurationHoverContainer = document.createElement('div');
- const visibleChildren = this.numberOfVisibleChildren(wp);
+ const visibleChildren = document.querySelector('wp-timeline-container')?.querySelectorAll(`.__hierarchy-group-${wp.id}`).length || 0;
childrenDurationBar.classList.add('children-duration-bar', '-clamp-style');
childrenDurationBar.title = this.text.label_children_derived_duration;
@@ -517,15 +517,4 @@ export class TimelineCellRenderer {
return false;
}
-
- protected numberOfVisibleChildren(wp:WorkPackageResource):number {
- let children = 0;
- const renderPass = this.workPackageTimeline.workPackageTable.lastRenderPass as HierarchyRenderPass|null;
-
- if (renderPass) {
- children = wp.children.filter(child => renderPass.rendered[child.id!]).length;
- }
-
- return children;
- }
}