geonetwork-ui 2.3.0-dev.179fba83 → 2.3.0-dev.2b8cc035

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 (319) hide show
  1. package/esm2022/index.mjs +2 -1
  2. package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.mjs +3 -3
  3. package/esm2022/libs/api/repository/src/lib/gn4/auth/avatar.service.interface.mjs +1 -1
  4. package/esm2022/libs/api/repository/src/lib/gn4/auth/gravatar.service.mjs +12 -1
  5. package/esm2022/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.mjs +36 -3
  6. package/esm2022/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.mjs +19 -7
  7. package/esm2022/libs/common/domain/src/lib/model/record/index.mjs +2 -1
  8. package/esm2022/libs/common/domain/src/lib/model/record/user-feedbacks.model.mjs +2 -0
  9. package/esm2022/libs/common/domain/src/lib/model/user/index.mjs +2 -0
  10. package/esm2022/libs/common/domain/src/lib/platform.service.interface.mjs +1 -1
  11. package/esm2022/libs/feature/editor/src/index.mjs +2 -2
  12. package/esm2022/libs/feature/editor/src/lib/+state/editor.facade.mjs +6 -2
  13. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-array/form-field-array.component.mjs +11 -0
  14. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-file/form-field-file.component.mjs +28 -0
  15. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.mjs +64 -0
  16. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-object/form-field-object.component.mjs +11 -0
  17. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.mjs +15 -0
  18. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.mjs +45 -0
  19. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-simple/form-field-simple.component.mjs +50 -0
  20. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.mjs +11 -0
  21. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extent/form-field-temporal-extent.component.mjs +11 -0
  22. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.mjs +121 -0
  23. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.model.mjs +2 -0
  24. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/index.mjs +10 -0
  25. package/esm2022/libs/feature/editor/src/lib/components/record-form/record-form.component.mjs +29 -0
  26. package/esm2022/libs/feature/editor/src/lib/components/wizard-field/wizard-field.component.mjs +1 -1
  27. package/esm2022/libs/feature/editor/src/lib/feature-editor.module.mjs +10 -10
  28. package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +16 -1
  29. package/esm2022/libs/feature/editor/src/lib/models/fields.model.mjs +1 -1
  30. package/esm2022/libs/feature/map/src/lib/add-layer-from-file/add-layer-from-file.component.mjs +3 -3
  31. package/esm2022/libs/feature/map/src/lib/add-layer-from-ogc-api/add-layer-from-ogc-api.component.mjs +1 -1
  32. package/esm2022/libs/feature/map/src/lib/add-layer-from-wfs/add-layer-from-wfs.component.mjs +1 -1
  33. package/esm2022/libs/feature/map/src/lib/add-layer-from-wms/add-layer-from-wms.component.mjs +1 -1
  34. package/esm2022/libs/feature/notifications/src/index.mjs +4 -0
  35. package/esm2022/libs/feature/notifications/src/lib/feature-notifications.module.mjs +18 -0
  36. package/esm2022/libs/feature/notifications/src/lib/notification.model.mjs +2 -0
  37. package/esm2022/libs/feature/notifications/src/lib/notifications-container/notifications-container.component.mjs +49 -0
  38. package/esm2022/libs/feature/notifications/src/lib/notifications.service.mjs +29 -0
  39. package/esm2022/libs/feature/record/src/lib/feature-record.module.mjs +4 -4
  40. package/esm2022/libs/feature/record/src/lib/state/mdview.actions.mjs +22 -4
  41. package/esm2022/libs/feature/record/src/lib/state/mdview.effects.mjs +37 -10
  42. package/esm2022/libs/feature/record/src/lib/state/mdview.facade.mjs +22 -7
  43. package/esm2022/libs/feature/record/src/lib/state/mdview.reducer.mjs +52 -17
  44. package/esm2022/libs/feature/record/src/lib/state/mdview.selectors.mjs +18 -3
  45. package/esm2022/libs/feature/router/src/lib/default/state/router.effects.mjs +2 -2
  46. package/esm2022/libs/feature/search/src/lib/results-table/results-table.component.mjs +3 -3
  47. package/esm2022/libs/ui/catalog/src/lib/organisation-preview/organisation-preview.component.mjs +3 -3
  48. package/esm2022/libs/ui/elements/src/index.mjs +15 -15
  49. package/esm2022/libs/ui/elements/src/lib/image-overlay-preview/image-overlay-preview.component.mjs +3 -3
  50. package/esm2022/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.mjs +45 -0
  51. package/esm2022/libs/ui/elements/src/lib/notification/notification.component.mjs +34 -0
  52. package/esm2022/libs/ui/elements/src/lib/record-api-form/record-api-form.component.mjs +34 -7
  53. package/esm2022/libs/ui/elements/src/lib/ui-elements.module.mjs +10 -2
  54. package/esm2022/libs/ui/elements/src/lib/user-feedback-item/time-since.pipe.mjs +59 -0
  55. package/esm2022/libs/ui/elements/src/lib/user-feedback-item/user-feedback-item.component.mjs +62 -0
  56. package/esm2022/libs/ui/inputs/src/index.mjs +15 -16
  57. package/esm2022/libs/ui/inputs/src/lib/date-picker/date-picker.component.mjs +22 -0
  58. package/esm2022/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.mjs +7 -5
  59. package/esm2022/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.mjs +17 -8
  60. package/esm2022/libs/ui/inputs/src/lib/text-area/text-area.component.mjs +27 -4
  61. package/esm2022/libs/ui/inputs/src/lib/text-input/text-input.component.mjs +19 -3
  62. package/esm2022/libs/ui/inputs/src/lib/ui-inputs.module.mjs +11 -28
  63. package/esm2022/libs/ui/layout/src/index.mjs +6 -5
  64. package/esm2022/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.mjs +18 -0
  65. package/esm2022/libs/util/shared/src/lib/links/link-utils.mjs +22 -1
  66. package/esm2022/translations/de.json +34 -0
  67. package/esm2022/translations/en.json +34 -0
  68. package/esm2022/translations/es.json +34 -0
  69. package/esm2022/translations/fr.json +34 -0
  70. package/esm2022/translations/it.json +34 -0
  71. package/esm2022/translations/nl.json +34 -0
  72. package/esm2022/translations/pt.json +34 -0
  73. package/fesm2022/geonetwork-ui.mjs +2581 -1674
  74. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  75. package/index.d.ts +1 -0
  76. package/index.d.ts.map +1 -1
  77. package/index.ts +1 -0
  78. package/libs/api/repository/src/lib/gn4/auth/avatar.service.interface.d.ts +1 -0
  79. package/libs/api/repository/src/lib/gn4/auth/avatar.service.interface.d.ts.map +1 -1
  80. package/libs/api/repository/src/lib/gn4/auth/gravatar.service.d.ts +1 -0
  81. package/libs/api/repository/src/lib/gn4/auth/gravatar.service.d.ts.map +1 -1
  82. package/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.d.ts +6 -2
  83. package/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.d.ts.map +1 -1
  84. package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts +9 -6
  85. package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts.map +1 -1
  86. package/libs/common/domain/src/lib/model/record/index.d.ts +1 -0
  87. package/libs/common/domain/src/lib/model/record/index.d.ts.map +1 -1
  88. package/libs/common/domain/src/lib/model/record/user-feedbacks.model.d.ts +15 -0
  89. package/libs/common/domain/src/lib/model/record/user-feedbacks.model.d.ts.map +1 -0
  90. package/libs/common/domain/src/lib/model/user/index.d.ts +2 -0
  91. package/libs/common/domain/src/lib/model/user/index.d.ts.map +1 -0
  92. package/libs/common/domain/src/lib/platform.service.interface.d.ts +3 -0
  93. package/libs/common/domain/src/lib/platform.service.interface.d.ts.map +1 -1
  94. package/libs/feature/editor/src/index.d.ts +1 -1
  95. package/libs/feature/editor/src/index.d.ts.map +1 -1
  96. package/libs/feature/editor/src/lib/+state/editor.facade.d.ts +8 -5
  97. package/libs/feature/editor/src/lib/+state/editor.facade.d.ts.map +1 -1
  98. package/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-array/form-field-array.component.d.ts +1 -1
  99. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-array/form-field-array.component.d.ts.map +1 -0
  100. package/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-file/form-field-file.component.d.ts +1 -1
  101. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-file/form-field-file.component.d.ts.map +1 -0
  102. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.d.ts +39 -0
  103. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.d.ts.map +1 -0
  104. package/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-object/form-field-object.component.d.ts +1 -1
  105. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-object/form-field-object.component.d.ts.map +1 -0
  106. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.d.ts +8 -0
  107. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.d.ts.map +1 -0
  108. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.d.ts +16 -0
  109. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.d.ts.map +1 -0
  110. package/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-simple/form-field-simple.component.d.ts +2 -2
  111. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-simple/form-field-simple.component.d.ts.map +1 -0
  112. package/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-spatial-extent/form-field-spatial-extent.component.d.ts +1 -1
  113. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.d.ts.map +1 -0
  114. package/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-temporal-extent/form-field-temporal-extent.component.d.ts +1 -1
  115. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extent/form-field-temporal-extent.component.d.ts.map +1 -0
  116. package/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field.component.d.ts +12 -4
  117. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts.map +1 -0
  118. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.model.d.ts.map +1 -0
  119. package/libs/feature/editor/src/lib/components/record-form/form-field/index.d.ts.map +1 -0
  120. package/libs/feature/editor/src/lib/{record-form → components/record-form}/record-form.component.d.ts +3 -3
  121. package/libs/feature/editor/src/lib/components/record-form/record-form.component.d.ts.map +1 -0
  122. package/libs/feature/editor/src/lib/feature-editor.module.d.ts +1 -1
  123. package/libs/feature/editor/src/lib/feature-editor.module.d.ts.map +1 -1
  124. package/libs/feature/editor/src/lib/fields.config.d.ts.map +1 -1
  125. package/libs/feature/editor/src/lib/models/fields.model.d.ts +1 -1
  126. package/libs/feature/notifications/src/index.d.ts +4 -0
  127. package/libs/feature/notifications/src/index.d.ts.map +1 -0
  128. package/libs/feature/notifications/src/lib/feature-notifications.module.d.ts +7 -0
  129. package/libs/feature/notifications/src/lib/feature-notifications.module.d.ts.map +1 -0
  130. package/libs/feature/notifications/src/lib/notification.model.d.ts +7 -0
  131. package/libs/feature/notifications/src/lib/notification.model.d.ts.map +1 -0
  132. package/libs/feature/notifications/src/lib/notifications-container/notifications-container.component.d.ts +12 -0
  133. package/libs/feature/notifications/src/lib/notifications-container/notifications-container.component.d.ts.map +1 -0
  134. package/libs/feature/notifications/src/lib/notifications.service.d.ts +15 -0
  135. package/libs/feature/notifications/src/lib/notifications.service.d.ts.map +1 -0
  136. package/libs/feature/record/src/lib/feature-record.module.d.ts.map +1 -1
  137. package/libs/feature/record/src/lib/state/mdview.actions.d.ts +40 -6
  138. package/libs/feature/record/src/lib/state/mdview.actions.d.ts.map +1 -1
  139. package/libs/feature/record/src/lib/state/mdview.effects.d.ts +24 -4
  140. package/libs/feature/record/src/lib/state/mdview.effects.d.ts.map +1 -1
  141. package/libs/feature/record/src/lib/state/mdview.facade.d.ts +14 -4
  142. package/libs/feature/record/src/lib/state/mdview.facade.d.ts.map +1 -1
  143. package/libs/feature/record/src/lib/state/mdview.reducer.d.ts +8 -5
  144. package/libs/feature/record/src/lib/state/mdview.reducer.d.ts.map +1 -1
  145. package/libs/feature/record/src/lib/state/mdview.selectors.d.ts +12 -9
  146. package/libs/feature/record/src/lib/state/mdview.selectors.d.ts.map +1 -1
  147. package/libs/ui/elements/src/index.d.ts +14 -14
  148. package/libs/ui/elements/src/index.d.ts.map +1 -1
  149. package/libs/ui/elements/src/lib/downloads-list/downloads-list.component.d.ts +1 -1
  150. package/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.d.ts +13 -0
  151. package/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.d.ts.map +1 -0
  152. package/libs/ui/elements/src/lib/notification/notification.component.d.ts +13 -0
  153. package/libs/ui/elements/src/lib/notification/notification.component.d.ts.map +1 -0
  154. package/libs/ui/elements/src/lib/record-api-form/record-api-form.component.d.ts +4 -2
  155. package/libs/ui/elements/src/lib/record-api-form/record-api-form.component.d.ts.map +1 -1
  156. package/libs/ui/elements/src/lib/ui-elements.module.d.ts +16 -14
  157. package/libs/ui/elements/src/lib/ui-elements.module.d.ts.map +1 -1
  158. package/libs/ui/elements/src/lib/user-feedback-item/time-since.pipe.d.ts +11 -0
  159. package/libs/ui/elements/src/lib/user-feedback-item/time-since.pipe.d.ts.map +1 -0
  160. package/libs/ui/elements/src/lib/user-feedback-item/user-feedback-item.component.d.ts +22 -0
  161. package/libs/ui/elements/src/lib/user-feedback-item/user-feedback-item.component.d.ts.map +1 -0
  162. package/libs/ui/inputs/src/index.d.ts +14 -15
  163. package/libs/ui/inputs/src/index.d.ts.map +1 -1
  164. package/libs/ui/inputs/src/lib/date-picker/date-picker.component.d.ts +9 -0
  165. package/libs/ui/inputs/src/lib/date-picker/date-picker.component.d.ts.map +1 -0
  166. package/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.d.ts +1 -1
  167. package/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.d.ts.map +1 -1
  168. package/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.d.ts +1 -1
  169. package/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.d.ts.map +1 -1
  170. package/libs/ui/inputs/src/lib/text-area/text-area.component.d.ts +7 -1
  171. package/libs/ui/inputs/src/lib/text-area/text-area.component.d.ts.map +1 -1
  172. package/libs/ui/inputs/src/lib/text-input/text-input.component.d.ts +4 -1
  173. package/libs/ui/inputs/src/lib/text-input/text-input.component.d.ts.map +1 -1
  174. package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts +35 -43
  175. package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts.map +1 -1
  176. package/libs/ui/layout/src/index.d.ts +5 -4
  177. package/libs/ui/layout/src/index.d.ts.map +1 -1
  178. package/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.d.ts +8 -0
  179. package/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.d.ts.map +1 -0
  180. package/libs/util/shared/src/lib/links/link-utils.d.ts +18 -0
  181. package/libs/util/shared/src/lib/links/link-utils.d.ts.map +1 -1
  182. package/package.json +1 -1
  183. package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +2 -2
  184. package/src/libs/api/repository/src/lib/gn4/auth/avatar.service.interface.ts +1 -0
  185. package/src/libs/api/repository/src/lib/gn4/auth/gravatar.service.ts +12 -1
  186. package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.ts +51 -1
  187. package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.ts +34 -7
  188. package/src/libs/common/domain/src/lib/model/record/index.ts +1 -0
  189. package/src/libs/common/domain/src/lib/model/record/user-feedbacks.model.ts +15 -0
  190. package/src/libs/common/domain/src/lib/platform.service.interface.ts +3 -0
  191. package/src/libs/common/fixtures/src/index.ts +8 -6
  192. package/src/libs/common/fixtures/src/lib/records.fixtures.ts +3 -3
  193. package/src/libs/common/fixtures/src/lib/user-feedbacks.fixtures.ts +83 -0
  194. package/src/libs/feature/editor/src/index.ts +1 -1
  195. package/src/libs/feature/editor/src/lib/+state/editor.facade.ts +8 -1
  196. package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-array/form-field-array.component.ts +1 -0
  197. package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-file/form-field-file.component.ts +4 -1
  198. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.html +8 -0
  199. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.ts +64 -0
  200. package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-object/form-field-object.component.ts +1 -0
  201. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.html +4 -0
  202. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.ts +15 -0
  203. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.html +20 -0
  204. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.ts +44 -0
  205. package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-simple/form-field-simple.component.ts +4 -1
  206. package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-spatial-extent/form-field-spatial-extent.component.ts +1 -0
  207. package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-temporal-extent/form-field-temporal-extent.component.ts +1 -0
  208. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.css +0 -0
  209. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +92 -0
  210. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +137 -0
  211. package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.css +0 -0
  212. package/src/libs/feature/editor/src/lib/{record-form → components/record-form}/record-form.component.html +1 -0
  213. package/src/libs/feature/editor/src/lib/{record-form → components/record-form}/record-form.component.ts +4 -4
  214. package/src/libs/feature/editor/src/lib/feature-editor.module.ts +9 -9
  215. package/src/libs/feature/editor/src/lib/fields.config.ts +15 -0
  216. package/src/libs/feature/editor/src/lib/models/fields.model.ts +1 -1
  217. package/src/libs/feature/map/src/lib/add-layer-from-file/add-layer-from-file.component.html +1 -1
  218. package/src/libs/feature/notifications/src/index.ts +3 -0
  219. package/src/libs/feature/notifications/src/lib/feature-notifications.module.ts +10 -0
  220. package/src/libs/feature/notifications/src/lib/notification.model.ts +6 -0
  221. package/src/libs/feature/notifications/src/lib/notifications-container/notifications-container.component.css +0 -0
  222. package/src/libs/feature/notifications/src/lib/notifications-container/notifications-container.component.html +17 -0
  223. package/src/libs/feature/notifications/src/lib/notifications-container/notifications-container.component.ts +44 -0
  224. package/src/libs/feature/notifications/src/lib/notifications.service.ts +27 -0
  225. package/src/libs/feature/record/src/lib/feature-record.module.ts +5 -2
  226. package/src/libs/feature/record/src/lib/state/mdview.actions.ts +51 -6
  227. package/src/libs/feature/record/src/lib/state/mdview.effects.ts +82 -7
  228. package/src/libs/feature/record/src/lib/state/mdview.facade.ts +49 -8
  229. package/src/libs/feature/record/src/lib/state/mdview.reducer.ts +81 -24
  230. package/src/libs/feature/record/src/lib/state/mdview.selectors.ts +40 -10
  231. package/src/libs/feature/router/src/lib/default/state/router.effects.ts +2 -2
  232. package/src/libs/feature/search/src/lib/results-table/results-table.component.html +3 -3
  233. package/src/libs/ui/catalog/src/lib/organisation-preview/organisation-preview.component.html +5 -5
  234. package/src/libs/ui/elements/src/index.ts +14 -14
  235. package/src/libs/ui/elements/src/lib/image-overlay-preview/image-overlay-preview.component.html +1 -1
  236. package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.css +0 -5
  237. package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.html +0 -21
  238. package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.ts +1 -14
  239. package/src/libs/ui/elements/src/lib/notification/notification.component.css +0 -0
  240. package/src/libs/ui/elements/src/lib/notification/notification.component.html +52 -0
  241. package/src/libs/ui/elements/src/lib/notification/notification.component.ts +31 -0
  242. package/src/libs/ui/elements/src/lib/record-api-form/record-api-form.component.html +2 -2
  243. package/src/libs/ui/elements/src/lib/record-api-form/record-api-form.component.ts +40 -4
  244. package/src/libs/ui/elements/src/lib/ui-elements.module.ts +5 -0
  245. package/src/libs/ui/elements/src/lib/user-feedback-item/time-since.pipe.ts +54 -0
  246. package/src/libs/ui/elements/src/lib/user-feedback-item/user-feedback-item.component.css +0 -0
  247. package/src/libs/ui/elements/src/lib/user-feedback-item/user-feedback-item.component.html +75 -0
  248. package/src/libs/ui/elements/src/lib/user-feedback-item/user-feedback-item.component.ts +63 -0
  249. package/src/libs/ui/inputs/src/index.ts +14 -15
  250. package/src/libs/ui/inputs/src/lib/date-picker/date-picker.component.css +3 -0
  251. package/src/libs/ui/inputs/src/lib/date-picker/date-picker.component.html +11 -0
  252. package/src/libs/ui/inputs/src/lib/date-picker/date-picker.component.ts +16 -0
  253. package/src/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.ts +8 -1
  254. package/src/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.ts +13 -0
  255. package/src/libs/ui/inputs/src/lib/text-area/text-area.component.html +2 -1
  256. package/src/libs/ui/inputs/src/lib/text-area/text-area.component.ts +29 -0
  257. package/src/libs/ui/inputs/src/lib/text-input/text-input.component.html +1 -1
  258. package/src/libs/ui/inputs/src/lib/text-input/text-input.component.ts +16 -1
  259. package/src/libs/ui/inputs/src/lib/ui-inputs.module.ts +2 -21
  260. package/src/libs/ui/layout/src/index.ts +5 -4
  261. package/src/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.css +0 -0
  262. package/src/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.html +18 -0
  263. package/src/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.ts +16 -0
  264. package/src/libs/util/shared/src/lib/links/link-utils.ts +21 -0
  265. package/tailwind.base.css +36 -0
  266. package/translations/de.json +34 -0
  267. package/translations/en.json +34 -0
  268. package/translations/es.json +34 -0
  269. package/translations/fr.json +34 -0
  270. package/translations/it.json +34 -0
  271. package/translations/nl.json +34 -0
  272. package/translations/pt.json +34 -0
  273. package/translations/sk.json +34 -0
  274. package/esm2022/libs/feature/editor/src/lib/record-form/record-form.component.mjs +0 -30
  275. package/esm2022/libs/ui/inputs/src/lib/form-field/form-field-array/form-field-array.component.mjs +0 -11
  276. package/esm2022/libs/ui/inputs/src/lib/form-field/form-field-file/form-field-file.component.mjs +0 -27
  277. package/esm2022/libs/ui/inputs/src/lib/form-field/form-field-object/form-field-object.component.mjs +0 -11
  278. package/esm2022/libs/ui/inputs/src/lib/form-field/form-field-rich/form-field-rich.component.mjs +0 -27
  279. package/esm2022/libs/ui/inputs/src/lib/form-field/form-field-simple/form-field-simple.component.mjs +0 -49
  280. package/esm2022/libs/ui/inputs/src/lib/form-field/form-field-spatial-extent/form-field-spatial-extent.component.mjs +0 -11
  281. package/esm2022/libs/ui/inputs/src/lib/form-field/form-field-temporal-extent/form-field-temporal-extent.component.mjs +0 -11
  282. package/esm2022/libs/ui/inputs/src/lib/form-field/form-field.component.mjs +0 -76
  283. package/esm2022/libs/ui/inputs/src/lib/form-field/form-field.model.mjs +0 -2
  284. package/esm2022/libs/ui/inputs/src/lib/form-field/index.mjs +0 -10
  285. package/libs/feature/editor/src/lib/record-form/record-form.component.d.ts.map +0 -1
  286. package/libs/ui/inputs/src/lib/form-field/form-field-array/form-field-array.component.d.ts.map +0 -1
  287. package/libs/ui/inputs/src/lib/form-field/form-field-file/form-field-file.component.d.ts.map +0 -1
  288. package/libs/ui/inputs/src/lib/form-field/form-field-object/form-field-object.component.d.ts.map +0 -1
  289. package/libs/ui/inputs/src/lib/form-field/form-field-rich/form-field-rich.component.d.ts +0 -11
  290. package/libs/ui/inputs/src/lib/form-field/form-field-rich/form-field-rich.component.d.ts.map +0 -1
  291. package/libs/ui/inputs/src/lib/form-field/form-field-simple/form-field-simple.component.d.ts.map +0 -1
  292. package/libs/ui/inputs/src/lib/form-field/form-field-spatial-extent/form-field-spatial-extent.component.d.ts.map +0 -1
  293. package/libs/ui/inputs/src/lib/form-field/form-field-temporal-extent/form-field-temporal-extent.component.d.ts.map +0 -1
  294. package/libs/ui/inputs/src/lib/form-field/form-field.component.d.ts.map +0 -1
  295. package/libs/ui/inputs/src/lib/form-field/form-field.model.d.ts.map +0 -1
  296. package/libs/ui/inputs/src/lib/form-field/index.d.ts.map +0 -1
  297. package/src/libs/ui/inputs/src/lib/form-field/form-field-rich/form-field-rich.component.html +0 -11
  298. package/src/libs/ui/inputs/src/lib/form-field/form-field-rich/form-field-rich.component.ts +0 -15
  299. package/src/libs/ui/inputs/src/lib/form-field/form-field.component.html +0 -68
  300. package/src/libs/ui/inputs/src/lib/form-field/form-field.component.ts +0 -80
  301. /package/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field.model.d.ts +0 -0
  302. /package/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/index.d.ts +0 -0
  303. /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-array/form-field-array.component.css +0 -0
  304. /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-array/form-field-array.component.html +0 -0
  305. /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-file/form-field-file.component.css +0 -0
  306. /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-file/form-field-file.component.html +0 -0
  307. /package/src/libs/feature/editor/src/lib/{record-form/record-form.component.css → components/record-form/form-field/form-field-license/form-field-license.component.css} +0 -0
  308. /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-object/form-field-object.component.css +0 -0
  309. /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-object/form-field-object.component.html +0 -0
  310. /package/src/libs/{ui/inputs/src/lib/form-field/form-field-rich/form-field-rich.component.css → feature/editor/src/lib/components/record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.css} +0 -0
  311. /package/src/libs/{ui/inputs/src/lib/form-field/form-field-simple/form-field-simple.component.css → feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.css} +0 -0
  312. /package/src/libs/{ui/inputs/src/lib/form-field/form-field-spatial-extent/form-field-spatial-extent.component.css → feature/editor/src/lib/components/record-form/form-field/form-field-simple/form-field-simple.component.css} +0 -0
  313. /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-simple/form-field-simple.component.html +0 -0
  314. /package/src/libs/{ui/inputs/src/lib/form-field/form-field-temporal-extent/form-field-temporal-extent.component.css → feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.css} +0 -0
  315. /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-spatial-extent/form-field-spatial-extent.component.html +0 -0
  316. /package/src/libs/{ui/inputs/src/lib/form-field/form-field.component.css → feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extent/form-field-temporal-extent.component.css} +0 -0
  317. /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field-temporal-extent/form-field-temporal-extent.component.html +0 -0
  318. /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/form-field.model.ts +0 -0
  319. /package/src/libs/{ui/inputs/src/lib → feature/editor/src/lib/components/record-form}/form-field/index.ts +0 -0
