geonetwork-ui 2.6.0-dev.857b51517 → 2.6.0-dev.9b9a26109

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 (274) hide show
  1. package/esm2022/libs/api/metadata-converter/src/lib/common/distribution.mapper.mjs +3 -1
  2. package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.mjs +40 -4
  3. package/esm2022/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.mjs +1 -1
  4. package/esm2022/libs/api/metadata-converter/src/lib/iso19115-3/read-parts.mjs +8 -4
  5. package/esm2022/libs/api/metadata-converter/src/lib/iso19115-3/write-parts.mjs +5 -2
  6. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/read-parts.mjs +4 -4
  7. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +2 -2
  8. package/esm2022/libs/api/repository/src/lib/gn4/elasticsearch/constant.mjs +2 -1
  9. package/esm2022/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.mjs +3 -3
  10. package/esm2022/libs/api/repository/src/lib/gn4/gn4-repository.mjs +66 -12
  11. package/esm2022/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.mjs +7 -1
  12. package/esm2022/libs/api/repository/src/lib/gn4/settings/gn4-settings.service.mjs +2 -1
  13. package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.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 +45 -9
  16. package/esm2022/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.mjs +2 -2
  17. package/esm2022/libs/feature/dataviz/src/lib/service/data.service.mjs +32 -2
  18. package/esm2022/libs/feature/dataviz/src/lib/table-view/table-view.component.mjs +25 -6
  19. package/esm2022/libs/feature/editor/src/lib/components/multilingual-panel/multilingual-panel.component.mjs +266 -11
  20. package/esm2022/libs/feature/record/src/index.mjs +2 -3
  21. package/esm2022/libs/feature/record/src/lib/data-view/data-view.component.mjs +3 -3
  22. package/esm2022/libs/feature/record/src/lib/map-view/map-view.component.mjs +33 -7
  23. package/esm2022/libs/feature/record/src/lib/state/mdview.actions.mjs +3 -1
  24. package/esm2022/libs/feature/record/src/lib/state/mdview.effects.mjs +7 -1
  25. package/esm2022/libs/feature/record/src/lib/state/mdview.facade.mjs +13 -13
  26. package/esm2022/libs/feature/record/src/lib/state/mdview.reducer.mjs +7 -1
  27. package/esm2022/libs/feature/record/src/lib/state/mdview.selectors.mjs +3 -1
  28. package/esm2022/libs/feature/search/src/lib/constants.mjs +2 -1
  29. package/esm2022/libs/feature/search/src/lib/results-list/results-list.container.component.mjs +6 -2
  30. package/esm2022/libs/feature/search/src/lib/results-table/results-table-container.component.mjs +13 -10
  31. package/esm2022/libs/ui/dataviz/src/lib/chart/chart.component.mjs +5 -3
  32. package/esm2022/libs/ui/dataviz/src/lib/data-table/data-table.component.mjs +11 -6
  33. package/esm2022/libs/ui/elements/src/index.mjs +3 -1
  34. package/esm2022/libs/ui/elements/src/lib/geo-data-badge/geo-data-badge.component.mjs +55 -0
  35. package/esm2022/libs/ui/elements/src/lib/internal-link-card/internal-link-card.component.mjs +42 -83
  36. package/esm2022/libs/ui/elements/src/lib/internal-link-card-contact/internal-link-card-contact.component.mjs +59 -0
  37. package/esm2022/libs/ui/elements/src/lib/kind-badge/kind-badge.component.mjs +22 -5
  38. package/esm2022/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.mjs +3 -3
  39. package/esm2022/libs/ui/elements/src/lib/metadata-info/metadata-info.component.mjs +3 -3
  40. package/esm2022/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.mjs +3 -3
  41. package/esm2022/libs/ui/elements/src/lib/record-feature-catalog/feature-catalog-list/feature-catalog-list.component.mjs +51 -0
  42. package/esm2022/libs/ui/elements/src/lib/related-record-card/related-record-card.component.mjs +17 -7
  43. package/esm2022/libs/ui/elements/src/lib/service-capabilities/service-capabilities.component.mjs +12 -4
  44. package/esm2022/libs/ui/elements/src/lib/ui-elements.module.mjs +10 -4
  45. package/esm2022/libs/ui/inputs/src/index.mjs +2 -1
  46. package/esm2022/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.mjs +3 -3
  47. package/esm2022/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.mjs +68 -0
  48. package/esm2022/libs/ui/inputs/src/lib/star-toggle/star-toggle.component.mjs +3 -3
  49. package/esm2022/libs/ui/layout/src/lib/expandable-panel/expandable-panel.component.mjs +34 -13
  50. package/esm2022/libs/ui/layout/src/lib/interactive-table/interactive-table.component.mjs +20 -10
  51. package/esm2022/libs/ui/layout/src/lib/truncated-text/truncated-text.component.mjs +65 -14
  52. package/esm2022/libs/ui/map/src/lib/components/feature-detail/feature-detail.component.mjs +29 -4
  53. package/esm2022/libs/ui/map/src/lib/components/spatial-extent/spatial-extent.component.mjs +2 -1
  54. package/esm2022/libs/ui/search/src/index.mjs +2 -1
  55. package/esm2022/libs/ui/search/src/lib/record-preview-row/record-preview-row.component.mjs +4 -8
  56. package/esm2022/libs/ui/search/src/lib/results-hits-search-kind/results-hits-search-kind.component.mjs +3 -3
  57. package/esm2022/libs/ui/search/src/lib/results-list/results-layout.config.mjs +2 -2
  58. package/esm2022/libs/ui/search/src/lib/results-list/results-list.component.mjs +3 -3
  59. package/esm2022/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.mjs +21 -12
  60. package/esm2022/libs/ui/search/src/lib/results-table/results-table.component.mjs +39 -18
  61. package/esm2022/libs/ui/search/src/lib/ui-search.module.mjs +10 -4
  62. package/esm2022/libs/util/i18n/src/lib/i18n.constants.mjs +42 -1
  63. package/esm2022/libs/util/i18n/src/lib/language-codes.mjs +24 -2
  64. package/esm2022/libs/util/shared/src/lib/links/link-classifier.service.mjs +4 -1
  65. package/esm2022/libs/util/shared/src/lib/links/link-utils.mjs +4 -1
  66. package/esm2022/translations/de.json +37 -7
  67. package/esm2022/translations/en.json +37 -9
  68. package/esm2022/translations/es.json +36 -6
  69. package/esm2022/translations/fr.json +37 -9
  70. package/esm2022/translations/it.json +66 -36
  71. package/esm2022/translations/nl.json +36 -6
  72. package/esm2022/translations/pt.json +36 -6
  73. package/fesm2022/geonetwork-ui.mjs +1847 -751
  74. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  75. package/libs/api/metadata-converter/src/lib/common/distribution.mapper.d.ts.map +1 -1
  76. package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts.map +1 -1
  77. package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts +0 -1
  78. package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts.map +1 -1
  79. package/libs/api/metadata-converter/src/lib/iso19115-3/read-parts.d.ts +1 -0
  80. package/libs/api/metadata-converter/src/lib/iso19115-3/read-parts.d.ts.map +1 -1
  81. package/libs/api/metadata-converter/src/lib/iso19115-3/write-parts.d.ts.map +1 -1
  82. package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts.map +1 -1
  83. package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
  84. package/libs/api/repository/src/lib/gn4/elasticsearch/constant.d.ts.map +1 -1
  85. package/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.d.ts +1 -1
  86. package/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.d.ts.map +1 -1
  87. package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts +13 -2
  88. package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts.map +1 -1
  89. package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts +2 -0
  90. package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts.map +1 -1
  91. package/libs/api/repository/src/lib/gn4/settings/gn4-settings.service.d.ts +1 -0
  92. package/libs/api/repository/src/lib/gn4/settings/gn4-settings.service.d.ts.map +1 -1
  93. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +4 -1
  94. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
  95. package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts +6 -0
  96. package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts.map +1 -1
  97. package/libs/feature/dataviz/src/lib/chart-view/chart-view.component.d.ts +12 -8
  98. package/libs/feature/dataviz/src/lib/chart-view/chart-view.component.d.ts.map +1 -1
  99. package/libs/feature/dataviz/src/lib/service/data.service.d.ts +1 -0
  100. package/libs/feature/dataviz/src/lib/service/data.service.d.ts.map +1 -1
  101. package/libs/feature/dataviz/src/lib/table-view/table-view.component.d.ts +5 -2
  102. package/libs/feature/dataviz/src/lib/table-view/table-view.component.d.ts.map +1 -1
  103. package/libs/feature/editor/src/lib/components/multilingual-panel/multilingual-panel.component.d.ts +48 -3
  104. package/libs/feature/editor/src/lib/components/multilingual-panel/multilingual-panel.component.d.ts.map +1 -1
  105. package/libs/feature/record/src/index.d.ts +1 -2
  106. package/libs/feature/record/src/index.d.ts.map +1 -1
  107. package/libs/feature/record/src/lib/map-view/map-view.component.d.ts.map +1 -1
  108. package/libs/feature/record/src/lib/state/mdview.actions.d.ts +10 -0
  109. package/libs/feature/record/src/lib/state/mdview.actions.d.ts.map +1 -1
  110. package/libs/feature/record/src/lib/state/mdview.effects.d.ts +6 -0
  111. package/libs/feature/record/src/lib/state/mdview.effects.d.ts.map +1 -1
  112. package/libs/feature/record/src/lib/state/mdview.facade.d.ts +28 -21
  113. package/libs/feature/record/src/lib/state/mdview.facade.d.ts.map +1 -1
  114. package/libs/feature/record/src/lib/state/mdview.reducer.d.ts +2 -0
  115. package/libs/feature/record/src/lib/state/mdview.reducer.d.ts.map +1 -1
  116. package/libs/feature/record/src/lib/state/mdview.selectors.d.ts +2 -0
  117. package/libs/feature/record/src/lib/state/mdview.selectors.d.ts.map +1 -1
  118. package/libs/feature/search/src/lib/constants.d.ts.map +1 -1
  119. package/libs/feature/search/src/lib/results-list/results-list.container.component.d.ts +1 -1
  120. package/libs/feature/search/src/lib/results-list/results-list.container.component.d.ts.map +1 -1
  121. package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts +6 -5
  122. package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts.map +1 -1
  123. package/libs/ui/dataviz/src/lib/chart/chart.component.d.ts +2 -1
  124. package/libs/ui/dataviz/src/lib/chart/chart.component.d.ts.map +1 -1
  125. package/libs/ui/dataviz/src/lib/data-table/data-table.component.d.ts +6 -1
  126. package/libs/ui/dataviz/src/lib/data-table/data-table.component.d.ts.map +1 -1
  127. package/libs/ui/elements/src/index.d.ts +2 -0
  128. package/libs/ui/elements/src/index.d.ts.map +1 -1
  129. package/libs/ui/elements/src/lib/geo-data-badge/geo-data-badge.component.d.ts +15 -0
  130. package/libs/ui/elements/src/lib/geo-data-badge/geo-data-badge.component.d.ts.map +1 -0
  131. package/libs/ui/elements/src/lib/internal-link-card/internal-link-card.component.d.ts +6 -13
  132. package/libs/ui/elements/src/lib/internal-link-card/internal-link-card.component.d.ts.map +1 -1
  133. package/libs/ui/elements/src/lib/internal-link-card-contact/internal-link-card-contact.component.d.ts +14 -0
  134. package/libs/ui/elements/src/lib/internal-link-card-contact/internal-link-card-contact.component.d.ts.map +1 -0
  135. package/libs/ui/elements/src/lib/kind-badge/kind-badge.component.d.ts +3 -1
  136. package/libs/ui/elements/src/lib/kind-badge/kind-badge.component.d.ts.map +1 -1
  137. package/libs/ui/elements/src/lib/record-feature-catalog/feature-catalog-list/feature-catalog-list.component.d.ts +16 -0
  138. package/libs/ui/elements/src/lib/record-feature-catalog/feature-catalog-list/feature-catalog-list.component.d.ts.map +1 -0
  139. package/libs/ui/elements/src/lib/related-record-card/related-record-card.component.d.ts +8 -1
  140. package/libs/ui/elements/src/lib/related-record-card/related-record-card.component.d.ts.map +1 -1
  141. package/libs/ui/elements/src/lib/service-capabilities/service-capabilities.component.d.ts +1 -0
  142. package/libs/ui/elements/src/lib/service-capabilities/service-capabilities.component.d.ts.map +1 -1
  143. package/libs/ui/elements/src/lib/ui-elements.module.d.ts +2 -1
  144. package/libs/ui/elements/src/lib/ui-elements.module.d.ts.map +1 -1
  145. package/libs/ui/inputs/src/index.d.ts +1 -0
  146. package/libs/ui/inputs/src/index.d.ts.map +1 -1
  147. package/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.d.ts +17 -0
  148. package/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.d.ts.map +1 -0
  149. package/libs/ui/layout/src/lib/expandable-panel/expandable-panel.component.d.ts +15 -8
  150. package/libs/ui/layout/src/lib/expandable-panel/expandable-panel.component.d.ts.map +1 -1
  151. package/libs/ui/layout/src/lib/interactive-table/interactive-table.component.d.ts +4 -2
  152. package/libs/ui/layout/src/lib/interactive-table/interactive-table.component.d.ts.map +1 -1
  153. package/libs/ui/layout/src/lib/truncated-text/truncated-text.component.d.ts +15 -6
  154. package/libs/ui/layout/src/lib/truncated-text/truncated-text.component.d.ts.map +1 -1
  155. package/libs/ui/map/src/lib/components/feature-detail/feature-detail.component.d.ts +6 -2
  156. package/libs/ui/map/src/lib/components/feature-detail/feature-detail.component.d.ts.map +1 -1
  157. package/libs/ui/map/src/lib/components/spatial-extent/spatial-extent.component.d.ts.map +1 -1
  158. package/libs/ui/search/src/index.d.ts +1 -0
  159. package/libs/ui/search/src/index.d.ts.map +1 -1
  160. package/libs/ui/search/src/lib/results-list/results-list.component.d.ts.map +1 -1
  161. package/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.d.ts +4 -3
  162. package/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.d.ts.map +1 -1
  163. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts +10 -4
  164. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts.map +1 -1
  165. package/libs/ui/search/src/lib/ui-search.module.d.ts +2 -1
  166. package/libs/ui/search/src/lib/ui-search.module.d.ts.map +1 -1
  167. package/libs/util/i18n/src/lib/i18n.constants.d.ts +1 -0
  168. package/libs/util/i18n/src/lib/i18n.constants.d.ts.map +1 -1
  169. package/libs/util/i18n/src/lib/language-codes.d.ts +23 -1
  170. package/libs/util/i18n/src/lib/language-codes.d.ts.map +1 -1
  171. package/libs/util/shared/src/lib/links/link-classifier.service.d.ts.map +1 -1
  172. package/libs/util/shared/src/lib/links/link-utils.d.ts.map +1 -1
  173. package/package.json +2 -2
  174. package/src/libs/api/metadata-converter/src/lib/common/distribution.mapper.ts +1 -0
  175. package/src/libs/api/metadata-converter/src/lib/fixtures/geocat-ch.records.ts +1 -1
  176. package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +62 -4
  177. package/src/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.ts +0 -1
  178. package/src/libs/api/metadata-converter/src/lib/iso19115-3/read-parts.ts +13 -3
  179. package/src/libs/api/metadata-converter/src/lib/iso19115-3/write-parts.ts +5 -1
  180. package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +8 -4
  181. package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +4 -1
  182. package/src/libs/api/repository/src/lib/gn4/elasticsearch/constant.ts +1 -0
  183. package/src/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.ts +2 -2
  184. package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +105 -12
  185. package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.ts +11 -0
  186. package/src/libs/api/repository/src/lib/gn4/settings/gn4-settings.service.ts +3 -0
  187. package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +9 -2
  188. package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +6 -0
  189. package/src/libs/common/fixtures/src/lib/elasticsearch/metadata-links.fixtures.ts +10 -0
  190. package/src/libs/common/fixtures/src/lib/link.fixtures.ts +14 -0
  191. package/src/libs/common/fixtures/src/lib/records.fixtures.ts +50 -1
  192. package/src/libs/feature/dataviz/src/lib/chart-view/chart-view.component.html +12 -9
  193. package/src/libs/feature/dataviz/src/lib/chart-view/chart-view.component.ts +54 -10
  194. package/src/libs/feature/dataviz/src/lib/service/data.service.ts +37 -0
  195. package/src/libs/feature/dataviz/src/lib/table-view/table-view.component.html +1 -0
  196. package/src/libs/feature/dataviz/src/lib/table-view/table-view.component.ts +27 -1
  197. package/src/libs/feature/editor/src/lib/components/multilingual-panel/multilingual-panel.component.html +117 -11
  198. package/src/libs/feature/editor/src/lib/components/multilingual-panel/multilingual-panel.component.ts +316 -6
  199. package/src/libs/feature/record/src/index.ts +1 -2
  200. package/src/libs/feature/record/src/lib/data-view/data-view.component.html +2 -0
  201. package/src/libs/feature/record/src/lib/map-view/map-view.component.html +4 -1
  202. package/src/libs/feature/record/src/lib/map-view/map-view.component.ts +35 -4
  203. package/src/libs/feature/record/src/lib/state/mdview.actions.ts +10 -0
  204. package/src/libs/feature/record/src/lib/state/mdview.effects.ts +22 -0
  205. package/src/libs/feature/record/src/lib/state/mdview.facade.ts +22 -15
  206. package/src/libs/feature/record/src/lib/state/mdview.reducer.ts +12 -0
  207. package/src/libs/feature/record/src/lib/state/mdview.selectors.ts +9 -0
  208. package/src/libs/feature/search/src/lib/constants.ts +1 -0
  209. package/src/libs/feature/search/src/lib/results-list/results-list.container.component.ts +2 -0
  210. package/src/libs/feature/search/src/lib/results-table/results-table-container.component.html +1 -0
  211. package/src/libs/feature/search/src/lib/results-table/results-table-container.component.ts +13 -3
  212. package/src/libs/ui/dataviz/src/lib/chart/chart.component.ts +2 -1
  213. package/src/libs/ui/dataviz/src/lib/data-table/data-table.component.html +6 -3
  214. package/src/libs/ui/dataviz/src/lib/data-table/data-table.component.ts +5 -4
  215. package/src/libs/ui/elements/src/index.ts +2 -0
  216. package/src/libs/ui/elements/src/lib/geo-data-badge/geo-data-badge.component.css +4 -0
  217. package/src/libs/ui/elements/src/lib/geo-data-badge/geo-data-badge.component.html +13 -0
  218. package/src/libs/ui/elements/src/lib/geo-data-badge/geo-data-badge.component.ts +54 -0
  219. package/src/libs/ui/elements/src/lib/internal-link-card/internal-link-card.component.html +68 -141
  220. package/src/libs/ui/elements/src/lib/internal-link-card/internal-link-card.component.ts +38 -97
  221. package/src/libs/ui/elements/src/lib/internal-link-card-contact/internal-link-card-contact.component.html +69 -0
  222. package/src/libs/ui/elements/src/lib/internal-link-card-contact/internal-link-card-contact.component.ts +61 -0
  223. package/src/libs/ui/elements/src/lib/kind-badge/kind-badge.component.html +7 -5
  224. package/src/libs/ui/elements/src/lib/kind-badge/kind-badge.component.ts +21 -2
  225. package/src/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.html +6 -3
  226. package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html +4 -0
  227. package/src/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.html +1 -1
  228. package/src/libs/ui/elements/src/lib/record-feature-catalog/feature-catalog-list/feature-catalog-list.component.html +48 -0
  229. package/src/libs/ui/elements/src/lib/record-feature-catalog/feature-catalog-list/feature-catalog-list.component.ts +52 -0
  230. package/src/libs/ui/elements/src/lib/related-record-card/related-record-card.component.html +8 -29
  231. package/src/libs/ui/elements/src/lib/related-record-card/related-record-card.component.ts +14 -1
  232. package/src/libs/ui/elements/src/lib/service-capabilities/service-capabilities.component.html +15 -1
  233. package/src/libs/ui/elements/src/lib/service-capabilities/service-capabilities.component.ts +9 -1
  234. package/src/libs/ui/elements/src/lib/ui-elements.module.ts +3 -1
  235. package/src/libs/ui/inputs/src/index.ts +1 -0
  236. package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.html +1 -1
  237. package/src/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.css +0 -0
  238. package/src/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.html +43 -0
  239. package/src/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.ts +77 -0
  240. package/src/libs/ui/inputs/src/lib/star-toggle/star-toggle.component.html +1 -2
  241. package/src/libs/ui/layout/src/lib/expandable-panel/expandable-panel.component.html +24 -8
  242. package/src/libs/ui/layout/src/lib/expandable-panel/expandable-panel.component.ts +36 -10
  243. package/src/libs/ui/layout/src/lib/interactive-table/interactive-table.component.html +3 -2
  244. package/src/libs/ui/layout/src/lib/interactive-table/interactive-table.component.ts +13 -6
  245. package/src/libs/ui/layout/src/lib/truncated-text/truncated-text.component.html +8 -10
  246. package/src/libs/ui/layout/src/lib/truncated-text/truncated-text.component.ts +75 -7
  247. package/src/libs/ui/map/src/lib/components/feature-detail/feature-detail.component.html +3 -3
  248. package/src/libs/ui/map/src/lib/components/feature-detail/feature-detail.component.ts +27 -3
  249. package/src/libs/ui/map/src/lib/components/spatial-extent/spatial-extent.component.ts +1 -0
  250. package/src/libs/ui/search/src/index.ts +1 -0
  251. package/src/libs/ui/search/src/lib/record-preview-row/record-preview-row.component.html +9 -81
  252. package/src/libs/ui/search/src/lib/results-hits-search-kind/results-hits-search-kind.component.html +1 -0
  253. package/src/libs/ui/search/src/lib/results-list/results-layout.config.ts +2 -2
  254. package/src/libs/ui/search/src/lib/results-list/results-list.component.html +1 -0
  255. package/src/libs/ui/search/src/lib/results-list/results-list.component.ts +0 -1
  256. package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.html +16 -6
  257. package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.ts +15 -11
  258. package/src/libs/ui/search/src/lib/results-table/results-table.component.css +4 -0
  259. package/src/libs/ui/search/src/lib/results-table/results-table.component.html +31 -27
  260. package/src/libs/ui/search/src/lib/results-table/results-table.component.ts +33 -15
  261. package/src/libs/ui/search/src/lib/ui-search.module.ts +3 -0
  262. package/src/libs/util/i18n/src/lib/i18n.constants.ts +42 -0
  263. package/src/libs/util/i18n/src/lib/language-codes.ts +23 -1
  264. package/src/libs/util/shared/src/lib/links/link-classifier.service.ts +3 -0
  265. package/src/libs/util/shared/src/lib/links/link-utils.ts +3 -0
  266. package/tailwind.base.css +1 -1
  267. package/translations/de.json +37 -7
  268. package/translations/en.json +37 -9
  269. package/translations/es.json +36 -6
  270. package/translations/fr.json +37 -9
  271. package/translations/it.json +66 -36
  272. package/translations/nl.json +36 -6
  273. package/translations/pt.json +36 -6
  274. package/translations/sk.json +36 -6
