geonetwork-ui 2.6.0-dev.a6b2f3e85 → 2.6.0-dev.a8e63e487

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 (222) 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 +37 -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 +41 -9
  11. package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +1 -1
  12. package/esm2022/libs/common/domain/src/lib/repository/records-repository.interface.mjs +1 -1
  13. package/esm2022/libs/feature/dataviz/src/lib/service/data.service.mjs +32 -2
  14. package/esm2022/libs/feature/editor/src/lib/components/multilingual-panel/multilingual-panel.component.mjs +266 -11
  15. package/esm2022/libs/feature/record/src/index.mjs +2 -3
  16. package/esm2022/libs/feature/record/src/lib/map-view/map-view.component.mjs +31 -5
  17. package/esm2022/libs/feature/record/src/lib/state/mdview.actions.mjs +3 -1
  18. package/esm2022/libs/feature/record/src/lib/state/mdview.effects.mjs +7 -1
  19. package/esm2022/libs/feature/record/src/lib/state/mdview.facade.mjs +13 -13
  20. package/esm2022/libs/feature/record/src/lib/state/mdview.reducer.mjs +7 -1
  21. package/esm2022/libs/feature/record/src/lib/state/mdview.selectors.mjs +3 -1
  22. package/esm2022/libs/feature/search/src/lib/constants.mjs +2 -1
  23. package/esm2022/libs/feature/search/src/lib/results-list/results-list.container.component.mjs +6 -2
  24. package/esm2022/libs/ui/elements/src/index.mjs +3 -1
  25. package/esm2022/libs/ui/elements/src/lib/geo-data-badge/geo-data-badge.component.mjs +55 -0
  26. package/esm2022/libs/ui/elements/src/lib/internal-link-card/internal-link-card.component.mjs +27 -53
  27. package/esm2022/libs/ui/elements/src/lib/kind-badge/kind-badge.component.mjs +22 -5
  28. package/esm2022/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.mjs +3 -3
  29. package/esm2022/libs/ui/elements/src/lib/metadata-info/metadata-info.component.mjs +3 -3
  30. package/esm2022/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.mjs +3 -3
  31. package/esm2022/libs/ui/elements/src/lib/record-feature-catalog/feature-catalog-list/feature-catalog-list.component.mjs +51 -0
  32. package/esm2022/libs/ui/elements/src/lib/related-record-card/related-record-card.component.mjs +17 -7
  33. package/esm2022/libs/ui/elements/src/lib/service-capabilities/service-capabilities.component.mjs +12 -4
  34. package/esm2022/libs/ui/elements/src/lib/ui-elements.module.mjs +10 -4
  35. package/esm2022/libs/ui/inputs/src/index.mjs +2 -1
  36. package/esm2022/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.mjs +3 -3
  37. package/esm2022/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.mjs +68 -0
  38. package/esm2022/libs/ui/inputs/src/lib/star-toggle/star-toggle.component.mjs +3 -3
  39. package/esm2022/libs/ui/layout/src/lib/expandable-panel/expandable-panel.component.mjs +34 -13
  40. package/esm2022/libs/ui/layout/src/lib/interactive-table/interactive-table.component.mjs +3 -3
  41. package/esm2022/libs/ui/layout/src/lib/truncated-text/truncated-text.component.mjs +65 -14
  42. package/esm2022/libs/ui/search/src/index.mjs +2 -1
  43. package/esm2022/libs/ui/search/src/lib/record-preview-row/record-preview-row.component.mjs +4 -8
  44. package/esm2022/libs/ui/search/src/lib/results-hits-search-kind/results-hits-search-kind.component.mjs +3 -3
  45. package/esm2022/libs/ui/search/src/lib/results-list/results-layout.config.mjs +2 -2
  46. package/esm2022/libs/ui/search/src/lib/results-list/results-list.component.mjs +3 -3
  47. package/esm2022/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.mjs +19 -12
  48. package/esm2022/libs/ui/search/src/lib/results-table/results-table.component.mjs +27 -14
  49. package/esm2022/libs/ui/search/src/lib/ui-search.module.mjs +10 -4
  50. package/esm2022/libs/util/i18n/src/lib/i18n.constants.mjs +42 -1
  51. package/esm2022/libs/util/i18n/src/lib/language-codes.mjs +24 -2
  52. package/esm2022/libs/util/shared/src/lib/links/link-classifier.service.mjs +4 -1
  53. package/esm2022/libs/util/shared/src/lib/links/link-utils.mjs +4 -1
  54. package/esm2022/translations/de.json +34 -5
  55. package/esm2022/translations/en.json +34 -7
  56. package/esm2022/translations/es.json +33 -4
  57. package/esm2022/translations/fr.json +34 -7
  58. package/esm2022/translations/it.json +64 -35
  59. package/esm2022/translations/nl.json +33 -4
  60. package/esm2022/translations/pt.json +33 -4
  61. package/fesm2022/geonetwork-ui.mjs +1580 -665
  62. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  63. package/libs/api/metadata-converter/src/lib/common/distribution.mapper.d.ts.map +1 -1
  64. package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts.map +1 -1
  65. package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts +0 -1
  66. package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts.map +1 -1
  67. package/libs/api/metadata-converter/src/lib/iso19115-3/read-parts.d.ts +1 -0
  68. package/libs/api/metadata-converter/src/lib/iso19115-3/read-parts.d.ts.map +1 -1
  69. package/libs/api/metadata-converter/src/lib/iso19115-3/write-parts.d.ts.map +1 -1
  70. package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts.map +1 -1
  71. package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
  72. package/libs/api/repository/src/lib/gn4/elasticsearch/constant.d.ts.map +1 -1
  73. package/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.d.ts +1 -1
  74. package/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.d.ts.map +1 -1
  75. package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts +7 -2
  76. package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts.map +1 -1
  77. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +2 -1
  78. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
  79. package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts +3 -0
  80. package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts.map +1 -1
  81. package/libs/feature/dataviz/src/lib/service/data.service.d.ts +1 -0
  82. package/libs/feature/dataviz/src/lib/service/data.service.d.ts.map +1 -1
  83. package/libs/feature/editor/src/lib/components/multilingual-panel/multilingual-panel.component.d.ts +48 -3
  84. package/libs/feature/editor/src/lib/components/multilingual-panel/multilingual-panel.component.d.ts.map +1 -1
  85. package/libs/feature/record/src/index.d.ts +1 -2
  86. package/libs/feature/record/src/index.d.ts.map +1 -1
  87. package/libs/feature/record/src/lib/map-view/map-view.component.d.ts.map +1 -1
  88. package/libs/feature/record/src/lib/state/mdview.actions.d.ts +10 -0
  89. package/libs/feature/record/src/lib/state/mdview.actions.d.ts.map +1 -1
  90. package/libs/feature/record/src/lib/state/mdview.effects.d.ts +6 -0
  91. package/libs/feature/record/src/lib/state/mdview.effects.d.ts.map +1 -1
  92. package/libs/feature/record/src/lib/state/mdview.facade.d.ts +28 -21
  93. package/libs/feature/record/src/lib/state/mdview.facade.d.ts.map +1 -1
  94. package/libs/feature/record/src/lib/state/mdview.reducer.d.ts +2 -0
  95. package/libs/feature/record/src/lib/state/mdview.reducer.d.ts.map +1 -1
  96. package/libs/feature/record/src/lib/state/mdview.selectors.d.ts +2 -0
  97. package/libs/feature/record/src/lib/state/mdview.selectors.d.ts.map +1 -1
  98. package/libs/feature/search/src/lib/constants.d.ts.map +1 -1
  99. package/libs/feature/search/src/lib/results-list/results-list.container.component.d.ts +1 -1
  100. package/libs/feature/search/src/lib/results-list/results-list.container.component.d.ts.map +1 -1
  101. package/libs/ui/elements/src/index.d.ts +2 -0
  102. package/libs/ui/elements/src/index.d.ts.map +1 -1
  103. package/libs/ui/elements/src/lib/geo-data-badge/geo-data-badge.component.d.ts +15 -0
  104. package/libs/ui/elements/src/lib/geo-data-badge/geo-data-badge.component.d.ts.map +1 -0
  105. package/libs/ui/elements/src/lib/internal-link-card/internal-link-card.component.d.ts +3 -7
  106. package/libs/ui/elements/src/lib/internal-link-card/internal-link-card.component.d.ts.map +1 -1
  107. package/libs/ui/elements/src/lib/kind-badge/kind-badge.component.d.ts +3 -1
  108. package/libs/ui/elements/src/lib/kind-badge/kind-badge.component.d.ts.map +1 -1
  109. package/libs/ui/elements/src/lib/record-feature-catalog/feature-catalog-list/feature-catalog-list.component.d.ts +16 -0
  110. package/libs/ui/elements/src/lib/record-feature-catalog/feature-catalog-list/feature-catalog-list.component.d.ts.map +1 -0
  111. package/libs/ui/elements/src/lib/related-record-card/related-record-card.component.d.ts +8 -1
  112. package/libs/ui/elements/src/lib/related-record-card/related-record-card.component.d.ts.map +1 -1
  113. package/libs/ui/elements/src/lib/service-capabilities/service-capabilities.component.d.ts +1 -0
  114. package/libs/ui/elements/src/lib/service-capabilities/service-capabilities.component.d.ts.map +1 -1
  115. package/libs/ui/elements/src/lib/ui-elements.module.d.ts +2 -1
  116. package/libs/ui/elements/src/lib/ui-elements.module.d.ts.map +1 -1
  117. package/libs/ui/inputs/src/index.d.ts +1 -0
  118. package/libs/ui/inputs/src/index.d.ts.map +1 -1
  119. package/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.d.ts +17 -0
  120. package/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.d.ts.map +1 -0
  121. package/libs/ui/layout/src/lib/expandable-panel/expandable-panel.component.d.ts +15 -8
  122. package/libs/ui/layout/src/lib/expandable-panel/expandable-panel.component.d.ts.map +1 -1
  123. package/libs/ui/layout/src/lib/truncated-text/truncated-text.component.d.ts +15 -6
  124. package/libs/ui/layout/src/lib/truncated-text/truncated-text.component.d.ts.map +1 -1
  125. package/libs/ui/search/src/index.d.ts +1 -0
  126. package/libs/ui/search/src/index.d.ts.map +1 -1
  127. package/libs/ui/search/src/lib/results-list/results-list.component.d.ts.map +1 -1
  128. package/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.d.ts +3 -3
  129. package/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.d.ts.map +1 -1
  130. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts +5 -1
  131. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts.map +1 -1
  132. package/libs/ui/search/src/lib/ui-search.module.d.ts +2 -1
  133. package/libs/ui/search/src/lib/ui-search.module.d.ts.map +1 -1
  134. package/libs/util/i18n/src/lib/i18n.constants.d.ts +1 -0
  135. package/libs/util/i18n/src/lib/i18n.constants.d.ts.map +1 -1
  136. package/libs/util/i18n/src/lib/language-codes.d.ts +23 -1
  137. package/libs/util/i18n/src/lib/language-codes.d.ts.map +1 -1
  138. package/libs/util/shared/src/lib/links/link-classifier.service.d.ts.map +1 -1
  139. package/libs/util/shared/src/lib/links/link-utils.d.ts.map +1 -1
  140. package/package.json +1 -1
  141. package/src/libs/api/metadata-converter/src/lib/common/distribution.mapper.ts +1 -0
  142. package/src/libs/api/metadata-converter/src/lib/fixtures/geocat-ch.records.ts +1 -1
  143. package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +55 -4
  144. package/src/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.ts +0 -1
  145. package/src/libs/api/metadata-converter/src/lib/iso19115-3/read-parts.ts +13 -3
  146. package/src/libs/api/metadata-converter/src/lib/iso19115-3/write-parts.ts +5 -1
  147. package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +8 -4
  148. package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +4 -1
  149. package/src/libs/api/repository/src/lib/gn4/elasticsearch/constant.ts +1 -0
  150. package/src/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.ts +2 -2
  151. package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +65 -7
  152. package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +8 -1
  153. package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +3 -0
  154. package/src/libs/common/fixtures/src/lib/elasticsearch/metadata-links.fixtures.ts +10 -0
  155. package/src/libs/common/fixtures/src/lib/link.fixtures.ts +14 -0
  156. package/src/libs/common/fixtures/src/lib/records.fixtures.ts +1 -1
  157. package/src/libs/feature/dataviz/src/lib/service/data.service.ts +37 -0
  158. package/src/libs/feature/editor/src/lib/components/multilingual-panel/multilingual-panel.component.html +117 -11
  159. package/src/libs/feature/editor/src/lib/components/multilingual-panel/multilingual-panel.component.ts +316 -6
  160. package/src/libs/feature/record/src/index.ts +1 -2
  161. package/src/libs/feature/record/src/lib/map-view/map-view.component.ts +35 -4
  162. package/src/libs/feature/record/src/lib/state/mdview.actions.ts +10 -0
  163. package/src/libs/feature/record/src/lib/state/mdview.effects.ts +22 -0
  164. package/src/libs/feature/record/src/lib/state/mdview.facade.ts +22 -15
  165. package/src/libs/feature/record/src/lib/state/mdview.reducer.ts +12 -0
  166. package/src/libs/feature/record/src/lib/state/mdview.selectors.ts +9 -0
  167. package/src/libs/feature/search/src/lib/constants.ts +1 -0
  168. package/src/libs/feature/search/src/lib/results-list/results-list.container.component.ts +2 -0
  169. package/src/libs/ui/elements/src/index.ts +2 -0
  170. package/src/libs/ui/elements/src/lib/geo-data-badge/geo-data-badge.component.css +4 -0
  171. package/src/libs/ui/elements/src/lib/geo-data-badge/geo-data-badge.component.html +13 -0
  172. package/src/libs/ui/elements/src/lib/geo-data-badge/geo-data-badge.component.ts +54 -0
  173. package/src/libs/ui/elements/src/lib/internal-link-card/internal-link-card.component.html +133 -138
  174. package/src/libs/ui/elements/src/lib/internal-link-card/internal-link-card.component.ts +19 -47
  175. package/src/libs/ui/elements/src/lib/kind-badge/kind-badge.component.html +7 -5
  176. package/src/libs/ui/elements/src/lib/kind-badge/kind-badge.component.ts +21 -2
  177. package/src/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.html +6 -3
  178. package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html +4 -0
  179. package/src/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.html +1 -1
  180. package/src/libs/ui/elements/src/lib/record-feature-catalog/feature-catalog-list/feature-catalog-list.component.html +48 -0
  181. package/src/libs/ui/elements/src/lib/record-feature-catalog/feature-catalog-list/feature-catalog-list.component.ts +52 -0
  182. package/src/libs/ui/elements/src/lib/related-record-card/related-record-card.component.html +8 -29
  183. package/src/libs/ui/elements/src/lib/related-record-card/related-record-card.component.ts +14 -1
  184. package/src/libs/ui/elements/src/lib/service-capabilities/service-capabilities.component.html +15 -1
  185. package/src/libs/ui/elements/src/lib/service-capabilities/service-capabilities.component.ts +9 -1
  186. package/src/libs/ui/elements/src/lib/ui-elements.module.ts +3 -1
  187. package/src/libs/ui/inputs/src/index.ts +1 -0
  188. package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.html +1 -1
  189. package/src/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.css +0 -0
  190. package/src/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.html +43 -0
  191. package/src/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.ts +77 -0
  192. package/src/libs/ui/inputs/src/lib/star-toggle/star-toggle.component.html +1 -2
  193. package/src/libs/ui/layout/src/lib/expandable-panel/expandable-panel.component.html +24 -8
  194. package/src/libs/ui/layout/src/lib/expandable-panel/expandable-panel.component.ts +36 -10
  195. package/src/libs/ui/layout/src/lib/interactive-table/interactive-table.component.html +1 -0
  196. package/src/libs/ui/layout/src/lib/truncated-text/truncated-text.component.html +8 -10
  197. package/src/libs/ui/layout/src/lib/truncated-text/truncated-text.component.ts +75 -7
  198. package/src/libs/ui/search/src/index.ts +1 -0
  199. package/src/libs/ui/search/src/lib/record-preview-row/record-preview-row.component.html +9 -81
  200. package/src/libs/ui/search/src/lib/results-hits-search-kind/results-hits-search-kind.component.html +1 -0
  201. package/src/libs/ui/search/src/lib/results-list/results-layout.config.ts +2 -2
  202. package/src/libs/ui/search/src/lib/results-list/results-list.component.html +1 -0
  203. package/src/libs/ui/search/src/lib/results-list/results-list.component.ts +0 -1
  204. package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.html +11 -3
  205. package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.ts +14 -11
  206. package/src/libs/ui/search/src/lib/results-table/results-table.component.css +4 -0
  207. package/src/libs/ui/search/src/lib/results-table/results-table.component.html +27 -17
  208. package/src/libs/ui/search/src/lib/results-table/results-table.component.ts +20 -10
  209. package/src/libs/ui/search/src/lib/ui-search.module.ts +3 -0
  210. package/src/libs/util/i18n/src/lib/i18n.constants.ts +42 -0
  211. package/src/libs/util/i18n/src/lib/language-codes.ts +23 -1
  212. package/src/libs/util/shared/src/lib/links/link-classifier.service.ts +3 -0
  213. package/src/libs/util/shared/src/lib/links/link-utils.ts +3 -0
  214. package/tailwind.base.css +1 -1
  215. package/translations/de.json +34 -5
  216. package/translations/en.json +34 -7
  217. package/translations/es.json +33 -4
  218. package/translations/fr.json +34 -7
  219. package/translations/it.json +64 -35
  220. package/translations/nl.json +33 -4
  221. package/translations/pt.json +33 -4
  222. package/translations/sk.json +33 -4
