geonetwork-ui 2.11.0-dev.e7b8ec331 → 2.11.0-dev.fa83d0484

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/fesm2022/geonetwork-ui.mjs +2652 -1670
  2. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  3. package/index.d.ts +465 -187
  4. package/index.d.ts.map +1 -1
  5. package/package.json +13 -11
  6. package/src/libs/api/metadata-converter/src/lib/dcat-ap/dcat-ap.converter.ts +2 -0
  7. package/src/libs/api/metadata-converter/src/lib/fixtures/mel.records.dataset+featurecatalog.ts +395 -0
  8. package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +78 -21
  9. package/src/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.ts +19 -0
  10. package/src/libs/api/metadata-converter/src/lib/iso19115-3/iso19115-3.converter.ts +17 -6
  11. package/src/libs/api/metadata-converter/src/lib/iso19115-3/read-parts.ts +110 -0
  12. package/src/libs/api/metadata-converter/src/lib/iso19115-3/write-parts.ts +131 -0
  13. package/src/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.ts +9 -0
  14. package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +2 -1
  15. package/src/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.ts +160 -54
  16. package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +123 -51
  17. package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.ts +11 -0
  18. package/src/libs/common/domain/src/lib/model/record/flags.model.ts +1 -0
  19. package/src/libs/common/domain/src/lib/model/record/index.ts +1 -0
  20. package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +26 -18
  21. package/src/libs/common/domain/src/lib/model/search/aggregation.model.ts +2 -0
  22. package/src/libs/common/domain/src/lib/model/search/filter.model.ts +24 -2
  23. package/src/libs/common/domain/src/lib/platform.service.interface.ts +1 -0
  24. package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +22 -3
  25. package/src/libs/common/fixtures/src/lib/records.fixtures.ts +42 -62
  26. package/src/libs/feature/dataviz/src/lib/chart-view/chart-view.component.ts +3 -2
  27. package/src/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.ts +2 -1
  28. package/src/libs/feature/dataviz/src/lib/service/data.service.ts +54 -41
  29. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-constraints/form-field-constraints.component.ts +3 -5
  30. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts/form-field-contacts.component.ts +2 -2
  31. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-record-flags/form-field-record-flag-component.html +18 -0
  32. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-record-flags/form-field-record-flag-component.ts +86 -0
  33. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +100 -88
  34. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +11 -4
  35. package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.ts +18 -4
  36. package/src/libs/feature/editor/src/lib/expressions.ts +67 -0
  37. package/src/libs/feature/editor/src/lib/fields.config.ts +13 -0
  38. package/src/libs/feature/editor/src/lib/models/editor-config.model.ts +10 -4
  39. package/src/libs/feature/map/src/index.ts +0 -2
  40. package/src/libs/feature/map/src/lib/add-layer-from-file/add-layer-from-file.component.html +1 -0
  41. package/src/libs/feature/map/src/lib/feature-map.module.ts +1 -8
  42. package/src/libs/feature/notifications/src/lib/notifications.service.ts +6 -4
  43. package/src/libs/feature/notify-reuse/src/lib/notify-reuse-form/notify-reuse-form.component.ts +8 -3
  44. package/src/libs/feature/record/src/lib/state/mdview.actions.ts +4 -8
  45. package/src/libs/feature/record/src/lib/state/mdview.effects.ts +10 -17
  46. package/src/libs/feature/record/src/lib/state/mdview.facade.ts +2 -4
  47. package/src/libs/feature/record/src/lib/state/mdview.reducer.ts +4 -9
  48. package/src/libs/feature/record/src/lib/state/mdview.selectors.ts +2 -7
  49. package/src/libs/feature/router/src/lib/default/state/query-params.utils.ts +1 -1
  50. package/src/libs/feature/search/src/index.ts +2 -0
  51. package/src/libs/feature/search/src/lib/filter-dropdown/filter-dropdown.component.html +18 -4
  52. package/src/libs/feature/search/src/lib/filter-dropdown/filter-dropdown.component.ts +80 -19
  53. package/src/libs/feature/search/src/lib/geocoding/geocoding.service.ts +105 -0
  54. package/src/libs/feature/search/src/lib/location-search/location-search.component.html +18 -0
  55. package/src/libs/feature/search/src/lib/location-search/location-search.component.ts +114 -0
  56. package/src/libs/feature/search/src/lib/search-filters-summary-item/search-filters-summary-item.component.ts +19 -8
  57. package/src/libs/feature/search/src/lib/state/reducer.ts +1 -4
  58. package/src/libs/feature/search/src/lib/utils/service/fields.service.ts +64 -4
  59. package/src/libs/feature/search/src/lib/utils/service/fields.ts +94 -10
  60. package/src/libs/ui/dataviz/src/lib/data-table/data-table.component.html +6 -7
  61. package/src/libs/ui/dataviz/src/lib/data-table/data-table.component.ts +31 -19
  62. package/src/libs/ui/dataviz/src/lib/data-table/data-table.fixtures.ts +2 -2
  63. package/src/libs/ui/elements/src/lib/record-feature-catalog/feature-catalog-list/feature-catalog-list.component.html +3 -3
  64. package/src/libs/ui/elements/src/lib/record-feature-catalog/feature-catalog-list/feature-catalog-list.component.ts +2 -2
  65. package/src/libs/ui/elements/src/lib/service-capabilities/service-capabilities.component.ts +2 -1
  66. package/src/libs/ui/inputs/src/index.ts +2 -0
  67. package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.css +0 -4
  68. package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.html +12 -3
  69. package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts +11 -3
  70. package/src/libs/ui/inputs/src/lib/date-adapter.providers.ts +30 -0
  71. package/src/libs/ui/inputs/src/lib/date-picker/date-picker.component.ts +3 -24
  72. package/src/libs/ui/inputs/src/lib/date-range-dropdown/date-range-dropdown.component.css +37 -3
  73. package/src/libs/ui/inputs/src/lib/date-range-dropdown/date-range-dropdown.component.html +135 -16
  74. package/src/libs/ui/inputs/src/lib/date-range-dropdown/date-range-dropdown.component.ts +166 -29
  75. package/src/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.ts +3 -7
  76. package/src/libs/ui/inputs/src/lib/drag-and-drop-file-input/drag-and-drop-file-input.component.css +1 -0
  77. package/src/libs/ui/inputs/src/lib/drag-and-drop-file-input/drag-and-drop-file-input.component.html +20 -7
  78. package/src/libs/ui/inputs/src/lib/drag-and-drop-file-input/drag-and-drop-file-input.component.ts +46 -5
  79. package/src/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.html +7 -4
  80. package/src/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.ts +12 -9
  81. package/src/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.model.ts +2 -2
  82. package/src/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.ts +2 -1
  83. package/src/libs/ui/inputs/src/lib/spatial-extent-dropdown/spatial-extent-dropdown.component.css +0 -0
  84. package/src/libs/ui/inputs/src/lib/spatial-extent-dropdown/spatial-extent-dropdown.component.html +117 -0
  85. package/src/libs/ui/inputs/src/lib/spatial-extent-dropdown/spatial-extent-dropdown.component.ts +244 -0
  86. package/src/libs/ui/layout/src/lib/block-list/block-list.component.css +1 -0
  87. package/src/libs/ui/map/src/lib/components/map-container/map-container.component.ts +6 -5
  88. package/src/libs/util/app-config/src/index.ts +1 -0
  89. package/src/libs/util/app-config/src/lib/app-config.ts +338 -247
  90. package/src/libs/util/app-config/src/lib/fixtures.ts +37 -1
  91. package/src/libs/util/app-config/src/lib/model.ts +42 -1
  92. package/src/libs/util/app-config/src/lib/parse-utils.ts +8 -4
  93. package/src/libs/util/data-fetcher/src/lib/data-fetcher.ts +19 -22
  94. package/src/libs/util/data-fetcher/src/lib/engine/duckdb.ts +185 -0
  95. package/src/libs/util/data-fetcher/src/lib/engine/results.ts +63 -0
  96. package/src/libs/util/data-fetcher/src/lib/{sql-utils.ts → engine/sql-utils.ts} +28 -13
  97. package/src/libs/util/data-fetcher/src/lib/model.ts +2 -1
  98. package/src/libs/util/data-fetcher/src/lib/readers/base-file.ts +53 -38
  99. package/src/libs/util/data-fetcher/src/lib/readers/base.ts +11 -0
  100. package/src/libs/util/data-fetcher/src/lib/readers/csv.ts +9 -47
  101. package/src/libs/util/data-fetcher/src/lib/readers/excel.ts +27 -27
  102. package/src/libs/util/data-fetcher/src/lib/readers/geojson.ts +5 -24
  103. package/src/libs/util/data-fetcher/src/lib/readers/gml.ts +5 -49
  104. package/src/libs/util/data-fetcher/src/lib/readers/json.ts +5 -23
  105. package/src/libs/util/data-fetcher/src/lib/readers/wfs.ts +184 -128
  106. package/src/libs/util/data-fetcher/src/lib/utils.ts +0 -143
  107. package/src/libs/util/shared/src/index.ts +1 -0
  108. package/src/libs/util/shared/src/lib/autofocus.directive.ts +26 -0
  109. package/src/libs/util/shared/src/lib/links/link-utils.ts +19 -10
  110. package/src/libs/util/shared/src/lib/services/date.service.ts +3 -3
  111. package/src/libs/util/shared/src/lib/utils/file.ts +15 -0
  112. package/src/libs/util/shared/src/lib/utils/geojson.ts +45 -10
  113. package/src/libs/util/shared/src/lib/utils/index.ts +1 -0
  114. package/tailwind.base.css +5 -0
  115. package/translations/de.json +29 -4
  116. package/translations/en.json +28 -3
  117. package/translations/es.json +27 -2
  118. package/translations/fr.json +33 -8
  119. package/translations/it.json +27 -2
  120. package/translations/nl.json +27 -2
  121. package/translations/pt.json +27 -2
  122. package/translations/sk.json +27 -2
  123. package/src/libs/feature/map/src/lib/geocoding/geocoding.component.html +0 -41
  124. package/src/libs/feature/map/src/lib/geocoding/geocoding.component.ts +0 -112
  125. package/src/libs/feature/map/src/lib/geocoding.service.ts +0 -57
  126. package/src/libs/feature/map/src/lib/style/index.ts +0 -2
  127. package/src/libs/feature/map/src/lib/style/map-style.fixtures.ts +0 -47
  128. package/src/libs/feature/map/src/lib/style/map-style.service.ts +0 -108
  129. package/src/libs/util/data-fetcher/src/lib/readers/base-cache.ts +0 -14
  130. /package/src/libs/feature/{map/src/lib/geocoding/geocoding.component.css → editor/src/lib/components/record-form/form-field/form-field-record-flags/form-field-record-flag-component.css} +0 -0
