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

work package hover box fit visible children's height

Aleix Suau52299e31118a
diff --git a/frontend/src/app/components/wp-fast-table/builders/modes/hierarchy/hierarchy-render-pass.ts b/frontend/src/app/components/wp-fast-table/builders/modes/hierarchy/hierarchy-render-pass.ts
index 383ec4eaee3..29a7127e762 100644
--- a/frontend/src/app/components/wp-fast-table/builders/modes/hierarchy/hierarchy-render-pass.ts
+++ b/frontend/src/app/components/wp-fast-table/builders/modes/hierarchy/hierarchy-render-pass.ts
@@ -23,7 +23,7 @@ export class HierarchyRenderPass extends PrimaryRenderPass {
@InjectField() wpTableHierarchies:WorkPackageViewHierarchiesService;
// Remember which rows were already rendered
- private rendered:{ [workPackageId:string]:boolean } = {};
+ readonly rendered:{ [workPackageId:string]:boolean } = {};
// Remember additional parents inserted that are not part of the results table
private additionalParents:{ [workPackageId:string]:WorkPackageResource } = {};
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 9c554476ec8..12ac0f3eb95 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
@@ -429,11 +429,12 @@ export class TimelineCellRenderer {
let previousChildrenDurationBar = row.querySelector('.children-duration-bar');
const childrenDurationBar = document.createElement('div');
const childrenDurationHoverContainer = document.createElement('div');
+ const visibleChildren = this.numberOfVisibleChildren(wp);
childrenDurationBar.classList.add('children-duration-bar', '-clamp-style');
childrenDurationBar.title = this.text.label_children_derived_duration;
childrenDurationHoverContainer.classList.add('children-duration-hover-container');
- childrenDurationHoverContainer.style.height = this.ganttChartRowHeight * wp.children.length + 10 + 'px';
+ childrenDurationHoverContainer.style.height = this.ganttChartRowHeight * visibleChildren + 10 + 'px';
if (derivedStartDate.isBefore(startDate) || derivedDueDate.isAfter(dueDate)) {
childrenDurationBar.classList.add('-duration-overflow');
@@ -516,4 +517,15 @@ 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;
+ }
}