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

Fix/35144 milestones due dates not highlighted (#8915)

Aleix Suauc30997591d5d
diff --git a/frontend/src/app/components/wp-table/configuration-modal/tabs/highlighting-tab.component.ts b/frontend/src/app/components/wp-table/configuration-modal/tabs/highlighting-tab.component.ts
index b0f5eb81a6e..97a2a23b355 100644
--- a/frontend/src/app/components/wp-table/configuration-modal/tabs/highlighting-tab.component.ts
+++ b/frontend/src/app/components/wp-table/configuration-modal/tabs/highlighting-tab.component.ts
@@ -112,9 +112,8 @@ export class WpTableConfigurationHighlightingTab implements TabComponent {
private setSelectedValues() {
const currentValues = this.wpTableHighlight.current.selectedAttributes;
- if (currentValues === undefined) {
- this.selectedAttributes = this.availableInlineHighlightedAttributes;
- } else {
+
+ if (currentValues) {
this.selectedAttributes = currentValues;
}
}
diff --git a/frontend/src/app/modules/fields/display/field-types/highlightable-display-field.module.ts b/frontend/src/app/modules/fields/display/field-types/highlightable-display-field.module.ts
index 3dacca1eb5f..1c2a12cc4ed 100644
--- a/frontend/src/app/modules/fields/display/field-types/highlightable-display-field.module.ts
+++ b/frontend/src/app/modules/fields/display/field-types/highlightable-display-field.module.ts
@@ -31,16 +31,30 @@ import {WorkPackageViewHighlightingService} from "core-app/modules/work_packages
import {InjectField} from "core-app/helpers/angular/inject-field.decorator";
export class HighlightableDisplayField extends DisplayField {
-
/** Optionally test if we can inject highlighting service */
@InjectField(WorkPackageViewHighlightingService, null) viewHighlighting:WorkPackageViewHighlightingService;
+
+ // DisplayFieldRenderer.attributeName returns the 'date' name for the
+ // 'dueDate' field because it is its schema.mappedName (that allows to display
+ // the correct input type). In the query.highlightedAttributes (used to decide
+ // if a field is highlighted) the attribute has the name 'dueDate', so we need
+ // to return the original name to get it highlighted.
+ get highlightName () {
+ if (this.name === 'date') {
+ return 'dueDate';
+ } else {
+ return this.name;
+ }
+ }
+
public get shouldHighlight() {
if (this.context.options.colorize === false) {
return false;
}
- const shouldHighlight = !!this.viewHighlighting && this.viewHighlighting.shouldHighlightInline(this.name);
+ const shouldHighlight = !!this.viewHighlighting && this.viewHighlighting.shouldHighlightInline(this.highlightName);
+
return this.context.container !== 'table' || shouldHighlight;
}
}