@@ -1,3 +1,4 @@
1
+ import { marker } from '@biesbjerg/ngx-translate-extract-marker'
1
2
  import { EditorFieldsConfig } from './models/fields.model'
2
3
 
3
4
  export const DEFAULT_FIELDS: EditorFieldsConfig = [
@@ -32,4 +33,18 @@ export const DEFAULT_FIELDS: EditorFieldsConfig = [
32
33
  },
33
34
  onSaveProcess: '${dateNow()}',
34
35
  },
36
+ {
37
+ model: 'licenses',
38
+ formFieldConfig: {
39
+ labelKey: marker('editor.record.form.license'),
40
+ type: 'list',
41
+ },
42
+ },
43
+ {
44
+ model: 'resourceUpdated',
45
+ formFieldConfig: {
46
+ labelKey: marker('editor.record.form.resourceUpdated'),
47
+ type: 'date',
48
+ },
49
+ },
35
50
  ]
@@ -1,4 +1,4 @@
1
- import { FormFieldConfig } from '../../../../../../libs/ui/inputs/src'
1
+ import { FormFieldConfig } from '../components/record-form/form-field'
2
2
 
3
3
  // Expressions should be enclosed in `${}` to be recognized as such
4
4
  // eg. ${dateNow()}
@@ -1,6 +1,6 @@
1
1
  <div class="flex flex-col gap-2 my-2">