@@ -1,15 +1,325 @@
1
- import { Component } from '@angular/core'
1
+ import {
2
+ ChangeDetectorRef,
3
+ Component,
4
+ ElementRef,
5
+ Input,
6
+ OnDestroy,
7
+ QueryList,
8
+ ViewChildren,
9
+ ViewContainerRef,
10
+ } from '@angular/core'
2
11
  import { CommonModule } from '@angular/common'
3
- import { CheckToggleComponent } from '../../../../../../../libs/ui/inputs/src'
4
- import { TranslateModule } from '@ngx-translate/core'
12
+ import { ButtonComponent, CheckToggleComponent } from '../../../../../../../libs/ui/inputs/src'
13
+ import { TranslateModule, TranslateService } from '@ngx-translate/core'
14
+ import { CatalogRecord } from '../../../../../../../libs/common/domain/src/lib/model/record'
15
+ import {
16
+ NgIconComponent,
17
+ provideIcons,
18
+ provideNgIconsConfig,
19
+ } from '@ng-icons/core'
20
+ import {
21
+ iconoirCheckCircle,
22
+ iconoirCircle,
23
+ iconoirSettings,
24
+ } from '@ng-icons/iconoir'
25
+ import { matMoreHorizOutline } from '@ng-icons/material-icons/outline'
26
+ import { EditorFacade } from '../../+state/editor.facade'
27
+ import { ConfirmationDialogComponent } from '../../../../../../../libs/ui/elements/src'
28
+ import { MatDialog } from '@angular/material/dialog'
29
+ import { RecordsRepositoryInterface } from '../../../../../../../libs/common/domain/src/lib/repository/records-repository.interface'
30
+ import { map, Subscription } from 'rxjs'
31
+ import { Overlay, OverlayRef } from '@angular/cdk/overlay'
32
+ import { TemplatePortal } from '@angular/cdk/portal'
33
+ import { ActionMenuComponent } from '../../../../../../../libs/ui/search/src'
34
+
35
+ const extraFlagMap: { [key: string]: string } = {
36
+ ar: 'arab',
37
+ en: 'gb',
38
+ ko: 'kr',
39
+ cs: 'cz',
40
+ zh: 'cn',
41
+ ca: 'es-ct',
42
+ rm: 'ch',
43
+ da: 'dk',
44
+ sv: 'se',
45
+ cy: 'gb-wls',
46
+ hy: 'am',
47
+ ka: 'ge',
48
+ uk: 'ua',
49
+ }
5
50
 
