geonetwork-ui 2.3.0-dev.e03215d1 → 2.3.0-dev.e43863db

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 (206) hide show
  1. package/esm2022/libs/api/metadata-converter/src/lib/iso19115-3/iso19115-3.converter.mjs +2 -2
  2. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.mjs +9 -7
  3. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/read-parts.mjs +23 -8
  4. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +15 -4
  5. package/esm2022/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.mjs +9 -7
  6. package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +1 -1
  7. package/esm2022/libs/feature/dataviz/src/lib/chart-view/chart-view.component.mjs +1 -1
  8. package/esm2022/libs/feature/dataviz/src/lib/service/data.service.mjs +47 -2
  9. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.mjs +1 -1
  10. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.mjs +104 -0
  11. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.mjs +8 -3
  12. package/esm2022/libs/feature/editor/src/lib/components/wizard-field/wizard-field.component.mjs +1 -1
  13. package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +8 -1
  14. package/esm2022/libs/feature/map/src/lib/add-layer-from-ogc-api/add-layer-from-ogc-api.component.mjs +73 -20
  15. package/esm2022/libs/feature/map/src/lib/add-layer-from-wfs/add-layer-from-wfs.component.mjs +1 -1
  16. package/esm2022/libs/feature/map/src/lib/add-layer-from-wms/add-layer-from-wms.component.mjs +1 -1
  17. package/esm2022/libs/feature/map/src/lib/map-context/map-context.model.mjs +1 -1
  18. package/esm2022/libs/feature/map/src/lib/map-context/map-context.service.mjs +58 -17
  19. package/esm2022/libs/feature/map/src/lib/utils/map-utils.service.mjs +7 -3
  20. package/esm2022/libs/feature/record/src/lib/data-view/data-view.component.mjs +1 -1
  21. package/esm2022/libs/feature/record/src/lib/map-view/map-view.component.mjs +17 -9
  22. package/esm2022/libs/feature/record/src/lib/state/mdview.facade.mjs +34 -5
  23. package/esm2022/libs/feature/record/src/lib/state/mdview.reducer.mjs +1 -3
  24. package/esm2022/libs/feature/search/src/index.mjs +2 -1
  25. package/esm2022/libs/feature/search/src/lib/results-layout/results-layout.component.mjs +1 -1
  26. package/esm2022/libs/feature/search/src/lib/results-list/results-list.container.component.mjs +4 -4
  27. package/esm2022/libs/feature/search/src/lib/sort-by/sort-by.component.mjs +1 -1
  28. package/esm2022/libs/feature/search/src/lib/utils/service/fields.service.mjs +1 -1
  29. package/esm2022/libs/ui/catalog/src/lib/language-switcher/language-switcher.component.mjs +1 -1
  30. package/esm2022/libs/ui/catalog/src/lib/organisations-filter/organisations-filter.component.mjs +1 -1
  31. package/esm2022/libs/ui/elements/src/index.mjs +2 -2
  32. package/esm2022/libs/ui/elements/src/lib/api-card/api-card.component.mjs +3 -2
  33. package/esm2022/libs/ui/elements/src/lib/downloads-list/downloads-list.component.mjs +2 -2
  34. package/esm2022/libs/ui/elements/src/lib/error/error.component.mjs +30 -0
  35. package/esm2022/libs/ui/elements/src/lib/link-card/link-card.component.mjs +16 -3
  36. package/esm2022/libs/ui/elements/src/lib/record-api-form/record-api-form.component.mjs +89 -54
  37. package/esm2022/libs/ui/elements/src/lib/ui-elements.module.mjs +6 -11
  38. package/esm2022/libs/ui/elements/src/lib/user-feedback-item/user-feedback-item.component.mjs +3 -5
  39. package/esm2022/libs/ui/inputs/src/index.mjs +2 -1
  40. package/esm2022/libs/ui/inputs/src/lib/check-toggle/check-toggle.component.mjs +4 -3
  41. package/esm2022/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.mjs +5 -3
  42. package/esm2022/libs/ui/inputs/src/lib/previous-next-buttons/previous-next-buttons.component.mjs +29 -0
  43. package/esm2022/libs/ui/inputs/src/lib/text-input/text-input.component.mjs +5 -3
  44. package/esm2022/libs/ui/inputs/src/lib/ui-inputs.module.mjs +6 -5
  45. package/esm2022/libs/ui/layout/src/index.mjs +2 -1
  46. package/esm2022/libs/ui/layout/src/lib/block-list/block-list.component.mjs +76 -0
  47. package/esm2022/libs/ui/layout/src/lib/carousel/carousel.component.mjs +42 -18
  48. package/esm2022/libs/ui/layout/src/lib/ui-layout.module.mjs +3 -8
  49. package/esm2022/libs/util/app-config/src/lib/app-config.mjs +3 -1
  50. package/esm2022/libs/util/app-config/src/lib/fixtures.mjs +2 -1
  51. package/esm2022/libs/util/app-config/src/lib/model.mjs +1 -1
  52. package/esm2022/libs/util/shared/src/lib/links/link-classifier.service.mjs +2 -2
  53. package/esm2022/translations/de.json +12 -14
  54. package/esm2022/translations/en.json +12 -14
  55. package/esm2022/translations/es.json +12 -14
  56. package/esm2022/translations/fr.json +12 -14
  57. package/esm2022/translations/it.json +12 -14
  58. package/esm2022/translations/nl.json +12 -14
  59. package/esm2022/translations/pt.json +12 -14
  60. package/fesm2022/geonetwork-ui.mjs +997 -536
  61. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  62. package/libs/api/metadata-converter/src/lib/iso19115-3/iso19115-3.converter.d.ts +2 -2
  63. package/libs/api/metadata-converter/src/lib/iso19115-3/iso19115-3.converter.d.ts.map +1 -1
  64. package/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.d.ts +1 -1
  65. package/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.d.ts.map +1 -1
  66. package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts +4 -1
  67. package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts.map +1 -1
  68. package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts +2 -1
  69. package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
  70. package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts.map +1 -1
  71. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +3 -3
  72. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
  73. package/libs/feature/dataviz/src/lib/service/data.service.d.ts +4 -1
  74. package/libs/feature/dataviz/src/lib/service/data.service.d.ts.map +1 -1
  75. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.d.ts +21 -0
  76. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.d.ts.map +1 -0
  77. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts +1 -0
  78. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts.map +1 -1
  79. package/libs/feature/editor/src/lib/fields.config.d.ts.map +1 -1
  80. package/libs/feature/map/src/lib/add-layer-from-ogc-api/add-layer-from-ogc-api.component.d.ts +10 -5
  81. package/libs/feature/map/src/lib/add-layer-from-ogc-api/add-layer-from-ogc-api.component.d.ts.map +1 -1
  82. package/libs/feature/map/src/lib/map-context/map-context.model.d.ts +7 -0
  83. package/libs/feature/map/src/lib/map-context/map-context.model.d.ts.map +1 -1
  84. package/libs/feature/map/src/lib/map-context/map-context.service.d.ts +1 -1
  85. package/libs/feature/map/src/lib/map-context/map-context.service.d.ts.map +1 -1
  86. package/libs/feature/map/src/lib/utils/map-utils.service.d.ts.map +1 -1
  87. package/libs/feature/record/src/lib/map-view/map-view.component.d.ts +2 -2
  88. package/libs/feature/record/src/lib/map-view/map-view.component.d.ts.map +1 -1
  89. package/libs/feature/record/src/lib/state/mdview.facade.d.ts +5 -2
  90. package/libs/feature/record/src/lib/state/mdview.facade.d.ts.map +1 -1
  91. package/libs/feature/record/src/lib/state/mdview.reducer.d.ts.map +1 -1
  92. package/libs/feature/search/src/index.d.ts +1 -0
  93. package/libs/feature/search/src/index.d.ts.map +1 -1
  94. package/libs/feature/search/src/lib/utils/service/fields.service.d.ts +3 -3
  95. package/libs/feature/search/src/lib/utils/service/fields.service.d.ts.map +1 -1
  96. package/libs/ui/elements/src/index.d.ts +1 -1
  97. package/libs/ui/elements/src/index.d.ts.map +1 -1
  98. package/libs/ui/elements/src/lib/api-card/api-card.component.d.ts.map +1 -1
  99. package/libs/ui/elements/src/lib/error/error.component.d.ts +16 -0
  100. package/libs/ui/elements/src/lib/error/error.component.d.ts.map +1 -0
  101. package/libs/ui/elements/src/lib/link-card/link-card.component.d.ts +3 -1
  102. package/libs/ui/elements/src/lib/link-card/link-card.component.d.ts.map +1 -1
  103. package/libs/ui/elements/src/lib/record-api-form/record-api-form.component.d.ts +22 -4
  104. package/libs/ui/elements/src/lib/record-api-form/record-api-form.component.d.ts.map +1 -1
  105. package/libs/ui/elements/src/lib/ui-elements.module.d.ts +29 -30
  106. package/libs/ui/elements/src/lib/ui-elements.module.d.ts.map +1 -1
  107. package/libs/ui/elements/src/lib/user-feedback-item/user-feedback-item.component.d.ts +1 -2
  108. package/libs/ui/elements/src/lib/user-feedback-item/user-feedback-item.component.d.ts.map +1 -1
  109. package/libs/ui/inputs/src/index.d.ts +1 -0
  110. package/libs/ui/inputs/src/index.d.ts.map +1 -1
  111. package/libs/ui/inputs/src/lib/check-toggle/check-toggle.component.d.ts +1 -1
  112. package/libs/ui/inputs/src/lib/check-toggle/check-toggle.component.d.ts.map +1 -1
  113. package/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.d.ts +2 -1
  114. package/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.d.ts.map +1 -1
  115. package/libs/ui/inputs/src/lib/previous-next-buttons/previous-next-buttons.component.d.ts +12 -0
  116. package/libs/ui/inputs/src/lib/previous-next-buttons/previous-next-buttons.component.d.ts.map +1 -0
  117. package/libs/ui/inputs/src/lib/text-input/text-input.component.d.ts +2 -1
  118. package/libs/ui/inputs/src/lib/text-input/text-input.component.d.ts.map +1 -1
  119. package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts +27 -27
  120. package/libs/ui/layout/src/index.d.ts +1 -0
  121. package/libs/ui/layout/src/index.d.ts.map +1 -1
  122. package/libs/ui/layout/src/lib/block-list/block-list.component.d.ts +25 -0
  123. package/libs/ui/layout/src/lib/block-list/block-list.component.d.ts.map +1 -0
  124. package/libs/ui/layout/src/lib/carousel/carousel.component.d.ts +13 -6
  125. package/libs/ui/layout/src/lib/carousel/carousel.component.d.ts.map +1 -1
  126. package/libs/ui/layout/src/lib/ui-layout.module.d.ts +4 -5
  127. package/libs/ui/layout/src/lib/ui-layout.module.d.ts.map +1 -1
  128. package/libs/util/app-config/src/lib/app-config.d.ts.map +1 -1
  129. package/libs/util/app-config/src/lib/fixtures.d.ts.map +1 -1
  130. package/libs/util/app-config/src/lib/model.d.ts +1 -0
  131. package/libs/util/app-config/src/lib/model.d.ts.map +1 -1
  132. package/package.json +2 -2
  133. package/src/libs/api/metadata-converter/src/lib/fixtures/generic.records.ts +9 -1
  134. package/src/libs/api/metadata-converter/src/lib/iso19115-3/iso19115-3.converter.ts +3 -3
  135. package/src/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.ts +35 -31
  136. package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +68 -16
  137. package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +72 -17
  138. package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.ts +16 -10
  139. package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +3 -3
  140. package/src/libs/common/fixtures/src/lib/link.fixtures.ts +8 -0
  141. package/src/libs/common/fixtures/src/lib/records.fixtures.ts +8 -0
  142. package/src/libs/feature/dataviz/src/lib/service/data.service.ts +65 -1
  143. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.css +0 -0
  144. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.html +14 -0
  145. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.ts +143 -0
  146. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +5 -0
  147. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +5 -0
  148. package/src/libs/feature/editor/src/lib/fields.config.ts +7 -0
  149. package/src/libs/feature/map/src/lib/add-layer-from-ogc-api/add-layer-from-ogc-api.component.css +7 -0
  150. package/src/libs/feature/map/src/lib/add-layer-from-ogc-api/add-layer-from-ogc-api.component.html +32 -18
  151. package/src/libs/feature/map/src/lib/add-layer-from-ogc-api/add-layer-from-ogc-api.component.ts +72 -17
  152. package/src/libs/feature/map/src/lib/map-context/map-context.model.ts +7 -0
  153. package/src/libs/feature/map/src/lib/map-context/map-context.service.ts +57 -17
  154. package/src/libs/feature/map/src/lib/utils/map-utils.service.ts +6 -2
  155. package/src/libs/feature/record/src/lib/map-view/map-view.component.ts +17 -9
  156. package/src/libs/feature/record/src/lib/state/mdview.facade.ts +40 -4
  157. package/src/libs/feature/record/src/lib/state/mdview.reducer.ts +0 -2
  158. package/src/libs/feature/search/src/index.ts +1 -0
  159. package/src/libs/feature/search/src/lib/results-list/results-list.container.component.html +4 -4
  160. package/src/libs/feature/search/src/lib/utils/service/fields.service.ts +2 -2
  161. package/src/libs/ui/elements/src/index.ts +1 -1
  162. package/src/libs/ui/elements/src/lib/api-card/api-card.component.ts +2 -1
  163. package/src/libs/ui/elements/src/lib/downloads-list/downloads-list.component.ts +1 -1
  164. package/src/libs/ui/elements/src/lib/{search-results-error/search-results-error.component.html → error/error.component.html} +18 -3
  165. package/src/libs/ui/elements/src/lib/{search-results-error/search-results-error.component.ts → error/error.component.ts} +5 -4
  166. package/src/libs/ui/elements/src/lib/link-card/link-card.component.html +38 -20
  167. package/src/libs/ui/elements/src/lib/link-card/link-card.component.ts +12 -0
  168. package/src/libs/ui/elements/src/lib/record-api-form/record-api-form.component.html +25 -9
  169. package/src/libs/ui/elements/src/lib/record-api-form/record-api-form.component.ts +116 -57
  170. package/src/libs/ui/elements/src/lib/ui-elements.module.ts +3 -6
  171. package/src/libs/ui/elements/src/lib/user-feedback-item/user-feedback-item.component.html +1 -1
  172. package/src/libs/ui/elements/src/lib/user-feedback-item/user-feedback-item.component.ts +0 -1
  173. package/src/libs/ui/inputs/src/index.ts +1 -0
  174. package/src/libs/ui/inputs/src/lib/check-toggle/check-toggle.component.ts +3 -0
  175. package/src/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.html +1 -0
  176. package/src/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.ts +1 -0
  177. package/src/libs/ui/inputs/src/lib/previous-next-buttons/previous-next-buttons.component.css +6 -0
  178. package/src/libs/ui/inputs/src/lib/previous-next-buttons/previous-next-buttons.component.html +26 -0
  179. package/src/libs/ui/inputs/src/lib/previous-next-buttons/previous-next-buttons.component.ts +32 -0
  180. package/src/libs/ui/inputs/src/lib/text-input/text-input.component.html +1 -0
  181. package/src/libs/ui/inputs/src/lib/text-input/text-input.component.ts +1 -0
  182. package/src/libs/ui/inputs/src/lib/ui-inputs.module.ts +1 -1
  183. package/src/libs/ui/layout/src/index.ts +1 -0
  184. package/src/libs/ui/layout/src/lib/block-list/block-list.component.css +23 -0
  185. package/src/libs/ui/layout/src/lib/block-list/block-list.component.html +20 -0
  186. package/src/libs/ui/layout/src/lib/block-list/block-list.component.ts +84 -0
  187. package/src/libs/ui/layout/src/lib/carousel/carousel.component.css +8 -4
  188. package/src/libs/ui/layout/src/lib/carousel/carousel.component.html +4 -4
  189. package/src/libs/ui/layout/src/lib/carousel/carousel.component.ts +45 -15
  190. package/src/libs/ui/layout/src/lib/ui-layout.module.ts +0 -2
  191. package/src/libs/util/app-config/src/lib/app-config.ts +2 -0
  192. package/src/libs/util/app-config/src/lib/fixtures.ts +1 -0
  193. package/src/libs/util/app-config/src/lib/model.ts +1 -0
  194. package/src/libs/util/shared/src/lib/links/link-classifier.service.ts +1 -1
  195. package/translations/de.json +12 -14
  196. package/translations/en.json +12 -14
  197. package/translations/es.json +12 -14
  198. package/translations/fr.json +12 -14
  199. package/translations/it.json +12 -14
  200. package/translations/nl.json +12 -14
  201. package/translations/pt.json +12 -14
  202. package/translations/sk.json +12 -14
  203. package/esm2022/libs/ui/elements/src/lib/search-results-error/search-results-error.component.mjs +0 -29
  204. package/libs/ui/elements/src/lib/search-results-error/search-results-error.component.d.ts +0 -15
  205. package/libs/ui/elements/src/lib/search-results-error/search-results-error.component.d.ts.map +0 -1
  206. /package/src/libs/ui/elements/src/lib/{search-results-error/search-results-error.component.css → error/error.component.css} +0 -0