@@ -65,7 +65,8 @@ export function extractCharacterString(): ChainableFunction<
65
65
  return pipe(
66
66
  fallback(
67
67
  findChildElement('gco:CharacterString', false),
68
- findChildElement('gmx:Anchor', false)
68
+ findChildElement('gmx:Anchor', false),
69
+ findChildElement('gmx:MimeFileType', false)
69
70
  ),
70
71
  readText()
71
72
  )
@@ -1161,11 +1162,14 @@ export function readOtherLanguages(rootEl: XmlElement): LanguageCode[] {
1161
1162
  findChildrenElement('gmd:locale', false),
1162
1163
  mapArray(
1163
1164
  pipe(
1164
- findChildElement('gmd:LanguageCode'),
1165
+ findChildElement('lan:LanguageCode'),
1165
1166
  readAttribute('codeListValue'),
1166
- map((lang) => LANG_3_TO_2_MAPPER[lang.toLowerCase()])
1167
+ map((lang) => LANG_3_TO_2_MAPPER[lang.toLowerCase()] ?? lang)
1167
1168
  )
1168
1169
  ),
1170
+ map((languages) =>
1171
+ languages.filter((lang): lang is LanguageCode => lang !== null)
1172
+ ),
1169
1173
  map((languages) => (languages.length ? languages : [defaultLanguage]))
1170
1174
  )(rootEl)