2
2
  <div class="flex items-center gap-4">
3
- <div class="flex-grow rounded-md border-2 border-gray-200">
3
+ <div class="grow rounded-md border-2 border-gray-200">
4
4
  <gn-ui-drag-and-drop-file-input
5
5
  (fileChange)="handleFileChange($event)"
6
6
  [accept]="acceptedMimeType.join(',')"
@@ -0,0 +1,3 @@
1
+ export * from './lib/feature-notifications.module'
2
+ export * from './lib/notifications.service'
3
+ export * from './lib/notifications-container/notifications-container.component'
@@ -0,0 +1,10 @@
1
+ import { NotificationsService } from './notifications.service'
2
+ import { NgModule } from '@angular/core'
3
+
4
+ @NgModule({
5
+ declarations: [],
6
+ exports: [],
7
+ imports: [],
8
+ providers: [NotificationsService],
9
+ })
10
+ export class FeatureNotificationsModule {}
@@ -0,0 +1,6 @@
1
+ export interface NotificationContent {
2
+ type: 'info' | 'warning' | 'error' | 'success'
3
+ title: string
4
+ text: string
5
+ closeMessage?: string
6
+ }
@@ -0,0 +1,17 @@
1
+ <div class="flex flex-col gap-6 p-6 items-start pointer-events-none">
2
+ <gn-ui-notification
3
+ *ngFor="
4
+ let notification of notificationsService.notifications$ | async;
5
+ trackBy: trackById
6
+ "
7
+ class="max-w-full pointer-events-auto"
8
+ [text]="notification.text"
9
+ [type]="notification.type"
10
+ [title]="notification.title"
11
+ [closeMessage]="notification.closeMessage"
12
+ (notificationClose)="
13
+ notificationsService.removeNotificationById(notification.id)
14
+ "
15
+ [@enterExit]
16
+ ></gn-ui-notification>
17
+ </div>
@@ -0,0 +1,44 @@
1
+ import { ChangeDetectionStrategy, Component } from '@angular/core'
2
+ import { CommonModule } from '@angular/common'
3
+ import { NotificationsService } from '../notifications.service'
4
+ import { NotificationComponent } from '../../../../../../libs/ui/elements/src'
5
+ import {
6
+ animate,
7
+ keyframes,
8
+ style,
9
+ transition,
10
+ trigger,
11
+ } from '@angular/animations'
12
+
13
+ @Component({
14
+ selector: 'gn-ui-notifications-container',
15
+ standalone: true,
16
+ imports: [CommonModule, NotificationComponent],
17
+ templateUrl: './notifications-container.component.html',
18
+ styleUrls: ['./notifications-container.component.css'],
19
+ changeDetection: ChangeDetectionStrategy.OnPush,
20
+ animations: [
21
+ trigger('enterExit', [
22
+ transition(':enter', [
23
+ animate(
24
+ '150ms',
25
+ keyframes([
26
+ style({ transform: 'scale(1)', opacity: 0 }),
27
+ style({ transform: 'scale(1.03)', opacity: 0.5 }),
28
+ style({ transform: 'scale(1)', opacity: 1 }),
29
+ ])
30
+ ),
31
+ ]),
32
+ transition(':leave', [
33
+ animate('200ms', style({ transform: 'translateX(50px)', opacity: 0 })),
34
+ ]),
35
+ ]),
36
+ ],
37
+ })
38
+ export class NotificationsContainerComponent {
39
+ constructor(protected notificationsService: NotificationsService) {}
40
+
41
+ trackById(index: number, notification: { id: number }) {
42
+ return notification.id
43
+ }
44
+ }
@@ -0,0 +1,27 @@
1
+ import { Injectable } from '@angular/core'
2
+ import { NotificationContent } from './notification.model'
3
+ import { BehaviorSubject } from 'rxjs'
4
+
5
+ type NotificationWithIdentity = NotificationContent & { id: number }
6
+
7
+ @Injectable({
8
+ providedIn: 'root',
9
+ })
10
+ export class NotificationsService {
11
+ notifications$ = new BehaviorSubject<NotificationWithIdentity[]>([])
12
+
13
+ showNotification(content: NotificationContent, timeoutMs?: number) {
14
+ const id = Math.floor(Math.random() * 1000000)
15
+ this.notifications$.next([...this.notifications$.value, { ...content, id }])
16
+ if (typeof timeoutMs === 'undefined') return
17
+ setTimeout(() => {
18
+ this.removeNotificationById(id)
19
+ }, timeoutMs)
20
+ }
21
+
22
+ removeNotificationById(id: number) {
23
+ this.notifications$.next(
24
+ this.notifications$.value.filter((n) => n.id !== id)
25
+ )
26
+ }
27
+ }
@@ -11,7 +11,10 @@ import { MdViewFacade } from './state'
11
11
  import { MdViewEffects } from './state/mdview.effects'
