From 065b5046f100e884ddfb9492b229c77e2a40a91e Mon Sep 17 00:00:00 2001 From: Camille Moinier Date: Thu, 4 Jul 2024 11:14:03 +0200 Subject: [PATCH 01/10] feat: rework org filters --- .../search-filters/search-filters.component.ts | 4 +++- .../src/lib/utils/service/fields.service.ts | 17 +++++++++++++++-- translations/de.json | 9 +++++++-- translations/en.json | 8 +++++--- translations/es.json | 5 +++++ translations/fr.json | 8 +++++--- translations/it.json | 7 ++++++- translations/nl.json | 5 +++++ translations/pt.json | 5 +++++ translations/sk.json | 7 ++++++- 10 files changed, 62 insertions(+), 13 deletions(-) diff --git a/apps/datahub/src/app/home/search/search-filters/search-filters.component.ts b/apps/datahub/src/app/home/search/search-filters/search-filters.component.ts index 508e335189..f3e144f1ac 100644 --- a/apps/datahub/src/app/home/search/search-filters/search-filters.component.ts +++ b/apps/datahub/src/app/home/search/search-filters/search-filters.component.ts @@ -53,12 +53,14 @@ export class SearchFiltersComponent implements OnInit { this.platformService.getMe().subscribe((user) => (this.userId = user?.id)) this.searchConfig = ( getOptionalSearchConfig().ADVANCED_FILTERS || [ - 'publisher', + 'organization', 'format', 'publicationYear', 'topic', 'isSpatial', 'license', + 'producer', + 'publisher', ] ) .filter((adv_filter) => { diff --git a/libs/feature/search/src/lib/utils/service/fields.service.ts b/libs/feature/search/src/lib/utils/service/fields.service.ts index 1096380a15..3fe888a417 100644 --- a/libs/feature/search/src/lib/utils/service/fields.service.ts +++ b/libs/feature/search/src/lib/utils/service/fields.service.ts @@ -25,19 +25,21 @@ marker('search.filters.keyword') marker('search.filters.isSpatial') marker('search.filters.license') marker('search.filters.publicationYear') -marker('search.filters.publisher') +marker('search.filters.organization') marker('search.filters.representationType') marker('search.filters.resourceType') marker('search.filters.standard') marker('search.filters.topic') marker('search.filters.contact') +marker('search.filters.producer') +marker('search.filters.publisher') @Injectable({ providedIn: 'root', }) export class FieldsService { protected fields = { - publisher: new OrganizationSearchField(this.injector), + organization: new OrganizationSearchField(this.injector), format: new SimpleSearchField('format', this.injector, 'asc'), resourceType: new TranslatedSearchField( 'resourceType', @@ -70,6 +72,17 @@ export class FieldsService { q: new FullTextSearchField(), license: new LicenseSearchField(this.injector), owner: new OwnerSearchField(this.injector), + producer: new MultilingualSearchField( + 'originatorOrgForResourceObject', + this.injector, + 'desc', + 'count' + ), + publisher: new MultilingualSearchField( + 'distributorOrgForResourceObject', + this.injector, + 'asc' + ), } as Record get supportedFields() { diff --git a/translations/de.json b/translations/de.json index 2db3fe2365..49ef680e97 100644 --- a/translations/de.json +++ b/translations/de.json @@ -49,6 +49,8 @@ "datafeeder.datasetValidation.submitButton": "OK, meine Daten sind korrekt", "datafeeder.datasetValidation.title": "Stellen Sie sicher, dass Ihre Daten korrekt sind", "datafeeder.datasetValidation.unknown": " - ", + "datafeeder.datasetValidationCsv.explicitLineNumbers": "", + "datafeeder.datasetValidationCsv.lineNumbers": "", "datafeeder.form.abstract": "Wie würden Sie Ihren Datensatz beschreiben?", "datafeeder.form.datepicker": "Wissen Sie, wann der Datensatz erstellt wurde?", "datafeeder.form.description": "Beschreiben Sie abschließend den Prozess, der zur Erstellung des Datensatzes verwendet wurde", @@ -76,6 +78,7 @@ "datafeeder.publishSuccess.geonetworkRecord": "Metadatensatz", "datafeeder.publishSuccess.illustration.title": "Erledigt, alles ist gut!", "datafeeder.publishSuccess.mapViewer": "Kartenviewer", + "datafeeder.publishSuccess.ogcFeature": "", "datafeeder.publishSuccess.subtitle": "Zeigen Sie Ihre Daten an in:", "datafeeder.publishSuccess.title": "Herzlichen Glückwunsch! \n Ihr Datensatz wurde veröffentlicht", "datafeeder.publishSuccess.uploadAnotherData": "Ein weiteren Datensatz hochladen", @@ -104,7 +107,6 @@ "datafeeder.upload.maxFileSize": "Maximale Dateigröße beträgt {size} MB", "datafeeder.upload.title": "Laden Sie Ihren Datensatz hoch", "datafeeder.upload.uploadButton": "Hochladen", - "datafeeder.validation.encoding": "Codierung", "datafeeder.validation.csv.delimiter": "", "datafeeder.validation.csv.delimiter.comma": "", "datafeeder.validation.csv.delimiter.semicolon": "", @@ -114,6 +116,7 @@ "datafeeder.validation.csv.quote.none": "", "datafeeder.validation.csv.quote.simple": "", "datafeeder.validation.csv.quoteChar": "", + "datafeeder.validation.encoding": "Codierung", "datafeeder.validation.extent.title": "Hier ist der Datensatzumfang", "datafeeder.validation.extent.title.unknown": "Das Projektionssystem ist unbekannt", "datafeeder.validation.projection": "Raumbezugssystem:", @@ -392,9 +395,11 @@ "search.filters.minimize": "Minimieren", "search.filters.myRecords": "Nur meine Datensätze anzeigen", "search.filters.myRecordsHelp": "Wenn dies aktiviert ist, werden nur von mir erstellte Datensätze angezeigt; Datensätze, die von anderen erstellt wurden, werden nicht angezeigt.", + "search.filters.organization": "", "search.filters.otherRecords": "Datensätze von einer anderen Person anzeigen", + "search.filters.producer": "", "search.filters.publicationYear": "Veröffentlichungsjahr", - "search.filters.publisher": "Organisationen", + "search.filters.publisher": "", "search.filters.representationType": "Repräsentationstyp", "search.filters.resourceType": "Ressourcentyp", "search.filters.standard": "Standard", diff --git a/translations/en.json b/translations/en.json index 041390c69f..6497695d09 100644 --- a/translations/en.json +++ b/translations/en.json @@ -46,11 +46,11 @@ "datafeeder.analysisProgressBar.subtitle": "The analysis may take several minutes, please wait.", "datafeeder.analysisProgressBar.title": "Analyze in progress", "datafeeder.datasetValidation.datasetInformation": "The provided dataset contains {number} entities", - "datafeeder.datasetValidationCsv.lineNumbers": "Sample of the first 5 lines* of the dataset:", - "datafeeder.datasetValidationCsv.explicitLineNumbers": "*The table must display the first 5 lines (excluding the header)
If this is not the case, check that the file is correctly formatted", "datafeeder.datasetValidation.submitButton": "OK, my data are correct", "datafeeder.datasetValidation.title": "Make sure your data are correct", "datafeeder.datasetValidation.unknown": " - ", + "datafeeder.datasetValidationCsv.explicitLineNumbers": "*The table must display the first 5 lines (excluding the header)
If this is not the case, check that the file is correctly formatted", + "datafeeder.datasetValidationCsv.lineNumbers": "Sample of the first 5 lines* of the dataset:", "datafeeder.form.abstract": "How would you describe your dataset?", "datafeeder.form.datepicker": "Do you know when the dataset was created?", "datafeeder.form.description": "Finally, please describe the process that was used to create the dataset", @@ -395,9 +395,11 @@ "search.filters.minimize": "Minimize", "search.filters.myRecords": "Show only my records", "search.filters.myRecordsHelp": "When this is enabled, records only created by myself are shown; records created by others will not show up.", + "search.filters.organization": "Organization", "search.filters.otherRecords": "Showing records from another person", + "search.filters.producer": "Producer", "search.filters.publicationYear": "Publication year", - "search.filters.publisher": "Organizations", + "search.filters.publisher": "Publisher", "search.filters.representationType": "Representation type", "search.filters.resourceType": "Resource type", "search.filters.standard": "Standard", diff --git a/translations/es.json b/translations/es.json index c4b7d6ef74..474298aaca 100644 --- a/translations/es.json +++ b/translations/es.json @@ -49,6 +49,8 @@ "datafeeder.datasetValidation.submitButton": "", "datafeeder.datasetValidation.title": "", "datafeeder.datasetValidation.unknown": "", + "datafeeder.datasetValidationCsv.explicitLineNumbers": "", + "datafeeder.datasetValidationCsv.lineNumbers": "", "datafeeder.form.abstract": "", "datafeeder.form.datepicker": "", "datafeeder.form.description": "", @@ -76,6 +78,7 @@ "datafeeder.publishSuccess.geonetworkRecord": "", "datafeeder.publishSuccess.illustration.title": "", "datafeeder.publishSuccess.mapViewer": "", + "datafeeder.publishSuccess.ogcFeature": "", "datafeeder.publishSuccess.subtitle": "", "datafeeder.publishSuccess.title": "", "datafeeder.publishSuccess.uploadAnotherData": "", @@ -392,7 +395,9 @@ "search.filters.minimize": "", "search.filters.myRecords": "", "search.filters.myRecordsHelp": "", + "search.filters.organization": "", "search.filters.otherRecords": "", + "search.filters.producer": "", "search.filters.publicationYear": "", "search.filters.publisher": "", "search.filters.representationType": "", diff --git a/translations/fr.json b/translations/fr.json index 9e15942f5c..4eaa3e9676 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -46,11 +46,11 @@ "datafeeder.analysisProgressBar.subtitle": "L'analyse peut prendre plusieurs minutes, merci d'attendre.", "datafeeder.analysisProgressBar.title": "Analyse en cours", "datafeeder.datasetValidation.datasetInformation": "Le jeu de données fourni contient {number} entités", - "datafeeder.datasetValidationCsv.lineNumbers": "Résumé des 5 premières lignes* du CSV :", - "datafeeder.datasetValidationCsv.explicitLineNumbers": "*Le tableau doit afficher les 5 premières lignes (hors en-tête)
Si ce n'est pas le cas, vérifier que le fichier est bien formatté", "datafeeder.datasetValidation.submitButton": "OK, mes données sont correctes", "datafeeder.datasetValidation.title": "Vérifiez que vos données sont correctes", "datafeeder.datasetValidation.unknown": " - ", + "datafeeder.datasetValidationCsv.explicitLineNumbers": "*Le tableau doit afficher les 5 premières lignes (hors en-tête)
Si ce n'est pas le cas, vérifier que le fichier est bien formatté", + "datafeeder.datasetValidationCsv.lineNumbers": "Résumé des 5 premières lignes* du CSV :", "datafeeder.form.abstract": "Comment décrire votre jeu de données ?", "datafeeder.form.datepicker": "Savez-vous quand la donnée a été créée ?", "datafeeder.form.description": "Enfin, décrivez le processus utilisé pour créer la donnée", @@ -395,9 +395,11 @@ "search.filters.minimize": "Réduire", "search.filters.myRecords": "Voir mes données", "search.filters.myRecordsHelp": "Quand activé, n'affiche que les données créées avec mon utilisateur. Les données créées par les autres utilisateurs ne sont pas affichées.", + "search.filters.organization": "Organisation", "search.filters.otherRecords": "Affichage des données d'un autre utilisateur", + "search.filters.producer": "Producteur", "search.filters.publicationYear": "Année de publication", - "search.filters.publisher": "Organisations", + "search.filters.publisher": "Distributeur", "search.filters.representationType": "Type de représentation", "search.filters.resourceType": "Type de ressource", "search.filters.standard": "Standard", diff --git a/translations/it.json b/translations/it.json index 02621f0449..03b9737af9 100644 --- a/translations/it.json +++ b/translations/it.json @@ -49,6 +49,8 @@ "datafeeder.datasetValidation.submitButton": "OK, i miei dati sono corretti", "datafeeder.datasetValidation.title": "Controllare che i dati siano corretti", "datafeeder.datasetValidation.unknown": " - ", + "datafeeder.datasetValidationCsv.explicitLineNumbers": "", + "datafeeder.datasetValidationCsv.lineNumbers": "", "datafeeder.form.abstract": "Come descrivere il suo dataset?", "datafeeder.form.datepicker": "Sa quando è stato creato il suo dataset ?", "datafeeder.form.description": "Infine, descrivere il processo utilizzato per creare il dataset", @@ -76,6 +78,7 @@ "datafeeder.publishSuccess.geonetworkRecord": "Scheda di metadati", "datafeeder.publishSuccess.illustration.title": "Completato, tutto è andato bene!", "datafeeder.publishSuccess.mapViewer": "Visualizzatore", + "datafeeder.publishSuccess.ogcFeature": "", "datafeeder.publishSuccess.subtitle": "Visualizzare i dati:", "datafeeder.publishSuccess.title": "Congratulazioni! \n I suoi dati sono stati pubblicati", "datafeeder.publishSuccess.uploadAnotherData": "Caricare un altro dato", @@ -392,9 +395,11 @@ "search.filters.minimize": "Riduci", "search.filters.myRecords": "Visualizza i miei dati", "search.filters.myRecordsHelp": "Quando attivato, mostra solo i dati creati con il mio utente. I dati creati da altri utenti non sono visualizzati.", + "search.filters.organization": "", "search.filters.otherRecords": "Visualizzazione dei dati di un altro utente", + "search.filters.producer": "", "search.filters.publicationYear": "Anno di pubblicazione", - "search.filters.publisher": "Organizzazioni", + "search.filters.publisher": "", "search.filters.representationType": "Tipo di rappresentazione", "search.filters.resourceType": "Tipo di risorsa", "search.filters.standard": "Standard", diff --git a/translations/nl.json b/translations/nl.json index 6e489176c7..5fe6272582 100644 --- a/translations/nl.json +++ b/translations/nl.json @@ -49,6 +49,8 @@ "datafeeder.datasetValidation.submitButton": "", "datafeeder.datasetValidation.title": "", "datafeeder.datasetValidation.unknown": "", + "datafeeder.datasetValidationCsv.explicitLineNumbers": "", + "datafeeder.datasetValidationCsv.lineNumbers": "", "datafeeder.form.abstract": "", "datafeeder.form.datepicker": "", "datafeeder.form.description": "", @@ -76,6 +78,7 @@ "datafeeder.publishSuccess.geonetworkRecord": "", "datafeeder.publishSuccess.illustration.title": "", "datafeeder.publishSuccess.mapViewer": "", + "datafeeder.publishSuccess.ogcFeature": "", "datafeeder.publishSuccess.subtitle": "", "datafeeder.publishSuccess.title": "", "datafeeder.publishSuccess.uploadAnotherData": "", @@ -392,7 +395,9 @@ "search.filters.minimize": "", "search.filters.myRecords": "", "search.filters.myRecordsHelp": "", + "search.filters.organization": "", "search.filters.otherRecords": "", + "search.filters.producer": "", "search.filters.publicationYear": "", "search.filters.publisher": "", "search.filters.representationType": "", diff --git a/translations/pt.json b/translations/pt.json index 92ab9940c4..2465a82ba4 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -49,6 +49,8 @@ "datafeeder.datasetValidation.submitButton": "", "datafeeder.datasetValidation.title": "", "datafeeder.datasetValidation.unknown": "", + "datafeeder.datasetValidationCsv.explicitLineNumbers": "", + "datafeeder.datasetValidationCsv.lineNumbers": "", "datafeeder.form.abstract": "", "datafeeder.form.datepicker": "", "datafeeder.form.description": "", @@ -76,6 +78,7 @@ "datafeeder.publishSuccess.geonetworkRecord": "", "datafeeder.publishSuccess.illustration.title": "", "datafeeder.publishSuccess.mapViewer": "", + "datafeeder.publishSuccess.ogcFeature": "", "datafeeder.publishSuccess.subtitle": "", "datafeeder.publishSuccess.title": "", "datafeeder.publishSuccess.uploadAnotherData": "", @@ -392,7 +395,9 @@ "search.filters.minimize": "", "search.filters.myRecords": "", "search.filters.myRecordsHelp": "", + "search.filters.organization": "", "search.filters.otherRecords": "", + "search.filters.producer": "", "search.filters.publicationYear": "", "search.filters.publisher": "", "search.filters.representationType": "", diff --git a/translations/sk.json b/translations/sk.json index 41fb225ad6..125dd26f1c 100644 --- a/translations/sk.json +++ b/translations/sk.json @@ -49,6 +49,8 @@ "datafeeder.datasetValidation.submitButton": "OK, moje dáta sú správne", "datafeeder.datasetValidation.title": "Uistite sa, že dáta sú správne", "datafeeder.datasetValidation.unknown": " - ", + "datafeeder.datasetValidationCsv.explicitLineNumbers": "", + "datafeeder.datasetValidationCsv.lineNumbers": "", "datafeeder.form.abstract": "Ako by ste opísali Váš dataset?", "datafeeder.form.datepicker": "Viete, kedy bol dataset vytvorený?", "datafeeder.form.description": "Nakoniec popíšte proces, ktorý bol použitý na vytvorenie datasetu", @@ -76,6 +78,7 @@ "datafeeder.publishSuccess.geonetworkRecord": "Metadátový záznam", "datafeeder.publishSuccess.illustration.title": "Hotovo, všetko je v poriadku!", "datafeeder.publishSuccess.mapViewer": "Prehliadač máp", + "datafeeder.publishSuccess.ogcFeature": "", "datafeeder.publishSuccess.subtitle": "Pozrite si svoje dáta v:", "datafeeder.publishSuccess.title": "Gratulujeme! Váš dataset bol publikovaný", "datafeeder.publishSuccess.uploadAnotherData": "Nahrajte ďalší dataset", @@ -392,9 +395,11 @@ "search.filters.minimize": "Zmenšiť", "search.filters.myRecords": "Zobraziť len moje záznamy", "search.filters.myRecordsHelp": "Keď je táto možnosť zapnutá, zobrazia sa len záznamy vytvorené mnou; záznamy vytvorené inými sa nezobrazia.", + "search.filters.organization": "", "search.filters.otherRecords": "Zobrazenie záznamov od inej osoby", + "search.filters.producer": "", "search.filters.publicationYear": "Rok zverejnenia", - "search.filters.publisher": "Organizácie", + "search.filters.publisher": "", "search.filters.representationType": "Typ reprezentácie", "search.filters.resourceType": "Typ zdroja", "search.filters.standard": "Štandard", From 6fcd63c67f08d9552902876b52b49df2cb081287 Mon Sep 17 00:00:00 2001 From: Camille Moinier Date: Thu, 4 Jul 2024 11:38:37 +0200 Subject: [PATCH 02/10] feat: adapt ut --- .../src/lib/utils/service/fields.service.spec.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/libs/feature/search/src/lib/utils/service/fields.service.spec.ts b/libs/feature/search/src/lib/utils/service/fields.service.spec.ts index b51ac1167a..3a71e24620 100644 --- a/libs/feature/search/src/lib/utils/service/fields.service.spec.ts +++ b/libs/feature/search/src/lib/utils/service/fields.service.spec.ts @@ -86,7 +86,7 @@ describe('FieldsService', () => { describe('#supportedFields', () => { it('returns a list of fields', () => { expect(service.supportedFields).toEqual([ - 'publisher', + 'organization', 'format', 'resourceType', 'representationType', @@ -99,13 +99,15 @@ describe('FieldsService', () => { 'q', 'license', 'owner', + 'producer', + 'publisher', ]) }) }) describe('#getAvailableValues', () => { let values beforeEach(async () => { - values = await lastValueFrom(service.getAvailableValues('publisher')) + values = await lastValueFrom(service.getAvailableValues('organization')) }) it('gets the values from the orgs service', () => { expect(values).toEqual([{ label: 'orgA (10)', value: 'orgA' }]) @@ -121,7 +123,7 @@ describe('FieldsService', () => { beforeEach(async () => { filters = await lastValueFrom( service.buildFiltersFromFieldValues({ - publisher: ['aa', 'bb'], + organization: ['aa', 'bb'], format: ['cc', 'dd'], publicationYear: '2022', q: 'any', @@ -174,12 +176,14 @@ describe('FieldsService', () => { isSpatial: [], license: [], publicationYear: [], - publisher: ['orgB'], + organization: ['orgB'], q: [], representationType: [], resourceType: [], topic: [], owner: [], + producer: [], + publisher: [], }) }) }) From f2a7369ce1846e0068a4fc69e80da252a8699f34 Mon Sep 17 00:00:00 2001 From: Camille Moinier Date: Thu, 4 Jul 2024 11:50:35 +0200 Subject: [PATCH 03/10] fix: edit e2e to work with new filter name --- apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts | 2 +- docs/reference/search-fields.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts b/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts index 0e9813850e..ef55ee7586 100644 --- a/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts +++ b/apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts @@ -246,7 +246,7 @@ describe('dataset pages', () => { }) it('should go to dataset search page when clicking on org name and filter by org', () => { cy.get('[data-cy="organization-name"]').eq(1).click() - cy.url().should('include', '/search?publisher=') + cy.url().should('include', '/search?organization=') }) it('should go to dataset search page when clicking on keyword and filter by keyword', () => { cy.get('gn-ui-expandable-panel').eq(2).click() diff --git a/docs/reference/search-fields.md b/docs/reference/search-fields.md index 0625fe8192..614f8495e9 100644 --- a/docs/reference/search-fields.md +++ b/docs/reference/search-fields.md @@ -11,7 +11,7 @@ GeoNetwork-UI has built-in logic for several search fields, each of them relying These fields are used in the following context: - when building a URL or permalink from several search criteria; these fields will appear as query parameters in the URL, for instance: - `/search?publisher=MyOrg&format=csv&format=excel` + `/search?organization=MyOrg&format=csv&format=excel` - when specifying advanced filters [in a configuration file](../guide/configure.md#search) ## Fields From 7a9ca716b355988a8a8aa71f17d20ad035004780 Mon Sep 17 00:00:00 2001 From: Camille Moinier Date: Thu, 4 Jul 2024 12:40:03 +0200 Subject: [PATCH 04/10] feat: fix e2e tests --- apps/datahub-e2e/src/e2e/datasets.cy.ts | 6 ++++-- apps/datahub-e2e/src/fixtures/config-with-all-filters.toml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/datahub-e2e/src/e2e/datasets.cy.ts b/apps/datahub-e2e/src/e2e/datasets.cy.ts index cb4c40e487..c19ff052f7 100644 --- a/apps/datahub-e2e/src/e2e/datasets.cy.ts +++ b/apps/datahub-e2e/src/e2e/datasets.cy.ts @@ -173,7 +173,7 @@ describe('datasets', () => { .click() }) it('should display all filters', () => { - cy.get('@filters').filter(':visible').should('have.length', 10) + cy.get('@filters').filter(':visible').should('have.length', 12) cy.get('@filters') .children() .then(($dropdowns) => @@ -182,7 +182,7 @@ describe('datasets', () => { .map((dropdown) => dropdown.getAttribute('data-cy-field')) ) .should('eql', [ - 'publisher', + 'organization', 'format', 'publicationYear', 'topic', @@ -192,6 +192,8 @@ describe('datasets', () => { 'keyword', 'resourceType', 'representationType', + 'producer', + 'publisher', ]) cy.screenshot({ capture: 'viewport' }) }) diff --git a/apps/datahub-e2e/src/fixtures/config-with-all-filters.toml b/apps/datahub-e2e/src/fixtures/config-with-all-filters.toml index 2fa889d3f5..70c1b400c4 100644 --- a/apps/datahub-e2e/src/fixtures/config-with-all-filters.toml +++ b/apps/datahub-e2e/src/fixtures/config-with-all-filters.toml @@ -9,4 +9,4 @@ main_color = "#212029" # All-purpose text color background_color = "#fdfbff" [search] -advanced_filters = ['publisher', 'format', 'publicationYear', 'topic', 'isSpatial', 'license', 'inspireKeyword', 'keyword', 'resourceType', 'representationType'] +advanced_filters = ['organization', 'format', 'publicationYear', 'topic', 'isSpatial', 'license', 'inspireKeyword', 'keyword', 'resourceType', 'representationType', 'producer', 'publisher'] From b9d69c9c42d56362e7a2f5433b62324d0b135d13 Mon Sep 17 00:00:00 2001 From: Camille Moinier Date: Thu, 4 Jul 2024 15:44:40 +0200 Subject: [PATCH 05/10] feat: sort options correctly --- .../feature/search/src/lib/utils/service/fields.service.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libs/feature/search/src/lib/utils/service/fields.service.ts b/libs/feature/search/src/lib/utils/service/fields.service.ts index 3fe888a417..ad4a8b6cea 100644 --- a/libs/feature/search/src/lib/utils/service/fields.service.ts +++ b/libs/feature/search/src/lib/utils/service/fields.service.ts @@ -75,13 +75,14 @@ export class FieldsService { producer: new MultilingualSearchField( 'originatorOrgForResourceObject', this.injector, - 'desc', - 'count' + 'asc', + 'key' ), publisher: new MultilingualSearchField( 'distributorOrgForResourceObject', this.injector, - 'asc' + 'asc', + 'key' ), } as Record From 40e71af6ace00b6c73cd7166a1fafd9cfe6fcc1c Mon Sep 17 00:00:00 2001 From: Camille Moinier Date: Fri, 5 Jul 2024 15:09:58 +0200 Subject: [PATCH 06/10] feat: add -Org at the end of the new filters --- .../datahub-e2e/src/fixtures/config-with-all-filters.toml | 2 +- .../search/src/lib/utils/service/fields.service.ts | 8 ++++---- translations/de.json | 4 ++-- translations/en.json | 4 ++-- translations/es.json | 4 ++-- translations/fr.json | 4 ++-- translations/it.json | 4 ++-- translations/nl.json | 4 ++-- translations/pt.json | 4 ++-- translations/sk.json | 4 ++-- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/apps/datahub-e2e/src/fixtures/config-with-all-filters.toml b/apps/datahub-e2e/src/fixtures/config-with-all-filters.toml index 70c1b400c4..c3f09682ae 100644 --- a/apps/datahub-e2e/src/fixtures/config-with-all-filters.toml +++ b/apps/datahub-e2e/src/fixtures/config-with-all-filters.toml @@ -9,4 +9,4 @@ main_color = "#212029" # All-purpose text color background_color = "#fdfbff" [search] -advanced_filters = ['organization', 'format', 'publicationYear', 'topic', 'isSpatial', 'license', 'inspireKeyword', 'keyword', 'resourceType', 'representationType', 'producer', 'publisher'] +advanced_filters = ['organization', 'format', 'publicationYear', 'topic', 'isSpatial', 'license', 'inspireKeyword', 'keyword', 'resourceType', 'representationType', 'producerOrg', 'publisherOrg'] diff --git a/libs/feature/search/src/lib/utils/service/fields.service.ts b/libs/feature/search/src/lib/utils/service/fields.service.ts index ad4a8b6cea..76a1850932 100644 --- a/libs/feature/search/src/lib/utils/service/fields.service.ts +++ b/libs/feature/search/src/lib/utils/service/fields.service.ts @@ -31,8 +31,8 @@ marker('search.filters.resourceType') marker('search.filters.standard') marker('search.filters.topic') marker('search.filters.contact') -marker('search.filters.producer') -marker('search.filters.publisher') +marker('search.filters.producerOrg') +marker('search.filters.publisherOrg') @Injectable({ providedIn: 'root', @@ -72,13 +72,13 @@ export class FieldsService { q: new FullTextSearchField(), license: new LicenseSearchField(this.injector), owner: new OwnerSearchField(this.injector), - producer: new MultilingualSearchField( + producerOrg: new MultilingualSearchField( 'originatorOrgForResourceObject', this.injector, 'asc', 'key' ), - publisher: new MultilingualSearchField( + publisherOrg: new MultilingualSearchField( 'distributorOrgForResourceObject', this.injector, 'asc', diff --git a/translations/de.json b/translations/de.json index 49ef680e97..55feccb7c4 100644 --- a/translations/de.json +++ b/translations/de.json @@ -397,9 +397,9 @@ "search.filters.myRecordsHelp": "Wenn dies aktiviert ist, werden nur von mir erstellte Datensätze angezeigt; Datensätze, die von anderen erstellt wurden, werden nicht angezeigt.", "search.filters.organization": "", "search.filters.otherRecords": "Datensätze von einer anderen Person anzeigen", - "search.filters.producer": "", + "search.filters.producerOrg": "", "search.filters.publicationYear": "Veröffentlichungsjahr", - "search.filters.publisher": "", + "search.filters.publisherOrg": "", "search.filters.representationType": "Repräsentationstyp", "search.filters.resourceType": "Ressourcentyp", "search.filters.standard": "Standard", diff --git a/translations/en.json b/translations/en.json index 6497695d09..1f3e28e966 100644 --- a/translations/en.json +++ b/translations/en.json @@ -397,9 +397,9 @@ "search.filters.myRecordsHelp": "When this is enabled, records only created by myself are shown; records created by others will not show up.", "search.filters.organization": "Organization", "search.filters.otherRecords": "Showing records from another person", - "search.filters.producer": "Producer", + "search.filters.producerOrg": "Producer", "search.filters.publicationYear": "Publication year", - "search.filters.publisher": "Publisher", + "search.filters.publisherOrg": "Publisher", "search.filters.representationType": "Representation type", "search.filters.resourceType": "Resource type", "search.filters.standard": "Standard", diff --git a/translations/es.json b/translations/es.json index 474298aaca..8973368432 100644 --- a/translations/es.json +++ b/translations/es.json @@ -397,9 +397,9 @@ "search.filters.myRecordsHelp": "", "search.filters.organization": "", "search.filters.otherRecords": "", - "search.filters.producer": "", + "search.filters.producerOrg": "", "search.filters.publicationYear": "", - "search.filters.publisher": "", + "search.filters.publisherOrg": "", "search.filters.representationType": "", "search.filters.resourceType": "", "search.filters.standard": "", diff --git a/translations/fr.json b/translations/fr.json index 4eaa3e9676..fb4d6e7462 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -397,9 +397,9 @@ "search.filters.myRecordsHelp": "Quand activé, n'affiche que les données créées avec mon utilisateur. Les données créées par les autres utilisateurs ne sont pas affichées.", "search.filters.organization": "Organisation", "search.filters.otherRecords": "Affichage des données d'un autre utilisateur", - "search.filters.producer": "Producteur", + "search.filters.producerOrg": "Producteur", "search.filters.publicationYear": "Année de publication", - "search.filters.publisher": "Distributeur", + "search.filters.publisherOrg": "Distributeur", "search.filters.representationType": "Type de représentation", "search.filters.resourceType": "Type de ressource", "search.filters.standard": "Standard", diff --git a/translations/it.json b/translations/it.json index 03b9737af9..e7fff9fb95 100644 --- a/translations/it.json +++ b/translations/it.json @@ -397,9 +397,9 @@ "search.filters.myRecordsHelp": "Quando attivato, mostra solo i dati creati con il mio utente. I dati creati da altri utenti non sono visualizzati.", "search.filters.organization": "", "search.filters.otherRecords": "Visualizzazione dei dati di un altro utente", - "search.filters.producer": "", + "search.filters.producerOrg": "", "search.filters.publicationYear": "Anno di pubblicazione", - "search.filters.publisher": "", + "search.filters.publisherOrg": "", "search.filters.representationType": "Tipo di rappresentazione", "search.filters.resourceType": "Tipo di risorsa", "search.filters.standard": "Standard", diff --git a/translations/nl.json b/translations/nl.json index 5fe6272582..1086aa0994 100644 --- a/translations/nl.json +++ b/translations/nl.json @@ -397,9 +397,9 @@ "search.filters.myRecordsHelp": "", "search.filters.organization": "", "search.filters.otherRecords": "", - "search.filters.producer": "", + "search.filters.producerOrg": "", "search.filters.publicationYear": "", - "search.filters.publisher": "", + "search.filters.publisherOrg": "", "search.filters.representationType": "", "search.filters.resourceType": "", "search.filters.standard": "", diff --git a/translations/pt.json b/translations/pt.json index 2465a82ba4..761e097ab1 100644 --- a/translations/pt.json +++ b/translations/pt.json @@ -397,9 +397,9 @@ "search.filters.myRecordsHelp": "", "search.filters.organization": "", "search.filters.otherRecords": "", - "search.filters.producer": "", + "search.filters.producerOrg": "", "search.filters.publicationYear": "", - "search.filters.publisher": "", + "search.filters.publisherOrg": "", "search.filters.representationType": "", "search.filters.resourceType": "", "search.filters.standard": "", diff --git a/translations/sk.json b/translations/sk.json index 125dd26f1c..aa56902b73 100644 --- a/translations/sk.json +++ b/translations/sk.json @@ -397,9 +397,9 @@ "search.filters.myRecordsHelp": "Keď je táto možnosť zapnutá, zobrazia sa len záznamy vytvorené mnou; záznamy vytvorené inými sa nezobrazia.", "search.filters.organization": "", "search.filters.otherRecords": "Zobrazenie záznamov od inej osoby", - "search.filters.producer": "", + "search.filters.producerOrg": "", "search.filters.publicationYear": "Rok zverejnenia", - "search.filters.publisher": "", + "search.filters.publisherOrg": "", "search.filters.representationType": "Typ reprezentácie", "search.filters.resourceType": "Typ zdroja", "search.filters.standard": "Štandard", From 7296aed0086a2eee5e80843dfd0a8d9ec09e651e Mon Sep 17 00:00:00 2001 From: Camille Moinier Date: Fri, 5 Jul 2024 15:10:10 +0200 Subject: [PATCH 07/10] feat: remove producerOrg & publsherOrg from default filters --- .../app/home/search/search-filters/search-filters.component.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/datahub/src/app/home/search/search-filters/search-filters.component.ts b/apps/datahub/src/app/home/search/search-filters/search-filters.component.ts index f3e144f1ac..28c6774eaf 100644 --- a/apps/datahub/src/app/home/search/search-filters/search-filters.component.ts +++ b/apps/datahub/src/app/home/search/search-filters/search-filters.component.ts @@ -59,8 +59,6 @@ export class SearchFiltersComponent implements OnInit { 'topic', 'isSpatial', 'license', - 'producer', - 'publisher', ] ) .filter((adv_filter) => { From 032a2c4519af3761262ae5698f58029819d0dd54 Mon Sep 17 00:00:00 2001 From: Camille Moinier Date: Fri, 5 Jul 2024 15:24:25 +0200 Subject: [PATCH 08/10] fix: change all occurences of publisher to organization and fix ut --- apps/datahub-e2e/src/e2e/datasets.cy.ts | 6 +++--- .../app/home/home-header/home-header.component.spec.ts | 2 +- .../search-filters/search-filters.component.spec.ts | 6 +++--- .../organization-details.component.html | 4 ++-- .../organization-details.component.spec.ts | 2 +- conf/default.toml | 6 +++--- docs/guide/configure.md | 4 ++-- .../router/src/lib/default/state/router.effects.spec.ts | 2 +- .../search/src/lib/utils/service/fields.service.spec.ts | 8 ++++---- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/apps/datahub-e2e/src/e2e/datasets.cy.ts b/apps/datahub-e2e/src/e2e/datasets.cy.ts index c19ff052f7..ae4fcd8811 100644 --- a/apps/datahub-e2e/src/e2e/datasets.cy.ts +++ b/apps/datahub-e2e/src/e2e/datasets.cy.ts @@ -192,13 +192,13 @@ describe('datasets', () => { 'keyword', 'resourceType', 'representationType', - 'producer', - 'publisher', + 'producerOrg', + 'publisherOrg', ]) cy.screenshot({ capture: 'viewport' }) }) - describe('publisher filter', () => { + describe('organization filter', () => { beforeEach(() => { cy.get('@filters').eq(0).click() getFilterOptions() diff --git a/apps/datahub/src/app/home/home-header/home-header.component.spec.ts b/apps/datahub/src/app/home/home-header/home-header.component.spec.ts index 1d764bdd72..2ff6c089db 100644 --- a/apps/datahub/src/app/home/home-header/home-header.component.spec.ts +++ b/apps/datahub/src/app/home/home-header/home-header.component.spec.ts @@ -31,7 +31,7 @@ jest.mock('@geonetwork-ui/util/app-config', () => { { sort: '-createDate', name: 'sortCeatedDateAndOrg', - filters: { publisher: ['DREAL'] }, + filters: { organization: ['DREAL'] }, }, { name: 'filterCarto', diff --git a/apps/datahub/src/app/home/search/search-filters/search-filters.component.spec.ts b/apps/datahub/src/app/home/search/search-filters/search-filters.component.spec.ts index 96b24e0406..9b838003c4 100644 --- a/apps/datahub/src/app/home/search/search-filters/search-filters.component.spec.ts +++ b/apps/datahub/src/app/home/search/search-filters/search-filters.component.spec.ts @@ -27,7 +27,7 @@ import { PlatformServiceInterface } from '@geonetwork-ui/common/domain/platform. jest.mock('@geonetwork-ui/util/app-config', () => ({ getOptionalSearchConfig: () => ({ ADVANCED_FILTERS: [ - 'publisher', + 'publisherOrg', 'format', 'isSpatial', 'documentStandard', @@ -92,7 +92,7 @@ class FieldsServiceMock { ) public get supportedFields() { return [ - 'publisher', + 'publisherOrg', 'format', 'isSpatial', 'documentStandard', @@ -294,7 +294,7 @@ describe('SearchFiltersComponent', () => { filter_format: {}, filter_publicationYear: {}, filter_isSpatial: {}, - filter_publisher: {}, + filter_publisherOrg: {}, filter_topic: {}, filter_license: {}, filter_documentStandard: {}, diff --git a/apps/datahub/src/app/organization/organization-details/organization-details.component.html b/apps/datahub/src/app/organization/organization-details/organization-details.component.html index 4147dd8a79..39f8da6180 100644 --- a/apps/datahub/src/app/organization/organization-details/organization-details.component.html +++ b/apps/datahub/src/app/organization/organization-details/organization-details.component.html @@ -33,7 +33,7 @@ { expect(orgDetailsSearchAllBtn).toBeTruthy() expect(orgDetailsSearchAllBtn?.getAttribute('href')).toEqual( - `/${ROUTER_ROUTE_SEARCH}?publisher=${encodeURIComponent( + `/${ROUTER_ROUTE_SEARCH}?organization=${encodeURIComponent( anOrganizationWithManyDatasets.name )}` ) diff --git a/conf/default.toml b/conf/default.toml index f0640402a3..33cf49335d 100644 --- a/conf/default.toml +++ b/conf/default.toml @@ -79,9 +79,9 @@ background_color = "#fdfbff" # filter_geometry_data = '{ "coordinates": [...], "type": "Polygon" }' # The advanced search filters available to the user can be customized with this setting. -# The following fields can be used for filtering: 'publisher', 'format', 'publicationYear', 'standard', 'inspireKeyword', 'keyword', 'topic', 'isSpatial', 'license', 'resourceType', 'representationType' +# The following fields can be used for filtering: 'organization', 'format', 'publicationYear', 'standard', 'inspireKeyword', 'keyword', 'topic', 'isSpatial', 'license', 'resourceType', 'representationType' # any other field will be ignored -# advanced_filters = ['publisher', 'format', 'publicationYear', 'topic', 'isSpatial', 'license'] +# advanced_filters = ['organization', 'format', 'publicationYear', 'topic', 'isSpatial', 'license'] # One or several search presets can be defined here; every search preset is composed of: # - a name (which can be a translation key) @@ -90,7 +90,7 @@ background_color = "#fdfbff" # [[search_preset]] # name = 'filterByName' # filters.q = 'Full text search' -# filters.publisher = ['Org 1', 'Org 2'] +# filters.organization = ['Org 1', 'Org 2'] # filters.format = ['format 1', 'format 2'] # filters.documentStandard = ['iso19115-3.2018'] # filters.inspireKeyword = ['keyword 1', 'keyword 2'] diff --git a/docs/guide/configure.md b/docs/guide/configure.md index 601788b76b..5be8bb6cd3 100644 --- a/docs/guide/configure.md +++ b/docs/guide/configure.md @@ -151,7 +151,7 @@ For a list of supported search fields, see [this documentation page](../referenc The filters should be provided as an array, for instance: ```toml -advanced_filters = ['publisher', 'inspireKeyword', 'keyword', 'topic'] +advanced_filters = ['organization', 'inspireKeyword', 'keyword', 'topic'] ``` - `[[search_preset]]` (multiple, optional) @@ -171,7 +171,7 @@ advanced_filters = ['publisher', 'inspireKeyword', 'keyword', 'topic'] [[search_preset]] name = 'filterByName' filters.q = 'full text search' - filters.publisher = ['Org 1', 'Org 2'] + filters.organization = ['Org 1', 'Org 2'] filters.format = ['format 1', 'format 2'] filters.documentStandard = ['iso19115-3.2018'] filters.inspireKeyword = ['keyword 1', 'keyword 2'] diff --git a/libs/feature/router/src/lib/default/state/router.effects.spec.ts b/libs/feature/router/src/lib/default/state/router.effects.spec.ts index 4936c377e5..53c7591496 100644 --- a/libs/feature/router/src/lib/default/state/router.effects.spec.ts +++ b/libs/feature/router/src/lib/default/state/router.effects.spec.ts @@ -44,7 +44,7 @@ const initialParams: Params = { class FieldsServiceMock { mapping = { - publisher: 'OrgForResource', + organization: 'OrgForResource', q: 'any', } buildFiltersFromFieldValues = jest.fn((fieldValues) => diff --git a/libs/feature/search/src/lib/utils/service/fields.service.spec.ts b/libs/feature/search/src/lib/utils/service/fields.service.spec.ts index 3a71e24620..eaf8b09deb 100644 --- a/libs/feature/search/src/lib/utils/service/fields.service.spec.ts +++ b/libs/feature/search/src/lib/utils/service/fields.service.spec.ts @@ -99,8 +99,8 @@ describe('FieldsService', () => { 'q', 'license', 'owner', - 'producer', - 'publisher', + 'producerOrg', + 'publisherOrg', ]) }) }) @@ -182,8 +182,8 @@ describe('FieldsService', () => { resourceType: [], topic: [], owner: [], - producer: [], - publisher: [], + producerOrg: [], + publisherOrg: [], }) }) }) From dac0dd6096196332e4624c04fe4cb7e69fdd7f2b Mon Sep 17 00:00:00 2001 From: Camille Moinier Date: Fri, 5 Jul 2024 15:43:33 +0200 Subject: [PATCH 09/10] feat: update doc --- conf/default.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/default.toml b/conf/default.toml index 33cf49335d..17f646eeed 100644 --- a/conf/default.toml +++ b/conf/default.toml @@ -79,7 +79,7 @@ background_color = "#fdfbff" # filter_geometry_data = '{ "coordinates": [...], "type": "Polygon" }' # The advanced search filters available to the user can be customized with this setting. -# The following fields can be used for filtering: 'organization', 'format', 'publicationYear', 'standard', 'inspireKeyword', 'keyword', 'topic', 'isSpatial', 'license', 'resourceType', 'representationType' +# The following fields can be used for filtering: 'organization', 'format', 'publicationYear', 'standard', 'inspireKeyword', 'keyword', 'topic', 'isSpatial', 'license', 'resourceType', 'representationType', 'producerOrg', 'publisherOrg' # any other field will be ignored # advanced_filters = ['organization', 'format', 'publicationYear', 'topic', 'isSpatial', 'license'] From 0501e198e7c6f9b3752f229df1992a2d8a17be3c Mon Sep 17 00:00:00 2001 From: Camille Moinier Date: Tue, 9 Jul 2024 15:51:02 +0200 Subject: [PATCH 10/10] feat: edit doc --- docs/reference/search-fields.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/reference/search-fields.md b/docs/reference/search-fields.md index 614f8495e9..977934c0b1 100644 --- a/docs/reference/search-fields.md +++ b/docs/reference/search-fields.md @@ -16,12 +16,24 @@ These fields are used in the following context: ## Fields -### Publisher +### Organization -> Field id: `publisher` +> Field id: `organization` This field targets the owner organization of a record. The exact meaning of a record's organization is defined by the "organization strategy" used; see [this documentation page](./organizations.md) for more details. +### Publisher + +> Field id: `publisherOrg` + +This field targets the organization publishing the record. The exact meaning of a record's organization publisher is defined by the "organization strategy" used; see [this documentation page](./organizations.md) for more details. + +### Producer + +> Field id: `producerOrg` + +This field targets the organization producing the record. The exact meaning of a record's organization producer is defined by the "organization strategy" used; see [this documentation page](./organizations.md) for more details. + ### Format > Field id: `format`