@@ -14,10 +14,13 @@ import {
14
14
  } from '../../../../../../libs/api/metadata-converter/src'
15
15
  import { PublicationVersionError } from '../../../../../../libs/common/domain/src/lib/model/error'
16
16
  import {
17
+ AssociatedRecord,
17
18
  CatalogRecord,
18
19
  DatasetFeatureCatalog,
19
- DatasetFeatureType,
20
20
  LanguageCode,
21
+ LinkedRecord,
22
+ RecordFlag,
23
+ RecordRelation,
21
24
  } from '../../../../../../libs/common/domain/src/lib/model/record'
22
25
  import {
23
26
  Aggregations,
@@ -34,6 +37,7 @@ import {
34
37
  LanguagesApiService,
35
38
  RecordsApiService,
36
39
  SearchApiService,
40
+ TagsApiService,
37
41
  } from '../../../../../../libs/data-access/gn4/src'
38
42
  import {
39
43
  combineLatest,
@@ -46,7 +50,13 @@ import {
46
50
  switchMap,
47
51
  throwError,
48
52
  } from 'rxjs'
49
- import { catchError, map, tap } from 'rxjs/operators'
53
+ import {
54
+ catchError,
55
+ map,
56
+ shareReplay,
57
+ tap,
58
+ withLatestFrom,
59
+ } from 'rxjs/operators'
50
60
  import { lt } from 'semver'
51
61
  import { ElasticsearchService } from './elasticsearch'
52
62
  import { toLang2 } from '../../../../../../libs/util/i18n/src'
@@ -78,6 +88,7 @@ export class Gn4Repository implements RecordsRepositoryInterface {
78
88
  private platformService = inject(PlatformServiceInterface)
79
89
  private gn4LanguagesApi = inject(LanguagesApiService)
80
90
  private settingsService = inject(Gn4SettingsService)
91
+ private gn4TagsApi = inject(TagsApiService)
81
92
  private disableDraft = inject(DISABLE_DRAFT, { optional: true }) ?? false
82
93
  private defaultConverter = inject(DEFAULT_RECORD_CONVERTER)
83
94
 
@@ -145,7 +156,7 @@ export class Gn4Repository implements RecordsRepositoryInterface {
145
156
  return this.gn4SearchApi
146
157
  .search(
147
158
  'bucket',
148
- ['fcats', 'hassources'],
159
+ ['fcats', 'hassources', 'siblings', 'associated'],
149
160
  JSON.stringify(
150
161
  this.gn4SearchHelper.getMetadataByIdsPayload([uniqueIdentifier])
151
162
  )
@@ -179,43 +190,15 @@ export class Gn4Repository implements RecordsRepositoryInterface {
179
190
  )
180
191
  }
181
192
 
182
- private mapEmbeddedFeatureCatalog(
183
- featureTypes: Array<DatasetFeatureType>
184
- ): DatasetFeatureCatalog {
185
- return {
186
- featureTypes: featureTypes.map((featureType) => ({
187
- name: featureType.typeName || '',
188
- definition: featureType.definition || '',
189
- attributes: Array.isArray(featureType.attributeTable)
190
- ? featureType.attributeTable.map((attr) => {
191
- const values = attr.values
192
- ?.filter((v) => v.code || v.label)
193
- .map((v) => ({
194
- code: v.code,
195
- label: v.label,
196
- }))
197
- return {
198
- name: attr.name,
199
- code: attr.code,
200
- definition: attr.definition,
201
- type: attr.type,
202
- ...(values?.length > 0 ? { values } : {}),
203
- }
204
- })
205
- : [],
206
- })),
207
- }
208
- }
209
- getFeatureCatalog(
193
+ queryLinkedFeatureCatalog(
210
194
  record: CatalogRecord,
211
195
  visited: Set<string> = new Set() // prevent looping
212
196
  ): Observable<DatasetFeatureCatalog | null> {
213
197
  if (
214
- record.extras?.['featureTypes'] &&
215
- Array.isArray(record.extras['featureTypes']) &&
216
- record.extras['featureTypes'].length > 0
198
+ 'featureTypeDescriptions' in record &&
199
+ record.featureTypeDescriptions?.length > 0
217
200
  ) {
218
- return of(this.mapEmbeddedFeatureCatalog(record.extras['featureTypes']))
201
+ return of({ featureTypes: record.featureTypeDescriptions })
219
202
  }
220
203
 
221
204
  const featureCatalogIdentifier = record.extras[
@@ -225,7 +208,7 @@ export class Gn4Repository implements RecordsRepositoryInterface {
225
208
  visited.add(featureCatalogIdentifier)
226
209
  return this.getRecord(featureCatalogIdentifier).pipe(
227
210
  switchMap((record) =>
228
- record ? this.getFeatureCatalog(record, visited) : of(null)
211
+ record ? this.queryLinkedFeatureCatalog(record, visited) : of(null)
229
212
  )
230
213
  )
231
214
  }
@@ -249,22 +232,43 @@ export class Gn4Repository implements RecordsRepositoryInterface {
249
232
  )
250
233
  }
251
234
 
252
- getSources(record: CatalogRecord): Observable<CatalogRecord[]> {
253
- const sourcesIdentifiers = record.extras?.['sourcesIdentifiers'] as string[]
254
- if (sourcesIdentifiers && sourcesIdentifiers.length > 0) {
255
- return this.getMultipleRecords(sourcesIdentifiers)
256
- }
257
- return of(null)
258
- }
259
-
260
- getSourceOf(record: CatalogRecord): Observable<CatalogRecord[]> {
261
- const sourceOfIdentifiers = record.extras?.[
262
- 'sourceOfIdentifiers'
263
- ] as string[]
264
- if (sourceOfIdentifiers && sourceOfIdentifiers.length > 0) {
265
- return this.getMultipleRecords(sourceOfIdentifiers)
235
+ getLinkedRecords(record: CatalogRecord): Observable<LinkedRecord[]> {
236
+ const siblings = (record.extras?.['siblings'] ?? []) as AssociatedRecord[]
237
+ const relations: Array<[RecordRelation, string[]]> = [
238
+ ['source', (record.extras?.['sourcesIdentifiers'] ?? []) as string[]],
239
+ ['sourceOf', (record.extras?.['sourceOfIdentifiers'] ?? []) as string[]],
240
+ ['sibling', siblings.map(({ uniqueIdentifier }) => uniqueIdentifier)],
241
+ [
242
+ 'associated',
243
+ (record.extras?.['associatedIdentifiers'] ?? []) as string[],
244
+ ],
245
+ ]
246
+ const requested = relations.filter(
247
+ ([, identifiers]) => identifiers.length > 0
248
+ )
249
+ if (requested.length === 0) {
250
+ return of([])
266
251
  }
267
- return of(null)
252
+ return forkJoin(
253
+ requested.map(([relation, identifiers]) =>
254
+ this.getMultipleRecords(identifiers).pipe(
255
+ map((records) =>
256
+ (records ?? []).map((record) => ({
257
+ record,
258
+ relation,
259
+ associationType:
260
+ relation === 'sibling'
261
+ ? siblings.find(
262
+ ({ uniqueIdentifier }) =>
263
+ uniqueIdentifier === record.uniqueIdentifier
264
+ )?.associationType
265
+ : undefined,
266
+ }))
267
+ ),
268
+ catchError(() => of([]))
269
+ )
270
+ )
271
+ ).pipe(map((groups) => groups.flat()))
268
272
  }
269
273
 
270
274
  aggregate(params: AggregationsParams): Observable<Aggregations> {
@@ -680,4 +684,72 @@ export class Gn4Repository implements RecordsRepositoryInterface {
680
684
  private removeRecordFromLocalStorage(recordId: string): void {
681
685
  window.localStorage.removeItem(this.getLocalStorageKeyForRecord(recordId))
682
686
  }
687
+
688
+ /*
689
+ * FLAGS
690
+ * Note: in GN4 API, categories are named "tags"
691
+ */
692
+
693
+ categoriesIdentifierForFlags: Observable<Record<RecordFlag, number>> =
694
+ this.gn4TagsApi.getTags().pipe(
695
+ map((categories) =>
696
+ categories.reduce(
697
+ (acc, category) => {
698
+ if (category.name.startsWith('geonetwork-ui-flag:')) {
699
+ acc[
700
+ category.name.replace(/^geonetwork-ui-flag:/, '') as RecordFlag
701
+ ] = category.id
702
+ }
703
+ return acc
704
+ },
705
+ {} as Record<RecordFlag, number>
706
+ )
707
+ ),
708
+ shareReplay(1)
709
+ )
710
+
711
+ private getCategoryIdForFlag(
712
+ flagName: RecordFlag
713
+ ): Observable<number | null> {
714
+ return this.categoriesIdentifierForFlags.pipe(
715
+ map((categories) => {
716
+ const categoryId = categories[flagName]
717
+ if (categoryId === undefined) {
718
+ console.warn(
719
+ `The record flag ${flagName} is not created on GeoNetwork backend; please create a category with the name geonetwork-ui-flag:${flagName} for this to work.`
720
+ )
721
+ return null
722
+ }
723
+ return categoryId
724
+ })
725
+ )
726
+ }
727
+
728
+ setRecordFlag(
729
+ uniqueIdentifier: string,
730
+ flagName: RecordFlag,
731
+ value: boolean
732
+ ): Observable<void> {
733
+ return this.getCategoryIdForFlag(flagName).pipe(
734
+ switchMap((categoryId) => {
735
+ if (categoryId === null) return of()
736
+ return value
737
+ ? this.gn4RecordsApi.tagRecord(uniqueIdentifier, [categoryId], false)
738
+ : this.gn4RecordsApi.deleteTags(uniqueIdentifier, [categoryId])
739
+ })
740
+ )
741
+ }
742
+
743
+ getRecordFlag(
744
+ uniqueIdentifier: string,
745
+ flagName: RecordFlag
746
+ ): Observable<boolean> {
747
+ return this.gn4RecordsApi.getRecordTags(uniqueIdentifier).pipe(
748
+ withLatestFrom(this.getCategoryIdForFlag(flagName)),
749
+ map(([tags, categoryId]) => {
750
+ if (categoryId === null) return false
751
+ return Array.from(tags).some((tag) => tag.id === categoryId)
752
+ })
753
+ )
754
+ }
683
755
  }
@@ -92,6 +92,13 @@ export class Gn4PlatformService implements PlatformServiceInterface {
92
92
  switchMap((apiUser) => this.mapper.userFromMeApi(apiUser)),
93
93
  shareReplay({ bufferSize: 1, refCount: true })
94
94
  )
95
+ private isAdmin$ = this.disableAuth
96
+ ? of(false)
97
+ : of(true).pipe(
98
+ switchMap(() => this.meApi.getMe()),
99
+ map((apiUser) => !!apiUser?.admin),
100
+ shareReplay({ bufferSize: 1, refCount: true })
101
+ )
95
102
 
96
103
  /**
97
104
  * A map of already loaded thesauri (groups of keywords); the key is a URI
@@ -146,6 +153,10 @@ export class Gn4PlatformService implements PlatformServiceInterface {
146
153
  return this.isUserAnonymous$
147
154
  }
148
155
 
156
+ isAdministrator(): Observable<boolean> {
157
+ return this.isAdmin$
158
+ }
159
+
149
160
  getOrganizations(): Observable<Organization[]> {
150
161
  return undefined
151
162
  }
@@ -0,0 +1 @@
1
+ export type RecordFlag = 'IS_REFERENCE_DATASET'
@@ -3,3 +3,4 @@ export * from './metadata.model'
3
3
  export * from './organization.model'
4
4
  export * from './translation.model'
5
5
  export * from './user-feedbacks.model'
6
+ export * from './flags.model'
@@ -294,6 +294,18 @@ export interface AssociatedRecord {
294
294
  associationType: AssociationType
295
295
  }
296
296
 
297
+ /**
298
+ * Nature of the link between a record and another one; the association type is
299
+ * only known for 'sibling' relations, as it is held by the declaring record.
300
+ */
301
+ export type RecordRelation = 'source' | 'sourceOf' | 'sibling' | 'associated'
302
+
303
+ export interface LinkedRecord {
304
+ record: CatalogRecord
305
+ relation: RecordRelation
306
+ associationType?: AssociationType
307
+ }
308
+
297
309
  export interface DatasetRecord extends BaseRecord {
298
310
  kind: 'dataset'
299
311
  status: RecordStatus
@@ -304,6 +316,7 @@ export interface DatasetRecord extends BaseRecord {
304
316
  spatialExtents: Array<DatasetSpatialExtent>
305
317
  temporalExtents: Array<DatasetTemporalExtent>
306
318
  spatialRepresentation?: SpatialRepresentationType
319
+ featureTypeDescriptions?: Array<DatasetFeatureType>
307
320
  }
308
321
 
309
322
  export interface ServiceEndpoint {
@@ -335,33 +348,28 @@ export interface ReuseRecord extends BaseRecord {
335
348
  temporalExtents: Array<DatasetTemporalExtent>
336
349
  }
337
350
 
351
+ export interface DatasetFeatureType {
352
+ name: string
353
+ label?: string
354
+ description?: string
355
+ attributes: DatasetFeatureAttribute[]
356
+ }
338
357
  export type DatasetFeatureCatalog = {
339
- featureTypes: Array<{
340
- name: string
341
- definition: string
342
- attributes: DatasetFeatureAttribute[]
343
- }>
358
+ featureTypes: Array<DatasetFeatureType>
344
359
  }
345
360
  export interface DatasetFeatureAttributeValue {
346
- code?: string
347
- definition?: string
361
+ value: string // empty string when the value has no code
348
362
  label?: string
363
+ description?: string
349
364
  }
350
365
  export interface DatasetFeatureAttribute {
351
366
  name: string
352
- definition: string
353
- type: string
354
- code: string
367
+ label?: string
368
+ description?: string
369
+ type?: string
370
+ code?: string
355
371
  values?: Array<DatasetFeatureAttributeValue>
356
372
  }
357
- export interface DatasetFeatureType {
358
- aliases: string
359
- code: string
360
- isAbstract: string
361
- typeName: string
362
- definition: string
363
- attributeTable: Array<DatasetFeatureAttribute>
364
- }
365
373
 
366
374
  export type ReuseType = 'application' | 'map' | 'other'
367
375
 
@@ -7,6 +7,8 @@ export interface TermsAggregationParams {
7
7
  limit: number
8
8
  sort: AggregationSort
9
9
  filter?: string
10
+ includeValues?: string[]
11
+ excludeValues?: string[]
10
12
  }
11
13
  export interface HistogramAggregationParams {
12
14
  type: 'histogram'
@@ -6,17 +6,39 @@ export type FieldFilterByRange = {
6
6
  start?: Date
7
7
  end?: Date
8
8
  }
9
+ // matches util/shared's BoundingBox; duplicated here to avoid a circular
10
+ // dependency (util/shared already depends on common/domain)
11
+ export type FieldFilterByBoundingBox = [number, number, number, number]
9
12
 
10
13
  export type FieldFilter =
11
14
  | FieldFilterByExpression
12
15
  | FieldFilterByValues
13
16
  | FieldFilterByRange
17
+ | FieldFilterByBoundingBox
14
18
  export type FieldFilters = Record<FieldName, FieldFilter>
15
19
 
16
20
  export type QueryString = {
17
21
  query_string: string
18
22
  }
19
23
  export type QueryRange = {
20
- range: Record<string, { format: string; gte: string; lte: string }>
24
+ range: Record<
25
+ string,
26
+ { format: string; gte?: string; lte?: string; relation?: string }
27
+ >
21
28
  }
22
- export type FilterQuery = Array<QueryString | QueryRange>
29
+ export type QueryGeoShape = {
30
+ geo_shape: {
31
+ geom: {
32
+ shape: { type: string; coordinates: number[][] }
33
+ relation: string
34
+ }
35
+ }
36
+ }
37
+ export type QueryBool = {
38
+ bool: {
39
+ filter: QueryRange[]
40
+ }
41
+ }
42
+ export type FilterQuery = Array<
43
+ QueryString | QueryRange | QueryGeoShape | QueryBool
44
+ >
@@ -28,6 +28,7 @@ export abstract class PlatformServiceInterface {
28
28
  abstract supportsAuthentication(): boolean
29
29
  abstract getMe(): Observable<UserModel>
30
30
  abstract isAnonymous(): Observable<boolean>
31
+ abstract isAdministrator(): Observable<boolean>
31
32
  abstract getUsers(): Observable<UserModel[]>
32
33
  abstract getUserPermissionsByGroup(): Observable<GroupModel[]>
33
34
  abstract getUsersByOrganization(
@@ -10,21 +10,22 @@ import {
10
10
  CatalogRecord,
11
11
  DatasetFeatureCatalog,
12
12
  LanguageCode,
13
+ LinkedRecord,
14
+ RecordFlag,
13
15
  } from '../model/record'
14
16
 
15
17
  export abstract class RecordsRepositoryInterface {
16
18
  abstract search(params: SearchParams): Observable<SearchResults>
17
19
  abstract getMatchesCount(filters: FieldFilters): Observable<number>
18
20
  abstract getRecord(uniqueIdentifier: string): Observable<CatalogRecord | null>
19
- abstract getFeatureCatalog(
21
+ abstract queryLinkedFeatureCatalog(
20
22
  record: CatalogRecord
21
23
  ): Observable<DatasetFeatureCatalog | null>
22
24
  abstract aggregate(params: AggregationsParams): Observable<Aggregations>
23
25
  abstract getSimilarRecords(
24
26
  similarTo: CatalogRecord
25
27
  ): Observable<CatalogRecord[]>
26
- abstract getSources(record: CatalogRecord): Observable<CatalogRecord[]>
27
- abstract getSourceOf(record: CatalogRecord): Observable<CatalogRecord[]>
28
+ abstract getLinkedRecords(record: CatalogRecord): Observable<LinkedRecord[]>
28
29
  abstract fuzzySearch(query: string): Observable<SearchResults>
29
30
  abstract canDuplicate(record: CatalogRecord): boolean
30
31
  abstract canDelete(record: CatalogRecord): Observable<boolean>
@@ -106,4 +107,22 @@ export abstract class RecordsRepositoryInterface {
106
107
  ): Observable<{ user: string; date: Date }>
107
108
  abstract getRecordPublicationStatus(uuid: string): Observable<boolean>
108
109
  abstract getApplicationLanguages(): Observable<LanguageCode[]>
110
+
111
+ /**
112
+ * Sets a given flag on a record. Flags are not part of the metadata document, which is why they are
113
+ * not part of the Record model.
114
+ */
115
+ abstract setRecordFlag(
116
+ uniqueIdentifier: string,
117
+ flagName: RecordFlag,
118
+ value: boolean
119
+ ): Observable<void>
120
+
121
+ /**
122
+ * Checks whether a given flag is enabled for a record.
123
+ */
124
+ abstract getRecordFlag(
125
+ uniqueIdentifier: string,
126
+ flagName: RecordFlag
127
+ ): Observable<boolean>
109
128
  }
@@ -164,69 +164,49 @@ As such, **it is not very interesting at all.**`,
164
164
  extras: {
165
165
  isPublishedToAll: true,
166
166
  edit: true,
167
- featureTypes: [
168
- {
169
- attributeTable: [
170
- {
171
- code: 'OBJECTID',
172
- name: 'OBJECTID',
173
- link: '',
174
- definition: 'Object identifier',
175
- type: 'OID',
176
- },
177
- {
178
- code: 'NOM',
179
- name: 'Nom',
180
- link: '',
181
- definition: 'Nom de la rue',
182
- type: 'String (48)',
183
- values: [
184
- {
185
- code: 'Pomme',
186
- label: 'Les Pommiers',
187
- description: 'Sous les pommiers',
188
- },
189
- {
190
- code: 'Cotton',
191
- label: 'Rue Cotton',
192
- description: 'Rue Cotton',
193
- },
194
- { code: "Passage de l'échiquier" },
195
- { description: 'Rue du Charlieu' },
196
- ],
197
- },
198
- {
199
- code: 'RUE',
200
- name: 'Rue',
201
- link: '',
202
- definition: '',
203
- type: 'String (50)',
204
- },
205
- ],
206
- code: '',
207
- aliases: '',
208
- typeName: "Catalogue d'attributs N°1",
209
- definition: 'Définition du catalogue d attributs N°1',
210
- isAbstract: 'false',
211
- },
212
- {
213
- attributeTable: [
214
- {
215
- code: 'UniqueObject',
216
- name: 'unique object ',
217
- link: '',
218
- definition: 'this is the only object of this catalog',
219
- type: 'String (50)',
220
- },
221
- ],
222
- code: '',
223
- aliases: '',
224
- typeName: "Catalogue d'attributs N°2",
225
- definition: 'Définition du catalogue d attributs N°2',
226
- isAbstract: 'false',
227
- },
228
- ],
229
167
  },
168
+ featureTypeDescriptions: [
169
+ {
170
+ name: "Catalogue d'attributs N°1",
171
+ description: 'Définition du catalogue d attributs N°1',
172
+ attributes: [
173
+ {
174
+ name: 'OBJECTID',
175
+ description: 'Object identifier',
176
+ code: 'OBJECTID',
177
+ type: 'OID',
178
+ },
179
+ {
180
+ name: 'Nom',
181
+ description: 'Nom de la rue',
182
+ code: 'NOM',
183
+ type: 'String (48)',
184
+ values: [
185
+ { value: 'Pomme', label: 'Les Pommiers' },
186
+ { value: 'Cotton', label: 'Rue Cotton' },
187
+ { value: "Passage de l'échiquier" },
188
+ ],
189
+ },
190
+ {
191
+ name: 'Rue',
192
+ code: 'RUE',
193
+ type: 'String (50)',
194
+ },
195
+ ],
196
+ },
197
+ {
198
+ name: "Catalogue d'attributs N°2",
199
+ description: 'Définition du catalogue d attributs N°2',
200
+ attributes: [
201
+ {
202
+ name: 'unique object ',
203
+ description: 'this is the only object of this catalog',
204
+ code: 'UniqueObject',
205
+ type: 'String (50)',
206
+ },
207
+ ],
208
+ },
209
+ ],
230
210
  },
231
211
  {
232
212
  uniqueIdentifier: '7d002c4c-92ef-4b9f-a568-d732f740b99e',
@@ -2,9 +2,9 @@ import {
2
2
  ChangeDetectionStrategy,
3
3
  ChangeDetectorRef,
4
4
  Component,
5
+ inject,
5
6
  Input,
6
7
  Output,
7
- inject,
8
8
  } from '@angular/core'
9
9
  import { marker } from '@biesbjerg/ngx-translate-extract-marker'
10
10
  import {
@@ -183,7 +183,7 @@ export class ChartViewComponent {
183
183
  yChoices$ = this.properties$.pipe(
184
184
  map((properties) =>
185
185
  properties
186
- .filter((prop) => prop.type === 'number' || prop.type === 'date')
186
+ .filter((prop) => prop.type === 'number')
187
187
  .map((prop) => ({ value: prop.name, label: prop.label || prop.name }))
188
188
  ),
189
189
  tap((choices) => {
@@ -222,6 +222,7 @@ export class ChartViewComponent {
222
222
  switchMap(([dataset, xProp, yProp, aggregation]) => {
223
223
  const fieldAgg: FieldAggregation =
224
224
  aggregation === 'count' ? ['count'] : [aggregation, yProp]
225
+ this.loading = true
225
226
  return dataset
226
227
  .groupBy(['distinct', xProp])
227
228
  .aggregate(fieldAgg)
@@ -2,11 +2,11 @@ import {
2
2
  ChangeDetectionStrategy,
3
3
  ChangeDetectorRef,
4
4
  Component,
5
+ inject,
5
6
  Input,
6
7
  OnDestroy,
7
8
  OnInit,
8
9
  ViewChild,
9
- inject,
10
10
  } from '@angular/core'
11
11
  import {
12
12
  DataTableComponent,
@@ -75,6 +75,7 @@ export class GeoTableViewComponent implements OnInit, OnDestroy {
75
75
  }
76
76
 
77
77
  private async initMapContext(): Promise<MapContext> {
78
+ this.dataset.load()
78
79
  this.dataset.selectAll()
79
80
  return {
80
81
  layers: [