6
51
  @Component({
7
52
  selector: 'gn-ui-multilingual-panel',
8
53
  standalone: true,
9
- imports: [CommonModule, CheckToggleComponent, TranslateModule],
54
+ imports: [
55
+ CommonModule,
56
+ CheckToggleComponent,
57
+ TranslateModule,
58
+ ButtonComponent,
59
+ NgIconComponent,
60
+ ActionMenuComponent,
61
+ ],
62
+ providers: [
63
+ provideIcons({
64
+ iconoirSettings,
65
+ matMoreHorizOutline,
66
+ iconoirCheckCircle,
67
+ iconoirCircle,
68
+ }),
69
+ provideNgIconsConfig({
70
+ size: '1.25em',
71
+ }),
72
+ ],
10
73
  templateUrl: './multilingual-panel.component.html',
11
74
  styleUrl: './multilingual-panel.component.css',
12
75
  })
13
- export class MultilingualPanelComponent {
14
- translationsEnabled = false
76
+ export class MultilingualPanelComponent implements OnDestroy {
77
+ isMultilingual: boolean
78
+ _record: CatalogRecord
79
+ editTranslations: boolean
80
+ selectedLanguages = []
81
+ recordLanguages = []
82
+ formLanguage = ''
83
+ @Input() set record(value: CatalogRecord) {
84
+ this._record = value
85
+ this.isMultilingual = value.otherLanguages.length > 0
86
+ this.editTranslations = false
87
+ this.recordLanguages = [...value.otherLanguages, value.defaultLanguage]
88
+ this.selectedLanguages = this.recordLanguages
89
+ this.formLanguage = value.defaultLanguage
90
+ }
91
+ @ViewChildren('actionMenuButton', { read: ElementRef })
92
+ actionMenuButtons!: QueryList<ElementRef>
93
+ private overlayRef!: OverlayRef
94
+
95
+ isActionMenuOpen = false
96
+ subscription = new Subscription()
97
+
98
+ supportedLanguages$ = this.recordsRepository
99
+ .getApplicationLanguages()
100
+ .pipe(map((languages) => this.sortLanguages(languages)))
101
+
102
+ constructor(
103
+ public facade: EditorFacade,
104
+ public dialog: MatDialog,
105
+ private translateService: TranslateService,
106
+ private recordsRepository: RecordsRepositoryInterface,
107
+ private overlay: Overlay,
108
+ private viewContainerRef: ViewContainerRef,
109
+ private cdr: ChangeDetectorRef
110
+ ) {}
111
+
112
+ ngOnDestroy() {
113
+ this.subscription.unsubscribe()
114
+ }
115
+
116
+ sortLanguages(languages: string[]) {
117
+ return languages
118
+ .map((lang) => {
119
+ const label = this.translateService.instant('language.' + lang)
120
+ const isTranslated = label !== 'language.' + lang
121
+
122
+ return {
123
+ lang,
124
+ label,
125
+ isTranslated,
126
+ }
127
+ })
128
+ .sort((a, b) => {
129
+ if (a.isTranslated && !b.isTranslated) return -1
130
+ if (!a.isTranslated && b.isTranslated) return 1
131
+
132
+ return a.label.localeCompare(b.label)
133
+ })
134
+ .map((item) => item.lang)
135
+ }
136
+
137
+ toggleLanguageSelection() {
138
+ this.editTranslations = !this.editTranslations
139
+ }
140
+
141
+ getIconClass(lang: string) {
142
+ return extraFlagMap[lang]
143
+ ? `fi fi-${extraFlagMap[lang]} w-4 h-3`
144
+ : `fi fi-${lang} w-4 h-3`
145
+ }
146
+
147
+ switchMultilingual() {
148
+ if (this.isMultilingual && this.selectedLanguages.length > 1) {
149
+ this.confirmDeleteAction()
150
+ } else {
151
+ this.isMultilingual = true
152
+ this.editTranslations = true
153
+ }
154
+ }
155
+
156
+ getExtraClass(lang: string) {
157
+ const baseClass = 'h-[34px] w-full font-bold justify-start hover:bg-white'
158
+ if (this.selectedLanguages.includes(lang)) {
159
+ return `${baseClass} bg-white border border-black`
160
+ }
161
+ return baseClass
162
+ }
163
+
164
+ toggleLanguage(lang: string) {
165
+ if (this.selectedLanguages.includes(lang)) {
166
+ this.removeSelectedLanguage(lang)
167
+ } else {
168
+ this.selectedLanguages.push(lang)
169
+ }
170
+ }
171
+
172
+ removeSelectedLanguage(lang: string) {
173
+ this.selectedLanguages = this.selectedLanguages.filter(
174
+ (language) => language !== lang
175
+ )
176
+ }
177
+
178
+ validateTranslations() {
179
+ const equalLength =
180
+ this.selectedLanguages.length === this.recordLanguages.length
181
+ if (
182
+ this.selectedLanguages.length < this.recordLanguages.length ||
183
+ (equalLength && this.selectedLanguages !== this.recordLanguages)
184
+ ) {
185
+ this.confirmDeleteAction(this.selectedLanguages)
186
+ } else {
187
+ this.updateTranslations()
188
+ }
189
+ }
190
+
191
+ updateTranslations() {
192
+ this.facade.updateRecordField(
193
+ 'otherLanguages',
194
+ this.selectedLanguages.filter((lang) => lang !== this.formLanguage)
195
+ )
196
+ this.recordLanguages = this.selectedLanguages
197
+ this.editTranslations = false
198
+ }
199
+
200
+ switchFormLang(lang) {
201
+ // TO IMPLEMENT FURTHER
202
+ }
203
+
204
+ switchDefaultLang(lang: string) {
205
+ this.formLanguage = lang
206
+ this.facade.updateRecordField('defaultLanguage', lang)
207
+ this.facade.updateRecordField(
208
+ 'otherLanguages',
209
+ this.selectedLanguages.filter((lang) => lang !== this.formLanguage)
210
+ )
211
+ this.closeActionMenu()
212
+ }
213
+
214
+ confirmDeleteAction(lang?: string[] | string) {
215
+ const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
216
+ data: {
217
+ title: this.translateService.instant(
218
+ 'editor.record.multilingual.confirmation.title'
219
+ ),
220
+ message: this.translateService.instant(
221
+ 'editor.record.multilingual.confirmation.message'
222
+ ),
223
+ confirmText: this.translateService.instant(
224
+ 'editor.record.multilingual.confirmation.confirmText'
225
+ ),
226
+ cancelText: this.translateService.instant(
227
+ 'editor.record.multilingual.confirmation.cancelText'
228
+ ),
229
+ },
230
+ restoreFocus: true,
231
+ })
232
+ this.subscription.add(
233
+ dialogRef.afterClosed().subscribe((confirmed) => {
234
+ if (confirmed) {
235
+ if (lang) {
236
+ if (!Array.isArray(lang)) {
237
+ this.removeSelectedLanguage(lang)
238
+ this.closeActionMenu()
239
+ }
240
+ this.updateTranslations()
241
+ } else {
242
+ this.facade.updateRecordField('otherLanguages', [])
243
+ this.isMultilingual = false
244
+ this.selectedLanguages = []
245
+ }
246
+ } else {
247
+ this.isMultilingual = true
248
+ this.selectedLanguages = this.recordLanguages
249
+ }
250
+ this.editTranslations = false
251
+ })
252
+ )
253
+ }
254
+
255
+ isFirstUnsupported(index: number): boolean {
256
+ const langs = this.sortLanguages(this.recordLanguages)
257
+ return (
258
+ langs[index].length === 3 &&
259
+ langs.slice(0, index).every((lang) => lang.length !== 3)
260
+ )
261
+ }
262
+
263
+ isLangSupported(lang: string) {
264
+ return lang.length === 2
265
+ }
266
+
267
+ getToggleTitle(lang: string) {
268
+ if (lang === this._record.defaultLanguage) {
269
+ return this.translateService.instant(
270
+ 'editor.record.form.multilingual.forbidden'
271
+ )
272
+ }
273
+ return ''
274
+ }
275
+
276
+ openActionMenu(item: string, template) {
277
+ this.isActionMenuOpen = true
278
+ const index = this.sortLanguages(this.selectedLanguages).indexOf(item)
279
+ const buttonElement = this.actionMenuButtons.toArray()[index]
280
+
281
+ const positionStrategy = this.overlay
282
+ .position()
283
+ .flexibleConnectedTo(buttonElement)
284
+ .withFlexibleDimensions(true)
285
+ .withPush(true)
286
+ .withPositions([
287
+ {
288
+ originX: 'end',
289
+ originY: 'bottom',
290
+ overlayX: 'end',
291
+ overlayY: 'top',
292
+ },
293
+ {
294
+ originX: 'end',
295
+ originY: 'top',
296
+ overlayX: 'end',
297
+ overlayY: 'bottom',
298
+ },
299
+ ])
300
+
301
+ this.overlayRef = this.overlay.create({
302
+ hasBackdrop: true,
303
+ backdropClass: 'cdk-overlay-transparent-backdrop',
304
+ positionStrategy: positionStrategy,
305
+ scrollStrategy: this.overlay.scrollStrategies.reposition(),
306
+ })
307
+
308
+ const portal = new TemplatePortal(template, this.viewContainerRef)
309
+
310
+ this.overlayRef.attach(portal)
311
+ this.subscription.add(
312
+ this.overlayRef.backdropClick().subscribe(() => {
313
+ this.closeActionMenu()
314
+ })
315
+ )
316
+ }
317
+
318
+ closeActionMenu() {
319
+ if (this.overlayRef) {
320
+ this.isActionMenuOpen = false
321
+ this.overlayRef.dispose()
322
+ this.cdr.markForCheck()
323
+ }
324
+ }
15
325
  }
