Skip to content

Commit

Permalink
fix: change all occurences of publisher to organization and fix ut
Browse files Browse the repository at this point in the history
  • Loading branch information
cmoinier committed Jul 5, 2024
1 parent 7296aed commit 032a2c4
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
6 changes: 3 additions & 3 deletions apps/datahub-e2e/src/e2e/datasets.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jest.mock('@geonetwork-ui/util/app-config', () => {
{
sort: '-createDate',
name: 'sortCeatedDateAndOrg',
filters: { publisher: ['DREAL'] },
filters: { organization: ['DREAL'] },
},
{
name: 'filterCarto',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -92,7 +92,7 @@ class FieldsServiceMock {
)
public get supportedFields() {
return [
'publisher',
'publisherOrg',
'format',
'isSpatial',
'documentStandard',
Expand Down Expand Up @@ -294,7 +294,7 @@ describe('SearchFiltersComponent', () => {
filter_format: {},
filter_publicationYear: {},
filter_isSpatial: {},
filter_publisher: {},
filter_publisherOrg: {},
filter_topic: {},
filter_license: {},
filter_documentStandard: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<a
data-test="organizationDatasetCount"
[routerLink]="['/', ROUTER_ROUTE_SEARCH]"
[queryParams]="{ publisher: organization.name }"
[queryParams]="{ organization: organization.name }"
>
<gn-ui-figure
class="py-[37px] pl-[47px] rounded-lg border bg-white mb-5 card-shadow cursor-pointer"
Expand Down Expand Up @@ -82,7 +82,7 @@
<div class="ml-auto">
<a
[routerLink]="['/', ROUTER_ROUTE_SEARCH]"
[queryParams]="{ publisher: organization.name }"
[queryParams]="{ organization: organization.name }"
class="gn-ui-btn-primary h-[34px] rounded-lg"
data-test="orgDetailsSearchAllBtn"
translate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ describe('OrganizationDetailsComponent', () => {
expect(orgDetailsSearchAllBtn).toBeTruthy()

expect(orgDetailsSearchAllBtn?.getAttribute('href')).toEqual(
`/${ROUTER_ROUTE_SEARCH}?publisher=${encodeURIComponent(
`/${ROUTER_ROUTE_SEARCH}?organization=${encodeURIComponent(
anOrganizationWithManyDatasets.name
)}`
)
Expand Down
6 changes: 3 additions & 3 deletions conf/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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']
Expand Down
4 changes: 2 additions & 2 deletions docs/guide/configure.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const initialParams: Params = {

class FieldsServiceMock {
mapping = {
publisher: 'OrgForResource',
organization: 'OrgForResource',
q: 'any',
}
buildFiltersFromFieldValues = jest.fn((fieldValues) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ describe('FieldsService', () => {
'q',
'license',
'owner',
'producer',
'publisher',
'producerOrg',
'publisherOrg',
])
})
})
Expand Down Expand Up @@ -182,8 +182,8 @@ describe('FieldsService', () => {
resourceType: [],
topic: [],
owner: [],
producer: [],
publisher: [],
producerOrg: [],
publisherOrg: [],
})
})
})
Expand Down

0 comments on commit 032a2c4

Please sign in to comment.