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

Render derived percentage done only if derivable

Aaron Contreras97682d3f9c6e
diff --git a/frontend/src/app/shared/components/fields/display/field-types/compound-progress-display-field.module.ts b/frontend/src/app/shared/components/fields/display/field-types/compound-progress-display-field.module.ts
index 6331af71e83..9c7b51b01aa 100644
--- a/frontend/src/app/shared/components/fields/display/field-types/compound-progress-display-field.module.ts
+++ b/frontend/src/app/shared/components/fields/display/field-types/compound-progress-display-field.module.ts
@@ -37,8 +37,11 @@ export class CompoundProgressDisplayField extends DisplayField {
element.setAttribute('title', displayText);
this.renderActual(element, displayText);
- this.renderSeparator(element);
- this.renderDerived(element, this.derivedValueString);
+
+ if (this.hasChildren()) {
+ this.renderSeparator(element);
+ this.renderDerived(element, this.derivedValueString);
+ }
}
private renderActual(element:HTMLElement, displayText:string):void {
@@ -94,4 +97,8 @@ export class CompoundProgressDisplayField extends DisplayField {
private formatAsPercentage(value:number) {
return `${value}%`;
}
+
+ private hasChildren() {
+ return !!this.resource.children;
+ }
}