From c4b10d8994b97aa029e5c15d3ebe1ecbc42d451d Mon Sep 17 00:00:00 2001 From: Camille Moinier Date: Mon, 1 Jul 2024 15:13:57 +0200 Subject: [PATCH] feat: add two new filters --- .../app/search/search-filters/search-filters.component.ts | 4 ++-- apps/datahub/src/app/search/service/fields.service.ts | 4 ++++ resources/translations/en_MEL.json | 5 ++++- resources/translations/fr_MEL.json | 5 ++++- 4 files changed, 14 insertions(+), 4 deletions(-) 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 145d3b4a..1731d8e9 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 @@ -7,7 +7,7 @@ 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') +marker('mel.datahub.search.filters.territories') @Component({ selector: 'mel-datahub-search-filters', @@ -24,7 +24,7 @@ export class SearchFiltersComponent { 'publicationYear', 'license', 'qualityScore', - 'keyword', + 'territories', ].map((filter) => ({ fieldName: filter, title: `mel.datahub.search.filters.${filter}`, diff --git a/apps/datahub/src/app/search/service/fields.service.ts b/apps/datahub/src/app/search/service/fields.service.ts index ec9b69d0..e5287f1f 100644 --- a/apps/datahub/src/app/search/service/fields.service.ts +++ b/apps/datahub/src/app/search/service/fields.service.ts @@ -4,6 +4,8 @@ import { FieldsService, SimpleSearchField } from 'geonetwork-ui' import { TranslatedSearchField } from 'geonetwork-ui' marker('search.filters.categoryKeyword') +marker('search.filters.qualityScore') +marker('search.filters.territories') @Injectable({ providedIn: 'root', }) @@ -20,6 +22,8 @@ export class MelFieldsService extends FieldsService { this.injector, 'desc' ), + qualityScore: new SimpleSearchField('qualityScore', this.injector, 'desc'), + territories: new TranslatedSearchField('th_mel.link', this.injector, 'asc'), } constructor(override injector: Injector) { diff --git a/resources/translations/en_MEL.json b/resources/translations/en_MEL.json index f0c66751..530f7792 100644 --- a/resources/translations/en_MEL.json +++ b/resources/translations/en_MEL.json @@ -20,6 +20,7 @@ "mel.datahub.search.filters.reduce": "", "mel.datahub.search.filters.refine": "", "mel.datahub.search.filters.reset": "", + "mel.datahub.search.filters.territories": "", "mel.datahub.search.filters.topic": "", "mel.datahub.search.form.description": "", "mel.datahub.search.form.title": "", @@ -81,5 +82,7 @@ "mel.search.filter.generatedByWfs": "", "mel.searchpage.subtitle.favorites": "", "mel.tooltip.url.copy": "", - "search.filters.categoryKeyword": "" + "search.filters.categoryKeyword": "", + "search.filters.qualityScore": "", + "search.filters.territories": "" } diff --git a/resources/translations/fr_MEL.json b/resources/translations/fr_MEL.json index 1ab482ff..102f27ed 100644 --- a/resources/translations/fr_MEL.json +++ b/resources/translations/fr_MEL.json @@ -19,6 +19,7 @@ "mel.datahub.search.filters.reduce": "Réduire", "mel.datahub.search.filters.refine": "Affiner votre recherche", "mel.datahub.search.filters.reset": "Réinitialiser", + "mel.datahub.search.filters.territories": "Territoires", "mel.datahub.search.filters.topic": "Catégorie", "mel.datahub.search.form.description": "Vous pouvez utiliser la barre de recherche ou les différents filtres situés ci-dessous pour trouver un jeu de données plus rapidement.", "mel.datahub.search.form.title": "Trouver un jeu de données", @@ -80,5 +81,7 @@ "mel.search.filter.generatedByWfs": "généré par une API", "mel.searchpage.subtitle.favorites": "Jeux de données suivis", "mel.tooltip.url.copy": "Copier l'URL", - "search.filters.categoryKeyword": "Mot clé" + "search.filters.categoryKeyword": "Mot clé", + "search.filters.qualityScore": "", + "search.filters.territories": "" }