geonetwork-ui 2.4.0-dev.503109c9 → 2.4.0-dev.575f30f2

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 (347) hide show
  1. package/esm2022/libs/api/metadata-converter/src/index.mjs +2 -1
  2. package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.mjs +10 -3
  3. package/esm2022/libs/api/metadata-converter/src/lib/iso19115-3/iso19115-3.converter.mjs +5 -5
  4. package/esm2022/libs/api/metadata-converter/src/lib/iso19115-3/read-parts.mjs +7 -4
  5. package/esm2022/libs/api/metadata-converter/src/lib/iso19115-3/write-parts.mjs +10 -7
  6. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.mjs +7 -14
  7. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/read-parts.mjs +6 -6
  8. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +28 -18
  9. package/esm2022/libs/api/metadata-converter/src/lib/xml-utils.mjs +18 -2
  10. package/esm2022/libs/api/repository/src/lib/gn4/gn4-repository.mjs +78 -39
  11. package/esm2022/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.mjs +41 -7
  12. package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +1 -1
  13. package/esm2022/libs/common/domain/src/lib/platform.service.interface.mjs +1 -1
  14. package/esm2022/libs/common/domain/src/lib/repository/records-repository.interface.mjs +1 -1
  15. package/esm2022/libs/feature/dataviz/src/lib/chart-view/chart-view.component.mjs +1 -1
  16. package/esm2022/libs/feature/dataviz/src/lib/service/data.service.mjs +1 -1
  17. package/esm2022/libs/feature/dataviz/src/lib/table-view/table-view.component.mjs +1 -1
  18. package/esm2022/libs/feature/editor/src/index.mjs +2 -1
  19. package/esm2022/libs/feature/editor/src/lib/components/contact-card/contact-card.component.mjs +4 -16
  20. package/esm2022/libs/feature/editor/src/lib/components/generic-keywords/generic-keywords.component.mjs +4 -2
  21. package/esm2022/libs/feature/editor/src/lib/components/import-record/import-record.component.mjs +93 -0
  22. package/esm2022/libs/feature/editor/src/lib/components/online-resource-card/online-resource-card.component.mjs +71 -0
  23. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.mjs +11 -29
  24. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-date-updated/form-field-date-updated.component.mjs +19 -0
  25. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.mjs +23 -10
  26. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.mjs +3 -3
  27. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.mjs +148 -0
  28. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.mjs +86 -11
  29. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.mjs +4 -8
  30. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.mjs +36 -7
  31. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.mjs +35 -59
  32. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.mjs +3 -3
  33. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.mjs +12 -5
  34. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/index.mjs +2 -2
  35. package/esm2022/libs/feature/editor/src/lib/components/record-form/record-form.component.mjs +3 -3
  36. package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +34 -6
  37. package/esm2022/libs/feature/editor/src/lib/models/editor-config.model.mjs +1 -1
  38. package/esm2022/libs/feature/map/src/lib/add-layer-from-catalog/add-layer-record-preview/add-layer-record-preview.component.mjs +2 -2
  39. package/esm2022/libs/feature/record/src/lib/data-view/data-view.component.mjs +1 -1
  40. package/esm2022/libs/feature/record/src/lib/external-viewer-button/external-viewer-button.component.mjs +1 -1
  41. package/esm2022/libs/feature/record/src/lib/map-view/map-view.component.mjs +1 -1
  42. package/esm2022/libs/feature/record/src/lib/state/mdview.facade.mjs +4 -2
  43. package/esm2022/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.mjs +3 -3
  44. package/esm2022/libs/ui/elements/src/index.mjs +2 -2
  45. package/esm2022/libs/ui/elements/src/lib/download-item/download-item.component.mjs +2 -2
  46. package/esm2022/libs/ui/elements/src/lib/downloads-list/downloads-list.component.mjs +1 -1
  47. package/esm2022/libs/ui/elements/src/lib/link-card/link-card.component.mjs +2 -2
  48. package/esm2022/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.mjs +6 -6
  49. package/esm2022/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.mjs +2 -2
  50. package/esm2022/libs/ui/inputs/src/index.mjs +5 -1
  51. package/esm2022/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.mjs +7 -4
  52. package/esm2022/libs/ui/inputs/src/lib/badge/badge.component.mjs +5 -3
  53. package/esm2022/libs/ui/inputs/src/lib/button/button.component.mjs +8 -1
  54. package/esm2022/libs/ui/inputs/src/lib/date-picker/date-picker.component.mjs +11 -4
  55. package/esm2022/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.mjs +9 -3
  56. package/esm2022/libs/ui/inputs/src/lib/file-input/file-input.component.mjs +87 -0
  57. package/esm2022/libs/ui/inputs/src/lib/image-input/image-input.component.mjs +5 -4
  58. package/esm2022/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.mjs +4 -4
  59. package/esm2022/libs/ui/inputs/src/lib/text-area/text-area.component.mjs +4 -3
  60. package/esm2022/libs/ui/inputs/src/lib/url-input/url-input.component.mjs +3 -3
  61. package/esm2022/libs/ui/layout/src/index.mjs +3 -1
  62. package/esm2022/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.mjs +5 -3
  63. package/esm2022/libs/ui/layout/src/lib/modal-dialog/modal-dialog.component.mjs +29 -0
  64. package/esm2022/libs/ui/layout/src/lib/sortable-list/sortable-list.component.mjs +43 -0
  65. package/esm2022/libs/ui/search/src/lib/results-table/results-table.component.mjs +3 -3
  66. package/esm2022/libs/util/shared/src/lib/links/link-classifier.service.mjs +1 -1
  67. package/esm2022/libs/util/shared/src/lib/links/link-utils.mjs +1 -1
  68. package/esm2022/libs/util/shared/src/lib/services/theme.service.mjs +2 -1
  69. package/esm2022/libs/util/shared/src/lib/utils/bytes-convert.mjs +4 -1
  70. package/esm2022/translations/de.json +20 -0
  71. package/esm2022/translations/en.json +20 -0
  72. package/esm2022/translations/es.json +20 -0
  73. package/esm2022/translations/fr.json +21 -1
  74. package/esm2022/translations/it.json +20 -0
  75. package/esm2022/translations/nl.json +20 -0
  76. package/esm2022/translations/pt.json +20 -0
  77. package/fesm2022/geonetwork-ui.mjs +3136 -2523
  78. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  79. package/libs/api/metadata-converter/src/index.d.ts +1 -0
  80. package/libs/api/metadata-converter/src/index.d.ts.map +1 -1
  81. package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts +3 -3
  82. package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts.map +1 -1
  83. package/libs/api/metadata-converter/src/lib/iso19115-3/read-parts.d.ts +2 -2
  84. package/libs/api/metadata-converter/src/lib/iso19115-3/read-parts.d.ts.map +1 -1
  85. package/libs/api/metadata-converter/src/lib/iso19115-3/write-parts.d.ts +1 -1
  86. package/libs/api/metadata-converter/src/lib/iso19115-3/write-parts.d.ts.map +1 -1
  87. package/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.d.ts.map +1 -1
  88. package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts +4 -5
  89. package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts.map +1 -1
  90. package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts +7 -6
  91. package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
  92. package/libs/api/metadata-converter/src/lib/xml-utils.d.ts +6 -0
  93. package/libs/api/metadata-converter/src/lib/xml-utils.d.ts.map +1 -1
  94. package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts +12 -7
  95. package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts.map +1 -1
  96. package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts +21 -2
  97. package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts.map +1 -1
  98. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +6 -6
  99. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
  100. package/libs/common/domain/src/lib/platform.service.interface.d.ts +15 -0
  101. package/libs/common/domain/src/lib/platform.service.interface.d.ts.map +1 -1
  102. package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts +7 -0
  103. package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts.map +1 -1
  104. package/libs/feature/dataviz/src/lib/chart-view/chart-view.component.d.ts +2 -2
  105. package/libs/feature/dataviz/src/lib/chart-view/chart-view.component.d.ts.map +1 -1
  106. package/libs/feature/dataviz/src/lib/service/data.service.d.ts +6 -6
  107. package/libs/feature/dataviz/src/lib/service/data.service.d.ts.map +1 -1
  108. package/libs/feature/dataviz/src/lib/table-view/table-view.component.d.ts +3 -3
  109. package/libs/feature/dataviz/src/lib/table-view/table-view.component.d.ts.map +1 -1
  110. package/libs/feature/editor/src/index.d.ts +1 -0
  111. package/libs/feature/editor/src/index.d.ts.map +1 -1
  112. package/libs/feature/editor/src/lib/components/contact-card/contact-card.component.d.ts +1 -5
  113. package/libs/feature/editor/src/lib/components/contact-card/contact-card.component.d.ts.map +1 -1
  114. package/libs/feature/editor/src/lib/components/generic-keywords/generic-keywords.component.d.ts +2 -1
  115. package/libs/feature/editor/src/lib/components/generic-keywords/generic-keywords.component.d.ts.map +1 -1
  116. package/libs/feature/editor/src/lib/components/import-record/import-record.component.d.ts +33 -0
  117. package/libs/feature/editor/src/lib/components/import-record/import-record.component.d.ts.map +1 -0
  118. package/libs/feature/editor/src/lib/components/online-resource-card/online-resource-card.component.d.ts +15 -0
  119. package/libs/feature/editor/src/lib/components/online-resource-card/online-resource-card.component.d.ts.map +1 -0
  120. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.d.ts +2 -5
  121. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.d.ts.map +1 -1
  122. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-date-updated/form-field-date-updated.component.d.ts +9 -0
  123. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-date-updated/form-field-date-updated.component.d.ts.map +1 -0
  124. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.d.ts +5 -2
  125. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.d.ts.map +1 -1
  126. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.d.ts +35 -0
  127. 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 -0
  128. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.d.ts +20 -2
  129. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.d.ts.map +1 -1
  130. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.d.ts +1 -3
  131. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.d.ts.map +1 -1
  132. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.d.ts +7 -2
  133. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.d.ts.map +1 -1
  134. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.d.ts +9 -15
  135. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.d.ts.map +1 -1
  136. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts +5 -3
  137. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts.map +1 -1
  138. package/libs/feature/editor/src/lib/components/record-form/form-field/index.d.ts +1 -1
  139. package/libs/feature/editor/src/lib/components/record-form/form-field/index.d.ts.map +1 -1
  140. package/libs/feature/editor/src/lib/components/record-form/record-form.component.d.ts +3 -2
  141. package/libs/feature/editor/src/lib/components/record-form/record-form.component.d.ts.map +1 -1
  142. package/libs/feature/editor/src/lib/fields.config.d.ts +9 -1
  143. package/libs/feature/editor/src/lib/fields.config.d.ts.map +1 -1
  144. package/libs/feature/editor/src/lib/models/editor-config.model.d.ts +6 -0
  145. package/libs/feature/editor/src/lib/models/editor-config.model.d.ts.map +1 -1
  146. package/libs/feature/map/src/lib/add-layer-from-catalog/add-layer-record-preview/add-layer-record-preview.component.d.ts +5 -5
  147. package/libs/feature/map/src/lib/add-layer-from-catalog/add-layer-record-preview/add-layer-record-preview.component.d.ts.map +1 -1
  148. package/libs/feature/record/src/lib/data-view/data-view.component.d.ts +3 -3
  149. package/libs/feature/record/src/lib/data-view/data-view.component.d.ts.map +1 -1
  150. package/libs/feature/record/src/lib/external-viewer-button/external-viewer-button.component.d.ts +2 -2
  151. package/libs/feature/record/src/lib/external-viewer-button/external-viewer-button.component.d.ts.map +1 -1
  152. package/libs/feature/record/src/lib/map-view/map-view.component.d.ts +2 -2
  153. package/libs/feature/record/src/lib/map-view/map-view.component.d.ts.map +1 -1
  154. package/libs/feature/record/src/lib/state/mdview.facade.d.ts +7 -7
  155. package/libs/feature/record/src/lib/state/mdview.facade.d.ts.map +1 -1
  156. package/libs/ui/elements/src/index.d.ts +1 -1
  157. package/libs/ui/elements/src/index.d.ts.map +1 -1
  158. package/libs/ui/elements/src/lib/download-item/download-item.component.d.ts +2 -2
  159. package/libs/ui/elements/src/lib/download-item/download-item.component.d.ts.map +1 -1
  160. package/libs/ui/elements/src/lib/downloads-list/downloads-list.component.d.ts +7 -7
  161. package/libs/ui/elements/src/lib/downloads-list/downloads-list.component.d.ts.map +1 -1
  162. package/libs/ui/elements/src/lib/link-card/link-card.component.d.ts +2 -2
  163. package/libs/ui/elements/src/lib/link-card/link-card.component.d.ts.map +1 -1
  164. package/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.d.ts +2 -2
  165. package/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.d.ts.map +1 -1
  166. package/libs/ui/elements/src/lib/record-api-form/record-api-form.component.d.ts +1 -1
  167. package/libs/ui/inputs/src/index.d.ts +4 -0
  168. package/libs/ui/inputs/src/index.d.ts.map +1 -1
  169. package/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.d.ts.map +1 -1
  170. package/libs/ui/inputs/src/lib/badge/badge.component.d.ts.map +1 -1
  171. package/libs/ui/inputs/src/lib/button/button.component.d.ts +1 -1
  172. package/libs/ui/inputs/src/lib/button/button.component.d.ts.map +1 -1
  173. package/libs/ui/inputs/src/lib/date-picker/date-picker.component.d.ts.map +1 -1
  174. package/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.d.ts.map +1 -1
  175. package/libs/ui/inputs/src/lib/file-input/file-input.component.d.ts +24 -0
  176. package/libs/ui/inputs/src/lib/file-input/file-input.component.d.ts.map +1 -0
  177. package/libs/ui/inputs/src/lib/image-input/image-input.component.d.ts +1 -1
  178. package/libs/ui/inputs/src/lib/image-input/image-input.component.d.ts.map +1 -1
  179. package/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.d.ts +0 -1
  180. package/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.d.ts.map +1 -1
  181. package/libs/ui/inputs/src/lib/text-area/text-area.component.d.ts.map +1 -1
  182. package/libs/ui/layout/src/index.d.ts +2 -0
  183. package/libs/ui/layout/src/index.d.ts.map +1 -1
  184. package/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.d.ts +2 -2
  185. package/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.d.ts.map +1 -1
  186. package/libs/ui/layout/src/lib/interactive-table/interactive-table-column/interactive-table-column.component.d.ts +1 -1
  187. package/libs/ui/layout/src/lib/modal-dialog/modal-dialog.component.d.ts +20 -0
  188. package/libs/ui/layout/src/lib/modal-dialog/modal-dialog.component.d.ts.map +1 -0
  189. package/libs/ui/layout/src/lib/sortable-list/sortable-list.component.d.ts +14 -0
  190. package/libs/ui/layout/src/lib/sortable-list/sortable-list.component.d.ts.map +1 -0
  191. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts +1 -1
  192. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts.map +1 -1
  193. package/libs/util/shared/src/lib/links/link-classifier.service.d.ts +3 -3
  194. package/libs/util/shared/src/lib/links/link-classifier.service.d.ts.map +1 -1
  195. package/libs/util/shared/src/lib/links/link-utils.d.ts +6 -6
  196. package/libs/util/shared/src/lib/links/link-utils.d.ts.map +1 -1
  197. package/libs/util/shared/src/lib/services/theme.service.d.ts.map +1 -1
  198. package/libs/util/shared/src/lib/utils/bytes-convert.d.ts +2 -1
  199. package/libs/util/shared/src/lib/utils/bytes-convert.d.ts.map +1 -1
  200. package/package.json +1 -1
  201. package/src/libs/api/metadata-converter/src/index.ts +1 -0
  202. package/src/libs/api/metadata-converter/src/lib/fixtures/generic.records.ts +1 -1
  203. package/src/libs/api/metadata-converter/src/lib/fixtures/geo2france.records.ts +1 -1
  204. package/src/libs/api/metadata-converter/src/lib/fixtures/geocat-ch.records.ts +1 -1
  205. package/src/libs/api/metadata-converter/src/lib/fixtures/metawal.records.ts +1 -1
  206. package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +18 -16
  207. package/src/libs/api/metadata-converter/src/lib/iso19115-3/iso19115-3.converter.ts +4 -4
  208. package/src/libs/api/metadata-converter/src/lib/iso19115-3/read-parts.ts +12 -4
  209. package/src/libs/api/metadata-converter/src/lib/iso19115-3/write-parts.ts +14 -8
  210. package/src/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.ts +4 -12
  211. package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +13 -15
  212. package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +48 -36
  213. package/src/libs/api/metadata-converter/src/lib/xml-utils.ts +20 -1
  214. package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +132 -68
  215. package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.ts +47 -3
  216. package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +7 -7
  217. package/src/libs/common/domain/src/lib/platform.service.interface.ts +26 -0
  218. package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +10 -0
  219. package/src/libs/common/fixtures/src/lib/link.fixtures.ts +216 -175
  220. package/src/libs/common/fixtures/src/lib/records.fixtures.ts +3 -3
  221. package/src/libs/feature/dataviz/src/lib/chart-view/chart-view.component.ts +3 -3
  222. package/src/libs/feature/dataviz/src/lib/service/data.service.ts +6 -6
  223. package/src/libs/feature/dataviz/src/lib/table-view/table-view.component.ts +4 -4
  224. package/src/libs/feature/editor/src/index.ts +1 -0
  225. package/src/libs/feature/editor/src/lib/components/contact-card/contact-card.component.html +12 -24
  226. package/src/libs/feature/editor/src/lib/components/contact-card/contact-card.component.ts +1 -13
  227. package/src/libs/feature/editor/src/lib/components/generic-keywords/generic-keywords.component.ts +1 -0
  228. package/src/libs/feature/editor/src/lib/components/import-record/import-record.component.html +43 -0
  229. package/src/libs/feature/editor/src/lib/components/import-record/import-record.component.ts +129 -0
  230. package/src/libs/feature/editor/src/lib/components/online-resource-card/online-resource-card.component.html +35 -0
  231. package/src/libs/feature/editor/src/lib/components/online-resource-card/online-resource-card.component.ts +79 -0
  232. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.css +4 -0
  233. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.html +13 -23
  234. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.ts +7 -44
  235. package/src/libs/feature/editor/src/lib/components/record-form/form-field/{form-field-resource-updated/form-field-resource-updated.component.ts → form-field-date-updated/form-field-date-updated.component.ts} +4 -4
  236. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.html +3 -2
  237. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.ts +35 -3
  238. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.css +8 -0
  239. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.html +34 -0
  240. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.ts +182 -0
  241. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.html +11 -5
  242. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.ts +93 -4
  243. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.html +13 -6
  244. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.ts +0 -9
  245. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.html +7 -2
  246. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.ts +62 -6
  247. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.css +4 -0
  248. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.html +23 -3
  249. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.ts +37 -69
  250. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.css +4 -0
  251. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.html +16 -14
  252. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +27 -20
  253. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +10 -3
  254. package/src/libs/feature/editor/src/lib/components/record-form/form-field/index.ts +1 -1
  255. package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.html +31 -29
  256. package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.ts +2 -1
  257. package/src/libs/feature/editor/src/lib/fields.config.ts +37 -5
  258. package/src/libs/feature/editor/src/lib/models/editor-config.model.ts +12 -0
  259. package/src/libs/feature/map/src/lib/add-layer-from-catalog/add-layer-record-preview/add-layer-record-preview.component.ts +7 -7
  260. package/src/libs/feature/record/src/lib/data-view/data-view.component.ts +3 -3
  261. package/src/libs/feature/record/src/lib/external-viewer-button/external-viewer-button.component.ts +2 -2
  262. package/src/libs/feature/record/src/lib/map-view/map-view.component.ts +2 -2
  263. package/src/libs/feature/record/src/lib/state/mdview.facade.ts +5 -1
  264. package/src/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.html +1 -0
  265. package/src/libs/ui/elements/src/index.ts +1 -1
  266. package/src/libs/ui/elements/src/lib/download-item/download-item.component.ts +4 -4
  267. package/src/libs/ui/elements/src/lib/downloads-list/downloads-list.component.ts +7 -7
  268. package/src/libs/ui/elements/src/lib/link-card/link-card.component.ts +3 -3
  269. package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.html +13 -20
  270. package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.ts +1 -1
  271. package/src/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.css +5 -0
  272. package/src/libs/ui/inputs/src/index.ts +4 -0
  273. package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.css +25 -18
  274. package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.html +38 -24
  275. package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts +4 -1
  276. package/src/libs/ui/inputs/src/lib/badge/badge.component.html +12 -3
  277. package/src/libs/ui/inputs/src/lib/badge/badge.component.ts +2 -1
  278. package/src/libs/ui/inputs/src/lib/button/button.component.ts +15 -1
  279. package/src/libs/ui/inputs/src/lib/date-picker/date-picker.component.css +7 -2
  280. package/src/libs/ui/inputs/src/lib/date-picker/date-picker.component.html +13 -6
  281. package/src/libs/ui/inputs/src/lib/date-picker/date-picker.component.ts +7 -1
  282. package/src/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.css +7 -2
  283. package/src/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.html +27 -23
  284. package/src/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.ts +7 -1
  285. package/src/libs/ui/inputs/src/lib/file-input/file-input.component.css +4 -0
  286. package/src/libs/ui/inputs/src/lib/file-input/file-input.component.html +7 -3
  287. package/src/libs/ui/inputs/src/lib/file-input/file-input.component.ts +2 -1
  288. package/src/libs/ui/inputs/src/lib/image-input/image-input.component.css +4 -0
  289. package/src/libs/ui/inputs/src/lib/image-input/image-input.component.html +30 -22
  290. package/src/libs/ui/inputs/src/lib/image-input/image-input.component.ts +2 -1
  291. package/src/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.css +4 -3
  292. package/src/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.html +0 -1
  293. package/src/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.ts +1 -2
  294. package/src/libs/ui/inputs/src/lib/text-area/text-area.component.html +1 -1
  295. package/src/libs/ui/inputs/src/lib/text-area/text-area.component.ts +1 -1
  296. package/src/libs/ui/inputs/src/lib/url-input/url-input.component.html +1 -1
  297. package/src/libs/ui/layout/src/index.ts +2 -0
  298. package/src/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.html +8 -3
  299. package/src/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.ts +4 -3
  300. package/src/libs/ui/layout/src/lib/modal-dialog/modal-dialog.component.css +0 -0
  301. package/src/libs/ui/layout/src/lib/modal-dialog/modal-dialog.component.html +15 -0
  302. package/src/libs/ui/layout/src/lib/modal-dialog/modal-dialog.component.ts +44 -0
  303. package/src/libs/ui/layout/src/lib/sortable-list/sortable-list.component.html +37 -0
  304. package/src/libs/ui/{elements → layout}/src/lib/sortable-list/sortable-list.component.ts +13 -16
  305. package/src/libs/ui/search/src/lib/results-table/results-table.component.ts +4 -2
  306. package/src/libs/util/shared/src/lib/links/link-classifier.service.ts +4 -3
  307. package/src/libs/util/shared/src/lib/links/link-utils.ts +6 -6
  308. package/src/libs/util/shared/src/lib/services/theme.service.ts +1 -0
  309. package/src/libs/util/shared/src/lib/utils/bytes-convert.ts +4 -1
  310. package/tailwind.base.config.js +1 -0
  311. package/tailwind.base.css +35 -4
  312. package/translations/de.json +20 -0
  313. package/translations/en.json +20 -0
  314. package/translations/es.json +20 -0
  315. package/translations/fr.json +21 -1
  316. package/translations/it.json +20 -0
  317. package/translations/nl.json +20 -0
  318. package/translations/pt.json +20 -0
  319. package/translations/sk.json +20 -0
  320. package/esm2022/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.mjs +0 -96
  321. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.mjs +0 -19
  322. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents-date/form-field-temporal-extents-date.component.mjs +0 -17
  323. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents-range/form-field-temporal-extents-range.component.mjs +0 -17
  324. package/esm2022/libs/ui/elements/src/lib/sortable-list/sortable-list.component.mjs +0 -39
  325. package/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.d.ts +0 -27
  326. package/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.d.ts.map +0 -1
  327. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.d.ts +0 -9
  328. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.d.ts.map +0 -1
  329. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents-date/form-field-temporal-extents-date.component.d.ts +0 -8
  330. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents-date/form-field-temporal-extents-date.component.d.ts.map +0 -1
  331. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents-range/form-field-temporal-extents-range.component.d.ts +0 -8
  332. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents-range/form-field-temporal-extents-range.component.d.ts.map +0 -1
  333. package/libs/ui/elements/src/lib/sortable-list/sortable-list.component.d.ts +0 -17
  334. package/libs/ui/elements/src/lib/sortable-list/sortable-list.component.d.ts.map +0 -1
  335. package/src/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.html +0 -9
  336. package/src/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.ts +0 -113
  337. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents-date/form-field-temporal-extents-date.component.html +0 -7
  338. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents-date/form-field-temporal-extents-date.component.ts +0 -16
  339. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents-range/form-field-temporal-extents-range.component.html +0 -13
  340. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents-range/form-field-temporal-extents-range.component.ts +0 -16
  341. package/src/libs/ui/elements/src/lib/sortable-list/sortable-list.component.html +0 -29
  342. /package/src/libs/feature/editor/src/lib/components/{overview-upload/overview-upload.component.css → import-record/import-record.component.css} +0 -0
  343. /package/src/libs/feature/editor/src/lib/components/{record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.css → online-resource-card/online-resource-card.component.css} +0 -0
  344. /package/src/libs/feature/editor/src/lib/components/record-form/form-field/{form-field-temporal-extents/form-field-temporal-extents-date/form-field-temporal-extents-date.component.css → form-field-date-updated/form-field-date-updated.component.css} +0 -0
  345. /package/src/libs/feature/editor/src/lib/components/record-form/form-field/{form-field-resource-updated/form-field-resource-updated.component.html → form-field-date-updated/form-field-date-updated.component.html} +0 -0
  346. /package/src/libs/feature/editor/src/lib/components/record-form/form-field/{form-field-temporal-extents/form-field-temporal-extents-range/form-field-temporal-extents-range.component.css → form-field-online-link-resources/form-field-online-link-resources.component.css} +0 -0
  347. /package/src/libs/ui/{elements → layout}/src/lib/sortable-list/sortable-list.component.css +0 -0
@@ -36,7 +36,8 @@ export function createDocument(rootEl: XmlElement): XmlDocument {
36
36
  if (namespace === 'xmlns' || namespace === null) return
37
37
  if (rootEl.attributes[`xmlns:${namespace}`]) return
38
38
  if (!NAMESPACES[namespace]) {
39
- throw new Error(`No known URI for namespace ${namespace}`)
39
+ // the namespace is unknown but it might still be declared correctly: ignore it
40
+ return
40
41
  }
41
42
  rootEl.attributes[`xmlns:${namespace}`] = NAMESPACES[namespace]
42
43
  }
@@ -456,3 +457,21 @@ export function renameElements(
456
457
  doReplace(rootElement)
457
458
  return rootElement
458
459
  }
460
+
461
+ /**
462
+ * This function use the DOMParser to check if the given xmlString is a valid XML file or throw an error
463
+ * (Generated by chatGPT)
464
+ * @param xmlString
465
+ */
466
+ export function assertValidXml(xmlString: string): Document {
467
+ const parser = new DOMParser()
468
+ const xmlDoc = parser.parseFromString(xmlString, 'application/xml')
469
+ const parserError = xmlDoc.querySelector('parsererror')
470
+
471
+ if (parserError) {
472
+ console.error(parserError)
473
+ throw new Error('File is not a valid XML.')
474
+ }
475
+
476
+ return xmlDoc
477
+ }
@@ -6,6 +6,7 @@ import {
6
6
  import { ElasticsearchService } from './elasticsearch'
7
7
  import {
8
8
  combineLatest,
9
+ exhaustMap,
9
10
  from,
10
11
  Observable,
11
12
  of,
@@ -25,22 +26,30 @@ import {
25
26
  } from '../../../../../../libs/common/domain/src/lib/model/search'
26
27
  import { catchError, map, tap } from 'rxjs/operators'
27
28
  import {
29
+ assertValidXml,
28
30
  findConverterForDocument,
29
31
  Gn4Converter,
30
32
  Gn4SearchResults,
31
33
  Iso19139Converter,
32
34
  } from '../../../../../../libs/api/metadata-converter/src'
33
35
  import { CatalogRecord } from '../../../../../../libs/common/domain/src/lib/model/record'
34
- import { HttpErrorResponse } from '@angular/common/http'
36
+ import {
37
+ HttpClient,
38
+ HttpErrorResponse,
39
+ HttpHeaders,
40
+ } from '@angular/common/http'
35
41
 
36
42
  const TEMPORARY_ID_PREFIX = 'TEMP-ID-'
37
43
 
44
+ export type RecordAsXml = string
45
+
38
46
  @Injectable()
39
47
  export class Gn4Repository implements RecordsRepositoryInterface {
40
48
  _draftsChanged = new Subject<void>()
41
49
  draftsChanged$ = this._draftsChanged.asObservable()
42
50
 
43
51
  constructor(
52
+ private httpClient: HttpClient,
44
53
  private gn4SearchApi: SearchApiService,
45
54
  private gn4SearchHelper: ElasticsearchService,
46
55
  private gn4Mapper: Gn4Converter,
@@ -140,6 +149,7 @@ export class Gn4Repository implements RecordsRepositoryInterface {
140
149
  )
141
150
  )
142
151
  }
152
+
143
153
  aggregate(params: AggregationsParams): Observable<Aggregations> {
144
154
  // if aggregations are empty, return an empty object right away
145
155
  if (Object.keys(params).length === 0) return of({})
@@ -184,44 +194,12 @@ export class Gn4Repository implements RecordsRepositoryInterface {
184
194
  )
185
195
  }
186
196
 
187
- /**
188
- * Returns null if the record is not found
189
- */
190
- private loadRecordAsXml(uniqueIdentifier: string): Observable<string | null> {
191
- return this.gn4RecordsApi
192
- .getRecordAs(
193
- uniqueIdentifier,
194
- undefined,
195
- false,
196
- undefined,
197
- undefined,
198
- undefined,
199
- 'application/xml',
200
- 'response',
201
- undefined,
202
- { httpHeaderAccept: 'text/xml,application/xml' as 'application/xml' } // this is to make sure that the response is parsed as text
203
- )
204
- .pipe(
205
- map((response) => response.body),
206
- catchError((error: HttpErrorResponse) =>
207
- error.status === 404 ? of(null) : throwError(() => error)
208
- )
209
- )
210
- }
211
-
212
- private getLocalStorageKeyForRecord(uniqueIdentifier: string) {
213
- return `geonetwork-ui-draft-${uniqueIdentifier}`
214
- }
215
-
216
197
  openRecordForEdition(
217
198
  uniqueIdentifier: string
218
199
  ): Observable<[CatalogRecord, string, boolean] | null> {
219
- const draft$ = of(
220
- window.localStorage.getItem(
221
- this.getLocalStorageKeyForRecord(uniqueIdentifier)
222
- )
223
- )
224
- const recordAsXml$ = this.loadRecordAsXml(uniqueIdentifier)
200
+ const draft$ = of(this.getRecordFromLocalStorage(uniqueIdentifier))
201
+ const recordAsXml$ = this.getRecordAsXml(uniqueIdentifier)
202
+
225
203
  return combineLatest([draft$, recordAsXml$]).pipe(
226
204
  switchMap(([draft, recordAsXml]) => {
227
205
  const xml = draft ?? recordAsXml
@@ -239,34 +217,27 @@ export class Gn4Repository implements RecordsRepositoryInterface {
239
217
  openRecordForDuplication(
240
218
  uniqueIdentifier: string
241
219
  ): Observable<[CatalogRecord, string, false] | null> {
242
- return this.loadRecordAsXml(uniqueIdentifier).pipe(
243
- switchMap(async (recordAsXml) => {
244
- const converter = findConverterForDocument(recordAsXml)
245
- const record = await converter.readRecord(recordAsXml)
220
+ return this.getRecordAsXml(uniqueIdentifier).pipe(
221
+ switchMap(async (fetchedRecordAsXml) => {
222
+ const converter = findConverterForDocument(fetchedRecordAsXml)
223
+ const record = await converter.readRecord(fetchedRecordAsXml)
224
+
246
225
  record.uniqueIdentifier = `${TEMPORARY_ID_PREFIX}${Date.now()}`
247
226
  record.title = `${record.title} (Copy)`
248
- const xml = await converter.writeRecord(record, recordAsXml)
249
- window.localStorage.setItem(
250
- this.getLocalStorageKeyForRecord(record.uniqueIdentifier),
251
- xml
227
+
228
+ const recordAsXml = await converter.writeRecord(
229
+ record,
230
+ fetchedRecordAsXml
252
231
  )
232
+
233
+ this.saveRecordToLocalStorage(recordAsXml, record.uniqueIdentifier)
253
234
  this._draftsChanged.next()
254
- return [record, xml, false] as [CatalogRecord, string, false]
235
+
236
+ return [record, recordAsXml, false] as [CatalogRecord, string, false]
255
237
  })
256
238
  )
257
239
  }
258
240
 
259
- private serializeRecordToXml(
260
- record: CatalogRecord,
261
- referenceRecordSource?: string
262
- ): Observable<string> {
263
- // if there's a reference record, use that standard; otherwise, use iso19139
264
- const converter = referenceRecordSource
265
- ? findConverterForDocument(referenceRecordSource)
266
- : new Iso19139Converter()
267
- return from(converter.writeRecord(record, referenceRecordSource))
268
- }
269
-
270
241
  saveRecord(
271
242
  record: CatalogRecord,
272
243
  referenceRecordSource?: string
@@ -301,6 +272,32 @@ export class Gn4Repository implements RecordsRepositoryInterface {
301
272
  )
302
273
  }
303
274
 
275
+ duplicateExternalRecord(recordDownloadUrl: string): Observable<string> {
276
+ return this.getExternalRecordAsXml(recordDownloadUrl).pipe(
277
+ exhaustMap(async (fetchedRecordAsXml: string) => {
278
+ const converter = findConverterForDocument(fetchedRecordAsXml)
279
+ const record = await converter.readRecord(fetchedRecordAsXml)
280
+ const tempId = this.generateTemporaryId()
281
+
282
+ record.title = `${record.title} (Copy)`
283
+ record.uniqueIdentifier = tempId
284
+
285
+ const recordAsXml = await converter.writeRecord(
286
+ record,
287
+ fetchedRecordAsXml
288
+ )
289
+
290
+ this.saveRecordToLocalStorage(recordAsXml, record.uniqueIdentifier)
291
+ this._draftsChanged.next()
292
+
293
+ return tempId
294
+ }),
295
+ catchError((error: HttpErrorResponse) => {
296
+ return throwError(() => error)
297
+ })
298
+ )
299
+ }
300
+
304
301
  deleteRecord(uniqueIdentifier: string): Observable<void> {
305
302
  return this.gn4RecordsApi.deleteRecord(uniqueIdentifier)
306
303
  }
@@ -315,28 +312,19 @@ export class Gn4Repository implements RecordsRepositoryInterface {
315
312
  ): Observable<string> {
316
313
  return this.serializeRecordToXml(record, referenceRecordSource).pipe(
317
314
  tap((recordXml) => {
318
- window.localStorage.setItem(
319
- this.getLocalStorageKeyForRecord(record.uniqueIdentifier),
320
- recordXml
321
- )
315
+ this.saveRecordToLocalStorage(recordXml, record.uniqueIdentifier)
322
316
  this._draftsChanged.next()
323
317
  })
324
318
  )
325
319
  }
326
320
 
327
321
  clearRecordDraft(uniqueIdentifier: string): void {
328
- window.localStorage.removeItem(
329
- this.getLocalStorageKeyForRecord(uniqueIdentifier)
330
- )
322
+ this.removeRecordFromLocalStorage(uniqueIdentifier)
331
323
  this._draftsChanged.next()
332
324
  }
333
325
 
334
326
  recordHasDraft(uniqueIdentifier: string): boolean {
335
- return (
336
- window.localStorage.getItem(
337
- this.getLocalStorageKeyForRecord(uniqueIdentifier)
338
- ) !== null
339
- )
327
+ return this.getRecordFromLocalStorage(uniqueIdentifier) !== null
340
328
  }
341
329
 
342
330
  isRecordNotYetSaved(uniqueIdentifier: string): boolean {
@@ -356,4 +344,80 @@ export class Gn4Repository implements RecordsRepositoryInterface {
356
344
  )
357
345
  )
358
346
  }
347
+
348
+ private getRecordAsXml(uniqueIdentifier: string): Observable<string | null> {
349
+ return this.gn4RecordsApi
350
+ .getRecordAs(
351
+ uniqueIdentifier,
352
+ undefined,
353
+ false,
354
+ undefined,
355
+ undefined,
356
+ undefined,
357
+ 'application/xml',
358
+ 'response',
359
+ undefined,
360
+ { httpHeaderAccept: 'text/xml,application/xml' as 'application/xml' } // this is to make sure that the response is parsed as text
361
+ )
362
+ .pipe(
363
+ map((response) => response.body),
364
+ catchError((error: HttpErrorResponse) =>
365
+ error.status === 404 ? of(null) : throwError(() => error)
366
+ )
367
+ )
368
+ }
369
+
370
+ private serializeRecordToXml(
371
+ record: CatalogRecord,
372
+ referenceRecordSource?: string
373
+ ): Observable<string> {
374
+ // if there's a reference record, use that standard; otherwise, use iso19139
375
+ const converter = referenceRecordSource
376
+ ? findConverterForDocument(referenceRecordSource)
377
+ : new Iso19139Converter()
378
+ return from(converter.writeRecord(record, referenceRecordSource))
379
+ }
380
+
381
+ private getExternalRecordAsXml(
382
+ recordDownloadUrl: string
383
+ ): Observable<string> {
384
+ let headers = new HttpHeaders()
385
+ const responseType_ = 'text'
386
+ headers = headers.set('Accept', 'text/xml,application/xml')
387
+
388
+ return this.httpClient
389
+ .get<string>(recordDownloadUrl, {
390
+ responseType: <any>responseType_,
391
+ headers: headers,
392
+ observe: 'body',
393
+ })
394
+ .pipe(
395
+ map((recordAsXmlFile) => {
396
+ assertValidXml(recordAsXmlFile)
397
+
398
+ return recordAsXmlFile
399
+ })
400
+ )
401
+ }
402
+
403
+ private getLocalStorageKeyForRecord(recordId: string): string {
404
+ return `geonetwork-ui-draft-${recordId}` // Never change this prefix as it is a breaking change
405
+ }
406
+
407
+ private saveRecordToLocalStorage(recordAsXml: RecordAsXml, recordId: string) {
408
+ window.localStorage.setItem(
409
+ this.getLocalStorageKeyForRecord(recordId),
410
+ recordAsXml
411
+ )
412
+ }
413
+
414
+ private getRecordFromLocalStorage(recordId: string): RecordAsXml {
415
+ return window.localStorage.getItem(
416
+ this.getLocalStorageKeyForRecord(recordId)
417
+ )
418
+ }
419
+
420
+ private removeRecordFromLocalStorage(recordId: string): void {
421
+ window.localStorage.removeItem(this.getLocalStorageKeyForRecord(recordId))
422
+ }
359
423
  }
@@ -1,8 +1,9 @@
1
1
  import { Injectable } from '@angular/core'
2
2
  import { combineLatest, Observable, of, switchMap } from 'rxjs'
3
- import { catchError, map, shareReplay, tap } from 'rxjs/operators'
3
+ import { catchError, filter, map, shareReplay, tap } from 'rxjs/operators'
4
4
  import {
5
5
  MeApiService,
6
+ RecordsApiService,
6
7
  RegistriesApiService,
7
8
  SiteApiService,
8
9
  ToolsApiService,
@@ -19,7 +20,7 @@ import {
19
20
  import { Gn4PlatformMapper } from './gn4-platform.mapper'
20
21
  import { ltr } from 'semver'
21
22
  import { LangService } from '../../../../../../../libs/util/i18n/src'
22
- import { HttpClient } from '@angular/common/http'
23
+ import { HttpClient, HttpEventType } from '@angular/common/http'
23
24
  import {
24
25
  KeywordApiResponse,
25
26
  ThesaurusApiResponse,
@@ -77,7 +78,8 @@ export class Gn4PlatformService implements PlatformServiceInterface {
77
78
  private registriesApiService: RegistriesApiService,
78
79
  private langService: LangService,
79
80
  private userfeedbackApiService: UserfeedbackApiService,
80
- private httpClient: HttpClient
81
+ private httpClient: HttpClient,
82
+ private recordsApiService: RecordsApiService
81
83
  ) {
82
84
  this.me$ = this.meApi.getMe().pipe(
83
85
  switchMap((apiUser) => this.mapper.userFromMeApi(apiUser)),
@@ -274,4 +276,46 @@ export class Gn4PlatformService implements PlatformServiceInterface {
274
276
  })
275
277
  )
276
278
  }
279
+
280
+ getRecordAttachments(recordUuid: string) {
281
+ return this.recordsApiService.getAllResources(recordUuid).pipe(
282
+ map((resources) =>
283
+ resources.map((r) => ({
284
+ url: new URL(r.url),
285
+ fileName: r.filename,
286
+ }))
287
+ )
288
+ )
289
+ }
290
+
291
+ attachFileToRecord(recordUuid: string, file: File) {
292
+ let sizeBytes = -1
293
+ return this.recordsApiService
294
+ .putResource(recordUuid, file, 'public', undefined, 'events', true)
295
+ .pipe(
296
+ map((event) => {
297
+ if (event.type === HttpEventType.UploadProgress) {
298
+ sizeBytes = event.total
299
+ return {
300
+ type: 'progress',
301
+ progress: event.total
302
+ ? Math.round((100 * event.loaded) / event.total)
303
+ : 0,
304
+ } as const
305
+ }
306
+ if (event.type === HttpEventType.Response) {
307
+ return {
308
+ type: 'success',
309
+ attachment: {
310
+ url: new URL(event.body.url),
311
+ fileName: event.body.filename,
312
+ },
313
+ sizeBytes,
314
+ } as const
315
+ }
316
+ return undefined
317
+ }),
318
+ filter((event) => !!event)
319
+ )
320
+ }
277
321
  }
@@ -115,7 +115,7 @@ export type ServiceProtocol =
115
115
  | 'ogcFeatures'
116
116
  | 'other'
117
117
 
118
- export type DatasetDistributionType = 'service' | 'download' | 'link'
118
+ export type OnlineResourceType = 'service' | 'download' | 'link' | 'endpoint'
119
119
 
120
120
  export interface DatasetServiceDistribution {
121
121
  type: 'service'
@@ -146,12 +146,12 @@ export interface OnlineLinkResource {
146
146
  description?: string
147
147
  }
148
148
 
149
- export type DatasetDistribution = (
149
+ export type DatasetOnlineResource = (
150
150
  | DatasetServiceDistribution
151
151
  | DatasetDownloadDistribution
152
152
  | OnlineLinkResource
153
153
  ) & {
154
- type: DatasetDistributionType
154
+ type: OnlineResourceType
155
155
  }
156
156
 
157
157
  export interface GraphicOverview {
@@ -178,14 +178,12 @@ export interface DatasetRecord extends BaseRecord {
178
178
  kind: 'dataset'
179
179
  status: RecordStatus
180
180
  lineage: string // Explanation of the origin of this record (e.g: how, why)"
181
- distributions: Array<DatasetDistribution>
181
+ onlineResources: Array<DatasetOnlineResource>
182
182
  spatialExtents: Array<DatasetSpatialExtent>
183
183
  temporalExtents: Array<DatasetTemporalExtent>
184
184
  spatialRepresentation?: SpatialRepresentationType
185
185
  }
186
186
 
187
- export type ServiceOnlineResourceType = 'endpoint' | 'link'
188
-
189
187
  export interface ServiceEndpoint {
190
188
  endpointUrl: URL
191
189
  protocol: string
@@ -194,7 +192,7 @@ export interface ServiceEndpoint {
194
192
  }
195
193
 
196
194
  export type ServiceOnlineResource = (ServiceEndpoint | OnlineLinkResource) & {
197
- type: ServiceOnlineResourceType
195
+ type: OnlineResourceType
198
196
  }
199
197
 
200
198
  export interface ServiceRecord extends BaseRecord {
@@ -202,6 +200,8 @@ export interface ServiceRecord extends BaseRecord {
202
200
  onlineResources: Array<ServiceOnlineResource>
203
201
  }
204
202
 
203
+ export type OnlineResource = DatasetOnlineResource | ServiceOnlineResource
204
+
205
205
  export type CatalogRecord = ServiceRecord | DatasetRecord
206
206
 
207
207
  export type CatalogRecordKeys = keyof ServiceRecord | keyof DatasetRecord
@@ -4,6 +4,21 @@ import type { Organization } from './model/record/organization.model'
4
4
  import { Keyword, UserFeedback } from './model/record'
5
5
  import { KeywordType } from './model/thesaurus'
6
6
 
7
+ interface RecordAttachment {
8
+ url: URL
9
+ fileName: string
10
+ }
11
+ type UploadEvent =
12
+ | {
13
+ type: 'progress'
14
+ progress: number // in percent
15
+ }
16
+ | {
17
+ type: 'success'
18
+ attachment: RecordAttachment
19
+ sizeBytes: number
20
+ }
21
+
7
22
  export abstract class PlatformServiceInterface {
8
23
  abstract getType(): string
9
24
  abstract getApiVersion(): Observable<string>
@@ -15,7 +30,9 @@ export abstract class PlatformServiceInterface {
15
30
  organisation: Organization
16
31
  ): Observable<UserModel[]>
17
32
  abstract getOrganizations(): Observable<Organization[]>
33
+
18
34
  abstract translateKey(key: string): Observable<string>
35
+
19
36
  abstract searchKeywords(
20
37
  query: string,
21
38
  keywordTypes: KeywordType[]
@@ -25,6 +42,15 @@ export abstract class PlatformServiceInterface {
25
42
  query: string,
26
43
  thesaurusId: string
27
44
  ): Observable<Keyword[]>
45
+
28
46
  abstract getUserFeedbacks(recordUuid: string): Observable<UserFeedback[]>
29
47
  abstract postUserFeedbacks(recordUuid: UserFeedback): Observable<void>
48
+
49
+ abstract getRecordAttachments(
50
+ recordUuid: string
51
+ ): Observable<RecordAttachment[]>
52
+ abstract attachFileToRecord(
53
+ recordUuid: string,
54
+ file: File
55
+ ): Observable<UploadEvent>
30
56
  }
@@ -52,6 +52,16 @@ export abstract class RecordsRepositoryInterface {
52
52
  referenceRecordSource?: string
53
53
  ): Observable<string>
54
54
 
55
+ /**
56
+ * Try to duplicate the external record from given url. If it suceed, then it will save the record as draft and return its temporary id.
57
+ *
58
+ * @param recordDownloadUrl
59
+ * @returns Observable<string>
60
+ */
61
+ abstract duplicateExternalRecord(
62
+ recordDownloadUrl: string
63
+ ): Observable<string>
64
+
55
65
  /**
56
66
  * @param uniqueIdentifier
57
67
  * @returns Observable<void> Returns when record is deleted