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

Show a lightgrey wrapper container when clamp or parent wp is hovered

Aleix Suau303d0299a50a
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 32475fc92ab..bbb01e71c3b 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
@@ -52,7 +52,9 @@ export class TimelineCellRenderer {
public text = {
label_children_derived_duration: this.I18n.t('js.label_children_derived_duration')
- }
+ };
+
+ public ganttChartRowHeight:number;
public fieldRenderer:DisplayFieldRenderer = new DisplayFieldRenderer(this.injector, 'timeline');
@@ -60,6 +62,9 @@ export class TimelineCellRenderer {
constructor(readonly injector:Injector,
readonly workPackageTimeline:WorkPackageTimelineTableController) {
+ this.ganttChartRowHeight = +getComputedStyle(document.documentElement)
+ .getPropertyValue('--table-timeline--row-height')
+ .replace('px', '');
}
public get type():string {
@@ -422,9 +427,12 @@ export class TimelineCellRenderer {
let dueDate = moment(renderInfo.change.projectedResource.dueDate);
let previousChildrenDurationBar = row.querySelector('.children-duration-bar');
const childrenDurationBar = document.createElement('div');
+ const childrenDurationHoverContainer = document.createElement('div');
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';
if (derivedStartDate.isBefore(startDate) || derivedDueDate.isAfter(dueDate)) {
childrenDurationBar.classList.add('-duration-overflow');
@@ -436,6 +444,7 @@ export class TimelineCellRenderer {
previousChildrenDurationBar.remove();
}
+ childrenDurationBar.appendChild(childrenDurationHoverContainer);
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 931e12d5041..2838d2284a8 100644
--- a/frontend/src/global_styles/content/work_packages/timelines/_timelines.sass
+++ b/frontend/src/global_styles/content/work_packages/timelines/_timelines.sass
@@ -82,7 +82,7 @@
.children-duration-bar
position: absolute
- height: 0.5em
+ height: 10px
top: 1.7em
border: 1px solid
background: none
@@ -90,3 +90,16 @@
.-duration-overflow
border-color: var(--warn)
+
+.children-duration-hover-container
+ display: none
+ margin-left: -1px
+ margin-right: -1px
+ background-color: #d3d3d361
+
+.children-duration-hover-container:hover,
+.children-duration-bar:hover .children-duration-hover-container,
+.timeline-element:hover + .children-duration-bar .children-duration-hover-container
+ display: block
+
+