@@ -5,7 +5,6 @@ export * from './lib/data-view/data-view.component'
5
5
  export * from './lib/data-view-share/data-view-share.component'
6
6
  export * from './lib/data-view-web-component/data-view-web-component.component'
7
7
  export * from './lib/external-viewer-button/external-viewer-button.component'
8
- export * from './lib/map-view/map-view.component'
9
8
  export * from './lib/gpf-api-dl/gpf-api-dl.component'
9
+ export * from './lib/map-view/map-view.component'
10
10
  export * from './lib/record-meta/record-meta.component'
11
- export * from './lib/external-viewer-button/external-viewer-button.component'
@@ -39,8 +39,8 @@ import {
39
39
  import {
40
40
  FeatureDetailComponent,
41
41
  MapContainerComponent,
42
- prioritizePageScroll,
43
42
  MapLegendComponent,
43
+ prioritizePageScroll,
44
44
  } from '../../../../../../libs/ui/map/src'
45
45
  import { Feature } from 'geojson'
46
46
  import { NgIconComponent, provideIcons } from '@ng-icons/core'
@@ -109,9 +109,20 @@ export class MapViewComponent implements AfterViewInit {
109
109
  this.mdViewFacade.mapApiLinks$,
110
110
  this.mdViewFacade.geoDataLinksWithGeometry$,
111
111
  ]).pipe(
112
- map(([mapApiLinks, geoDataLinksWithGeometry]) => {
113
- return [...mapApiLinks, ...geoDataLinksWithGeometry]
114
- })
112
+ switchMap(async ([mapApiLinks, geoDataLinksWithGeometry]) => {
113
+ // looking for TMS links to process
114
+ let processedMapApiLinks = await Promise.all(
115
+ mapApiLinks.map((link) => {
116
+ if (link.type === 'service' && link.accessServiceProtocol === 'tms') {
117
+ return this.dataService.getGeodataLinksFromTms(link)
118
+ }
119
+ return link
120
+ })
121
+ )
122
+ processedMapApiLinks = processedMapApiLinks.flat()
123
+ return [...processedMapApiLinks, ...geoDataLinksWithGeometry]
124
+ }),
125
+ shareReplay(1)
115
126
  )
