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

Promote alternativeNames mapping to a property

Aaron Contreras736d7777361c
diff --git a/frontend/src/app/shared/components/work-packages/alternative-search.service.ts b/frontend/src/app/shared/components/work-packages/alternative-search.service.ts
index 34d4d07b8a4..066800b2f51 100644
--- a/frontend/src/app/shared/components/work-packages/alternative-search.service.ts
+++ b/frontend/src/app/shared/components/work-packages/alternative-search.service.ts
@@ -9,7 +9,7 @@ export class AlternativeSearchService {
readonly I18n:I18nService,
) { }
- public specialSearchStrings = {
+ private specialSearchStrings = {
done_ratio: this.I18n.t('js.work_packages.properties.done_ratio'),
done_ratio_alternative: this.I18n.t('js.work_packages.properties.done_ratio_alternative'),
work: this.I18n.t('js.work_packages.properties.work'),
@@ -18,21 +18,21 @@ export class AlternativeSearchService {
remaining_work_alternative: this.I18n.t('js.work_packages.properties.remaining_work_alternative'),
};
- public searchFunction = (term:string, currentItem:QueryFilterResource):boolean => {
- const alternativeNames:{ [index:string]:string } = {
- [this.specialSearchStrings.done_ratio_alternative]: this.specialSearchStrings.done_ratio,
- [this.specialSearchStrings.work_alternative]: this.specialSearchStrings.work,
- [this.specialSearchStrings.remaining_work_alternative]: this.specialSearchStrings.remaining_work,
- };
+ private alternativeNames:{ [index:string]:string } = {
+ [this.specialSearchStrings.done_ratio_alternative]: this.specialSearchStrings.done_ratio,
+ [this.specialSearchStrings.work_alternative]: this.specialSearchStrings.work,
+ [this.specialSearchStrings.remaining_work_alternative]: this.specialSearchStrings.remaining_work,
+ };
+ public searchFunction = (term:string, currentItem:QueryFilterResource):boolean => {
const lowercaseSearchTerm = term.toLowerCase();
const lowercaseCurrentItemName = currentItem.name.toLowerCase();
const alternativeMatch = Object
- .keys(alternativeNames)
+ .keys(this.alternativeNames)
.some((alternativeName) => {
return alternativeName.toLowerCase().indexOf(lowercaseSearchTerm) > -1
- && currentItem.name === alternativeNames[alternativeName];
+ && currentItem.name === this.alternativeNames[alternativeName];
});
return (