geonetwork-ui 2.4.0 → 2.4.1-dev.2804667fa

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 (153) hide show
  1. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/utils/update-frequency.mapper.mjs +6 -62
  2. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +19 -1
  3. package/esm2022/libs/api/repository/src/lib/gn4/gn4-repository.mjs +24 -17
  4. package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +27 -1
  5. package/esm2022/libs/common/domain/src/lib/repository/records-repository.interface.mjs +1 -1
  6. package/esm2022/libs/data-access/gn4/src/openapi/api/records.api.service.mjs +7 -1
  7. package/esm2022/libs/feature/editor/src/lib/+state/editor.actions.mjs +2 -1
  8. package/esm2022/libs/feature/editor/src/lib/+state/editor.effects.mjs +15 -14
  9. package/esm2022/libs/feature/editor/src/lib/+state/editor.facade.mjs +10 -4
  10. package/esm2022/libs/feature/editor/src/lib/+state/editor.reducer.mjs +6 -4
  11. package/esm2022/libs/feature/editor/src/lib/+state/editor.selectors.mjs +2 -2
  12. package/esm2022/libs/feature/editor/src/lib/components/constraint-card/constraint-card.component.mjs +3 -3
  13. package/esm2022/libs/feature/editor/src/lib/components/generic-keywords/generic-keywords.component.mjs +3 -3
  14. package/esm2022/libs/feature/editor/src/lib/components/import-record/import-record.component.mjs +2 -2
  15. package/esm2022/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.mjs +45 -9
  16. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.mjs +7 -12
  17. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.mjs +16 -12
  18. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.mjs +7 -13
  19. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.mjs +3 -3
  20. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.mjs +36 -60
  21. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.mjs +3 -3
  22. package/esm2022/libs/feature/editor/src/lib/components/record-form/record-form.component.mjs +3 -3
  23. package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +11 -15
  24. package/esm2022/libs/feature/editor/src/lib/services/editor.service.mjs +9 -5
  25. package/esm2022/libs/feature/search/src/lib/results-table/results-table-container.component.mjs +3 -4
  26. package/esm2022/libs/ui/dataviz/src/lib/figure/figure.component.mjs +3 -3
  27. package/esm2022/libs/ui/elements/src/index.mjs +3 -2
  28. package/esm2022/libs/ui/elements/src/lib/image-input/image-input.component.mjs +213 -0
  29. package/esm2022/libs/ui/elements/src/lib/ui-elements.module.mjs +19 -13
  30. package/esm2022/libs/ui/inputs/src/index.mjs +5 -6
  31. package/esm2022/libs/ui/inputs/src/lib/button/button.component.mjs +2 -1
  32. package/esm2022/libs/ui/inputs/src/lib/file-input/file-input.component.mjs +5 -5
  33. package/esm2022/libs/ui/inputs/src/lib/ui-inputs.module.mjs +19 -25
  34. package/esm2022/libs/ui/inputs/src/lib/url-input/url-input.component.mjs +6 -6
  35. package/esm2022/libs/ui/search/src/lib/results-table/results-table.component.mjs +3 -6
  36. package/esm2022/translations/de.json +47 -17
  37. package/esm2022/translations/en.json +27 -16
  38. package/esm2022/translations/es.json +45 -15
  39. package/esm2022/translations/fr.json +31 -20
  40. package/esm2022/translations/it.json +261 -231
  41. package/esm2022/translations/nl.json +45 -15
  42. package/esm2022/translations/pt.json +45 -15
  43. package/fesm2022/geonetwork-ui.mjs +1352 -1160
  44. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  45. package/libs/api/metadata-converter/src/lib/iso19139/utils/update-frequency.mapper.d.ts.map +1 -1
  46. package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
  47. package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts +3 -3
  48. package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts.map +1 -1
  49. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +2 -1
  50. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
  51. package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts +3 -3
  52. package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts.map +1 -1
  53. package/libs/data-access/gn4/src/openapi/api/records.api.service.d.ts +3 -0
  54. package/libs/data-access/gn4/src/openapi/api/records.api.service.d.ts.map +1 -1
  55. package/libs/feature/editor/src/lib/+state/editor.actions.d.ts +5 -2
  56. package/libs/feature/editor/src/lib/+state/editor.actions.d.ts.map +1 -1
  57. package/libs/feature/editor/src/lib/+state/editor.effects.d.ts +3 -2
  58. package/libs/feature/editor/src/lib/+state/editor.effects.d.ts.map +1 -1
  59. package/libs/feature/editor/src/lib/+state/editor.facade.d.ts +3 -2
  60. package/libs/feature/editor/src/lib/+state/editor.facade.d.ts.map +1 -1
  61. package/libs/feature/editor/src/lib/+state/editor.reducer.d.ts +1 -1
  62. package/libs/feature/editor/src/lib/+state/editor.reducer.d.ts.map +1 -1
  63. package/libs/feature/editor/src/lib/+state/editor.selectors.d.ts +1 -1
  64. package/libs/feature/editor/src/lib/+state/editor.selectors.d.ts.map +1 -1
  65. package/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.d.ts +11 -2
  66. package/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.d.ts.map +1 -1
  67. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.d.ts +1 -4
  68. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.d.ts.map +1 -1
  69. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.d.ts +5 -4
  70. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.d.ts.map +1 -1
  71. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.d.ts +1 -4
  72. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.d.ts.map +1 -1
  73. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.d.ts +1 -1
  74. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.d.ts.map +1 -1
  75. package/libs/feature/editor/src/lib/fields.config.d.ts.map +1 -1
  76. package/libs/feature/editor/src/lib/services/editor.service.d.ts +1 -1
  77. package/libs/feature/editor/src/lib/services/editor.service.d.ts.map +1 -1
  78. package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts +0 -1
  79. package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts.map +1 -1
  80. package/libs/ui/elements/src/index.d.ts +2 -1
  81. package/libs/ui/elements/src/index.d.ts.map +1 -1
  82. package/libs/ui/elements/src/lib/image-input/image-input.component.d.ts.map +1 -0
  83. package/libs/ui/elements/src/lib/ui-elements.module.d.ts +2 -1
  84. package/libs/ui/elements/src/lib/ui-elements.module.d.ts.map +1 -1
  85. package/libs/ui/inputs/src/index.d.ts +4 -5
  86. package/libs/ui/inputs/src/index.d.ts.map +1 -1
  87. package/libs/ui/inputs/src/lib/button/button.component.d.ts +1 -1
  88. package/libs/ui/inputs/src/lib/button/button.component.d.ts.map +1 -1
  89. package/libs/ui/inputs/src/lib/file-input/file-input.component.d.ts +1 -1
  90. package/libs/ui/inputs/src/lib/file-input/file-input.component.d.ts.map +1 -1
  91. package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts +6 -7
  92. package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts.map +1 -1
  93. package/libs/ui/inputs/src/lib/url-input/url-input.component.d.ts +2 -2
  94. package/libs/ui/inputs/src/lib/url-input/url-input.component.d.ts.map +1 -1
  95. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts +1 -2
  96. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts.map +1 -1
  97. package/package.json +1 -1
  98. package/src/libs/api/metadata-converter/src/lib/iso19139/utils/update-frequency.mapper.ts +9 -62
  99. package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +18 -0
  100. package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +47 -28
  101. package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +29 -7
  102. package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +4 -3
  103. package/src/libs/common/fixtures/src/lib/records.fixtures.ts +162 -0
  104. package/src/libs/data-access/gn4/src/openapi/api/records.api.service.ts +24 -4
  105. package/src/libs/feature/editor/src/lib/+state/editor.actions.ts +5 -1
  106. package/src/libs/feature/editor/src/lib/+state/editor.effects.ts +42 -31
  107. package/src/libs/feature/editor/src/lib/+state/editor.facade.ts +10 -9
  108. package/src/libs/feature/editor/src/lib/+state/editor.reducer.ts +12 -12
  109. package/src/libs/feature/editor/src/lib/+state/editor.selectors.ts +5 -5
  110. package/src/libs/feature/editor/src/lib/components/constraint-card/constraint-card.component.html +1 -1
  111. package/src/libs/feature/editor/src/lib/components/generic-keywords/generic-keywords.component.html +1 -1
  112. package/src/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.html +31 -6
  113. package/src/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.ts +47 -2
  114. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.html +1 -10
  115. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.ts +1 -7
  116. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.html +3 -18
  117. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.ts +12 -8
  118. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.html +0 -9
  119. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.ts +3 -9
  120. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.html +6 -6
  121. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.ts +46 -74
  122. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +4 -1
  123. package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.html +3 -6
  124. package/src/libs/feature/editor/src/lib/fields.config.ts +10 -14
  125. package/src/libs/feature/editor/src/lib/services/editor.service.ts +18 -16
  126. package/src/libs/feature/search/src/lib/results-table/results-table-container.component.html +0 -1
  127. package/src/libs/feature/search/src/lib/results-table/results-table-container.component.ts +0 -3
  128. package/src/libs/ui/dataviz/src/lib/figure/figure.component.html +1 -0
  129. package/src/libs/ui/elements/src/index.ts +2 -1
  130. package/src/libs/ui/{inputs → elements}/src/lib/image-input/image-input.component.html +4 -19
  131. package/src/libs/ui/{inputs → elements}/src/lib/image-input/image-input.component.ts +13 -9
  132. package/src/libs/ui/elements/src/lib/ui-elements.module.ts +13 -10
  133. package/src/libs/ui/inputs/src/index.ts +4 -5
  134. package/src/libs/ui/inputs/src/lib/button/button.component.ts +2 -1
  135. package/src/libs/ui/inputs/src/lib/file-input/file-input.component.ts +1 -1
  136. package/src/libs/ui/inputs/src/lib/ui-inputs.module.ts +22 -25
  137. package/src/libs/ui/inputs/src/lib/url-input/url-input.component.html +5 -3
  138. package/src/libs/ui/inputs/src/lib/url-input/url-input.component.ts +1 -1
  139. package/src/libs/ui/search/src/lib/results-table/results-table.component.html +8 -4
  140. package/src/libs/ui/search/src/lib/results-table/results-table.component.ts +0 -1
  141. package/translations/de.json +47 -17
  142. package/translations/en.json +27 -16
  143. package/translations/es.json +45 -15
  144. package/translations/fr.json +31 -20
  145. package/translations/it.json +261 -231
  146. package/translations/nl.json +45 -15
  147. package/translations/pt.json +45 -15
  148. package/translations/sk.json +45 -15
  149. package/esm2022/libs/ui/inputs/src/lib/image-input/image-input.component.mjs +0 -214
  150. package/libs/ui/inputs/src/lib/image-input/image-input.component.d.ts.map +0 -1
  151. package/src/libs/api/metadata-converter/src/lib/dcat-ap/utils/update-frequency.mapper.ts +0 -67
  152. /package/libs/ui/{inputs → elements}/src/lib/image-input/image-input.component.d.ts +0 -0
  153. /package/src/libs/ui/{inputs → elements}/src/lib/image-input/image-input.component.css +0 -0
