geonetwork-ui 2.11.0-dev.5c2e5295e → 2.11.0-dev.62b98576f

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 +2654 -1669
  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 +119 -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 +30 -5
  116. package/translations/en.json +29 -4
  117. package/translations/es.json +27 -2
  118. package/translations/fr.json +34 -9
  119. package/translations/it.json +28 -3
  120. package/translations/nl.json +27 -2
  121. package/translations/pt.json +27 -2
  122. package/translations/sk.json +28 -3
  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
@@ -12,13 +12,13 @@ import {
12
12
  import { MatTooltipModule } from '@angular/material/tooltip'
13
13
  import {
14
14
  AssociatedRecord,
15
- CatalogRecordKeys,
16
15
  Constraint,
17
16
  DatasetTemporalExtent,
18
17
  GraphicOverview,
19
18
  Individual,
20
19
  Keyword,
21
20
  OnlineResource,
21
+ RecordFlag,
22
22
  RecordKind,
23
23
  UpdateFrequency,
24
24
  } from '../../../../../../../../libs/common/domain/src/lib/model/record'
@@ -36,9 +36,10 @@ import {
36
36
  FormFieldTemporalExtentsComponent,
37
37
  } from '.'
38
38
  import {
39
- FieldModelSpecifier,
40
39
  FormFieldComponentName,
41
40
  FormFieldConfig,
41
+ FormFieldModel,
42
+ FormFieldModelSpecifier,
42
43
  } from '../../../models'
43
44
  import { FormFieldAssociatedRecordsComponent } from './form-field-associated-records/form-field-associated-records.component'
44
45
  import { FormFieldContactsForResourceComponent } from './form-field-contacts-for-resource/form-field-contacts-for-resource.component'
@@ -57,6 +58,7 @@ import { FormFieldConstraintsComponent } from './form-field-constraints/form-fie
57
58
  import { TextFieldModule } from '@angular/cdk/text-field'
58
59
  import { FormFieldSpatialToggleComponent } from './form-field-spatial-toggle/form-field-spatial-toggle.component'
59
60
  import { FormFieldTopicsComponent } from './form-field-topics/form-field-topics.component'
61
+ import { FormFieldRecordFlagComponent } from './form-field-record-flags/form-field-record-flag-component'
60
62
 
61
63
  @Component({
62
64
  selector: 'gn-ui-form-field',
@@ -90,6 +92,7 @@ import { FormFieldTopicsComponent } from './form-field-topics/form-field-topics.
90
92
  FormFieldTopicsComponent,
91
93
  TextFieldModule,
92
94
  NgIconComponent,
95
+ FormFieldRecordFlagComponent,
93
96
  ],
94
97
  providers: [provideIcons({ matEditOutline, matHelpOutline })],
95
98
  hostDirectives: [FieldFocusDirective],
@@ -97,8 +100,8 @@ import { FormFieldTopicsComponent } from './form-field-topics/form-field-topics.
97
100
  export class FormFieldComponent {
98
101
  @Input() uniqueIdentifier: string
99
102
  @Input() recordKind: RecordKind
100
- @Input() model: CatalogRecordKeys
101
- @Input() modelSpecifier: FieldModelSpecifier
103
+ @Input() model: FormFieldModel
104
+ @Input() modelSpecifier: FormFieldModelSpecifier
102
105
  @Input() componentName: FormFieldComponentName
103
106
 
104
107
  @Input() config: FormFieldConfig
@@ -126,6 +129,7 @@ export class FormFieldComponent {
126
129
  this.model === 'legalConstraints' ||
127
130
  this.model === 'securityConstraints' ||
128
131
  this.model === 'otherConstraints' ||
132
+ this.model === 'flags' ||
129
133
  this.componentName === 'form-field-constraints-shortcuts'
130
134
  )
131
135
  }
@@ -172,6 +176,9 @@ export class FormFieldComponent {
172
176
  }>
173
177
  return identifiers?.[0]?.code || ''
174
178
  }
179
+ get recordFlag() {
180
+ return this.modelSpecifier?.replace(/^flags:/, '') as RecordFlag
181
+ }
175
182
 
176
183
  handleResourceIdentifierChange(code: string) {
177
184
  const identifiers = this.value as Array<{
@@ -11,7 +11,7 @@ import {
11
11
  viewChildren,
12
12
  } from '@angular/core'
13
13
  import { EditorFacade } from '../../+state/editor.facade'
14
- import { EditorFieldValue } from '../../models'
14
+ import { EditorFieldValue, FormFieldModel } from '../../models'
15
15
  import { FieldFocusDirective, FormFieldComponent } from './form-field'
16
16
  import { TranslateDirective } from '@ngx-translate/core'
17
17
  import {
@@ -24,6 +24,7 @@ import { switchMap } from 'rxjs/operators'
24
24
  import { toSignal } from '@angular/core/rxjs-interop'
25
25
  import { evaluate, isExpression } from '../../expressions'
26
26
  import { NotificationsService } from '../../../../../../../libs/feature/notifications/src'
27
+ import { PlatformServiceInterface } from '../../../../../../../libs/common/domain/src/lib/platform.service.interface'
27
28
 
28
29
  @Component({
29
30
  selector: 'gn-ui-record-form',
@@ -41,6 +42,7 @@ import { NotificationsService } from '../../../../../../../libs/feature/notifica
41
42
  export class RecordFormComponent implements OnInit, OnDestroy {
42
43
  facade = inject(EditorFacade)
43
44
  notifications = inject(NotificationsService)
45
+ platform = inject(PlatformServiceInterface)
44
46
  subscription = new Subscription()
45
47
 
46
48
  recordUniqueIdentifier$ = this.facade.record$.pipe(
@@ -90,8 +92,8 @@ export class RecordFormComponent implements OnInit, OnDestroy {
90
92
  this.subscription.unsubscribe()
91
93
  }
92
94
 
93
- handleFieldValueChange(model: CatalogRecordKeys, newValue: EditorFieldValue) {
94
- if (!model) {
95
+ handleFieldValueChange(model: FormFieldModel, newValue: EditorFieldValue) {
96
+ if (!model || model === 'flags') {
95
97
  return
96
98
  }
97
99
  this.facade.updateRecordField(model, newValue)
@@ -122,6 +124,8 @@ export class RecordFormComponent implements OnInit, OnDestroy {
122
124
  }
123
125
 
124
126
  private recordSignal = toSignal(this.facade.record$, { requireSync: true })
127
+ private userSignal = toSignal(this.platform.getMe())
128
+ private isAdminSignal = toSignal(this.platform.isAdministrator())
125
129
  private expressionCache = new Map<string, Signal<EditorFieldValue>>()
126
130
 
127
131
  // only compiles the expression into an evaluator the first time;
@@ -149,7 +153,17 @@ ${errors.map((err) => `> ${err}`).join('\n')}`)
149
153
  }
150
154
  this.expressionCache.set(
151
155
  expression,
152
- computed(() => evaluator({ globals: { record: this.recordSignal() } }))
156
+ computed(() =>
157
+ evaluator({
158
+ globals: {
159
+ record: this.recordSignal(),
160
+ user: {
161
+ ...this.userSignal(),
162
+ isAdmin: this.isAdminSignal(),
163
+ },
164
+ },
165
+ })
166
+ )
153
167
  )
154
168
  return this.expressionCache.get(expression)
155
169
  }
@@ -17,10 +17,14 @@ const TOKEN_OPERATOR_LOGICAL = ['==', '!=']
17
17
  const TOKEN_STRING_LITERAL = ["'", '"']
18
18
  const TOKEN_GROUP_START = '('
19
19
  const TOKEN_GROUP_END = ')'
20
+ const TOKEN_OPERATOR_BOOLEAN = ['&&', '||']
21
+ const TOKEN_OPERATOR_NOT = '!'
20
22
 
21
23
  // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_precedence
22
24
  const OPERATORS_BY_PRECEDENCE: string[][] = [
23
25
  [TOKEN_OPERATOR_TERNARY_FIRST, TOKEN_OPERATOR_TERNARY_SECOND],
26
+ TOKEN_OPERATOR_BOOLEAN,
27
+ [TOKEN_OPERATOR_NOT],
24
28
  TOKEN_OPERATOR_LOGICAL,
25
29
  ]
26
30
  const ALL_OPERATORS = OPERATORS_BY_PRECEDENCE.flat()
@@ -161,6 +165,18 @@ function evaluateInternal(
161
165
  continue
162
166
  }
163
167
 
168
+ // BOOLEAN LITERAL
169
+ const isBooleanLiteral =
170
+ readNext(expression, pos, 4) === 'true' ||
171
+ readNext(expression, pos, 5) === 'false'
172
+ if (isBooleanLiteral) {
173
+ const literal = readNext(expression, pos, 4) === 'true' ? 'true' : 'false'
174
+ pos += literal.length
175
+ const booleanLiteral = literal === 'true'
176
+ currentEvaluator = () => booleanLiteral
177
+ continue
178
+ }
179
+
164
180
  // SYMBOL (NAME)
165
181
  const isSymbol = /[a-zA-Z]/.test(readNext(expression, pos))
166
182
  if (isSymbol) {
@@ -291,6 +307,57 @@ function evaluateInternal(
291
307
  continue
292
308
  }
293
309
 
310
+ // BOOLEAN OPERATORS
311
+ const isBooleanOperator = TOKEN_OPERATOR_BOOLEAN.some(
312
+ (token) => readNext(expression, pos, token.length) === token
313
+ )
314
+ if (isBooleanOperator) {
315
+ const matchingOperator = TOKEN_OPERATOR_BOOLEAN.find(
316
+ (token) => readNext(expression, pos, token.length) === token
317
+ )
318
+ const isAnd = matchingOperator === '&&'
319
+ pos += matchingOperator.length
320
+ const leftEvaluator = currentEvaluator
321
+ const rightExpression = readUntilNextOperator(
322
+ expression,
323
+ pos,
324
+ matchingOperator
325
+ )
326
+ pos += rightExpression.length
327
+ const rightEvaluator = evaluateInternal(
328
+ rightExpression,
329
+ currentContext
330
+ ).evaluator
331
+
332
+ currentEvaluator = (context) => {
333
+ return isAnd
334
+ ? Boolean(leftEvaluator(context) && rightEvaluator(context))
335
+ : Boolean(leftEvaluator(context) || rightEvaluator(context))
336
+ }
337
+ continue
338
+ }
339
+
340
+ // PREFIX OPERATORS
341
+ const isNotOperator = readNext(expression, pos) === TOKEN_OPERATOR_NOT
342
+ if (isNotOperator) {
343
+ pos++
344
+ const operandExpression = readUntilNextOperator(
345
+ expression,
346
+ pos,
347
+ TOKEN_OPERATOR_NOT
348
+ )
349
+ pos += operandExpression.length
350
+ const operandEvaluator = evaluateInternal(
351
+ operandExpression,
352
+ currentContext
353
+ ).evaluator
354
+
355
+ currentEvaluator = (context) => {
356
+ return !operandEvaluator(context)
357
+ }
358
+ continue
359
+ }
360
+
294
361
  // TERNARY OPERATOR
295
362
  const isTernary = readNext(expression, pos) === TOKEN_OPERATOR_TERNARY_FIRST
296
363
  if (isTernary) {
@@ -37,6 +37,19 @@ export const DEFAULT_CONFIGURATION: EditorConfig = {
37
37
  labelKey: marker('editor.record.form.field.title'),
38
38
  },
39
39
  },
40
+ {
41
+ model: 'flags',
42
+ modelSpecifier: 'flags:IS_REFERENCE_DATASET',
43
+ formFieldConfig: {
44
+ labelKey: marker(
45
+ 'editor.record.form.field.flags.IS_REFERENCE_DATASET'
46
+ ),
47
+ hintKey: marker(
48
+ 'editor.record.form.field.hint.flags.IS_REFERENCE_DATASET'
49
+ ),
50
+ },
51
+ hidden: '${record.kind != "dataset" || !user.isAdmin}',
52
+ },
40
53
  {
41
54
  model: 'abstract',
42
55
  formFieldConfig: {
@@ -1,4 +1,7 @@
1
- import { CatalogRecordKeys } from '../../../../../../libs/common/domain/src/lib/model/record'
1
+ import {
2
+ CatalogRecordKeys,
3
+ RecordFlag,
4
+ } from '../../../../../../libs/common/domain/src/lib/model/record'
2
5
 
3
6
  // Expressions should be enclosed in `${}` to be recognized as such
4
7
  // eg. ${dateNow()}
@@ -15,6 +18,8 @@ export interface FormFieldConfig {
15
18
  invalidHintKey?: string
16
19
  }
17
20
 
21
+ export type FormFieldModel = CatalogRecordKeys | 'flags'
22
+
18
23
  // Specifiers let us use specific components
19
24
  // This is used for instance to target only certain online resources in a field
20
25
  type OnlineLinkResourceSpecifier = `onlineResourceType:link`
@@ -25,11 +30,12 @@ type OnlineSingleLinkResourceSpecifier = `onlineResourceType:singleLink`
25
30
  // When set on the `contacts` field, contacts are rendered as editable detail
26
31
  // fields (ContactDetailsFormComponent) instead of cards (ContactCardComponent)
27
32
  type EditableContactDetailsSpecifier = `contact:editableDetails`
28
- export type FieldModelSpecifier =
33
+ export type FormFieldModelSpecifier =
29
34
  | OnlineLinkResourceSpecifier
30
35
  | DatasetDistributionsSpecifier
31
36
  | OnlineSingleLinkResourceSpecifier
32
37
  | EditableContactDetailsSpecifier
38
+ | `flags:${RecordFlag}`
33
39
 
34
40
  export type FormFieldComponentName =
35
41
  | 'form-field-constraints-shortcuts'
@@ -37,8 +43,8 @@ export type FormFieldComponentName =
37
43
 
38
44
  export interface EditorFieldIdentification {
39
45
  // name of the target field in the record; will not change the record directly if not defined
40
- model?: CatalogRecordKeys
41
- modelSpecifier?: FieldModelSpecifier
46
+ model?: FormFieldModel
47
+ modelSpecifier?: FormFieldModelSpecifier
42
48
 
43
49
  // if no model is given, a component can be shown instead
44
50
  componentName?: FormFieldComponentName
@@ -6,8 +6,6 @@ export * from './lib/feature-map.module'
6
6
  export * from './lib/map-state-container/map-state-container.component'
7
7
  export * from './lib/constant'
8
8
  export * from './lib/utils'
9
- export * from './lib/style'
10
9
  export * from './lib/layers-panel/layers-panel.component'
11
10
  export * from './lib/add-layer-from-catalog/add-layer-from-catalog.component'
12
11
  export * from './lib/add-layer-from-catalog/add-layer-record-preview/add-layer-record-preview.component'
13
- export * from './lib/geocoding/geocoding.component'
@@ -5,6 +5,7 @@
5
5
  (fileChange)="handleFileChange($event)"
6
6
  [accept]="acceptedMimeType.join(',')"
7
7
  [placeholder]="'map.addFromFile.placeholder' | translate"
8
+ textClass="text-gray-900 pl-2 py-2"
8
9
  class="placeholder-grey"
9
10
  ></gn-ui-drag-and-drop-file-input>
10
11
  </div>
@@ -2,18 +2,11 @@ import { NgModule } from '@angular/core'
2
2
  import { StoreModule } from '@ngrx/store'
3
3
  import * as fromMap from './+state/map.reducer'
4
4
  import { MapFacade } from './+state/map.facade'
5
- import { GEOCODING_PROVIDER, GeocodingProvider } from './geocoding.service'
6
5
 
7
6
  @NgModule({
8
7
  imports: [
9
8
  StoreModule.forFeature(fromMap.MAP_FEATURE_KEY, fromMap.mapReducer),
10
9
  ],
11
- providers: [
12
- MapFacade,
13
- {
14
- provide: GEOCODING_PROVIDER,
15
- useValue: ['geonames', { maxRows: 5 }] as GeocodingProvider,
16
- },
17
- ],
10
+ providers: [MapFacade],
18
11
  })
19
12
  export class FeatureMapModule {}
@@ -18,10 +18,12 @@ export class NotificationsService {
18
18
  error && console.error(error)
19
19
  const id = Math.floor(Math.random() * 1000000)
20
20
  this.notifications$.next([...this.notifications$.value, { ...content, id }])
21
- if (typeof timeoutMs === 'undefined') return
22
- setTimeout(() => {
23
- this.removeNotificationById(id)
24
- }, timeoutMs)
21
+ if (typeof timeoutMs !== 'undefined') {
22
+ setTimeout(() => {
23
+ this.removeNotificationById(id)
24
+ }, timeoutMs)
25
+ }
26
+ return id
25
27
  }
26
28
 
27
29
  removeNotificationById(id: number) {
@@ -33,7 +33,6 @@ import { RecordsRepositoryInterface } from '../../../../../../libs/common/domain
33
33
  import { NOT_KNOWN_CONSTRAINT } from '../../../../../../libs/feature/editor/src'
34
34
  import { NotificationsService } from '../../../../../../libs/feature/notifications/src'
35
35
  import { ButtonComponent, TextInputComponent } from '../../../../../../libs/ui/inputs/src'
36
- import { getOptionalEditorConfig } from '../../../../../../libs/util/app-config/src'
37
36
  import { NgIcon, provideIcons, provideNgIconsConfig } from '@ng-icons/core'
38
37
  import { iconoirAppWindow, iconoirPlusCircle } from '@ng-icons/iconoir'
39
38
  import { matCloseOutline } from '@ng-icons/material-icons/outline'
@@ -48,6 +47,10 @@ marker('notify.reuse.form.error.title')
48
47
  marker('notify.reuse.form.error.body')
49
48
 
50
49
  export const REUSE_FORM_URL = new InjectionToken<string>('reuseFormUrl')
50
+ // language assigned to the created reuse record; falls back to the current UI language
51
+ export const NEW_RECORD_DEFAULT_LANGUAGE = new InjectionToken<string>(
52
+ 'newRecordDefaultLanguage'
53
+ )
51
54
 
52
55
  @Component({
53
56
  selector: 'gn-ui-notify-reuse-form',
@@ -86,6 +89,9 @@ export class NotifyReuseFormComponent implements OnDestroy {
86
89
  private readonly notificationsService = inject(NotificationsService)
87
90
  private readonly platformServiceInterface = inject(PlatformServiceInterface)
88
91
  reuseFormUrl = inject(REUSE_FORM_URL, { optional: true })
92
+ private newRecordDefaultLanguage = inject(NEW_RECORD_DEFAULT_LANGUAGE, {
93
+ optional: true,
94
+ })
89
95
  private locationStrategy = inject(LocationStrategy)
90
96
 
91
97
  me = toSignal(this.platformServiceInterface.getMe())
@@ -158,8 +164,7 @@ export class NotifyReuseFormComponent implements OnDestroy {
158
164
  submit() {
159
165
  if (!this.isFormValid()) return
160
166
  const defaultLang =
161
- getOptionalEditorConfig()?.NEW_RECORD_DEFAULT_LANGUAGE ??
162
- this.translate.currentLang
167
+ this.newRecordDefaultLanguage ?? this.translate.currentLang
163
168
  const onlineResource: OnlineLinkResource = {
164
169
  type: 'link',
165
170
  url: new URL(this.url()),
@@ -3,6 +3,7 @@ import { createAction, props } from '@ngrx/store'
3
3
  import {
4
4
  CatalogRecord,
5
5
  DatasetFeatureCatalog,
6
+ LinkedRecord,
6
7
  UserFeedback,
7
8
  } from '../../../../../../libs/common/domain/src/lib/model/record'
8
9
 
@@ -54,14 +55,9 @@ export const setRelated = createAction(
54
55
  props<{ related: CatalogRecord[] }>()
55
56
  )
56
57
 
57
- export const setSources = createAction(
58
- '[Metadata view] Set sources',
59
- props<{ sources: CatalogRecord[] }>()
60
- )
61
-
62
- export const setSourceOf = createAction(
63
- '[Metadata view] Set has sources',
64
- props<{ sourceOf: CatalogRecord[] }>()
58
+ export const setLinkedRecords = createAction(
59
+ '[Metadata view] Set associated records',
60
+ props<{ linkedRecords: LinkedRecord[] }>()
65
61
  )
66
62
 
67
63
  /*
@@ -40,7 +40,9 @@ export class MdViewEffects {
40
40
  this.actions$.pipe(
41
41
  ofType(MdViewActions.loadFullMetadataSuccess),
42
42
  filter(({ full }) => full !== undefined),
43
- switchMap(({ full }) => this.recordsRepository.getFeatureCatalog(full)),
43
+ switchMap(({ full }) =>
44
+ this.recordsRepository.queryLinkedFeatureCatalog(full)
45
+ ),
44
46
  map((featureCatalog) =>
45
47
  MdViewActions.loadFeatureCatalogSuccess({
46
48
  datasetCatalog: featureCatalog,
@@ -70,25 +72,16 @@ export class MdViewEffects {
70
72
  )
71
73
  )
72
74
 
73
- loadSources$ = createEffect(() =>
74
- this.actions$.pipe(
75
- ofType(MdViewActions.loadFullMetadataSuccess),
76
- switchMap(({ full }) => this.recordsRepository.getSources(full)),
77
- map((sources) => {
78
- return MdViewActions.setSources({ sources })
79
- }),
80
- catchError(() => of(MdViewActions.setSources({ sources: null })))
81
- )
82
- )
83
-
84
- loadSourceOf$ = createEffect(() =>
75
+ loadLinkedRecords$ = createEffect(() =>
85
76
  this.actions$.pipe(
86
77
  ofType(MdViewActions.loadFullMetadataSuccess),
87
- switchMap(({ full }) => this.recordsRepository.getSourceOf(full)),
88
- map((sourceOf) => {
89
- return MdViewActions.setSourceOf({ sourceOf })
78
+ switchMap(({ full }) => this.recordsRepository.getLinkedRecords(full)),
79
+ map((linkedRecords) => {
80
+ return MdViewActions.setLinkedRecords({ linkedRecords })
90
81
  }),
91
- catchError(() => of(MdViewActions.setSourceOf({ sourceOf: null })))
82
+ catchError(() =>
83
+ of(MdViewActions.setLinkedRecords({ linkedRecords: null }))
84
+ )
92
85
  )
93
86
  )
94
87
 
@@ -74,9 +74,7 @@ export class MdViewFacade {
74
74
 
75
75
  related$ = this.store.pipe(select(MdViewSelectors.getRelated))
76
76
 
77
- sources$ = this.store.pipe(select(MdViewSelectors.getSources))
78
-
79
- sourceOf$ = this.store.pipe(select(MdViewSelectors.getSourceOf))
77
+ linkedRecords$ = this.store.pipe(select(MdViewSelectors.getLinkedRecords))
80
78
 
81
79
  chartConfig$ = this.store.pipe(select(MdViewSelectors.getChartConfig))
82
80
 
@@ -164,7 +162,7 @@ export class MdViewFacade {
164
162
  link.accessServiceProtocol === 'ogcFeatures'
165
163
  ) {
166
164
  return from(
167
- this.dataService.getItemsFromOgcApi(link.url.href, 1)
165
+ this.dataService.getItemsFromOgcApi(link.url.href, link.name, 1)
168
166
  ).pipe(
169
167
  map((collectionRecords: OgcApiRecord[]) => {
170
168
  return collectionRecords &&
@@ -4,6 +4,7 @@ import { DatavizChartConfigModel } from '../../../../../../libs/common/domain/sr
4
4
  import {
5
5
  CatalogRecord,
6
6
  DatasetFeatureCatalog,
7
+ LinkedRecord,
7
8
  UserFeedback,
8
9
  } from '../../../../../../libs/common/domain/src/lib/model/record'
9
10
 
@@ -14,8 +15,7 @@ export interface MetadataViewState {
14
15
  error: { notFound?: boolean; otherError?: string } | null
15
16
  metadata?: Partial<CatalogRecord>
16
17
  related?: CatalogRecord[]
17
- sources?: CatalogRecord[]
18
- sourceOf?: CatalogRecord[]
18
+ linkedRecords?: LinkedRecord[]
19
19
  userFeedbacks?: UserFeedback[]
20
20
  allUserFeedbacksLoading: boolean
21
21
  addUserFeedbackLoading: boolean
@@ -77,14 +77,9 @@ const metadataViewReducer = createReducer(
77
77
  related,
78
78
  })),
79
79
 
80
- on(MetadataViewActions.setSources, (state, { sources }) => ({
80
+ on(MetadataViewActions.setLinkedRecords, (state, { linkedRecords }) => ({
81
81
  ...state,
82
- sources,
83
- })),
84
-
85
- on(MetadataViewActions.setSourceOf, (state, { sourceOf }) => ({
86
- ...state,
87
- sourceOf,
82
+ linkedRecords,
88
83
  })),
89
84
 
90
85
  /*
@@ -41,14 +41,9 @@ export const getRelated = createSelector(
41
41
  (state: MetadataViewState) => state.related
42
42
  )
43
43
 
44
- export const getSources = createSelector(
44
+ export const getLinkedRecords = createSelector(
45
45
  getMdViewState,
46
- (state: MetadataViewState) => state.sources
47
- )
48
-
49
- export const getSourceOf = createSelector(
50
- getMdViewState,
51
- (state: MetadataViewState) => state.sourceOf
46
+ (state: MetadataViewState) => state.linkedRecords
52
47
  )
53
48
  /*
54
49
  Metadata selectors
@@ -22,7 +22,7 @@ export function flattenQueryParams(
22
22
  const start = (flattened[key] as DateRange).start
23
23
  const end = (flattened[key] as DateRange).end
24
24
  flattened[key] = [
25
- `${start ? formatDate(start) : ''}..${formatDate(end) || ''}`,
25
+ `${start ? formatDate(start) : ''}..${end ? formatDate(end) : ''}`,
26
26
  ]
27
27
  }
28
28
  }
@@ -1,4 +1,6 @@
1
1
  export * from './lib/feature-search.module'
2
+ export * from './lib/geocoding/geocoding.service'
3
+ export * from './lib/location-search/location-search.component'
2
4
  export * from './lib/filter-geometry.token'
3
5
  export * from './lib/record-url.token'
4
6
  export * from './lib/state/actions'
@@ -1,11 +1,25 @@
1
1
  @if (fieldType === 'dateRange') {
2
2
  <gn-ui-date-range-dropdown
3
3
  [title]="title"
4
- [startDate]="(selectedDateRange$ | async)?.start"
5
- [endDate]="(selectedDateRange$ | async)?.end"
6
- (startDateChange)="onStartDateChange($event)"
7
- (endDateChange)="onEndDateChange($event)"
4
+ [dateRange]="(selectedDateRange$ | async) ?? {}"
5
+ (dateRangeChange)="onDateRangeChange($event)"
6
+ [attr.data-cy-field]="fieldName"
8
7
  ></gn-ui-date-range-dropdown>
8
+ } @else if (fieldType === 'spatialExtent') {
9
+ <gn-ui-spatial-extent-dropdown
10
+ [title]="title"
11
+ [initialBbox]="(selectedBoundingBox$ | async) ?? null"
12
+ [maxFileSizeMb]="spatialExtentMaxFileSize"
13
+ (bboxChange)="onBboxChange($event)"
14
+ (errorChange)="onSpatialExtentError($event)"
15
+ [attr.data-cy-field]="fieldName"
16
+ >
17
+ <gn-ui-location-search
18
+ [placeholder]="'search.filters.spatialExtent.searchLocation' | translate"
19
+ (bboxSelected)="onLocationSelected($event)"
20
+ data-cy="locationSearch"
21
+ ></gn-ui-location-search>
22
+ </gn-ui-spatial-extent-dropdown>
9
23
  } @else {
10
24
  <gn-ui-dropdown-multiselect
11
25
  class="w-full"