From 35b78fb7ac81a46ab85f114594e0ae3490306f1c Mon Sep 17 00:00:00 2001 From: Camille Moinier Date: Thu, 27 Jun 2024 15:22:13 +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 | 6 ++++-- resources/translations/fr_MEL.json | 6 ++++-- 4 files changed, 14 insertions(+), 6 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 75ba87c3..a2e379ea 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.publicationYear') 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 95c1ae63..2b60cc2f 100644 --- a/resources/translations/en_MEL.json +++ b/resources/translations/en_MEL.json @@ -10,7 +10,6 @@ "mel.datahub.home.title": "Métropole Européenne de Lille", "mel.datahub.multiselect.filter.placeholder": "", "mel.datahub.search.clear": "", - "mel.datahub.search.filters.keyword": "", "mel.datahub.search.filters.license": "", "mel.datahub.search.filters.publicationYear": "", "mel.datahub.search.filters.publisher": "", @@ -18,6 +17,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": "", @@ -78,5 +78,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 21cf8a44..98f7d65b 100644 --- a/resources/translations/fr_MEL.json +++ b/resources/translations/fr_MEL.json @@ -10,7 +10,6 @@ "mel.datahub.home.title": "Métropole Européenne de Lille", "mel.datahub.multiselect.filter.placeholder": "Rechercher", "mel.datahub.search.clear": "Effacer", - "mel.datahub.search.filters.keyword": "Territoires", "mel.datahub.search.filters.license": "Licence", "mel.datahub.search.filters.publicationYear": "Date", "mel.datahub.search.filters.publisher": "Producteur", @@ -18,6 +17,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", @@ -78,5 +78,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": "" + "search.filters.categoryKeyword": "", + "search.filters.qualityScore": "", + "search.filters.territories": "" }