62264: Group messages

This commit is contained in:
Kristof De Langhe
2019-05-10 10:19:51 +02:00
parent 2166e0633c
commit 461eacff45
4 changed files with 23 additions and 25 deletions

View File

@@ -4,10 +4,8 @@ import { Observable } from 'rxjs';
@Injectable()
/**
* Assemble the correct i18n key for the filtered search page's title depending on the current route's filter parameter
* and title data.
* The format of the key will be "{title}{filter}.title" with:
* - title: The prefix of the key stored in route.data
* Assemble the correct i18n key for the filtered search page's title depending on the current route's filter parameter.
* The format of the key will be "{filter}.search.title" with:
* - filter: The current filter stored in route.params
*/
export class FilteredSearchPageGuard implements CanActivate {
@@ -16,7 +14,7 @@ export class FilteredSearchPageGuard implements CanActivate {
state: RouterStateSnapshot): Observable<boolean> | Promise<boolean> | boolean {
const filter = route.params.filter;
const newTitle = route.data.title + filter + '.title';
const newTitle = filter + '.search.title';
route.data = { title: newTitle };
return true;

View File

@@ -9,7 +9,7 @@ import { FilteredSearchPageGuard } from './filtered-search-page.guard';
imports: [
RouterModule.forChild([
{ path: '', component: SearchPageComponent, data: { title: 'search.title' } },
{ path: ':filter', component: FilteredSearchPageComponent, canActivate: [FilteredSearchPageGuard], data: { title: 'search.' }}
{ path: ':filter', component: FilteredSearchPageComponent, canActivate: [FilteredSearchPageGuard]}
])
]
})

View File

@@ -60,7 +60,7 @@ export class SearchResultsComponent {
*/
getTitleKey() {
if (isNotEmpty(this.fixedFilter)) {
return 'search.' + this.fixedFilter + '.results.head'
return this.fixedFilter + '.search.results.head'
} else {
return 'search.results.head';
}