116
127
 
117
128
  dropdownChoices$ = this.compatibleMapLinks$.pipe(
@@ -239,6 +250,26 @@ export class MapViewComponent implements AfterViewInit {
239
250
  type: 'wms',
240
251
  name: link.name,
241
252
  })
253
+ } else if (
254
+ link.type === 'service' &&
255
+ link.accessServiceProtocol === 'tms'
256
+ ) {
257
+ // FIXME: here we're assuming that the TMS serves vector tiles only; should be checked with ogc-client first
258
+ return of({
259
+ url: link.url.toString().replace(/\/?$/, '/{z}/{x}/{y}.pbf'),
260
+ type: 'xyz',
261
+ tileFormat: 'application/vnd.mapbox-vector-tile',
262
+ name: link.name,
263
+ })
264
+ } else if (
265
+ link.type === 'service' &&
266
+ link.accessServiceProtocol === 'maplibre-style'
267
+ ) {
268
+ return of({
269
+ type: 'maplibre-style',
270
+ name: link.name,
271
+ styleUrl: link.url.toString(),
272
+ })
242
273
  } else if (
243
274
  link.type === 'service' &&
244
275
  link.accessServiceProtocol === 'wmts'
@@ -54,6 +54,16 @@ export const setRelated = createAction(
54
54
  props<{ related: CatalogRecord[] }>()
55
55
  )
56
56
 
57
+ export const setSources = createAction(
58
+ '[Metadata view] Set sources',
59
+ props<{ sources: CatalogRecord[] }>()
60
+ )
61
+
62
+ export const setSourceOf = createAction(
63
+ '[Metadata view] Set has sources',
64
+ props<{ sourceOf: CatalogRecord[] }>()
65
+ )
66
+
57
67
  /*
58
68
  ChartConfig actions
59
69
  */
@@ -68,6 +68,28 @@ export class MdViewEffects {
68
68
  )
69
69
  )