1171
1175
  }
@@ -1173,7 +1177,7 @@ export function readOtherLanguages(rootEl: XmlElement): LanguageCode[] {
1173
1177
  export function readDefaultLanguage(rootEl: XmlElement): LanguageCode {
1174
1178
  return pipe(
1175
1179
  findChildElement('gmd:language', false),
1176
- findChildElement('gmd:LanguageCode'),
1180
+ findChildElement('lan:LanguageCode'),
1177
1181
  readAttribute('codeListValue'),
1178
1182
  map((lang) => (lang ? LANG_3_TO_2_MAPPER[lang.toLowerCase()] : null))
1179
1183
  )(rootEl)
@@ -1471,7 +1471,10 @@ export function writeLanguages(record: DatasetRecord, rootEl: XmlElement) {
1471
1471
  writeAttribute('id', lang.toUpperCase()),
1472
1472
  createNestedChild('gmd:languageCode', 'gmd:LanguageCode'),
1473
1473
  writeAttribute('codeList', 'http://www.loc.gov/standards/iso639-2/'),
1474
- writeAttribute('codeListValue', LANG_2_TO_3_MAPPER[lang])
1474
+ writeAttribute(
1475
+ 'codeListValue',
1476
+ lang.length === 2 ? LANG_2_TO_3_MAPPER[lang] : lang
1477
+ )
1475
1478
  )
1476
1479
 
1477
1480
  // add new languages (only if other than default one)
@@ -8,6 +8,7 @@ export const ES_SOURCE_SUMMARY = [
8
8
  'overview',
9
9
  'logo',
10
10
  'codelist_status_text',
11
+ 'link',
11
12
  'linkProtocol',
12
13
  'contactForResource.organisation',
13
14
  'contact.organisation',
@@ -124,11 +124,11 @@ export class ElasticsearchService {
124
124
  this.runtimeFields[fieldName] = expression
125
125
  }
126
126
 
127
- getMetadataByIdPayload(uuid: string): EsSearchParams {
127
+ getMetadataByIdsPayload(uuids: string[]): EsSearchParams {
128
128
  return {
129
129
  query: {
130
130
  ids: {
131
- values: [uuid],
131
+ values: uuids,
132
132
  },
133
133
  },
134
134
  }
@@ -14,8 +14,8 @@ import {
14
14
  import { PublicationVersionError } from '../../../../../../libs/common/domain/src/lib/model/error'
15
15
  import {
16
16
  CatalogRecord,
17
- DatasetFeatureType,
18
17
  DatasetFeatureCatalog,
18
+ DatasetFeatureType,
19
19
  } from '../../../../../../libs/common/domain/src/lib/model/record'
20
20
  import {
21
21
  Aggregations,
@@ -29,10 +29,11 @@ import {
29
29
  import { PlatformServiceInterface } from '../../../../../../libs/common/domain/src/lib/platform.service.interface'
30
30
  import { RecordsRepositoryInterface } from '../../../../../../libs/common/domain/src/lib/repository/records-repository.interface'
31
31
  import {
32
+ LanguagesApiService,
32
33
  RecordsApiService,
33
34
  SearchApiService,
34
- FeatureResponseApiModel,
35
35
  } from '../../../../../../libs/data-access/gn4/src'
36
+ import { LANG_3_TO_2_MAPPER } from '../../../../../../libs/util/i18n/src'
36
37
  import {
37
38
  combineLatest,
38
39
  exhaustMap,
@@ -47,6 +48,7 @@ import {
47
48
  import { catchError, map, tap } from 'rxjs/operators'
48
49
  import { lt } from 'semver'
49
50
  import { ElasticsearchService } from './elasticsearch'
51
+ import { Gn4SettingsService } from './settings/gn4-settings.service'
50
52
 
51
53
  const minPublicationApiVersion = '4.2.5'
52
54
 
@@ -65,7 +67,9 @@ export class Gn4Repository implements RecordsRepositoryInterface {
65
67
  private gn4SearchHelper: ElasticsearchService,
66
68
  private gn4Mapper: Gn4Converter,
67
69
  private gn4RecordsApi: RecordsApiService,
68
- private platformService: PlatformServiceInterface
70
+ private platformService: PlatformServiceInterface,
71
+ private gn4LanguagesApi: LanguagesApiService,
72
+ private settingsService: Gn4SettingsService
69
73
  ) {}
70
74
 
71
75
  search({
@@ -129,9 +133,9 @@ export class Gn4Repository implements RecordsRepositoryInterface {
129
133
  return this.gn4SearchApi
130
134
  .search(
131
135
  'bucket',
132
- ['fcats'],
136
+ ['fcats', 'hassources'],
133
137
  JSON.stringify(
134
- this.gn4SearchHelper.getMetadataByIdPayload(uniqueIdentifier)
138
+ this.gn4SearchHelper.getMetadataByIdsPayload([uniqueIdentifier])
135
139
  )
136
140
  )
137
141
  .pipe(
@@ -142,6 +146,27 @@ export class Gn4Repository implements RecordsRepositoryInterface {
142
146
  )
143
147
  }
144
148
 
149
+ getMultipleRecords(
150
+ uniqueIdentifiers: string[]
151
+ ): Observable<CatalogRecord[] | null> {
152
+ return this.gn4SearchApi
153
+ .search(
154
+ 'bucket',
155
+ undefined,
156
+ JSON.stringify(
157
+ this.gn4SearchHelper.getMetadataByIdsPayload(uniqueIdentifiers)
158
+ )
159
+ )
160
+ .pipe(
161
+ map((results: Gn4SearchResults) => results.hits.hits),
162
+ switchMap((records) =>
163
+ records && records.length > 0
164
+ ? this.gn4Mapper.readRecords(records)
165
+ : of(null)
166
+ )
167
+ )
168
+ }
169
+
145
170
  private mapEmbeddedFeatureCatalog(
146
171
  featureTypes: Array<DatasetFeatureType>
147
172
  ): DatasetFeatureCatalog {
@@ -152,7 +177,9 @@ export class Gn4Repository implements RecordsRepositoryInterface {
152
177
  attributes: Array.isArray(featureType.attributeTable)
153
178
  ? featureType.attributeTable.map((attr) => ({
154
179
  name: attr.name,
180
+ code: attr.code,
155
181
  title: attr.definition,
182
+ type: attr.type,
156
183
  }))
157
184
  : [],
158
185
  })),
@@ -164,7 +191,8 @@ export class Gn4Repository implements RecordsRepositoryInterface {
164
191
  ): Observable<DatasetFeatureCatalog | null> {
165
192
  if (
166
193
  record.extras?.['featureTypes'] &&
167
- Array.isArray(record.extras['featureTypes'])
194
+ Array.isArray(record.extras['featureTypes']) &&
195
+ record.extras['featureTypes'].length > 0
168
196
  ) {
169
197
  return of(this.mapEmbeddedFeatureCatalog(record.extras['featureTypes']))
170
198
  }
@@ -200,6 +228,24 @@ export class Gn4Repository implements RecordsRepositoryInterface {
200
228
  )
201
229
  }
202
230
 
231
+ getSources(record: CatalogRecord): Observable<CatalogRecord[]> {
232
+ const sourcesIdentifiers = record.extras?.['sourcesIdentifiers'] as string[]
233
+ if (sourcesIdentifiers && sourcesIdentifiers.length > 0) {
234
+ return this.getMultipleRecords(sourcesIdentifiers)
235
+ }
236
+ return of(null)
237
+ }
238
+
239
+ getSourceOf(record: CatalogRecord): Observable<CatalogRecord[]> {
240
+ const sourceOfIdentifiers = record.extras?.[
241
+ 'sourceOfIdentifiers'
242
+ ] as string[]
243
+ if (sourceOfIdentifiers && sourceOfIdentifiers.length > 0) {
244
+ return this.getMultipleRecords(sourceOfIdentifiers)
245
+ }
246
+ return of(null)
247
+ }
248
+
203
249
  aggregate(params: AggregationsParams): Observable<Aggregations> {
204
250
  // if aggregations are empty, return an empty object right away
205
251
  if (Object.keys(params).length === 0) return of({})
@@ -252,14 +298,46 @@ export class Gn4Repository implements RecordsRepositoryInterface {
252
298
  : of(true)
253
299
  }
254
300
 
255
- canEditRecord(uniqueIdentifier: string): Observable<boolean> {
256
- return this.getRecord(uniqueIdentifier).pipe(
257
- map((record) => {
258
- return record.extras['edit'] as boolean
301
+ canDuplicate(record: CatalogRecord): boolean {
302
+ return record.kind === 'dataset'
303
+ }
304
+
305
+ canDelete(record: CatalogRecord): Observable<boolean> {
306
+ return this.settingsService.allowEditHarvested$.pipe(
307
+ map((allowEditHarvested) => {
308
+ return (
309
+ record.extras['edit'] &&
310
+ (!record.extras['isHarvested'] || allowEditHarvested)
311
+ )
259
312
  })
260
313
  )
261
314
  }
262
315
 
316
+ private canEdit(record: CatalogRecord, allowEditHarvested: boolean): boolean {
317
+ return (
318
+ record.kind === 'dataset' &&
319
+ record.extras['edit'] &&
320
+ (!record.extras['isHarvested'] || allowEditHarvested)
321
+ )
322
+ }
323
+
324
+ canEditRecord(uniqueIdentifier: string): Observable<boolean> {
325
+ return combineLatest([
326
+ this.getRecord(uniqueIdentifier),
327
+ this.settingsService.allowEditHarvested$,
328
+ ]).pipe(
329
+ map(([record, allowEditHarvested]) =>
330
+ record ? this.canEdit(record, allowEditHarvested) : false
331
+ )
332
+ )
333
+ }
334
+
335
+ canEditIndexedRecord(record: CatalogRecord): Observable<boolean> {
336
+ return this.settingsService.allowEditHarvested$.pipe(
337
+ map((allowEditHarvested) => this.canEdit(record, allowEditHarvested))
338
+ )
339
+ }
340
+
263
341
  openRecordForEdition(
264
342
  uniqueIdentifier: string
265
343
  ): Observable<[CatalogRecord, string, boolean] | null> {
@@ -362,9 +440,12 @@ export class Gn4Repository implements RecordsRepositoryInterface {
362
440
  const record = await converter.readRecord(fetchedRecordAsXml)
363
441
 
364
442
  record.title = `${record.title} (Copy)`
365
- await converter.writeRecord(record, fetchedRecordAsXml)
443
+ const recordAsXml = await converter.writeRecord(
444
+ record,
445
+ fetchedRecordAsXml
446
+ )
366
447
 
367
- return this.saveRecord(record, '', false)
448
+ return this.saveRecord(record, recordAsXml, false)
368
449
  }),
369
450
  exhaustMap((uuidObservable: Observable<string>) => uuidObservable),
370
451
  catchError((error: HttpErrorResponse) => {
@@ -465,6 +546,18 @@ export class Gn4Repository implements RecordsRepositoryInterface {
465
546
  )
466
547
  }
467
548
 
549
+ getApplicationLanguages(): Observable<string[]> {
550
+ return this.gn4LanguagesApi
551
+ .getApplicationLanguages()
552
+ .pipe(
553
+ map((languages) =>
554
+ languages
555
+ .map((lang) => LANG_3_TO_2_MAPPER[lang.id ?? ''])
556
+ .filter((code): code is string => !!code)
557
+ )
558
+ )
559
+ }
560
+
468
561
  private getRecordAsXml(uniqueIdentifier: string): Observable<string | null> {
469
562
  return this.gn4RecordsApi
470
563
  .getRecordAs(
@@ -82,6 +82,13 @@ export class Gn4PlatformService implements PlatformServiceInterface {
82
82
  shareReplay(1)
83
83
  )
84
84
 
85
+ private readonly allowEditHarvestedMd$ = this.settings$.pipe(
86
+ map((info) => {
87
+ return info['system/harvester/enableEditing'] as boolean
88
+ }),
89
+ shareReplay(1)
90
+ )
91
+
85
92
  /**
86
93
  * A map of already loaded thesauri (groups of keywords); the key is a URI
87
94
  * @private
@@ -123,6 +130,10 @@ export class Gn4PlatformService implements PlatformServiceInterface {
123
130
  return this.apiVersion$
124
131
  }
125
132
 
133
+ getAllowEditHarvestedMd(): Observable<boolean> {
134
+ return this.allowEditHarvestedMd$
135
+ }
136
+
126
137
  getMe(): Observable<UserModel> {
127
138
  return this.me$
128
139
  }
@@ -11,6 +11,9 @@ export class Gn4SettingsService {
11
11
  'system/users/identicon'
12
12
  )
13
13
 
14
+ public allowEditHarvested$: Observable<boolean> =
15
+ this.getSettingsSetValueByKey('system/harvester/enableEditing')
16
+
14
17
  constructor(private siteApiService: SiteApiService) {}
15
18
 
16
19
  private getSettingsSetValueByKey(key: string) {
@@ -152,6 +152,8 @@ export type ServiceProtocol =
152
152
  | 'esriRest'
153
153
  | 'ogcFeatures'
154
154
  | 'GPFDL'
155
+ | 'tms'
156
+ | 'maplibre-style'
155
157
  | 'other'
156
158
 
157
159
  export type OnlineResourceType = 'service' | 'download' | 'link' | 'endpoint'
@@ -235,7 +237,7 @@ export type DatasetFeatureCatalog = {
235
237
  featureTypes: Array<{
236
238
  name: string
237
239
  definition: string
238
- attributes: Array<{ name: string; title: string }>
240
+ attributes: Array<{ name: string; title: string; code: string }>
239
241
  }>
240
242
  }
241
243
 
@@ -272,7 +274,12 @@ export interface DatasetFeatureType {
272
274
  isAbstract: string
273
275
  typeName: string
274
276
  definition: string
275
- attributeTable: Array<{ name: string; definition: string }>
277
+ attributeTable: Array<{
278
+ name: string
279
+ definition: string
280
+ type: string
281
+ code: string
282
+ }>
276
283
  }
277
284
 
278
285
  export type ReuseType = 'application' | 'map' | 'other'
@@ -19,8 +19,13 @@ export abstract class RecordsRepositoryInterface {
19
19
  abstract getSimilarRecords(
20
20
  similarTo: CatalogRecord
21
21
  ): Observable<CatalogRecord[]>
22
+ abstract getSources(record: CatalogRecord): Observable<CatalogRecord[]>
23
+ abstract getSourceOf(record: CatalogRecord): Observable<CatalogRecord[]>
22
24
  abstract fuzzySearch(query: string): Observable<SearchResults>
25
+ abstract canDuplicate(record: CatalogRecord): boolean
26
+ abstract canDelete(record: CatalogRecord): Observable<boolean>
23
27
  abstract canEditRecord(uniqueIdentifier: string): Observable<boolean>
28
+ abstract canEditIndexedRecord(record: CatalogRecord): Observable<boolean>
24
29
  /**
25
30
  * This emits once:
26
31
  * - record object; if a draft exists, this will return it
@@ -95,4 +100,5 @@ export abstract class RecordsRepositoryInterface {
95
100
  localRecord: CatalogRecord
96
101
  ): Observable<{ user: string; date: Date }>
97
102
  abstract getRecordPublicationStatus(uuid: string): Observable<boolean>
103
+ abstract getApplicationLanguages(): Observable<string[]>
98
104
  }
@@ -144,4 +144,14 @@ export const elasticLinkFixture = (): Record<string, unknown> => ({
144
144
  name: 'ogcapi features layer',
145
145
  url: 'https://mel.integration.apps.gs-fr-prod.camptocamp.com/data/ogcapi/collections/comptages_velo/items?',
146
146
  },
147
+ maplayerTms: {
148
+ accessServiceProtocol: 'TMS',
149
+ name: 'mytmslayer',
150
+ url: 'https://my.tms.server/MapServer',
151
+ },
152
+ maplayerTms2: {
153
+ accessServiceProtocol: 'OSGeo:TMS',
154
+ name: 'myothertmslayer',
155
+ url: 'https://my.tms.server/MapServer',
156
+ },
147
157
  })
@@ -185,6 +185,20 @@ export const aSetOfLinksFixture = () => ({
185
185
  url: new URL('https://my.ogc.server/wms'),
186
186
  accessServiceProtocol: 'wms',
187
187
  }) as DatasetServiceDistribution,
188
+ geodataTms: () =>
189
+ ({
190
+ name: 'mytmslayer',
191
+ type: 'service',
192
+ url: new URL('https://my.ogc.server/tms'),
193
+ accessServiceProtocol: 'tms',
194
+ }) as DatasetServiceDistribution,
195
+ geodataAsMaplibreStyle: () =>
196
+ ({
197
+ name: 'mytmslayerAsMaplibreJson',
198
+ type: 'service',
199
+ url: new URL('https://my.ogc.server/tms/layer/style.json'),
200
+ accessServiceProtocol: 'maplibre-style',
201
+ }) as DatasetServiceDistribution,
188
202
  geodataWfs2: () =>
189
203
  ({
190
204
  name: 'myotherlayer',
@@ -3,6 +3,7 @@ import {
3
3
  DatasetRecord,
4
4
  DatasetSpatialExtent,
5
5
  Keyword,
6
+ ServiceRecord,
6
7
  } from '../../../../../libs/common/domain/src/lib/model/record'
7
8
 
8
9
  export const datasetRecordsFixture: () => CatalogRecord[] = () => [
@@ -231,7 +232,7 @@ As such, **it is not very interesting at all.**`,
231
232
  recordUpdated: new Date('2022-04-15T14:18:19'),
232
233
  resourceUpdated: new Date('2022-03-29'),
233
234
  title:
234
- "Plan local d'urbanisme (PLU) dématérialisé - commune d'Avrigny - approbation du 29/03/2022",
235
+ "Plan local d'urbanisme (PLU) dématérialisé - commune d'Avrigny - approbation du 29/03/2022 (Ce lot informe du droit à bâtir sur la commune d'Avrigny)",
235
236
  abstract: `Plan local d'urbanisme (PLU) dématérialisé - commune d'Avrigny - approbation du 29/03/2022.
236
237
 
237
238
  Ce lot informe du droit à bâtir sur la commune d'Avrigny.
@@ -811,6 +812,54 @@ export const importDatasetRecordAsXmlFixture = (): string => `
811
812
  </gmd:identificationInfo>
812
813
  </gmd:MD_Metadata>`
813
814
 
815
+ export const simpleServiceRecordFixture = (): ServiceRecord => ({
816
+ kind: 'service',
817
+ status: null,
818
+ lineage: null,
819
+ recordUpdated: new Date('2023-03-17T07:38:08.875Z'),
820
+ recordPublished: null,
821
+ ownerOrganization: null,
822
+ licenses: [],
823
+ legalConstraints: [],
824
+ securityConstraints: [],
825
+ otherConstraints: [],
826
+ contacts: [],
827
+ contactsForResource: [],
828
+ keywords: [],
829
+ topics: [],
830
+ spatialExtents: [],
831
+ temporalExtents: [],
832
+ overviews: [],
833
+ defaultLanguage: null,
834
+ otherLanguages: [],
835
+ title: 'Sites de gestion des déchets miniers - Service de visualisation WMS',
836
+ onlineResources: [
837
+ {
838
+ name: 'Service de visualisation WMS',
839
+ description:
840
+ 'Adresse de connexion au service de visualisation WMS de la série de couches de données "Sites de gestion des déchets miniers"',
841
+ type: 'service',
842
+ url: new URL(
843
+ 'https://geoservices.wallonie.be/arcgis/services/SOL_SOUS_SOL/DECHETS_MINIERS/MapServer/WMSServer?request=GetCapabilities&service=WMS'
844
+ ),
845
+ accessServiceProtocol: 'wms',
846
+ accessRestricted: false,
847
+ },
848
+ ],
849
+ uniqueIdentifier: '00b22798-ec8e-4500-89e8-90eeeda45919',
850
+ landingPage: new URL(
851
+ 'http://localhost:4200/geonetwork/srv/fre/catalog.search#/metadata/00b22798-ec8e-4500-89e8-90eeeda45919'
852
+ ),
853
+ extras: {
854
+ isPublishedToAll: true,
855
+ id: '723',
856
+ isHarvested: true,
857
+ ownerInfo: 'admin|admin|admin|Administrator',
858
+ edit: true,
859
+ },
860
+ recordCreated: new Date('2023-03-17T07:38:08.875Z'),
861
+ })
862
+
814
863
  export const NATIONAL_KEYWORD = {
815
864
  key: 'http://inspire.ec.europa.eu/metadata-codelist/SpatialScope/national',
816
865
  label: 'National',
@@ -18,15 +18,17 @@
18
18
  [selected]="xProperty$.value"
19
19
  [title]="'chart.dropdown.xProperty' | translate"
20
20
  ></gn-ui-dropdown-selector>
21
- <gn-ui-dropdown-selector
22
- class="basis-1/4"
23
- *ngIf="!isCountAggregation"
24
- [choices]="yChoices$ | async"
25
- (selectValue)="yProperty$.next($event)"
26
- [selected]="yProperty$.value"
27
- [title]="'chart.dropdown.yProperty' | translate"
28
- class="select-y-prop"
29
- ></gn-ui-dropdown-selector>
21
+ <ng-container *ngIf="yChoices$ | async as yChoices">
22
+ <gn-ui-dropdown-selector
23
+ class="basis-1/4"
24
+ *ngIf="!isCountAggregation"
25
+ [choices]="yChoices"
26
+ (selectValue)="yProperty$.next($event)"
27
+ [selected]="yProperty$.value"
28
+ [title]="'chart.dropdown.yProperty' | translate"
29
+ class="select-y-prop"
30
+ ></gn-ui-dropdown-selector>
31
+ </ng-container>
30
32
  <gn-ui-dropdown-selector
31
33
  class="basis-1/4"
32
34
  [choices]="aggregationChoices"
@@ -43,6 +45,7 @@
43
45
  *ngIf="!error"
44
46
  [data]="chartData$ | async"
45
47
  [type]="chartType$.value"
48
+ [prettyLabel]="prettyLabel$ | async"
46
49
  [labelProperty]="labelProperty"
47
50
  [valueProperty]="valueProperty"
48
51
  ></gn-ui-chart>
@@ -2,9 +2,7 @@ import {
2
2
  ChangeDetectionStrategy,
3
3
  ChangeDetectorRef,
4
4
  Component,
5
- Inject,
6
5
  Input,
7
- Optional,
8
6
  Output,
9
7
  } from '@angular/core'
10
8
  import { marker } from '@biesbjerg/ngx-translate-extract-marker'
@@ -13,6 +11,7 @@ import {
13
11
  FetchError,
14
12
  FieldAggregation,
15
13
  getJsonDataItemsProxy,
14
+ PropertyInfo,
16
15
  } from '../../../../../../libs/util/data-fetcher/src'
17
16
  import {
18
17
  DropdownChoice,
@@ -30,7 +29,10 @@ import {
30
29
  } from 'rxjs/operators'
31
30
  import { DataService } from '../service/data.service'
32
31
  import { InputChartType } from '../../../../../../libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model'
33
- import { DatasetOnlineResource } from '../../../../../../libs/common/domain/src/lib/model/record'
32
+ import {
33
+ DatasetFeatureCatalog,
34
+ DatasetOnlineResource,
35
+ } from '../../../../../../libs/common/domain/src/lib/model/record'
34
36
  import { TranslateModule, TranslateService } from '@ngx-translate/core'
35
37
  import { CommonModule } from '@angular/common'
36
38
  import { ChartComponent } from '../../../../../../libs/ui/dataviz/src'
@@ -67,9 +69,18 @@ marker('chart.aggregation.count')
67
69
  standalone: true,
68
70
  })
69
71
  export class ChartViewComponent {
72
+ public featureCatalog$ = new BehaviorSubject<DatasetFeatureCatalog | null>(
73
+ null
74
+ )
75
+ @Input() set featureCatalog(value: DatasetFeatureCatalog) {
76
+ this.featureCatalog$.next(value)
77
+ }
70
78
  @Input() cacheActive = true
71
79
  @Input() set link(value: DatasetOnlineResource) {
72
80
  this.currentLink$.next(value)
81
+ if (value) {
82
+ this.aggregation$.next('sum')
83
+ }
73
84
  }
74
85
  private currentLink$ = new BehaviorSubject<DatasetOnlineResource>(null)
75
86
 
@@ -150,13 +161,8 @@ export class ChartViewComponent {
150
161
  }),
151
162
  shareReplay(1)
152
163
  )
153
- properties$ = this.dataset$.pipe(
154
- switchMap((dataset) =>
155
- dataset.properties.catch((error) => {
156
- this.handleError(error)
157
- return []
158
- })
159
- ),
164
+ properties$ = combineLatest([this.dataset$, this.featureCatalog$]).pipe(
165
+ switchMap(([dataset, catalog]) => this.setProperties(dataset, catalog)),
160
166
  shareReplay(1)
161
167
  )
162
168
  yChoices$ = this.properties$.pipe(
@@ -197,6 +203,7 @@ export class ChartViewComponent {
197
203
  this.yProperty$.pipe(filter((value) => value !== undefined)),
198
204
  this.aggregation$,
199
205
  ]).pipe(
206
+ filter(([_, x, y]) => !!x || !!y),
200
207
  switchMap(([dataset, xProp, yProp, aggregation]) => {
201
208
  const fieldAgg: FieldAggregation =
202
209
  aggregation === 'count' ? ['count'] : [aggregation, yProp]
@@ -217,6 +224,18 @@ export class ChartViewComponent {
217
224
  shareReplay(1)
218
225
  )
219
226
 
227
+ prettyLabel$ = combineLatest([
228
+ this.aggregation$,
229
+ this.properties$,
230
+ this.yProperty$,
231
+ ]).pipe(
232
+ map(([aggregation, properties, yProperty]) => {
233
+ if (aggregation === 'count') return 'count()'
234
+ const prop = properties.find((p) => p.name === yProperty)
235
+ return prop ? `${aggregation}(${prop.label})` : ''
236
+ })
237
+ )
238
+
220
239
  get labelProperty() {
221
240
  if (!this.xProperty$.value) return ''
222
241
  return `distinct(${this.xProperty$.value})`
@@ -235,6 +254,31 @@ export class ChartViewComponent {
235
254
  private translateService: TranslateService
236
255
  ) {}
237
256
 
257
+ setProperties(
258
+ dataset: BaseReader,
259
+ catalog: DatasetFeatureCatalog
260
+ ): Promise<PropertyInfo[]> {
261
+ return dataset.properties
262
+ .then((properties) => {
263
+ return properties.map((p) => {
264
+ if (catalog) {
265
+ const featureAttributes = catalog?.featureTypes[0]?.attributes ?? []
266
+ const matchingAttribute = featureAttributes.find(
267
+ (attr) => attr.name === p.label
268
+ )
269
+ if (matchingAttribute?.code) {
270
+ return { ...p, label: matchingAttribute.code }
271
+ }
272
+ return p
273
+ }
274
+ return p
275
+ })
276
+ })
277
+ .catch((error) => {
278
+ this.handleError(error)
279
+ return []
280
+ })
281
+ }
238
282
  handleError(error: FetchError | Error | string) {
239
283
  if (error instanceof FetchError) {
240
284
  this.error = this.translateService.instant(