12
12
  import { MapViewComponent } from './map-view/map-view.component'
13
13
  import { DataViewComponent } from './data-view/data-view.component'
14
- import { MD_VIEW_FEATURE_STATE_KEY, reducer } from './state/mdview.reducer'
14
+ import {
15
+ METADATA_VIEW_FEATURE_STATE_KEY,
16
+ reducer,
17
+ } from './state/mdview.reducer'
15
18
  import { MatTabsModule } from '@angular/material/tabs'
16
19
  import { MatIconModule } from '@angular/material/icon'
17
20
  import { UiWidgetsModule } from '../../../../../libs/ui/widgets/src'
@@ -35,7 +38,7 @@ import { DataViewShareComponent } from './data-view-share/data-view-share.compon
35
38
  ],
36
39
  imports: [
37
40
  CommonModule,
38
- StoreModule.forFeature(MD_VIEW_FEATURE_STATE_KEY, reducer),
41
+ StoreModule.forFeature(METADATA_VIEW_FEATURE_STATE_KEY, reducer),
39
42
  EffectsModule.forFeature([MdViewEffects]),
40
43
  UiLayoutModule,
41
44
  FeatureMapModule,
@@ -1,7 +1,13 @@
1
1
  import { DatavizConfigurationModel } from '../../../../../../libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model'
2
2
  import { createAction, props } from '@ngrx/store'
3
- import { CatalogRecord } from '../../../../../../libs/common/domain/src/lib/model/record'
3
+ import {
4
+ CatalogRecord,
5
+ UserFeedback,
6
+ } from '../../../../../../libs/common/domain/src/lib/model/record'
4
7
 
8
+ /*
9
+ Metadata actions
10
+ */
5
11
  export const loadFullMetadata = createAction(
6
12
  '[Metadata view] Load full metadata',
7
13
  props<{ uuid: string }>()
@@ -12,24 +18,63 @@ export const setIncompleteMetadata = createAction(
12
18
  props<{ incomplete: Partial<CatalogRecord> }>()
13
19
  )
14
20
 
15
- export const loadFullSuccess = createAction(
16
- '[Metadata view] Load full success',
21
+ export const loadFullMetadataSuccess = createAction(
22
+ '[Metadata view] Load full metadata success',
17
23
  props<{ full: CatalogRecord }>()
18
24
  )
19
25
 
20
- export const loadFullFailure = createAction(
21
- '[Metadata view] Load full failure',
26
+ export const loadFullMetadataFailure = createAction(
27
+ '[Metadata view] Load full metadata failure',
22
28
  props<{ otherError?: string; notFound?: boolean }>()
23
29
  )
24
30
 
31
+ export const closeMetadata = createAction('[Metadata view] close')
32
+
33
+ /*
34
+ Related actions
35
+ */
25
36
  export const setRelated = createAction(
26
37
  '[Metadata view] Set related records',
27
38
  props<{ related: CatalogRecord[] }>()
28
39
  )
29
40
 
41
+ /*
42
+ ChartConfig actions
43
+ */
30
44
  export const setChartConfig = createAction(
31
45
  '[Metadata view] Set chart config',
32
46
  props<{ chartConfig: DatavizConfigurationModel }>()
33
47
  )
34
48
 
35
- export const close = createAction('[Metadata view] close')
49
+ /*
50
+ User Feedbacks actions
51
+ */
52
+ export const addUserFeedback = createAction(
53
+ '[Metadata view] Add UserFeedback',
54
+ props<{ userFeedback: UserFeedback }>()
55
+ )
56
+
57
+ export const addUserFeedbackSuccess = createAction(
58
+ '[Metadata view] Add UserFeedback Success',
59
+ props<{ datasetUuid: string }>()
60
+ )
61
+
62
+ export const addUserFeedbackFailure = createAction(
63
+ '[Metadata view] Add UserFeedback Failure',
64
+ props<{ otherError?: string; notFound?: boolean }>()
65
+ )
66
+
67
+ export const loadUserFeedbacks = createAction(
68
+ '[Metadata view] Load UserFeedbacks',
69
+ props<{ datasetUuid: string }>()
70
+ )
71
+
72
+ export const loadUserFeedbacksSuccess = createAction(
73
+ '[Metadata view] Load UserFeedbacks Success',
74
+ props<{ userFeedbacks: UserFeedback[] }>()
75
+ )
76
+
77
+ export const loadUserFeedbacksFailure = createAction(
78
+ '[Metadata view] Load UserFeedbacks Failure',
79
+ props<{ otherError?: string; notFound?: boolean }>()
80
+ )
@@ -1,18 +1,23 @@
1
1
  import { Injectable } from '@angular/core'
2
2
  import { Actions, createEffect, ofType } from '@ngrx/effects'
3
- import { of } from 'rxjs'
3
+ import { exhaustMap, mergeMap, of } from 'rxjs'
4
4
  import { catchError, map, switchMap } from 'rxjs/operators'
5
5
  import * as MdViewActions from './mdview.actions'
6
6
  import { RecordsRepositoryInterface } from '../../../../../../libs/common/domain/src/lib/repository/records-repository.interface'
7
+ import { PlatformServiceInterface } from '../../../../../../libs/common/domain/src/lib/platform.service.interface'
7
8
 
8
9
  @Injectable()
9
10
  export class MdViewEffects {
10
11
  constructor(
11
12
  private actions$: Actions,
12
- private recordsRepository: RecordsRepositoryInterface
13
+ private recordsRepository: RecordsRepositoryInterface,
14
+ private platformServiceInterface: PlatformServiceInterface
13
15
  ) {}
14
16
 
15
- loadFull$ = createEffect(() =>
17
+ /*
18
+ Metadata effects
19
+ */
20
+ loadFullMetadata$ = createEffect(() =>
16
21
  this.actions$.pipe(
17
22
  ofType(MdViewActions.loadFullMetadata),
18
23
  switchMap(({ uuid }) =>
@@ -20,19 +25,22 @@ export class MdViewEffects {
20
25
  ),
21
26
  map((record) => {
22
27
  if (record === null) {
23
- return MdViewActions.loadFullFailure({ notFound: true })
28
+ return MdViewActions.loadFullMetadataFailure({ notFound: true })
24
29
  }
25
- return MdViewActions.loadFullSuccess({ full: record })
30
+ return MdViewActions.loadFullMetadataSuccess({ full: record })
26
31
  }),
27
32
  catchError((error) =>
28
- of(MdViewActions.loadFullFailure({ otherError: error.message }))
33
+ of(MdViewActions.loadFullMetadataFailure({ otherError: error.message }))
29
34
  )
30
35
  )
31
36
  )
32
37
 
38
+ /*
39
+ Related effects
40
+ */
33
41
  loadRelatedRecords$ = createEffect(() =>
34
42
  this.actions$.pipe(
35
- ofType(MdViewActions.loadFullSuccess),
43
+ ofType(MdViewActions.loadFullMetadataSuccess),
36
44
  switchMap(({ full }) => this.recordsRepository.getSimilarRecords(full)),
37
45
  map((related) => {
38
46
  return MdViewActions.setRelated({ related })
@@ -40,4 +48,71 @@ export class MdViewEffects {
40
48
  catchError((error) => of(MdViewActions.setRelated({ related: null })))
41
49
  )
42
50
  )
51
+
52
+ /*
53
+ UserFeedback effects
54
+ */
55
+ loadUserFeedbacks$ = createEffect(() =>
56
+ this.actions$.pipe(
57
+ ofType(MdViewActions.loadUserFeedbacks),
58
+ exhaustMap(({ datasetUuid }) =>
59
+ this.platformServiceInterface.getUserFeedbacks(datasetUuid).pipe(
60
+ map((userFeedbacks) =>
61
+ MdViewActions.loadUserFeedbacksSuccess({ userFeedbacks })
62
+ ),
63
+ catchError((error) =>
64
+ of(
65
+ MdViewActions.loadUserFeedbacksFailure({
66
+ otherError: error.message,
67
+ })
68
+ )
69
+ )
70
+ )
71
+ )
72
+ )
73
+ )
74
+
75
+ reloadUserFeedbacks$ = createEffect(() =>
76
+ this.actions$.pipe(
77
+ ofType(MdViewActions.addUserFeedbackSuccess),
78
+ exhaustMap(({ datasetUuid }) =>
79
+ this.platformServiceInterface.getUserFeedbacks(datasetUuid).pipe(
80
+ map((userFeedbacks) =>
81
+ MdViewActions.loadUserFeedbacksSuccess({ userFeedbacks })
82
+ ),
83
+ catchError((error) =>
84
+ of(
85
+ MdViewActions.loadUserFeedbacksFailure({
86
+ otherError: error.message,
87
+ })
88
+ )
89
+ )
90
+ )
91
+ )
92
+ )
93
+ )
94
+
95
+ addUserFeedback$ = createEffect(() =>
96
+ this.actions$.pipe(
97
+ ofType(MdViewActions.addUserFeedback),
98
+ mergeMap((action) =>
99
+ this.platformServiceInterface
100
+ .postUserFeedbacks(action.userFeedback)
101
+ .pipe(
102
+ map(() =>
103
+ MdViewActions.addUserFeedbackSuccess({
104
+ datasetUuid: action.userFeedback.metadataUUID,
105
+ })
106
+ ),
107
+ catchError((error) => {
108
+ return of(
109
+ MdViewActions.addUserFeedbackFailure({
110
+ otherError: error.message,
111
+ })
112
+ )
113
+ })
114
+ )
115
+ )
116
+ )
117
+ )
43
118
  }
@@ -5,7 +5,12 @@ import * as MdViewActions from './mdview.actions'
5
5
  import * as MdViewSelectors from './mdview.selectors'
6
6
  import { LinkClassifierService, LinkUsage } from '../../../../../../libs/util/shared/src'
7
7
  import { DatavizConfigurationModel } from '../../../../../../libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model'
8
- import { CatalogRecord } from '../../../../../../libs/common/domain/src/lib/model/record'
8
+ import {
9
+ CatalogRecord,
10
+ UserFeedback,
11
+ UserFeedbackViewModel,
12
+ } from '../../../../../../libs/common/domain/src/lib/model/record'
13
+ import { AvatarServiceInterface } from '../../../../../../libs/api/repository/src'
9
14
 
10
15
  @Injectable()
11
16
  /**
@@ -15,19 +20,31 @@ import { CatalogRecord } from '../../../../../../libs/common/domain/src/lib/mode
15
20
  * To clear the current record use the `close()` method.
16
21
  */
17
22
  export class MdViewFacade {
23
+ constructor(
24
+ private store: Store,
25
+ private linkClassifier: LinkClassifierService,
26
+ private avatarService: AvatarServiceInterface
27
+ ) {}
28
+
18
29
  isPresent$ = this.store.pipe(
19
30
  select(MdViewSelectors.getMetadataUuid),
20
31
  map((uuid) => !!uuid)
21
32
  )
22
- isLoading$ = this.store.pipe(select(MdViewSelectors.getMetadataIsLoading))
33
+
34
+ isMetadataLoading$ = this.store.pipe(
35
+ select(MdViewSelectors.getMetadataIsLoading)
36
+ )
37
+
23
38
  metadata$ = this.store.pipe(
24
39
  select(MdViewSelectors.getMetadata),
25
40
  filter((md) => !!md)
26
41
  )
42
+
27
43
  isIncomplete$ = this.store.pipe(
28
44
  select(MdViewSelectors.getMetadataIsIncomplete),
29
45
  filter((incomplete) => incomplete !== null)
30
46
  )
47
+
31
48
  error$ = this.store.pipe(select(MdViewSelectors.getMetadataError))
32
49
 
33
50
  related$ = this.store.pipe(select(MdViewSelectors.getRelated))
@@ -37,11 +54,13 @@ export class MdViewFacade {
37
54
  allLinks$ = this.metadata$.pipe(
38
55
  map((record) => ('distributions' in record ? record.distributions : []))
39
56
  )
57
+
40
58
  apiLinks$ = this.allLinks$.pipe(
41
59
  map((links) =>
42
60
  links.filter((link) => this.linkClassifier.hasUsage(link, LinkUsage.API))
43
61
  )
44
62
  )
63
+
45
64
  mapApiLinks$ = this.allLinks$.pipe(
46
65
  map((links) =>
47
66
  links.filter((link) =>
@@ -49,6 +68,7 @@ export class MdViewFacade {
49
68
  )
50
69
  )
51
70
  )
71
+
52
72
  downloadLinks$ = this.allLinks$.pipe(
53
73
  map((links) =>
54
74
  links.filter((link) =>
@@ -56,11 +76,13 @@ export class MdViewFacade {
56
76
  )
57
77
  )
58
78
  )
79
+
59
80
  dataLinks$ = this.allLinks$.pipe(
60
81
  map((links) =>
61
82
  links.filter((link) => this.linkClassifier.hasUsage(link, LinkUsage.DATA))
62
83
  )
63
84
  )
85
+
64
86
  geoDataLinks$ = this.allLinks$.pipe(
65
87
  map((links) =>
66
88
  links.filter((link) =>
@@ -68,9 +90,11 @@ export class MdViewFacade {
68
90
  )
69
91
  )
70
92
  )
93
+
71
94
  landingPageLinks$ = this.metadata$.pipe(
72
95
  map((record) => ('landingPage' in record ? [record.landingPage] : []))
73
96
  )
97
+
74
98
  otherLinks$ = this.allLinks$.pipe(
75
99
  map((links) =>
76
100
  links.filter((link) =>
@@ -79,10 +103,13 @@ export class MdViewFacade {
79
103
  )
80
104
  )
81
105
 
82
- constructor(
83
- private store: Store,
84
- private linkClassifier: LinkClassifierService
85
- ) {}
106
+ userFeedbacks$ = this.store.pipe(select(MdViewSelectors.getUserFeedbacks))
107
+ isAllUserFeedbackLoading$ = this.store.pipe(
108
+ select(MdViewSelectors.getAllUserFeedbacksLoading)
109
+ )
110
+ isAddUserFeedbackLoading$ = this.store.pipe(
111
+ select(MdViewSelectors.getAddUserFeedbacksLoading)
112
+ )
86
113
 
87
114
  /**
88
115
  * This will show an incomplete record (e.g. from a search result) as a preview
@@ -91,16 +118,30 @@ export class MdViewFacade {
91
118
  setIncompleteMetadata(incomplete: CatalogRecord) {
92
119
  this.store.dispatch(MdViewActions.setIncompleteMetadata({ incomplete }))
93
120
  }
121
+
94
122
  /**
95
123
  * This will trigger the load of a full metadata record
96
124
  */
97
125
  loadFull(uuid: string) {
98
126
  this.store.dispatch(MdViewActions.loadFullMetadata({ uuid }))
99
127
  }
100
- close() {
101
- this.store.dispatch(MdViewActions.close())
128
+
129
+ closeMetadata() {
130
+ this.store.dispatch(MdViewActions.closeMetadata())
102
131
  }
132
+
103
133
  setChartConfig(chartConfig: DatavizConfigurationModel) {
104
134
  this.store.dispatch(MdViewActions.setChartConfig({ chartConfig }))
105
135
  }
136
+
137
+ /**
138
+ * UserFeedbacks
139
+ */
140
+ addUserFeedback(userFeedback: UserFeedback) {
141
+ this.store.dispatch(MdViewActions.addUserFeedback({ userFeedback }))
142
+ }
143
+
144
+ loadUserFeedbacks(datasetUuid: string) {
145
+ this.store.dispatch(MdViewActions.loadUserFeedbacks({ datasetUuid }))
146
+ }
106
147
  }
@@ -1,61 +1,118 @@
1
1
  import { Action, createReducer, on } from '@ngrx/store'
2
- import * as MdViewActions from './mdview.actions'
2
+ import * as MetadataViewActions from './mdview.actions'
3
3
  import { DatavizConfigurationModel } from '../../../../../../libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model'
4
- import { CatalogRecord } from '../../../../../../libs/common/domain/src/lib/model/record'
4
+ import {
5
+ CatalogRecord,
6
+ UserFeedback,
7
+ } from '../../../../../../libs/common/domain/src/lib/model/record'
5
8
 
6
- export const MD_VIEW_FEATURE_STATE_KEY = 'mdView'
9
+ export const METADATA_VIEW_FEATURE_STATE_KEY = 'metadataView'
7
10
 
8
- export interface MdViewState {
11
+ export interface MetadataViewState {
9
12
  loadingFull: boolean
10
13
  error: { notFound?: boolean; otherError?: string } | null
11
14
  metadata?: Partial<CatalogRecord>
12
15
  related?: CatalogRecord[]
16
+ userFeedbacks?: UserFeedback[]
17
+ allUserFeedbacksLoading: boolean
18
+ addUserFeedbackLoading: boolean
13
19
  chartConfig?: DatavizConfigurationModel
14
20
  }
15
21
 
16
- export const initialMdviewState: MdViewState = {
22
+ export const initialMetadataViewState: MetadataViewState = {
17
23
  error: null,
18
24
  loadingFull: false,
25
+ allUserFeedbacksLoading: false,
26
+ addUserFeedbackLoading: false,
19
27
  }
20
28
 
21
- const mdViewReducer = createReducer(
22
- initialMdviewState,
23
- on(MdViewActions.loadFullMetadata, (state) => ({
29
+ const metadataViewReducer = createReducer(
30
+ initialMetadataViewState,
31
+
32
+ /*
33
+ Metadata reducers
34
+ */
35
+ on(MetadataViewActions.loadFullMetadata, (state) => ({
24
36
  ...state,
25
37
  error: null,
26
38
  loadingFull: true,
27
39
  })),
28
- on(MdViewActions.setIncompleteMetadata, (state, { incomplete }) => ({
40
+ on(MetadataViewActions.setIncompleteMetadata, (state, { incomplete }) => ({
29
41
  ...state,
30
42
  error: null,
31
43
  metadata: incomplete,
32
44
  })),
33
- on(MdViewActions.loadFullSuccess, (state, { full }) => ({
45
+ on(MetadataViewActions.loadFullMetadataSuccess, (state, { full }) => ({
34
46
  ...state,
35
47
  error: null,
36
48
  metadata: full,
37
49
  loadingFull: false,
38
50
  })),
39
- on(MdViewActions.loadFullFailure, (state, { otherError, notFound }) => ({
40
- ...state,
41
- error: { otherError, notFound },
42
- loadingFull: false,
43
- })),
44
- on(MdViewActions.setRelated, (state, { related }) => ({
51
+ on(
52
+ MetadataViewActions.loadFullMetadataFailure,
53
+ (state, { otherError, notFound }) => ({
54
+ ...state,
55
+ error: { otherError, notFound },
56
+ loadingFull: false,
57
+ })
58
+ ),
59
+ on(MetadataViewActions.closeMetadata, (state) => {
60
+ const { metadata, related, userFeedbacks, ...stateWithoutMetadata } = state
61
+ return stateWithoutMetadata
62
+ }),
63
+
64
+ /*
65
+ Related reducers
66
+ */
67
+ on(MetadataViewActions.setRelated, (state, { related }) => ({
45
68
  ...state,
46
69
  related,
47
70
  })),
48
- on(MdViewActions.setChartConfig, (state, { chartConfig }) => ({
71
+
72
+ /*
73
+ ChartConfig reducers
74
+ */
75
+ on(MetadataViewActions.setChartConfig, (state, { chartConfig }) => ({
49
76
  ...state,
50
77
  chartConfig,
51
78
  })),
52
- on(MdViewActions.close, (state) => {
53
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
54
- const { metadata, related, ...stateWithoutMd } = state
55
- return stateWithoutMd
56
- })
79
+
80
+ /*
81
+ UserFeedbacks reducers
82
+ */
83
+ on(MetadataViewActions.loadUserFeedbacks, (state) => ({
84
+ ...state,
85
+ error: null,
86
+ allUserFeedbacksLoading: true,
87
+ })),
88
+ on(MetadataViewActions.addUserFeedback, (state) => ({
89
+ ...state,
90
+ addUserFeedbackLoading: true,
91
+ })),
92
+ on(
93
+ MetadataViewActions.loadUserFeedbacksSuccess,
94
+ (state, { userFeedbacks }) => ({
95
+ ...state,
96
+ error: null,
97
+ userFeedbacks: userFeedbacks,
98
+ addUserFeedbackLoading: false,
99
+ allUserFeedbacksLoading: false,
100
+ })
101
+ ),
102
+ on(
103
+ MetadataViewActions.loadUserFeedbacksFailure,
104
+ (state, { otherError, notFound }) => ({
105
+ ...state,
106
+ error: { otherError, notFound },
107
+ addUserFeedbackLoading: false,
108
+ allUserFeedbacksLoading: false,
109
+ })
110
+ )
57
111
  )
58
112
 
59
- export function reducer(state: MdViewState | undefined, action: Action) {
60
- return mdViewReducer(state, action)
113
+ export function reducer(
114
+ metadataViewState: MetadataViewState | undefined,
115
+ action: Action
116
+ ) {
117
+ return metadataViewReducer(metadataViewState, action)
61
118
  }