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

use const values for drop down in baseline component

bsatarnejad29c7958fefc0
diff --git a/frontend/src/app/shared/components/baseline/baseline.component.ts b/frontend/src/app/shared/components/baseline/baseline.component.ts
index 3db1a3788a7..2183f1d9d08 100644
--- a/frontend/src/app/shared/components/baseline/baseline.component.ts
+++ b/frontend/src/app/shared/components/baseline/baseline.component.ts
@@ -86,37 +86,35 @@ export class OpBaselineComponent extends UntilDestroyedMixin implements AfterVie
public baselineAvailableValues = [
{
- value: '0',
+ value: 'none',
title: this.I18n.t('js.baseline.drop_down.none'),
},
{
- value: '1',
+ value: 'oneDayAgo',
title: this.I18n.t('js.baseline.drop_down.yesterday'),
},
{
- value: '2',
+ value: 'lastWorkingDay',
title: this.I18n.t('js.baseline.drop_down.last_working_day'),
},
{
- value: '3',
+ value: 'oneWeekAgo',
title: this.I18n.t('js.baseline.drop_down.last_week'),
},
{
- value: '4',
+ value: 'oneMonthAgo',
title: this.I18n.t('js.baseline.drop_down.last_month'),
},
{
- value: '5',
+ value: 'aSpecificDate',
title: this.I18n.t('js.baseline.drop_down.a_specific_date'),
},
{
- value: '6',
+ value: 'betweenTwoSpecificDates',
title: this.I18n.t('js.baseline.drop_down.between_two_specific_dates'),
},
];
- public query$ = this.wpTableFilters.querySpace.query.values$();
-
constructor(
readonly I18n:I18nService,
readonly wpTableFilters:WorkPackageViewFiltersService,
@@ -224,19 +222,19 @@ export class OpBaselineComponent extends UntilDestroyedMixin implements AfterVie
}
public filterChange(value:string):void {
- if (value !== '0') {
+ if (value !== 'none') {
this.filterSelected = true;
switch (value) {
- case '1':
+ case 'oneDayAgo':
this.dropDownDescription = this.yesterdayDate();
break;
- case '2':
+ case 'lastWorkingDay':
this.dropDownDescription=this.lastWorkingDate();
break;
- case '3':
+ case 'oneWeekAgo':
this.dropDownDescription = this.lastweekDate();
break;
- case '4':
+ case 'oneMonthAgo':
this.dropDownDescription = this.lastMonthDate();
break;
default: