Skip to content

Commit

Permalink
feat: add two new filters
Browse files Browse the repository at this point in the history
  • Loading branch information
cmoinier committed Jul 1, 2024
1 parent 39e8d41 commit c4b10d8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -24,7 +24,7 @@ export class SearchFiltersComponent {
'publicationYear',
'license',
'qualityScore',
'keyword',
'territories',
].map((filter) => ({
fieldName: filter,
title: `mel.datahub.search.filters.${filter}`,
Expand Down
4 changes: 4 additions & 0 deletions apps/datahub/src/app/search/service/fields.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
})
Expand All @@ -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) {
Expand Down
5 changes: 4 additions & 1 deletion resources/translations/en_MEL.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down Expand Up @@ -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": ""
}
5 changes: 4 additions & 1 deletion resources/translations/fr_MEL.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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": ""
}

0 comments on commit c4b10d8

Please sign in to comment.