@@ -1,67 +1,14 @@
1
- import { UpdateFrequency } from '../../../../../../../libs/common/domain/src/lib/model/record'
1
+ import {
2
+ UpdateFrequency,
3
+ UpdateFrequencyCode,
4
+ updateFrequencyCodeValues,
5
+ } from '../../../../../../../libs/common/domain/src/lib/model/record'
2
6
 
3
7
  export function getUpdateFrequencyFromFrequencyCode(
4
8
  frequencyCode: string
5
9
  ): UpdateFrequency {
6
- switch (frequencyCode) {
7
- case 'asNeeded':
8
- return 'asNeeded'
9
- case 'unknown':
10
- return 'unknown'
11
- case 'irregular':
12
- return 'irregular'
13
- case 'notPlanned':
14
- return 'notPlanned'
15
- case 'continual':
16
- return 'continual'
17
- case 'periodic':
18
- return 'periodic'
19
- case 'daily':
20
- return {
21
- updatedTimes: 1,
22
- per: 'day',
23
- }
24
- case 'weekly':
25
- return {
26
- updatedTimes: 1,
27
- per: 'week',
28
- }
29
- case 'fortnightly':
30
- return {
31
- updatedTimes: 0.5,
32
- per: 'week',
33
- }
34
- case 'semimonthly':
35
- return {
36
- updatedTimes: 2,
37
- per: 'month',
38
- }
39
- case 'monthly':
40
- return {
41
- updatedTimes: 1,
42
- per: 'month',
43
- }
44
- case 'quarterly':
45
- return {
46
- updatedTimes: 4,
47
- per: 'year',
48
- }
49
- case 'biannually':
50
- return {
51
- updatedTimes: 2,
52
- per: 'year',
53
- }
54
- case 'annually':
55
- return {
56
- updatedTimes: 1,
57
- per: 'year',
58
- }
59
- case 'biennially':
60
- return {
61
- updatedTimes: 0.5,
62
- per: 'year',
63
- }
64
- default:
65
- return null
66
- }
10
+ return frequencyCode &&
11
+ updateFrequencyCodeValues.includes(frequencyCode as UpdateFrequencyCode)
12
+ ? (frequencyCode as UpdateFrequencyCode)
13
+ : null
67
14
  }