70
70
 
71
+ loadSources$ = createEffect(() =>
72
+ this.actions$.pipe(
73
+ ofType(MdViewActions.loadFullMetadataSuccess),
74
+ switchMap(({ full }) => this.recordsRepository.getSources(full)),
75
+ map((sources) => {
76
+ return MdViewActions.setSources({ sources })
77
+ }),
78
+ catchError(() => of(MdViewActions.setSources({ sources: null })))
79
+ )
80
+ )
81
+
82
+ loadSourceOf$ = createEffect(() =>
83
+ this.actions$.pipe(
84
+ ofType(MdViewActions.loadFullMetadataSuccess),
85
+ switchMap(({ full }) => this.recordsRepository.getSourceOf(full)),
86
+ map((sourceOf) => {
87
+ return MdViewActions.setSourceOf({ sourceOf })
88
+ }),
89
+ catchError(() => of(MdViewActions.setSourceOf({ sourceOf: null })))
90
+ )
91
+ )
92
+
71
93
  /*
72
94
  UserFeedback effects
73
95
  */
@@ -6,6 +6,7 @@ import {
6
6
  filter,
7
7
  map,
8
8
  mergeMap,
9
+ shareReplay,
9
10
  switchMap,
10
11
  toArray,
11
12
  } from 'rxjs/operators'
