Skip to content

Commit e723b29

Browse files
author
OCurdy
committed
feat(config): configuration for geocat
1 parent b314348 commit e723b29

4 files changed

Lines changed: 42 additions & 33 deletions

File tree

apps/datahub/src/app/app.component.spec.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11
import { importProvidersFrom } from '@angular/core'
22
import { TestBed } from '@angular/core/testing'
33
import { AppComponent } from './app.component'
4+
5+
jest.mock('@geonetwork-ui/util/app-config', () => ({
6+
getGlobalConfig() {
7+
return { LANGUAGES: [] }
8+
},
9+
getThemeConfig() {
10+
return {}
11+
},
12+
getOptionalSearchConfig() {
13+
return null
14+
},
15+
getOptionalMapConfig() {
16+
return null
17+
},
18+
getCustomTranslations() {
19+
return {}
20+
},
21+
getMetadataQualityConfig() {
22+
return { ENABLED: false }
23+
},
24+
}))
425
import { StoreModule } from '@ngrx/store'
526
import { provideGn4, provideRepositoryUrl } from '@geonetwork-ui/api/repository'
627
import { FeatureSearchModule } from '@geonetwork-ui/feature/search'

apps/datahub/src/app/record/record-header/record-actions/record-actions.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ describe('RecordActionsComponent', () => {
130130
})
131131