@@ -269,6 +269,24 @@ export function getMaintenanceFrequencyCode(
269
269
  return 'continual'
270
270
  case 'periodic':
271
271
  return 'periodic'
272
+ case 'daily':
273
+ return 'daily'
274
+ case 'weekly':
275
+ return 'weekly'
276
+ case 'fortnightly':
277
+ return 'fortnightly'
278
+ case 'monthly':
279
+ return 'monthly'
280
+ case 'quarterly':
281
+ return 'quarterly'
282
+ case 'biannually':
283
+ return 'biannually'
284
+ case 'annually':
285
+ return 'annually'
286
+ case 'semimonthly':
287
+ return 'semimonthly'
288
+ case 'biennially':
289
+ return 'biennially'
272
290
  }
273
291
  }
274
292
 
@@ -201,13 +201,22 @@ export class Gn4Repository implements RecordsRepositoryInterface {
201
201
  )
202
202
  }
203
203
 
204
+ getRecordPublicationStatus(uniqueIdentifier: string): Observable<boolean> {
205
+ return uniqueIdentifier
206
+ ? this.getRecord(uniqueIdentifier).pipe(
207
+ map((record) => record.extras['isPublishedToAll'] as boolean)
208
+ )
209
+ : of(true)
210
+ }
211
+
204
212
  openRecordForEdition(
205
213
  uniqueIdentifier: string
206
214
  ): Observable<[CatalogRecord, string, boolean] | null> {
207
215
  const draft$ = of(this.getRecordFromLocalStorage(uniqueIdentifier))
208
216
  const recordAsXml$ = this.getRecordAsXml(uniqueIdentifier)
217
+ const record$ = this.getRecord(uniqueIdentifier)
209
218
 
210
- return combineLatest([draft$, recordAsXml$]).pipe(
219
+ return combineLatest([draft$, recordAsXml$, record$]).pipe(
211
220
  switchMap(([draft, recordAsXml]) => {
212
221
  const xml = draft ?? recordAsXml
213
222
  const isSavedAlready = recordAsXml !== null
@@ -223,31 +232,45 @@ export class Gn4Repository implements RecordsRepositoryInterface {
223
232
 
224
233
  openRecordForDuplication(
225
234
  uniqueIdentifier: string
226
- ): Observable<[CatalogRecord, string, false] | null> {
227
- return this.getRecordAsXml(uniqueIdentifier).pipe(
228
- switchMap(async (fetchedRecordAsXml) => {
229
- const converter = findConverterForDocument(fetchedRecordAsXml)
230
- const record = await converter.readRecord(fetchedRecordAsXml)
231
-
232
- record.uniqueIdentifier = `${TEMPORARY_ID_PREFIX}${Date.now()}`
233
- record.title = `${record.title} (Copy)`
234
-
235
- const recordAsXml = await converter.writeRecord(
236
- record,
237
- fetchedRecordAsXml
238
- )
239
-
240
- this.saveRecordToLocalStorage(recordAsXml, record.uniqueIdentifier)
241
- this._draftsChanged.next()
242
-
243
- return [record, recordAsXml, false] as [CatalogRecord, string, false]
244
- })
245
- )
235
+ ): Observable<[CatalogRecord, string, true] | null> {
236
+ return this.gn4RecordsApi
237
+ .create(
238
+ uniqueIdentifier,
239
+ '2',
240
+ 'METADATA',
241
+ '',
242
+ false,
243
+ undefined,
244
+ true,
245
+ false,
246
+ undefined,
247
+ 'body',
248
+ false,
249
+ {
250
+ httpHeaderAccept: 'application/json',
251
+ httpContentTypeSelected: 'application/json;charset=UTF-8',
252
+ }
253
+ )
254
+ .pipe(
255
+ switchMap((uniqueIdentifier) => {
256
+ return this.getRecordAsXml(uniqueIdentifier)
257
+ }),
258
+ switchMap((xml) => {
259
+ return from(
260
+ findConverterForDocument(xml)
261
+ .readRecord(xml)
262
+ .then((record) => {
263
+ return [record, xml, true] as [CatalogRecord, string, true]
264
+ })
265
+ )
266
+ })
267
+ )
246
268
  }
247
269
 
248
270
  saveRecord(
249
271
  record: CatalogRecord,
250
- referenceRecordSource?: string
272
+ referenceRecordSource?: string,
273
+ publishToAll = true
251
274
  ): Observable<string> {
252
275
  return this.platformService.getApiVersion().pipe(
253
276
  map((version) => {
@@ -262,7 +285,7 @@ export class Gn4Repository implements RecordsRepositoryInterface {
262
285
  undefined,
263
286
  undefined,
264
287
  undefined,
265
- true,
288
+ publishToAll,
266
289
  undefined,
267
290
  'OVERWRITE',
268
291
  undefined,
@@ -337,10 +360,6 @@ export class Gn4Repository implements RecordsRepositoryInterface {
337
360
  return this.getRecordFromLocalStorage(uniqueIdentifier) !== null
338
361
  }
339
362
 
340
- isRecordNotYetSaved(uniqueIdentifier: string): boolean {
341
- return uniqueIdentifier.startsWith(TEMPORARY_ID_PREFIX)
342
- }
343
-
344
363
  // generated by copilot
345
364
  getAllDrafts(): Observable<CatalogRecord[]> {
346
365
  const items = { ...window.localStorage }
@@ -368,7 +387,7 @@ export class Gn4Repository implements RecordsRepositoryInterface {
368
387
 
369
388
  hasRecordChangedSinceDraft(localRecord: CatalogRecord) {
370
389
  return of({
371
- isUnsaved: this.isRecordNotYetSaved(localRecord.uniqueIdentifier),
390
+ isUnsaved: !localRecord.uniqueIdentifier,
372
391
  hasDraft: this.recordHasDraft(localRecord.uniqueIdentifier),
373
392
  }).pipe(
374
393
  switchMap(({ isUnsaved, hasDraft }) => {
@@ -21,19 +21,41 @@ marker('domain.record.updateFrequency.irregular')
21
21
  marker('domain.record.updateFrequency.continual')
22
22
  marker('domain.record.updateFrequency.periodic')
23
23
 
24
- export type UpdateFrequencyCode =
25
- | 'unknown'
26
- | 'notPlanned'
27
- | 'asNeeded'
28
- | 'irregular'
29
- | 'continual'
30
- | 'periodic'
24
+ export const updateFrequencyCodeValues = [
25
+ 'unknown',
26
+ 'notPlanned',
27
+ 'asNeeded',
28
+ 'irregular',
29
+ 'continual',
30
+ 'periodic',
31
+ 'daily',
32
+ 'weekly',
33
+ 'fortnightly',
34
+ 'semimonthly',
35
+ 'monthly',
36
+ 'quarterly',
37
+ 'biannually',
38
+ 'annually',
39
+ 'biennially',
40
+ ] as const
41
+
42
+ export type UpdateFrequencyCode = (typeof updateFrequencyCodeValues)[number]
31
43
 
32
44
  marker('domain.record.updateFrequency.day')
33
45
  marker('domain.record.updateFrequency.week')
34
46
  marker('domain.record.updateFrequency.month')
35
47
  marker('domain.record.updateFrequency.year')
36
48
 
49
+ marker('domain.record.updateFrequency.daily')
50
+ marker('domain.record.updateFrequency.weekly')
51
+ marker('domain.record.updateFrequency.fortnightly')
52
+ marker('domain.record.updateFrequency.monthly')
53
+ marker('domain.record.updateFrequency.quarterly')
54
+ marker('domain.record.updateFrequency.biannually')
55
+ marker('domain.record.updateFrequency.annually')
56
+ marker('domain.record.updateFrequency.semimonthly')
57
+ marker('domain.record.updateFrequency.biennially')
58
+
37
59
  export type UpdateFrequencyCustom = {
38
60
  updatedTimes: number // this should be an integer
39
61
  per: 'day' | 'week' | 'month' | 'year'
@@ -40,7 +40,7 @@ export abstract class RecordsRepositoryInterface {
40
40
  */
41
41
  abstract openRecordForDuplication(
42
42
  uniqueIdentifier: string
43
- ): Observable<[CatalogRecord, string, false] | null>
43
+ ): Observable<[CatalogRecord, string, true] | null>
44
44
 
45
45
  /**
46
46
  * @param record
@@ -49,7 +49,8 @@ export abstract class RecordsRepositoryInterface {
49
49
  */
50
50
  abstract saveRecord(
51
51
  record: CatalogRecord,
52
- referenceRecordSource?: string
52
+ referenceRecordSource?: string,
53
+ publishToAll?: boolean
53
54
  ): Observable<string>
54
55
 
55
56
  /**
@@ -82,7 +83,6 @@ export abstract class RecordsRepositoryInterface {
82
83
 
83
84
  abstract clearRecordDraft(uniqueIdentifier: string): void
84
85
  abstract recordHasDraft(uniqueIdentifier: string): boolean
85
- abstract isRecordNotYetSaved(uniqueIdentifier: string): boolean
86
86
 
87
87
  /** will return all pending drafts, both published and not published */
88
88
  abstract getAllDrafts(): Observable<CatalogRecord[]>
@@ -91,4 +91,5 @@ export abstract class RecordsRepositoryInterface {
91
91
  abstract hasRecordChangedSinceDraft(
92
92
  localRecord: CatalogRecord
93
93
  ): Observable<{ user: string; date: Date }>
94
+ abstract getRecordPublicationStatus(uuid: string): Observable<boolean>
94
95
  }
@@ -157,6 +157,9 @@ As such, **it is not very interesting at all.**`,
157
157
  },
158
158
  otherLanguages: ['de'],
159
159
  defaultLanguage: 'en',
160
+ extras: {
161
+ isPublishedToAll: true,
162
+ },
160
163
  },
161
164
  {
162
165
  uniqueIdentifier: '7d002c4c-92ef-4b9f-a568-d732f740b99e',
@@ -467,6 +470,165 @@ export const simpleDatasetRecordAsXmlFixture =
467
470
  </mdb:resourceLineage>
468
471
  </mdb:MD_Metadata>`
469
472
 
473
+ export const duplicateDatasetRecordAsXmlFixture =
474
+ (): string => `<?xml version="1.0" encoding="UTF-8"?>
475
+ <mdb:MD_Metadata xmlns:mdb="http://standards.iso.org/iso/19115/-3/mdb/2.0" xmlns:mcc="http://standards.iso.org/iso/19115/-3/mcc/1.0" xmlns:gco="http://standards.iso.org/iso/19115/-3/gco/1.0" xmlns:cit="http://standards.iso.org/iso/19115/-3/cit/2.0" xmlns:mri="http://standards.iso.org/iso/19115/-3/mri/1.0" xmlns:mco="http://standards.iso.org/iso/19115/-3/mco/1.0" xmlns:gcx="http://standards.iso.org/iso/19115/-3/gcx/1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mmi="http://standards.iso.org/iso/19115/-3/mmi/1.0" xmlns:mrd="http://standards.iso.org/iso/19115/-3/mrd/1.0" xmlns:mrl="http://standards.iso.org/iso/19115/-3/mrl/2.0">
476
+ <mdb:metadataIdentifier>
477
+ <mcc:MD_Identifier>
478
+ <mcc:code>
479
+ <gco:CharacterString>my-dataset-001</gco:CharacterString>
480
+ </mcc:code>
481
+ </mcc:MD_Identifier>
482
+ </mdb:metadataIdentifier>
483
+ <mdb:metadataScope>
484
+ <mdb:MD_MetadataScope>
485
+ <mdb:resourceScope>
486
+ <mcc:MD_ScopeCode codeList="https://standards.iso.org/iso/19115/resources/Codelists/cat/codelists.xml#MD_ScopeCode" codeListValue="dataset">dataset</mcc:MD_ScopeCode>
487
+ </mdb:resourceScope>
488
+ </mdb:MD_MetadataScope>
489
+ </mdb:metadataScope>
490
+ <mdb:contact>
491
+ <cit:CI_Responsibility>
492
+ <cit:role>
493
+ <cit:CI_RoleCode codeList="https://standards.iso.org/iso/19115/resources/Codelists/cat/codelists.xml#CI_RoleCode" codeListValue="pointOfContact">pointOfContact</cit:CI_RoleCode>
494
+ </cit:role>
495
+ <cit:party>
496
+ <cit:CI_Organisation>
497
+ <cit:name>
498
+ <gco:CharacterString>MyOrganization</gco:CharacterString>
499
+ </cit:name>
500
+ <cit:contactInfo>
501
+ <cit:CI_Contact>
502
+ <cit:address>
503
+ <cit:CI_Address>
504
+ <cit:electronicMailAddress>
505
+ <gco:CharacterString>bob@org.net</gco:CharacterString>
506
+ </cit:electronicMailAddress>
507
+ </cit:CI_Address>
508
+ </cit:address>
509
+ </cit:CI_Contact>
510
+ </cit:contactInfo>
511
+ <cit:individual>
512
+ <cit:CI_Individual>
513
+ <cit:name>
514
+ <gco:CharacterString>Bob TheGreat</gco:CharacterString>
515
+ </cit:name>
516
+ <cit:positionName>
517
+ <gco:CharacterString>developer</gco:CharacterString>
518
+ </cit:positionName>
519
+ </cit:CI_Individual>
520
+ </cit:individual>
521
+ </cit:CI_Organisation>
522
+ </cit:party>
523
+ </cit:CI_Responsibility>
524
+ </mdb:contact>
525
+ <mdb:dateInfo>
526
+ <cit:CI_Date>
527
+ <cit:date>
528
+ <gco:DateTime>2022-02-01T15:12:00</gco:DateTime>
529
+ </cit:date>
530
+ <cit:dateType>
531
+ <cit:CI_DateTypeCode codeList="https://standards.iso.org/iso/19115/resources/Codelists/cat/codelists.xml#CI_DateTypeCode" codeListValue="revision">revision</cit:CI_DateTypeCode>
532
+ </cit:dateType>
533
+ </cit:CI_Date>
534
+ </mdb:dateInfo>
535
+ <mdb:identificationInfo>
536
+ <mri:MD_DataIdentification>
537
+ <mri:citation>
538
+ <cit:CI_Citation>
539
+ <cit:title>
540
+ <gco:CharacterString>Copy of record A very interesting dataset (un jeu de données très intéressant)</gco:CharacterString>
541
+ </cit:title>
542
+ <cit:date>
543
+ <cit:CI_Date>
544
+ <cit:date>
545
+ <gco:DateTime>2022-09-01T14:18:19</gco:DateTime>
546
+ </cit:date>
547
+ <cit:dateType>
548
+ <cit:CI_DateTypeCode codeList="https://standards.iso.org/iso/19115/resources/Codelists/cat/codelists.xml#CI_DateTypeCode" codeListValue="creation">creation</cit:CI_DateTypeCode>
549
+ </cit:dateType>
550
+ </cit:CI_Date>
551
+ </cit:date>
552
+ <cit:date>
553
+ <cit:CI_Date>
554
+ <cit:date>
555
+ <gco:DateTime>2022-12-04T15:12:00</gco:DateTime>
556
+ </cit:date>
557
+ <cit:dateType>
558
+ <cit:CI_DateTypeCode codeList="https://standards.iso.org/iso/19115/resources/Codelists/cat/codelists.xml#CI_DateTypeCode" codeListValue="revision">revision</cit:CI_DateTypeCode>
559
+ </cit:dateType>
560
+ </cit:CI_Date>
561
+ </cit:date>
562
+ </cit:CI_Citation>
563
+ </mri:citation>
564
+ <mri:abstract>
565
+ <gco:CharacterString>This dataset has been established for testing purposes.</gco:CharacterString>
566
+ </mri:abstract>
567
+ <mri:topicCategory>
568
+ <mri:MD_TopicCategoryCode>testData</mri:MD_TopicCategoryCode>
569
+ </mri:topicCategory>
570
+ <mri:status>
571
+ <mcc:MD_ProgressCode codeList="https://standards.iso.org/iso/19115/resources/Codelists/cat/codelists.xml#MD_ProgressCode" codeListValue="onGoing">onGoing</mcc:MD_ProgressCode>
572
+ </mri:status>
573
+ <mri:resourceMaintenance>
574
+ <mmi:MD_MaintenanceInformation>
575
+ <mmi:userDefinedMaintenanceFrequency>
576
+ <gco:TM_PeriodDuration>P0Y0M10D</gco:TM_PeriodDuration>
577
+ </mmi:userDefinedMaintenanceFrequency>
578
+ </mmi:MD_MaintenanceInformation>
579
+ </mri:resourceMaintenance>
580
+ <mri:spatialRepresentationType>
581
+ <mcc:MD_SpatialRepresentationTypeCode codeList="https://standards.iso.org/iso/19115/resources/Codelists/cat/codelists.xml#MD_SpatialRepresentationTypeCode" codeListValue="grid">grid</mcc:MD_SpatialRepresentationTypeCode>
582
+ </mri:spatialRepresentationType>
583
+ </mri:MD_DataIdentification>
584
+ </mdb:identificationInfo>
585
+ <mdb:distributionInfo>
586
+ <mrd:MD_Distribution>
587
+ <mrd:distributionFormat>
588
+ <mrd:MD_Format>
589
+ <mrd:formatSpecificationCitation>
590
+ <cit:CI_Citation>
591
+ <cit:title>
592
+ <gco:CharacterString>x-gis/x-shapefile</gco:CharacterString>
593
+ </cit:title>
594
+ </cit:CI_Citation>
595
+ </mrd:formatSpecificationCitation>
596
+ </mrd:MD_Format>
597
+ </mrd:distributionFormat>
598
+ <mrd:transferOptions>
599
+ <mrd:MD_DigitalTransferOptions>
600
+ <mrd:onLine>
601
+ <cit:CI_OnlineResource>
602
+ <cit:linkage>
603
+ <gco:CharacterString>http://my-org.net/download/1.zip</gco:CharacterString>
604
+ </cit:linkage>
605
+ <cit:description>
606
+ <gco:CharacterString>Dataset downloaded as a shapefile</gco:CharacterString>
607
+ </cit:description>
608
+ <cit:name>
609
+ <gco:CharacterString>Direct download</gco:CharacterString>
610
+ </cit:name>
611
+ <cit:protocol>
612
+ <gco:CharacterString>WWW:DOWNLOAD</gco:CharacterString>
613
+ </cit:protocol>
614
+ <cit:function>
615
+ <cit:CI_OnLineFunctionCode codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#CI_OnLineFunctionCode" codeListValue="download"/>
616
+ </cit:function>
617
+ </cit:CI_OnlineResource>
618
+ </mrd:onLine>
619
+ </mrd:MD_DigitalTransferOptions>
620
+ </mrd:transferOptions>
621
+ </mrd:MD_Distribution>
622
+ </mdb:distributionInfo>
623
+ <mdb:resourceLineage>
624
+ <mrl:LI_Lineage>
625
+ <mrl:statement>
626
+ <gco:CharacterString>This record was edited manually to test the conversion processes</gco:CharacterString>
627
+ </mrl:statement>
628
+ </mrl:LI_Lineage>
629
+ </mdb:resourceLineage>
630
+ </mdb:MD_Metadata>`
631
+
470
632
  export const NATIONAL_KEYWORD = {
471
633
  key: 'http://inspire.ec.europa.eu/metadata-codelist/SpatialScope/national',
472
634
  label: 'National',
@@ -1371,7 +1371,10 @@ export class RecordsApiService {
1371
1371
  hasAttachmentsOfSource?: boolean,
1372
1372
  observe?: 'body',
1373
1373
  reportProgress?: boolean,
1374
- options?: { httpHeaderAccept?: 'application/json' }
1374
+ options?: {
1375
+ httpHeaderAccept?: 'application/json'
1376
+ httpContentTypeSelected?: 'application/json;charset=UTF-8'
1377
+ }
1375
1378
  ): Observable<string>
1376
1379
  public create(
1377
1380
  sourceUuid: string,
@@ -1389,7 +1392,10 @@ export class RecordsApiService {
1389
1392
  hasAttachmentsOfSource?: boolean,
1390
1393
  observe?: 'response',
1391
1394
  reportProgress?: boolean,
1392
- options?: { httpHeaderAccept?: 'application/json' }
1395
+ options?: {
1396
+ httpHeaderAccept?: 'application/json'
1397
+ httpContentTypeSelected?: 'application/json;charset=UTF-8'
1398
+ }
1393
1399
  ): Observable<HttpResponse<string>>
1394
1400
  public create(
1395
1401
  sourceUuid: string,
@@ -1407,7 +1413,10 @@ export class RecordsApiService {
1407
1413
  hasAttachmentsOfSource?: boolean,
1408
1414
  observe?: 'events',
1409
1415
  reportProgress?: boolean,
1410
- options?: { httpHeaderAccept?: 'application/json' }
1416
+ options?: {
1417
+ httpHeaderAccept?: 'application/json'
1418
+ httpContentTypeSelected?: 'application/json;charset=UTF-8'
1419
+ }
1411
1420
  ): Observable<HttpEvent<string>>
1412
1421
  public create(
1413
1422
  sourceUuid: string,
@@ -1425,7 +1434,10 @@ export class RecordsApiService {
1425
1434
  hasAttachmentsOfSource?: boolean,
1426
1435
  observe: any = 'body',
1427
1436
  reportProgress: boolean = false,
1428
- options?: { httpHeaderAccept?: 'application/json' }
1437
+ options?: {
1438
+ httpHeaderAccept?: 'application/json'
1439
+ httpContentTypeSelected?: 'application/json;charset=UTF-8'
1440
+ }
1429
1441
  ): Observable<any> {
1430
1442
  if (sourceUuid === null || sourceUuid === undefined) {
1431
1443
  throw new Error(
@@ -1510,6 +1522,14 @@ export class RecordsApiService {
1510
1522
 
1511
1523
  let headers = this.defaultHeaders
1512
1524
 
1525
+ // to determine the Content-Type header
1526
+ const consumes: string[] = ['application/json;charset=UTF-8']
1527
+ const httpContentTypeSelected: string | undefined =
1528
+ this.configuration.selectHeaderContentType(consumes)
1529
+ if (httpContentTypeSelected !== undefined) {
1530
+ headers = headers.set('Content-Type', httpContentTypeSelected)
1531
+ }
1532
+
1513
1533
  let httpHeaderAcceptSelected: string | undefined =
1514
1534
  options && options.httpHeaderAccept
1515
1535
  if (httpHeaderAcceptSelected === undefined) {
@@ -7,7 +7,6 @@ export const openRecord = createAction(
7
7
  '[Editor] Open record',
8
8
  props<{
9
9
  record: CatalogRecord
10
- alreadySavedOnce: boolean
11
10
  recordSource?: string | null
12
11
  }>()
13
12
  )
@@ -51,3 +50,8 @@ export const hasRecordChangedSinceDraftSuccess = createAction(
51
50
  '[Editor] Has Record Changed Since Draft Success',
52
51
  props<{ changes: { user: string; date: Date } }>()
53
52
  )
53
+
54
+ export const isPublished = createAction(
55
+ '[Editor] Record Saved But Not Published',
56
+ props<{ isPublished: boolean }>()
57
+ )
@@ -8,7 +8,6 @@ import { Store } from '@ngrx/store'
8
8
  import {
9
9
  selectEditorConfig,
10
10
  selectRecord,
11
- selectRecordAlreadySavedOnce,
12
11
  selectRecordSource,
13
12
  } from './editor.selectors'
14
13
  import { RecordsRepositoryInterface } from '../../../../../../libs/common/domain/src/lib/repository/records-repository.interface'
@@ -28,31 +27,27 @@ export class EditorEffects {
28
27
  withLatestFrom(
29
28
  this.store.select(selectRecord),
30
29
  this.store.select(selectRecordSource),
31
- this.store.select(selectEditorConfig),
32
- this.store.select(selectRecordAlreadySavedOnce)
30
+ this.store.select(selectEditorConfig)
33
31
  ),
34
- switchMap(([, record, recordSource, fieldsConfig, alreadySavedOnce]) =>
35
- this.editorService
36
- .saveRecord(record, recordSource, fieldsConfig, !alreadySavedOnce)
37
- .pipe(
38
- switchMap(([record, recordSource]) =>
39
- of(
40
- EditorActions.saveRecordSuccess(),
41
- EditorActions.openRecord({
42
- record,
43
- alreadySavedOnce: true,
44
- recordSource,
45
- })
46
- )
47
- ),
48
- catchError((error) =>
49
- of(
50
- EditorActions.saveRecordFailure({
51
- error,
52
- })
53
- )
32
+ switchMap(([, record, recordSource, fieldsConfig]) =>
33
+ this.editorService.saveRecord(record, recordSource, fieldsConfig).pipe(
34
+ switchMap(([record, recordSource]) =>
35
+ of(
36
+ EditorActions.saveRecordSuccess(),
37
+ EditorActions.openRecord({
38
+ record,
39
+ recordSource,
40
+ })
41
+ )
42
+ ),
43
+ catchError((error) =>
44
+ of(
45
+ EditorActions.saveRecordFailure({
46
+ error,
47
+ })
54
48
  )
55
49
  )
50
+ )
56
51
  )
57
52
  )
58
53
  )
@@ -63,12 +58,14 @@ export class EditorEffects {
63
58
  ofType(EditorActions.saveRecordSuccess),
64
59
  withLatestFrom(this.store.select(selectRecord)),
65
60
  switchMap(([_, record]) => {
66
- this.gn4PlateformService.cleanRecordAttachments(record).subscribe({
67
- next: (_) => undefined,
68
- error: (err) => {
69
- console.error(err)
70
- },
71
- })
61
+ if (record.uniqueIdentifier !== null) {
62
+ this.gn4PlateformService.cleanRecordAttachments(record).subscribe({
63
+ next: (_) => undefined,
64
+ error: (err) => {
65
+ console.error(err)
66
+ },
67
+ })
68
+ }
72
69
  return EMPTY
73
70
  }),
74
71
  catchError((error) => {
@@ -106,10 +103,9 @@ export class EditorEffects {
106
103
  ofType(EditorActions.undoRecordDraft),
107
104
  withLatestFrom(this.store.select(selectRecord)),
108
105
  switchMap(([, record]) => this.editorService.undoRecordDraft(record)),
109
- map(([record, recordSource, alreadySavedOnce]) =>
106
+ map(([record, recordSource]) =>
110
107
  EditorActions.openRecord({
111
108
  record,
112
- alreadySavedOnce,
113
109
  recordSource,
114
110
  })
115
111
  )
@@ -141,4 +137,19 @@ export class EditorEffects {
141
137
  )
142
138
  )
143
139
  )
140
+
141
+ checkIsRecordPublished$ = createEffect(() =>
142
+ this.actions$.pipe(
143
+ ofType(EditorActions.openRecord),
144
+ map(({ record }) => record.uniqueIdentifier),
145
+ switchMap((uniqueIdentifier) =>
146
+ this.recordsRepository.getRecordPublicationStatus(uniqueIdentifier)
147
+ ),
148
+ map((isPublished) =>
149
+ EditorActions.isPublished({
150
+ isPublished: isPublished,
151
+ })
152
+ )
153
+ )
154
+ )
144
155
  }