geonetwork-ui 2.6.0-dev.c4b99cdef → 2.6.0-dev.e291f381d

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 (39) hide show
  1. package/esm2022/libs/api/repository/src/lib/gn4/gn4-repository.mjs +2 -1
  2. package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +1 -1
  3. package/esm2022/libs/feature/dataviz/src/lib/chart-view/chart-view.component.mjs +45 -9
  4. package/esm2022/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.mjs +2 -2
  5. package/esm2022/libs/feature/dataviz/src/lib/table-view/table-view.component.mjs +25 -6
  6. package/esm2022/libs/feature/record/src/lib/data-view/data-view.component.mjs +3 -3
  7. package/esm2022/libs/feature/record/src/lib/map-view/map-view.component.mjs +3 -3
  8. package/esm2022/libs/ui/dataviz/src/lib/chart/chart.component.mjs +5 -3
  9. package/esm2022/libs/ui/dataviz/src/lib/data-table/data-table.component.mjs +11 -6
  10. package/esm2022/libs/ui/map/src/lib/components/feature-detail/feature-detail.component.mjs +29 -4
  11. package/fesm2022/geonetwork-ui.mjs +117 -29
  12. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  13. package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts.map +1 -1
  14. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +2 -0
  15. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
  16. package/libs/feature/dataviz/src/lib/chart-view/chart-view.component.d.ts +12 -8
  17. package/libs/feature/dataviz/src/lib/chart-view/chart-view.component.d.ts.map +1 -1
  18. package/libs/feature/dataviz/src/lib/table-view/table-view.component.d.ts +5 -2
  19. package/libs/feature/dataviz/src/lib/table-view/table-view.component.d.ts.map +1 -1
  20. package/libs/ui/dataviz/src/lib/chart/chart.component.d.ts +2 -1
  21. package/libs/ui/dataviz/src/lib/chart/chart.component.d.ts.map +1 -1
  22. package/libs/ui/dataviz/src/lib/data-table/data-table.component.d.ts +6 -1
  23. package/libs/ui/dataviz/src/lib/data-table/data-table.component.d.ts.map +1 -1
  24. package/libs/ui/map/src/lib/components/feature-detail/feature-detail.component.d.ts +6 -2
  25. package/libs/ui/map/src/lib/components/feature-detail/feature-detail.component.d.ts.map +1 -1
  26. package/package.json +2 -2
  27. package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +1 -0
  28. package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +2 -2
  29. package/src/libs/feature/dataviz/src/lib/chart-view/chart-view.component.html +12 -9
  30. package/src/libs/feature/dataviz/src/lib/chart-view/chart-view.component.ts +54 -10
  31. package/src/libs/feature/dataviz/src/lib/table-view/table-view.component.html +1 -0
  32. package/src/libs/feature/dataviz/src/lib/table-view/table-view.component.ts +27 -1
  33. package/src/libs/feature/record/src/lib/data-view/data-view.component.html +2 -0
  34. package/src/libs/feature/record/src/lib/map-view/map-view.component.html +4 -1
  35. package/src/libs/ui/dataviz/src/lib/chart/chart.component.ts +2 -1
  36. package/src/libs/ui/dataviz/src/lib/data-table/data-table.component.html +6 -3
  37. package/src/libs/ui/dataviz/src/lib/data-table/data-table.component.ts +5 -4
  38. package/src/libs/ui/map/src/lib/components/feature-detail/feature-detail.component.html +3 -3
  39. package/src/libs/ui/map/src/lib/components/feature-detail/feature-detail.component.ts +27 -3
@@ -1,6 +1,7 @@
1
1
  import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
2
2
  import { CommonModule } from '@angular/common'
3
3
  import type { Feature } from 'geojson'
4
+ import { DatasetFeatureCatalog } from '../../../../../../../libs/common/domain/src/lib/model/record'
4
5
 
5
6
  const geometryKeys = ['geometry', 'the_geom']
6
7
 
@@ -14,11 +15,34 @@ const geometryKeys = ['geometry', 'the_geom']
14
15
  })
15
16
  export class FeatureDetailComponent {
16
17
  @Input() feature: Feature
18
+ _featureAttributes = []
19
+ @Input() set featureCatalog(value: DatasetFeatureCatalog) {
20
+ if (value) this._featureAttributes = value.featureTypes[0].attributes
21
+ }
17
22
 
18
23
  get properties() {
19
24
  if (!this.feature) return []
20
- return Object.keys(this.feature.properties).filter(
21
- (prop) => !geometryKeys.includes(prop)
22
- )
25
+ return this.setProperties()
26
+ }
27
+
28
+ setProperties() {
29
+ const properties = Object.keys(this.feature.properties)
30
+ .filter((p) => !geometryKeys.includes(p))
31
+ .reduce((acc, p) => {
32
+ let key = p
33
+ if (this._featureAttributes.length) {
34
+ const matchingAttribute = this._featureAttributes.find(
35
+ (attr) => attr.name === p
36
+ )
37
+
38
+ if (matchingAttribute && matchingAttribute.code) {
39
+ key = matchingAttribute.code
40
+ }
41
+ }
42
+ acc[key] = this.feature.properties[p]
43
+ return acc
44
+ }, {})
45
+
46
+ return properties
23
47
  }
24
48
  }