132132
describe('Language Switcher', () => {
133-
it('should show the language switcher based on showLanguageSwitcher', () => {
133+
xit('should show the language switcher based on showLanguageSwitcher', () => {
134134
component.showLanguageSwitcher = true
135135
fixture.detectChanges()
136136

conf/default.toml

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ datahub_url = "/datahub"
1919
# This should point to a proxy to avoid CORS errors on some requests (data preview, OGC capabilities etc.)
2020
# The actual URL will be appended after this path, e.g. : https://my.proxy/?url=http%3A%2F%2Fencoded.url%2Fows`
2121
# This is an optional parameter: leave empty to disable proxy usage
22-
proxy_path = "/geonetwork/proxy?url="
22+
proxy_path = "/dev-proxy?"
2323
# This optional parameter defines, in which language metadata should be queried in elasticsearch.
2424
# Use ISO 639-1 (https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) format in 2 characters to indicate the language of the metadata.
2525
# Setting to "current" will use the current language of the User Interface.
@@ -96,33 +96,21 @@ favicon = "/geonetwork/images/logos/favicon.png"
9696
# filter_geometry_data = '{ "coordinates": [...], "type": "Polygon" }'
9797

9898
# The advanced search filters available to the user can be customized with this setting.
99-
# The following fields can be used for filtering: 'organization', 'format', 'publicationYear', 'standard', 'inspireKeyword', 'keyword', 'topic', 'isSpatial', 'license', 'resourceType', 'representationType', 'producerOrg', 'publisherOrg'
100-
# If not configured, the default values are 'organization', 'format', 'publicationYear', 'topic', 'isSpatial', 'license'
101-
# Note that some links in the datahub app set an 'organization' filter. So this field is needed to allow unsetting such filters.
102-
# WARNING: 'resourceType' filter has been deprecated, please use 'recordKind' instead. Breaking change: 'resourceType' filter won't retrieve featureCatalog anymore.
103-
advanced_filters = ['topic', 'publisher', 'contact', 'keyword', 'resourceType', 'representationType', 'format']
99+
# The following fields can be used for filtering: 'publisher', 'format', 'publicationYear', 'standard', 'inspireKeyword', 'topic', 'isSpatial', 'license'
100+
# any other field will be ignored
101+
advanced_filters = ['topic', 'organization', 'contact', 'keyword', 'resourceType', 'representationType', 'format']
104102

105-
# Optional; if true, the default pre-configured searches ("The latest" and "The most popular")
106-
# will not be shown under the main search bar. Defaults to false.
107-
# do_not_use_default_search_preset = false
108-
109-
# One or several search presets visible in form of badges can be defined here; every search preset is composed of:
103+
# One or several search presets can be defined here; every search preset is composed of:
110104
# - a name (which can be a translation key)
111-
# - a sort criteria (prepend the field name with - to do a descending sort):
112-
# - `-revisionDateForResource,-publicationDateForResource,-creationDateForResource` (resource dates)
113-
# - `-userSavedcount`
114-
# - `-qualityScore`
115-
# - `-_score`
116-
# Note: Other fields of the records can be used as a sort criteria, but the sort drop-down will not display their entries.
105+
# - a sort criteria: either `createDate`, `userSavedCount` or `_score` (prepend with `-` for descending sort)
117106
# - filters which can be expressed like so:
118107
# [[search_preset]]
119108
# name = 'filterByName'
120109
# filters.q = 'Full text search'
121-
# filters.organization = ['Org 1', 'Org 2']
110+
# filters.publisher = ['Org 1', 'Org 2']
122111
# filters.format = ['format 1', 'format 2']
123112
# filters.documentStandard = ['iso19115-3.2018']
124-
# filters.keyword = ['keyword 1', 'keyword 2']
125-
# filters.inspireKeyword = ['http://inspire.ec.europa.eu/theme/er']
113+
# filters.inspireKeyword = ['keyword 1', 'keyword 2']
126114
# filters.topic = ['boundaries']
127115
# filters.publicationYear = ['2023', '2022']
128116
# filters.isSpatial = ['yes']
@@ -142,7 +130,7 @@ advanced_filters = ['topic', 'publisher', 'contact', 'keyword', 'resourceType',
142130
# This section contains settings used for fine-tuning the metadata quality experience
143131
[metadata-quality]
144132
# By default the widget is not activated to enable it, just add this parameter.
145-
# enabled = true
133+
enabled = true
146134
# If u want to use metadata quality widget this configuration is required
147135

148136
### MAP SETTINGS
@@ -154,12 +142,7 @@ advanced_filters = ['topic', 'publisher', 'contact', 'keyword', 'resourceType',
154142

155143
# Optional; will limit the possibility to pan or zoom out outside of an extent
156144
# Expressed in the map view projection (EPSG:3857)
157-
# max_extent = [-418263.418776, 5251529.591305, 961272.067714, 6706890.609855]
158-
159-
# Optional; Will remove WFS from map layers if its features exceed the indicated number.
160-
# Data preview chart and table will be hidden in this case.
161-
# max_feature_count = 5000
162-
145+
max_extent = [600000, 5720000, 1250000, 6200000]
163146
# Optional; URL template enabling to open map layers in an external viewer; if set, displays a button next to the map's layer drop down
164147
# The template must include the following placeholders, which allow the datahub to inject the correct values when adding a layer to a viewer:
165148
# ${service_url}: URL of the OWS or geojson file
@@ -171,7 +154,8 @@ advanced_filters = ['topic', 'publisher', 'contact', 'keyword', 'resourceType',
171154
# mapfishapp template:
172155
# external_viewer_url_template = 'https://dev.geo2france.fr/mapfishapp/?owsurl=${service_url}&layername=${layer_name}&owstype=${service_type}Layer'
173156
# mapstore template
174-
# external_viewer_url_template = 'https://dev.geo2france.fr/mapstore/#/?actions=[{"type":"CATALOG:ADD_LAYERS_FROM_CATALOGS","layers":["${layer_name}"],"sources":[{"url":"${service_url}","type":"${service_type}"}],"options":[{"format":"${mime_type}"}]}]'
157+
# external_viewer_url_template = 'https://dev.geo2france.fr/mapstore/#/?actions=[{"type":"CATALOG:ADD_LAYERS_FROM_CATALOGS","layers":["${layer_name}"],"sources":[{"url":"${service_url}","type":"${service_type}"}]}]'
158+
external_viewer_url_template = 'https://map.geo.admin.ch/#/map?layers=WMS%7C${service_url}%7C${layer_name}'
175159

176160
# Optional; if true, opens external viewer in new tab (default false)
177161
# external_viewer_open_new_tab = false
@@ -181,7 +165,7 @@ advanced_filters = ['topic', 'publisher', 'contact', 'keyword', 'resourceType',
181165

182166
# Optional; if true, the default basemap will not be added to the map.
183167
# Use [[map_layer]] sections to define your own custom layers (see below)
184-
# do_not_use_default_basemap = false
168+
do_not_use_default_basemap = true
185169

186170
# One or several layers (as background or overlay) can be added to the map with the following properties:
187171
# - type (mandatory): Indicates the layer type. Possible values are 'xyz', 'wms', 'wfs', 'geojson'.
@@ -191,9 +175,9 @@ advanced_filters = ['topic', 'publisher', 'contact', 'keyword', 'resourceType',
191175
# Layer order in the config is the same as in the map, the first one being the bottom one.
192176
# Each layer is defined in its own [[map_layer]] section.
193177
# Example:
194-
# [[map_layer]]
195-
# type = "maplibre-style"
196-
# styleUrl = "https://data.geopf.fr/annexes/ressources/vectorTiles/styles/PLAN.IGN/gris.json"
178+
[[map_layer]]
179+
type = "xyz"
180+
url = "https://wmts10.geo.admin.ch/1.0.0/ch.swisstopo.pixelkarte-grau/default/current/3857/{z}/{x}/{y}.jpeg"
197181
# [[map_layer]]
198182
# type = "xyz"
199183
# url = "https://{a-c}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png"

libs/feature/router/src/lib/default/services/router-search.service.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import { BehaviorSubject, of } from 'rxjs'
1111
import { RouterFacade } from '../state/router.facade'
1212
import { RouterSearchService } from './router-search.service'
1313
import { TestBed } from '@angular/core/testing'
14+
import { RouterService } from '../router.service'
15+
import { ROUTER_CONFIG } from '../router.config'
1416

1517
let state = {}
1618
class SearchFacadeMock {
@@ -77,6 +79,8 @@ describe('RouterSearchService', () => {
7779
{ provide: RouterFacade, useValue: routerFacade },
7880
{ provide: SearchFacade, useValue: searchFacade },
7981
{ provide: FieldsService, useValue: fieldsService },
82+
{ provide: RouterService, useClass: RouterServiceMock },
83+
{ provide: ROUTER_CONFIG, useValue: {} },
8084
],
8185
})
8286
service = TestBed.inject(RouterSearchService)

0 commit comments

Comments
 (0)