@@ -15,13 +16,11 @@ import { LinkClassifierService, LinkUsage } from '../../../../../../libs/util/sh
15
16
  import { DatavizConfigurationModel } from '../../../../../../libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model'
16
17
  import {
17
18
  CatalogRecord,
18
- DatasetServiceDistribution,
19
- ServiceEndpoint,
20
19
  UserFeedback,
21
20
  } from '../../../../../../libs/common/domain/src/lib/model/record'
22
21
  import { AvatarServiceInterface } from '../../../../../../libs/api/repository/src'
23
22
  import { OgcApiRecord } from '@camptocamp/ogc-client'
24
- import { from, of } from 'rxjs'
23
+ import { from, of, Observable } from 'rxjs'
25
24
  import { DataService } from '../../../../../../libs/feature/dataviz/src'
26
25
 
27
26
  @Injectable()
@@ -77,24 +76,24 @@ export class MdViewFacade {
77
76
 
78
77
  related$ = this.store.pipe(select(MdViewSelectors.getRelated))
79
78
 
79
+ sources$ = this.store.pipe(select(MdViewSelectors.getSources))
80
+
81
+ sourceOf$ = this.store.pipe(select(MdViewSelectors.getSourceOf))
82
+
80
83
  chartConfig$ = this.store.pipe(select(MdViewSelectors.getChartConfig))
81
84
 
82
85
  allLinks$ = this.metadata$.pipe(
83
- map((record) => ('onlineResources' in record ? record.onlineResources : []))
86
+ map((record) =>
87
+ 'onlineResources' in record ? record.onlineResources : []
88
+ ),
89
+ shareReplay(1)
84
90
  )
85
91
 
86
92
  apiLinks$ = this.allLinks$.pipe(
87
93
  map((links) =>
88
- links
89
- .filter((link) => this.linkClassifier.hasUsage(link, LinkUsage.API))
90
- // Put links to IGN Géoplateforme first
91
- .sort((dd1, dd2) => {
92
- return (dd2 as DatasetServiceDistribution | ServiceEndpoint)
93
- .accessServiceProtocol === 'GPFDL'
94
- ? 1
95
- : undefined // do not change the sorting otherwise
96
- })
97
- )
94
+ links.filter((link) => this.linkClassifier.hasUsage(link, LinkUsage.API))
95
+ ),
96
+ shareReplay(1)
98
97
  )
99
98
 
100
99
  mapApiLinks$ = this.allLinks$.pipe(
@@ -102,7 +101,8 @@ export class MdViewFacade {
102
101
  links.filter((link) =>
103
102
  this.linkClassifier.hasUsage(link, LinkUsage.MAP_API)
104
103
  )
105
- )
104
+ ),
105
+ shareReplay(1)
106
106
  )
107
107
 
108
108
  downloadLinks$ = this.allLinks$.pipe(
@@ -216,4 +216,11 @@ export class MdViewFacade {
216
216
  loadUserFeedbacks(datasetUuid: string) {
217
217
  this.store.dispatch(MdViewActions.loadUserFeedbacks({ datasetUuid }))
218
218
  }
219
+
220
+ /**
221
+ * loadFeatureCatalog
222
+ */
223
+ loadFeatureCatalog(metadata: CatalogRecord) {
224
+ this.store.dispatch(MdViewActions.loadFeatureCatalog({ metadata }))
225
+ }
219
226
  }
@@ -14,6 +14,8 @@ export interface MetadataViewState {
14
14
  error: { notFound?: boolean; otherError?: string } | null
15
15
  metadata?: Partial<CatalogRecord>
16
16
  related?: CatalogRecord[]
17
+ sources?: CatalogRecord[]
18
+ sourceOf?: CatalogRecord[]
17
19
  userFeedbacks?: UserFeedback[]
18
20
  allUserFeedbacksLoading: boolean
19
21
  addUserFeedbackLoading: boolean
@@ -75,6 +77,16 @@ const metadataViewReducer = createReducer(
75
77
  related,
76
78
  })),
77
79
 
80
+ on(MetadataViewActions.setSources, (state, { sources }) => ({
81
+ ...state,
82
+ sources,
83
+ })),
84
+
85
+ on(MetadataViewActions.setSourceOf, (state, { sourceOf }) => ({
86
+ ...state,
87
+ sourceOf,
88
+ })),
89
+
78
90
  /*
79
91
  ChartConfig reducers
80
92
  */