@@ -24,6 +24,7 @@ import { FormFieldSimpleComponent } from './form-field-simple/form-field-simple.
24
24
  import { FormFieldSpatialExtentComponent } from './form-field-spatial-extent/form-field-spatial-extent.component'
25
25
  import { FormFieldTemporalExtentComponent } from './form-field-temporal-extent/form-field-temporal-extent.component'
26
26
  import { FormFieldConfig } from './form-field.model'
27
+ import { FormFieldUpdateFrequencyComponent } from './form-field-update-frequency/form-field-update-frequency.component'
27
28
 
28
29
  @Component({
29
30
  selector: 'gn-ui-form-field',
@@ -40,6 +41,7 @@ import { FormFieldConfig } from './form-field.model'
40
41
  FormFieldWrapperComponent,
41
42
  FormFieldLicenseComponent,
42
43
  FormFieldResourceUpdatedComponent,
44
+ FormFieldUpdateFrequencyComponent,
43
45
  FormFieldSimpleComponent,
44
46
  FormFieldRichComponent,
45
47
  FormFieldObjectComponent,
@@ -130,6 +132,9 @@ export class FormFieldComponent {
130
132
  get isResourceUpdated() {
131
133
  return this.model === 'resourceUpdated'
132
134
  }
135
+ get isUpdateFrequency() {
136
+ return this.model === 'updateFrequency'
137
+ }
133
138
 
134
139
  get withoutWrapper() {
135
140
  return this.model === 'title' || this.model === 'abstract'
@@ -47,4 +47,11 @@ export const DEFAULT_FIELDS: EditorFieldsConfig = [
47
47
  type: 'date',
48
48
  },
49
49
  },
50
+ {
51
+ model: 'updateFrequency',
52
+ formFieldConfig: {
53
+ labelKey: marker('editor.record.form.updateFrequency'),
54
+ type: 'text',
55
+ },
56
+ },
50
57
  ]
@@ -0,0 +1,7 @@
1
+ .dropdown-content {
2
+ display: none;
3
+ }
4
+
5
+ .relative:hover .dropdown-content {
6
+ display: block;
7
+ }
@@ -4,8 +4,7 @@
4
4
  (valueChange)="urlChange.next($event)"
5
5
  [hint]="'map.ogc.urlInput.hint' | translate"
6
6
  class="w-96"
7
- >
8
- </gn-ui-text-input>
7
+ ></gn-ui-text-input>
9
8
  </div>
10
9
 
11
10
  <div *ngIf="errorMessage" class="text-red-500 mt-2">
@@ -16,21 +15,36 @@
16
15
  <p class="loading-message" translate>map.loading.service</p>
17
16
  </div>
18
17
 
19
- <div *ngIf="!loading && layers.length > 0">
20
- <h2 class="font-bold" translate>map.layers.available</h2>
21
- <ng-container *ngFor="let layer of layers">
22
- <div class="flex items-center justify-between my-2 layer-item-tree">
23
- <p class="max-w-xs overflow-hidden overflow-ellipsis whitespace-nowrap">
24
- {{ layer }}
25
- </p>
26
- <gn-ui-button
27
- class="layer-add-btn"
28
- type="primary"
29
- (buttonClick)="addLayer(layer)"
30
- extraClass="text-sm !px-2 !py-1"
31
- translate
32
- ><span translate> map.layer.add </span></gn-ui-button
18
+ <ng-container *ngFor="let layer of layers">
19
+ <div
20
+ *ngIf="shouldDisplayLayer(layer)"
21
+ class="flex items-center justify-between my-2 layer-item-tree"
22
+ >
23
+ <div class="flex flex-col items-start w-full">
24
+ <p
25
+ class="max-w-xs overflow-hidden overflow-ellipsis whitespace-nowrap"
26
+ [title]="layer.name"
33
27
  >
28
+ {{ layer.name }}
29
+ </p>
30
+ <div class="flex justify-between items-center w-full">
31
+ <gn-ui-dropdown-selector
32
+ [title]="'Add Layer As' | translate"
33
+ [choices]="getLayerChoices(layer)"
34
+ (selectValue)="onLayerTypeSelect(layer.name, $event)"
35
+ [selected]="selectedLayerTypes[layer.name]"
36
+ extraBtnClass="w-6 h-5 !text-sm !px-2 !py-1"
37
+ ></gn-ui-dropdown-selector>
38
+ <gn-ui-button
39
+ class="layer-add-btn"
40
+ type="primary"
41
+ (buttonClick)="addLayer(layer.name, selectedLayerTypes[layer.name])"
42
+ extraClass="text-sm !px-2 !py-1"
43
+ translate
44
+ >
45
+ <span translate>map.layer.add</span>
46
+ </gn-ui-button>
47
+ </div>
34
48
  </div>
35
- </ng-container>
36
- </div>
49
+ </div>
50
+ </ng-container>
@@ -14,7 +14,7 @@ import {
14
14
  MapContextLayerTypeEnum,
15
15
  } from '../map-context/map-context.model'
16
16
  import { TranslateModule } from '@ngx-translate/core'
17
- import { UiInputsModule } from '../../../../../../libs/ui/inputs/src'
17
+ import { DropdownChoice, UiInputsModule } from '../../../../../../libs/ui/inputs/src'
18
18
  import { CommonModule } from '@angular/common'
19
19
  import { MapLayer } from '../+state/map.models'
20
20
 
@@ -30,18 +30,16 @@ export class AddLayerFromOgcApiComponent implements OnInit {
30
30
  @Output() layerAdded = new EventEmitter<MapLayer>()
31
31
 
32
32
  urlChange = new Subject<string>()
33
- layerUrl = ''
34
33
  loading = false
35
- layers: string[] = []
36
- ogcEndpoint: OgcApiEndpoint = null
34
+ layers: any[] = []
37
35
  errorMessage: string | null = null
36
+ selectedLayerTypes: { [key: string]: DropdownChoice['value'] } = {}
38
37
 
39
38
  constructor(private changeDetectorRef: ChangeDetectorRef) {}
40
39
 
41
40
  ngOnInit() {
42
41
  this.urlChange.pipe(debounceTime(700)).subscribe(() => {
43
42
  this.loadLayers()
44
- this.changeDetectorRef.detectChanges() // manually trigger change detection
45
43
  })
46
44
  }
47
45
 
@@ -49,14 +47,13 @@ export class AddLayerFromOgcApiComponent implements OnInit {
49
47
  this.errorMessage = null
50
48
  try {
51
49
  this.loading = true
52
- if (this.ogcUrl.trim() === '') {
50
+ if (!this.ogcUrl.trim()) {
53
51
  this.layers = []
54
52
  return
55
53
  }
56
- this.ogcEndpoint = await new OgcApiEndpoint(this.ogcUrl)
57
-
58
- // Currently only supports feature collections
59
- this.layers = await this.ogcEndpoint.featureCollections
54
+ const ogcEndpoint = await new OgcApiEndpoint(this.ogcUrl)
55
+ this.layers = await ogcEndpoint.allCollections
56
+ this.setDefaultLayerTypes()
60
57
  } catch (error) {
61
58
  const err = error as Error
62
59
  this.layers = []
@@ -67,14 +64,72 @@ export class AddLayerFromOgcApiComponent implements OnInit {
67
64
  }
68
65
  }
69
66
 
70
- async addLayer(layer: string) {
71
- this.layerUrl = await this.ogcEndpoint.getCollectionItemsUrl(layer)
67
+ setDefaultLayerTypes() {
68
+ this.layers.forEach((layer) => {
69
+ const choices = this.getLayerChoices(layer)
70
+ if (choices.length > 0) {
71
+ this.selectedLayerTypes[layer.name] = choices[0].value
72
+ }
73
+ })
74
+ }
72
75
 
73
- const layerToAdd: MapContextLayerModel = {
74
- name: layer,
75
- url: this.layerUrl,
76
- type: MapContextLayerTypeEnum.OGCAPI,
76
+ getLayerChoices(layer: any) {
77
+ const choices = []
78
+ if (layer.hasRecords) {
79
+ choices.push({ label: 'Records', value: 'record' })
80
+ }
81
+ if (layer.hasFeatures) {
82
+ choices.push({ label: 'Features', value: 'features' })
83
+ }
84
+ if (layer.hasVectorTiles) {
85
+ choices.push({ label: 'Vector Tiles', value: 'vectorTiles' })
86
+ }
87
+ if (layer.hasMapTiles) {
88
+ choices.push({ label: 'Map Tiles', value: 'mapTiles' })
89
+ }
90
+ return choices
91
+ }
92
+
93
+ shouldDisplayLayer(layer: any) {
94
+ return (
95
+ layer.hasRecords ||
96
+ layer.hasFeatures ||
97
+ layer.hasVectorTiles ||
98
+ layer.hasMapTiles
99
+ )
100
+ }
101
+
102
+ onLayerTypeSelect(layerName: string, selectedType: any) {
103
+ this.selectedLayerTypes[layerName] = selectedType
104
+ ? selectedType
105
+ : this.getLayerChoices(layerName)[0]?.value
106
+ }
107
+
108
+ async addLayer(layer: string, layerType: any) {
109
+ try {
110
+ const ogcEndpoint = await new OgcApiEndpoint(this.ogcUrl)
111
+ let layerUrl: string
112
+
113
+ if (layerType === 'vectorTiles') {
114
+ layerUrl = await ogcEndpoint.getVectorTilesetUrl(layer)
115
+ } else if (layerType === 'mapTiles') {
116
+ layerUrl = await ogcEndpoint.getMapTilesetUrl(layer)
117
+ } else {
118
+ layerUrl = await ogcEndpoint.getCollectionItemsUrl(layer, {
119
+ outputFormat: 'json',
120
+ })
121
+ }
122
+
123
+ const layerToAdd: MapContextLayerModel = {
124
+ name: layer,
125
+ url: layerUrl,
126
+ type: MapContextLayerTypeEnum.OGCAPI,
127
+ layerType: layerType,
128
+ }
129
+ this.layerAdded.emit({ ...layerToAdd, title: layer })
130
+ } catch (error) {
131
+ const err = error as Error
132
+ console.error('Error adding layer:', err.message)
77
133
  }
78
- this.layerAdded.emit({ ...layerToAdd, title: layer })
79
134
  }
80
135
  }
@@ -20,29 +20,35 @@ export interface MapContextLayerWmsModel {
20
20
  type: 'wms'
21
21
  url: string
22
22
  name: string
23
+ attributions?: string
23
24
  }
24
25
 
25
26
  export interface MapContextLayerWmtsModel {
26
27
  type: 'wmts'
27
28
  url: string
28
29
  name: string
30
+ attributions?: string
29
31
  }
30
32
 
31
33
  interface MapContextLayerWfsModel {
32
34
  type: 'wfs'
33
35
  url: string
34
36
  name: string
37
+ attributions?: string
35
38
  }
36
39
 
37
40
  export interface MapContextLayerOgcapiModel {
38
41
  type: 'ogcapi'
39
42
  url: string
40
43
  name: string
44
+ layerType: 'feature' | 'vectorTiles' | 'mapTiles' | 'record'
45
+ attributions?: string
41
46
  }
42
47
 
43
48
  interface LayerXyzModel {
44
49
  type: 'xyz'
45
50
  name?: string
51
+ attributions?: string
46
52
  }
47
53
  interface LayerXyzModelWithUrl extends LayerXyzModel {
48
54
  url: string
@@ -58,6 +64,7 @@ export type MapContextLayerXyzModel =
58
64
 
59
65
  interface LayerGeojson {
60
66
  type: 'geojson'
67
+ attributions?: string
61
68
  }
62
69
  interface LayerGeojsonWithUrl extends LayerGeojson {
63
70
  url: string
@@ -25,6 +25,12 @@ import WMTS from 'ol/source/WMTS'
25
25
  import { Geometry } from 'ol/geom'
26
26
  import Feature from 'ol/Feature'
27
27
  import { WfsEndpoint, WmtsEndpoint } from '@camptocamp/ogc-client'
28
+ import OGCVectorTile from 'ol/source/OGCVectorTile.js'
29
+ import { MVT } from 'ol/format'
30
+ import VectorTileLayer from 'ol/layer/VectorTile'
31
+ import OGCMapTile from 'ol/source/OGCMapTile.js'
32
+ import ImageLayer from 'ol/layer/Image'
33
+ import ImageWMS from 'ol/source/ImageWMS'
28
34
 
29
35
  export const DEFAULT_BASELAYER_CONTEXT: MapContextLayerXyzModel = {
30
36
  type: MapContextLayerTypeEnum.XYZ,
@@ -33,6 +39,7 @@ export const DEFAULT_BASELAYER_CONTEXT: MapContextLayerXyzModel = {
33
39
  `https://b.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}.png`,
34
40
  `https://c.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}.png`,
35
41
  ],
42
+ attributions: `<span>© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="https://carto.com/">Carto</a></span>`,
36
43
  }
37
44
 
38
45
  export const DEFAULT_VIEW: MapContextViewModel = {
@@ -69,38 +76,69 @@ export class MapContextService {
69
76
  }
70
77
  map.setView(this.createView(mapContext.view, map))
71
78
  map.getLayers().clear()
72
- mapContext.layers.forEach((layer) => map.addLayer(this.createLayer(layer)))
79
+ mapContext.layers.forEach((layer) =>
80
+ map.addLayer(this.createLayer(layer, mapConfig))
81
+ )
73
82
  return map
74
83
  }
75
84
 
76
- createLayer(layerModel: MapContextLayerModel): Layer {
85
+ createLayer(layerModel: MapContextLayerModel, mapConfig?: MapConfig): Layer {
77
86
  const { type } = layerModel
78
87
  const style = this.styleService.styles.default
79
88
  switch (type) {
80
89
  case MapContextLayerTypeEnum.OGCAPI:
81
- return new VectorLayer({
82
- source: new VectorSource({
83
- format: new GeoJSON(),
84
- url: layerModel.url,
85
- }),
86
- style,
87
- })
88
-
90
+ if (layerModel.layerType === 'vectorTiles') {
91
+ return new VectorTileLayer({
92
+ source: new OGCVectorTile({
93
+ url: layerModel.url,
94
+ format: new MVT(),
95
+ attributions: layerModel.attributions,
96
+ }),
97
+ })
98
+ } else if (layerModel.layerType === 'mapTiles') {
99
+ return new TileLayer({
100
+ source: new OGCMapTile({
101
+ url: layerModel.url,
102
+ attributions: layerModel.attributions,
103
+ }),
104
+ })
105
+ } else {
106
+ return new VectorLayer({
107
+ source: new VectorSource({
108
+ format: new GeoJSON(),
109
+ url: layerModel.url,
110
+ attributions: layerModel.attributions,
111
+ }),
112
+ style,
113
+ })
114
+ }
89
115
  case MapContextLayerTypeEnum.XYZ:
90
116
  return new TileLayer({
91
117
  source: new XYZ({
92
118
  url: 'url' in layerModel ? layerModel.url : undefined,
93
119
  urls: 'urls' in layerModel ? layerModel.urls : undefined,
120
+ attributions: layerModel.attributions,
94
121
  }),
95
122
  })
96
123
  case MapContextLayerTypeEnum.WMS:
97
- return new TileLayer({
98
- source: new TileWMS({
99
- url: layerModel.url,
100
- params: { LAYERS: layerModel.name },
101
- gutter: 20,
102
- }),
103
- })
124
+ if (mapConfig?.DO_NOT_TILE_WMS) {
125
+ return new ImageLayer({
126
+ source: new ImageWMS({
127
+ url: layerModel.url,
128
+ params: { LAYERS: layerModel.name },
129
+ attributions: layerModel.attributions,
130
+ }),
131
+ })
132
+ } else {
133
+ return new TileLayer({
134
+ source: new TileWMS({
135
+ url: layerModel.url,
136
+ params: { LAYERS: layerModel.name, TILED: true },
137
+ attributions: layerModel.attributions,
138
+ }),
139
+ })
140
+ }
141
+
104
142
  case MapContextLayerTypeEnum.WMTS: {
105
143
  // TODO: isolate this in utils service
106
144
  const olLayer = new TileLayer({})
@@ -123,6 +161,7 @@ export class MapContextService {
123
161
  tileGrid,
124
162
  projection: matrixSet.crs,
125
163
  dimensions,
164
+ attributions: layerModel.attributions,
126
165
  })
127
166
  )
128
167
  })
@@ -148,6 +187,7 @@ export class MapContextService {
148
187
  })
149
188
  },
150
189
  strategy: bboxStrategy,
190
+ attributions: layerModel.attributions,
151
191
  })
152
192
  )
153
193
  })
@@ -33,6 +33,7 @@ import { WmsEndpoint, WmtsEndpoint } from '@camptocamp/ogc-client'
33
33
  import { LONLAT_CRS_CODES } from '../constant/projections'
34
34
  import { fromEPSGCode, register } from 'ol/proj/proj4'
35
35
  import proj4 from 'proj4/dist/proj4'
36
+ import { defaults as defaultControls } from 'ol/control/defaults'
36
37
 
37
38
  const FEATURE_PROJECTION = 'EPSG:3857'
38
39
  const DATA_PROJECTION = 'EPSG:4326'
@@ -47,7 +48,10 @@ export class MapUtilsService {
47
48
 
48
49
  createEmptyMap(): Map {
49
50
  return new Map({
50
- controls: [],
51
+ controls: defaultControls({
52
+ attribution: true,
53
+ attributionOptions: { collapsible: false },
54
+ }),
51
55
  pixelRatio: 1,
52
56
  })
53
57
  }
@@ -213,7 +217,7 @@ export class MapUtilsService {
213
217
  }
214
218
 
215
219
  getRecordExtent(record: Partial<CatalogRecord>): Extent {
216
- if (!('spatialExtents' in record)) {
220
+ if (!('spatialExtents' in record) || record.spatialExtents.length === 0) {
217
221
  return null
218
222
  }
219
223
  // transform an array of geojson geometries into a bbox
@@ -15,7 +15,7 @@ import {
15
15
  MapUtilsService,
16
16
  } from '../../../../../../libs/feature/map/src'
17
17
  import { getOptionalMapConfig, MapConfig } from '../../../../../../libs/util/app-config/src'
18
- import { getLinkLabel, ProxyService } from '../../../../../../libs/util/shared/src'
18
+ import { getLinkLabel } from '../../../../../../libs/util/shared/src'
19
19
  import Feature from 'ol/Feature'
20
20
  import { Geometry } from 'ol/geom'
21
21
  import { StyleLike } from 'ol/style/Style'
@@ -23,10 +23,8 @@ import {
23
23
  BehaviorSubject,
24
24
  combineLatest,
25
25
  from,
26
- lastValueFrom,
27
26
  Observable,
28
27
  of,
29
- startWith,
30
28
  Subscription,
31
29
  throwError,
32
30
  withLatestFrom,
@@ -36,6 +34,7 @@ import {
36
34
  distinctUntilChanged,
37
35
  finalize,
38
36
  map,
37
+ startWith,
39
38
  switchMap,
40
39
  tap,
41
40
  } from 'rxjs/operators'
@@ -57,9 +56,11 @@ export class MapViewComponent implements OnInit, OnDestroy {
57
56
 
58
57
  compatibleMapLinks$ = combineLatest([
59
58
  this.mdViewFacade.mapApiLinks$,
60
- this.mdViewFacade.geoDataLinks$,
59
+ this.mdViewFacade.geoDataLinksWithGeometry$,
61
60
  ]).pipe(
62
- map(([mapApiLinks, geoDataLinks]) => [...mapApiLinks, ...geoDataLinks])
61
+ map(([mapApiLinks, geoDataLinksWithGeometry]) => {
62
+ return [...mapApiLinks, ...geoDataLinksWithGeometry]
63
+ })
63
64
  )
64
65
 
65
66
  dropdownChoices$ = this.compatibleMapLinks$.pipe(
@@ -104,8 +105,8 @@ export class MapViewComponent implements OnInit, OnDestroy {
104
105
  mapContext$ = this.currentLayers$.pipe(
105
106
  switchMap((layers) =>
106
107
  from(this.mapUtils.getLayerExtent(layers[0])).pipe(
107
- catchError((error) => {
108
- console.warn(error) // FIXME: report this to the user somehow
108
+ catchError(() => {
109
+ this.error = 'The layer has no extent'
109
110
  return of(undefined)
110
111
  }),
111
112
  map(
@@ -117,9 +118,15 @@ export class MapViewComponent implements OnInit, OnDestroy {
117
118
  },
118
119
  } as MapContextModel)
119
120
  ),
120
- tap(() => this.resetSelection())
121
+ tap((res) => {
122
+ this.resetSelection()
123
+ })
121
124
  )
122
125
  ),
126
+ startWith({
127
+ layers: [],
128
+ view: {},
129
+ } as MapContextModel),
123
130
  withLatestFrom(this.mdViewFacade.metadata$),
124
131
  map(([context, metadata]) => {
125
132
  if (context.view.extent) return context
@@ -196,7 +203,8 @@ export class MapViewComponent implements OnInit, OnDestroy {
196
203
  } else if (
197
204
  (link.type === 'service' &&
198
205
  (link.accessServiceProtocol === 'wfs' ||
199
- link.accessServiceProtocol === 'esriRest')) ||
206
+ link.accessServiceProtocol === 'esriRest' ||
207
+ link.accessServiceProtocol === 'ogcFeatures')) ||
200
208
  link.type === 'download'
201
209
  ) {
202
210
  return this.dataService.readAsGeoJson(link).pipe(
@@ -1,6 +1,6 @@
1
1
  import { Injectable } from '@angular/core'
2
2
  import { select, Store } from '@ngrx/store'
3
- import { filter, map } from 'rxjs/operators'
3
+ import { defaultIfEmpty, filter, map, mergeMap, scan } from 'rxjs/operators'
4
4
  import * as MdViewActions from './mdview.actions'
5
5
  import * as MdViewSelectors from './mdview.selectors'
6
6
  import { LinkClassifierService, LinkUsage } from '../../../../../../libs/util/shared/src'
@@ -8,9 +8,11 @@ import { DatavizConfigurationModel } from '../../../../../../libs/common/domain/
8
8
  import {
9
9
  CatalogRecord,
10
10
  UserFeedback,
11
- UserFeedbackViewModel,
12
11
  } from '../../../../../../libs/common/domain/src/lib/model/record'
13
12
  import { AvatarServiceInterface } from '../../../../../../libs/api/repository/src'
13
+ import { OgcApiRecord } from '@camptocamp/ogc-client'
14
+ import { from, of } from 'rxjs'
15
+ import { DataService } from '../../../../../../libs/feature/dataviz/src'
14
16
 
15
17
  @Injectable()
16
18
  /**
@@ -22,8 +24,9 @@ import { AvatarServiceInterface } from '../../../../../../libs/api/repository/sr
22
24
  export class MdViewFacade {
23
25
  constructor(
24
26
  private store: Store,
25
- private linkClassifier: LinkClassifierService,
26
- private avatarService: AvatarServiceInterface
27
+ public linkClassifier: LinkClassifierService,
28
+ private avatarService: AvatarServiceInterface,
29
+ public dataService: DataService
27
30
  ) {}
28
31
 
29
32
  isPresent$ = this.store.pipe(
@@ -91,6 +94,39 @@ export class MdViewFacade {
91
94
  )
92
95
  )
93
96
 
97
+ geoDataLinksWithGeometry$ = this.allLinks$.pipe(
98
+ mergeMap((links) => {
99
+ return from(links)
100
+ }),
101
+ mergeMap((link) => {
102
+ if (this.linkClassifier.hasUsage(link, LinkUsage.GEODATA)) {
103
+ if (
104
+ link.type === 'service' &&
105
+ link.accessServiceProtocol === 'ogcFeatures'
106
+ ) {
107
+ return from(this.dataService.getItemsFromOgcApi(link.url.href)).pipe(
108
+ map((collectionRecords: OgcApiRecord) => {
109
+ return collectionRecords && collectionRecords.geometry
110
+ ? link
111
+ : null
112
+ }),
113
+ defaultIfEmpty(null)
114
+ )
115
+ } else {
116
+ return of(link)
117
+ }
118
+ } else {
119
+ return of(null)
120
+ }
121
+ }),
122
+ scan((acc, val) => {
123
+ if (val !== null && !acc.includes(val)) {
124
+ acc.push(val)
125
+ }
126
+ return acc
127
+ }, [])
128
+ )
129
+
94
130
  landingPageLinks$ = this.metadata$.pipe(
95
131
  map((record) => ('landingPage' in record ? [record.landingPage] : []))
96
132
  )
@@ -82,7 +82,6 @@ const metadataViewReducer = createReducer(
82
82
  */
83
83
  on(MetadataViewActions.loadUserFeedbacks, (state) => ({
84
84
  ...state,
85
- error: null,
86
85
  allUserFeedbacksLoading: true,
87
86
  })),
88
87
  on(MetadataViewActions.addUserFeedback, (state) => ({
@@ -93,7 +92,6 @@ const metadataViewReducer = createReducer(
93
92
  MetadataViewActions.loadUserFeedbacksSuccess,
94
93
  (state, { userFeedbacks }) => ({
95
94
  ...state,
96
- error: null,
97
95
  userFeedbacks: userFeedbacks,
98
96
  addUserFeedbackLoading: false,
99
97
  allUserFeedbacksLoading: false,
@@ -8,6 +8,7 @@ export * from './lib/state/effects'
8
8
  export * from './lib/state/reducer'
9
9
  export * from './lib/utils/service/search.service'
10
10
  export * from './lib/utils/service/fields.service'
11
+ export * from './lib/utils/service/fields'
11
12
  export * from './lib/results-list/results-list.container.component'
12
13
  export * from './lib/filter-dropdown/filter-dropdown.component'
13
14
  export * from './lib/constants'
@@ -42,16 +42,16 @@
42
42
  </div>
43
43
 
44
44
  <div class="p-4 max-w-[600px] m-auto text-[13px]">
45
- <gn-ui-search-results-error
45
+ <gn-ui-error
46
46
  *ngIf="(errorCode$ | async) === 0"
47
47
  [type]="errorTypes.COULD_NOT_REACH_API"
48
48
  >
49
- </gn-ui-search-results-error>
50
- <gn-ui-search-results-error
49
+ </gn-ui-error>
50
+ <gn-ui-error
51
51
  *ngIf="(error$ | async) !== null && (errorCode$ | async) !== 0"
52
52
  [type]="errorTypes.RECEIVED_ERROR"
53
53
  [error]="errorMessage$ | async"
54
- ></gn-ui-search-results-error>
54
+ ></gn-ui-error>
55
55
  </div>
56
56
 
57
57
  <ng-template #favoriteToggle let-record>
@@ -36,7 +36,7 @@ marker('search.filters.contact')
36
36
  providedIn: 'root',
37
37
  })
38
38
  export class FieldsService {
39
- private fields = {
39
+ protected fields = {
40
40
  publisher: new OrganizationSearchField(this.injector),
41
41
  format: new SimpleSearchField('format', this.injector, 'asc'),
42
42
  resourceType: new TranslatedSearchField(
@@ -76,7 +76,7 @@ export class FieldsService {
76
76
  return Object.keys(this.fields)
77
77
  }
78
78
 
79
- constructor(private injector: Injector) {}
79
+ constructor(protected injector: Injector) {}
80
80
 
81
81
  getAvailableValues(fieldName: string) {
82
82
  if (this.supportedFields.indexOf(fieldName) === -1)
@@ -17,7 +17,7 @@ export * from './lib/pagination-buttons/pagination-buttons.component'
17
17
  export * from './lib/pagination/pagination.component'
18
18
  export * from './lib/record-api-form/record-api-form.component'
19
19
  export * from './lib/related-record-card/related-record-card.component'
20
- export * from './lib/search-results-error/search-results-error.component'
20
+ export * from './lib/error/error.component'
21
21
  export * from './lib/thumbnail/thumbnail.component'
22
22
  export * from './lib/ui-elements.module'
23
23
  export * from './lib/user-preview/user-preview.component'
@@ -26,7 +26,8 @@ export class ApiCardComponent implements OnInit, OnChanges {
26
26
 
27
27
  ngOnInit() {
28
28
  this.displayApiFormButton =
29
- this.link.accessServiceProtocol === 'ogcFeatures' ? true : false
29
+ this.link.accessServiceProtocol === 'ogcFeatures' ||
30
+ this.link.accessServiceProtocol === 'wfs'
30
31
  }
31
32
 
32
33
  ngOnChanges(changes: SimpleChanges) {