diff --git a/apps/datahub/src/app/search/search-filters/search-filters.component.html b/apps/datahub/src/app/search/search-filters/search-filters.component.html index 053e41a..17eba68 100644 --- a/apps/datahub/src/app/search/search-filters/search-filters.component.html +++ b/apps/datahub/src/app/search/search-filters/search-filters.component.html @@ -1,8 +1,65 @@ -
- @for(filter of searchConfig; track filter.fieldName) { - - } +
+
+
+

+ mel.datahub.search.filters.refine +

+ +
+
+ +
+
+
+
+
+ + + + +
+
+ + + +
+
+ +
diff --git a/apps/datahub/src/app/search/search-filters/search-filters.component.ts b/apps/datahub/src/app/search/search-filters/search-filters.component.ts index 75cd31b..145d3b4 100644 --- a/apps/datahub/src/app/search/search-filters/search-filters.component.ts +++ b/apps/datahub/src/app/search/search-filters/search-filters.component.ts @@ -1,10 +1,13 @@ import { ChangeDetectionStrategy, Component } from '@angular/core' import { marker } from '@biesbjerg/ngx-translate-extract-marker' +import { RouterFacade } from 'geonetwork-ui' marker('mel.datahub.search.filters.categoryKeyword') marker('mel.datahub.search.filters.publisher') marker('mel.datahub.search.filters.revisionYear') marker('mel.datahub.search.filters.license') +marker('mel.datahub.search.filters.qualityScore') +marker('mel.datahub.search.filters.keyword') @Component({ selector: 'mel-datahub-search-filters', @@ -13,13 +16,32 @@ marker('mel.datahub.search.filters.license') changeDetection: ChangeDetectionStrategy.OnPush, }) export class SearchFiltersComponent { + constructor(private routerFacade: RouterFacade) {} + displayCount = 3 searchConfig = [ - 'categoryKeyword', + 'topic', 'publisher', - 'revisionYear', + 'publicationYear', 'license', + 'qualityScore', + 'keyword', ].map((filter) => ({ fieldName: filter, title: `mel.datahub.search.filters.${filter}`, })) + + showAll() { + this.displayCount = + this.displayCount === this.searchConfig.length + ? 3 + : this.searchConfig.length + } + + trackByFn(item) { + return item.fieldName + } + + resetFilters() { + this.routerFacade.setSearch({}) + } }