@@ -41,6 +41,15 @@ export const getRelated = createSelector(
41
41
  (state: MetadataViewState) => state.related
42
42
  )
43
43
 
44
+ export const getSources = createSelector(
45
+ getMdViewState,
46
+ (state: MetadataViewState) => state.sources
47
+ )
48
+
49
+ export const getSourceOf = createSelector(
50
+ getMdViewState,
51
+ (state: MetadataViewState) => state.sourceOf
52
+ )
44
53
  /*
45
54
  Metadata selectors
46
55
  */
@@ -12,6 +12,7 @@ export const FIELDS_SUMMARY: FieldName[] = [
12
12
  'overview',
13
13
  'logo',
14
14
  'codelist_status_text',
15
+ 'link',
15
16
  'linkProtocol',
16
17
  'contactForResource*.organisation*',
17
18
  'contact*.organisation*',
@@ -55,8 +55,10 @@ export class ResultsListContainerComponent implements OnInit {
55
55
  @Optional()
56
56
  @Inject(RECORD_DATASET_URL_TOKEN)
57
57
  private recordDatasetUrlTemplate: string,
58
+ @Optional()
58
59
  @Inject(RECORD_SERVICE_URL_TOKEN)
59
60
  private recordServiceUrlTemplate: string,
61
+ @Optional()
60
62
  @Inject(RECORD_REUSE_URL_TOKEN)
61
63
  private recordReuseUrlTemplate: string
62
64
  ) {}
@@ -5,6 +5,7 @@ export * from './lib/content-ghost/content-ghost.component'
5
5
  export * from './lib/download-item/download-item.component'
6
6
  export * from './lib/downloads-list/downloads-list.component'
7
7
  export * from './lib/error/error.component'
8
+ export * from './lib/geo-data-badge/geo-data-badge.component'
8
9
  export * from './lib/image-input/image-input.component'
9
10
  export * from './lib/image-overlay-preview/image-overlay-preview.component'
10
11
  export * from './lib/kind-badge/kind-badge.component'
@@ -26,3 +27,4 @@ export * from './lib/user-preview/user-preview.component'
26
27
  export * from './lib/application-banner/application-banner.component'
27
28
  export * from './lib/internal-link-card/internal-link-card.component'
28
29
  export * from './lib/service-capabilities/service-capabilities.component'
30
+ export * from './lib/record-feature-catalog/feature-catalog-list/feature-catalog-list.component'
@@ -0,0 +1,4 @@
1
+ :host {
2
+ --gn-ui-geo-data-badge-background-color: var(--color-primary-white);
3
+ --gn-ui-geo-data-badge-text-color: var(--color-primary-darkest);
4
+ }
@@ -0,0 +1,13 @@
1
+ <div
2
+ [class]="badgeClasses"
3
+ [title]="'record.metadata.isGeographical' | translate"
4
+ *ngIf="isGeodata()"
5
+ >
6
+ <ng-icon
7
+ class="shrink-0 text-[0.75em]"
8
+ name="matLocationSearchingOutline"
9
+ ></ng-icon>
10
+ <span class="ml-1 hidden sm:inline-block shrink-0" *ngIf="showLabel" translate
11
+ >record.metadata.isGeographical</span
12
+ >
13
+ </div>
@@ -0,0 +1,54 @@
1
+ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
2
+ import { matLocationSearchingOutline } from '@ng-icons/material-icons/outline'
3
+ import { CatalogRecord } from '../../../../../../libs/common/domain/src/lib/model/record'
4
+ import { CommonModule } from '@angular/common'
5
+ import { TranslateModule } from '@ngx-translate/core'
6
+ import { NgIcon, provideIcons } from '@ng-icons/core'
7
+ import { LinkClassifierService, LinkUsage } from '../../../../../../libs/util/shared/src'
8
+
9
+ @Component({
10
+ selector: 'gn-ui-geo-data-badge',
11
+ templateUrl: './geo-data-badge.component.html',
12
+ styleUrls: ['./geo-data-badge.component.css'],
13
+ changeDetection: ChangeDetectionStrategy.OnPush,
14
+ standalone: true,
15
+ imports: [CommonModule, NgIcon, TranslateModule],
16
+ viewProviders: [
17
+ provideIcons({
18
+ matLocationSearchingOutline,
19
+ }),
20
+ ],
21
+ })
22
+ export class GeoDataBadgeComponent {
23
+ @Input() showLabel = true
24
+ @Input() styling = 'default'
25
+ @Input() record: CatalogRecord
26
+
27
+ isGeodata() {
28
+ const links =
29
+ 'onlineResources' in this.record ? this.record.onlineResources : []
30
+ const hasMapApi = links.some((link) =>
31
+ this.linkClassifier.hasUsage(link, LinkUsage.MAP_API)
32
+ )
33
+ const hasGeoData = links.some((link) =>
34
+ this.linkClassifier.hasUsage(link, LinkUsage.GEODATA)
35
+ )
36
+ return hasMapApi || hasGeoData
37
+ }
38
+
39
+ get badgeClasses(): string {
40
+ const baseClasses =
41
+ 'flex shrink-0 items-center badge-btn text-xs px-2 h-6 min-h-6'
42
+
43
+ switch (this.styling) {
44
+ case 'light':
45
+ return `${baseClasses} bg-primary-white text-primary-darkest`
46
+ case 'default':
47
+ return `${baseClasses} bg-primary-darker text-white`
48
+ default:
49
+ return 'flex shrink-0 items-center'
50
+ }
51
+ }
52
+
53
+ constructor(public linkClassifier: LinkClassifierService) {}
54
+ }