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 different placeholder text when favorites selected (#20028)

Oliver Günther84339cfa51c1
diff --git a/config/locales/js-en.yml b/config/locales/js-en.yml
index 743e5959726..af39399b302 100644
--- a/config/locales/js-en.yml
+++ b/config/locales/js-en.yml
@@ -1324,12 +1324,14 @@ en:
all: "All projects"
selected: "Only selected"
search_placeholder: "Search project..."
+ search_placeholder_favorites: "Search favorites..."
include_subprojects: "Include all sub-projects"
tooltip:
include_all_selected: "Project already included since Include all sub-projects is enabled."
current_project: "This is the current project you are in."
does_not_match_search: "Project does not match the search criteria."
no_results: "No project matches your search criteria."
+ no_favorite_results: "No favorite project matches your search criteria."
baseline:
toggle_title: "Baseline"
clear: "Clear"
diff --git a/frontend/src/app/shared/components/header-project-select/header-project-select.component.html b/frontend/src/app/shared/components/header-project-select/header-project-select.component.html
index bfc09eaffce..da3bb3541de 100644
--- a/frontend/src/app/shared/components/header-project-select/header-project-select.component.html
+++ b/frontend/src/app/shared/components/header-project-select/header-project-select.component.html
@@ -44,7 +44,7 @@
>
<spot-text-field
*ngIf="displayMode !== 'favored' || (favorites$ | async)?.length > 0"
- [placeholder]="text.search_placeholder"
+ [placeholder]="displayMode === 'favored' ? text.search_favorites_placeholder : text.search_placeholder"
[(ngModel)]="searchableProjectListService.searchText"
[ngModelOptions]="{standalone: true}"
data-test-selector="op-header-project-select--search"
@@ -91,7 +91,7 @@
</div>
<span *ngIf="!(displayMode === 'favored' && (favorites$ | async).length === 0)"
class="op-project-list-modal--no-results">
- {{ text.no_results }}
+ {{ displayMode === 'favored' ? text.no_favorite_results : text.no_results }}
</span>
</ng-template>
</ng-container>
diff --git a/frontend/src/app/shared/components/header-project-select/header-project-select.component.ts b/frontend/src/app/shared/components/header-project-select/header-project-select.component.ts
index 0eb51efa836..d142af5e5e8 100644
--- a/frontend/src/app/shared/components/header-project-select/header-project-select.component.ts
+++ b/frontend/src/app/shared/components/header-project-select/header-project-select.component.ts
@@ -133,7 +133,9 @@ export class OpHeaderProjectSelectComponent extends UntilDestroyedMixin implemen
select: this.I18n.t('js.label_all_projects'),
},
search_placeholder: this.I18n.t('js.include_projects.search_placeholder'),
+ search_favorites_placeholder: this.I18n.t('js.include_projects.search_placeholder_favorites'),
no_results: this.I18n.t('js.include_projects.no_results'),
+ no_favorite_results: this.I18n.t('js.include_projects.no_favorite_results'),
};
public displayMode:'all'|'favored';