geonetwork-ui 2.7.0-dev.d500b08cc → 2.7.0-dev.d51ff2ddf

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 (162) hide show
  1. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/utils/status.mapper.mjs +4 -1
  2. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +5 -1
  3. package/esm2022/libs/api/repository/src/lib/gn4/elasticsearch/constant.mjs +4 -6
  4. package/esm2022/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.mjs +47 -3
  5. package/esm2022/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.mjs +32 -4
  6. package/esm2022/libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model.mjs +1 -1
  7. package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +5 -1
  8. package/esm2022/libs/common/domain/src/lib/platform.service.interface.mjs +1 -1
  9. package/esm2022/libs/feature/dataviz/src/lib/chart-view/chart-view.component.mjs +10 -2
  10. package/esm2022/libs/feature/dataviz/src/lib/service/data.service.mjs +2 -2
  11. package/esm2022/libs/feature/editor/src/index.mjs +2 -1
  12. package/esm2022/libs/feature/editor/src/lib/components/metadata-quality-panel/metadata-quality-panel.component.mjs +80 -0
  13. package/esm2022/libs/feature/editor/src/lib/components/multilingual-panel/multilingual-panel.component.mjs +3 -3
  14. package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +1 -3
  15. package/esm2022/libs/feature/map/src/lib/utils/map-utils.service.mjs +3 -5
  16. package/esm2022/libs/feature/record/src/lib/data-view/data-view.component.mjs +31 -12
  17. package/esm2022/libs/feature/record/src/lib/map-view/map-view.component.mjs +76 -27
  18. package/esm2022/libs/feature/record/src/lib/state/mdview.effects.mjs +4 -2
  19. package/esm2022/libs/feature/search/src/lib/state/reducer.mjs +5 -2
  20. package/esm2022/libs/ui/dataviz/src/lib/data-table/data-table.component.mjs +4 -3
  21. package/esm2022/libs/ui/elements/src/lib/downloads-list/downloads-list.component.mjs +5 -4
  22. package/esm2022/libs/ui/elements/src/lib/geo-data-badge/geo-data-badge.component.mjs +5 -4
  23. package/esm2022/libs/ui/elements/src/lib/internal-link-card/internal-link-card.component.mjs +4 -4
  24. package/esm2022/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.mjs +21 -43
  25. package/esm2022/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.mjs +5 -4
  26. package/esm2022/libs/ui/map/src/lib/components/map-legend/map-legend.component.mjs +2 -2
  27. package/esm2022/libs/util/app-config/src/lib/app-config.mjs +5 -1
  28. package/esm2022/libs/util/app-config/src/lib/model.mjs +1 -1
  29. package/esm2022/libs/util/shared/src/index.mjs +2 -2
  30. package/esm2022/libs/util/shared/src/lib/links/link-utils.mjs +12 -2
  31. package/esm2022/libs/util/shared/src/lib/record/index.mjs +3 -0
  32. package/esm2022/libs/util/shared/src/lib/record/quality-score.util.mjs +45 -0
  33. package/esm2022/libs/util/shared/src/lib/record/record.util.mjs +56 -0
  34. package/esm2022/libs/util/shared/src/lib/utils/geojson.mjs +58 -1
  35. package/esm2022/libs/util/shared/src/lib/utils/index.mjs +2 -1
  36. package/esm2022/libs/util/shared/src/lib/utils/mobile-screen.mjs +9 -0
  37. package/esm2022/translations/de.json +9 -1
  38. package/esm2022/translations/en.json +9 -1
  39. package/esm2022/translations/es.json +9 -1
  40. package/esm2022/translations/fr.json +10 -2
  41. package/esm2022/translations/it.json +9 -1
  42. package/esm2022/translations/nl.json +9 -1
  43. package/esm2022/translations/pt.json +9 -1
  44. package/esm2022/translations/sk.json +9 -1
  45. package/fesm2022/geonetwork-ui.mjs +2725 -2331
  46. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  47. package/libs/api/metadata-converter/src/lib/iso19139/utils/status.mapper.d.ts.map +1 -1
  48. package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
  49. package/libs/api/repository/src/lib/gn4/elasticsearch/constant.d.ts.map +1 -1
  50. package/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.d.ts +1 -1
  51. package/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.d.ts.map +1 -1
  52. package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts +3 -0
  53. package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts.map +1 -1
  54. package/libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model.d.ts +1 -0
  55. package/libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model.d.ts.map +1 -1
  56. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
  57. package/libs/common/domain/src/lib/platform.service.interface.d.ts +1 -0
  58. package/libs/common/domain/src/lib/platform.service.interface.d.ts.map +1 -1
  59. package/libs/feature/dataviz/src/lib/chart-view/chart-view.component.d.ts +3 -2
  60. package/libs/feature/dataviz/src/lib/chart-view/chart-view.component.d.ts.map +1 -1
  61. package/libs/feature/dataviz/src/lib/service/data.service.d.ts.map +1 -1
  62. package/libs/feature/editor/src/index.d.ts +1 -0
  63. package/libs/feature/editor/src/index.d.ts.map +1 -1
  64. package/libs/feature/editor/src/lib/components/metadata-quality-panel/metadata-quality-panel.component.d.ts +19 -0
  65. package/libs/feature/editor/src/lib/components/metadata-quality-panel/metadata-quality-panel.component.d.ts.map +1 -0
  66. package/libs/feature/editor/src/lib/fields.config.d.ts.map +1 -1
  67. package/libs/feature/map/src/lib/utils/map-utils.service.d.ts +2 -2
  68. package/libs/feature/map/src/lib/utils/map-utils.service.d.ts.map +1 -1
  69. package/libs/feature/record/src/lib/data-view/data-view.component.d.ts +8 -4
  70. package/libs/feature/record/src/lib/data-view/data-view.component.d.ts.map +1 -1
  71. package/libs/feature/record/src/lib/map-view/map-view.component.d.ts +12 -5
  72. package/libs/feature/record/src/lib/map-view/map-view.component.d.ts.map +1 -1
  73. package/libs/feature/record/src/lib/state/mdview.effects.d.ts.map +1 -1
  74. package/libs/feature/search/src/lib/state/reducer.d.ts.map +1 -1
  75. package/libs/ui/dataviz/src/lib/data-table/data-table.component.d.ts.map +1 -1
  76. package/libs/ui/elements/src/lib/downloads-list/downloads-list.component.d.ts +1 -0
  77. package/libs/ui/elements/src/lib/downloads-list/downloads-list.component.d.ts.map +1 -1
  78. package/libs/ui/elements/src/lib/geo-data-badge/geo-data-badge.component.d.ts +1 -0
  79. package/libs/ui/elements/src/lib/geo-data-badge/geo-data-badge.component.d.ts.map +1 -1
  80. package/libs/ui/elements/src/lib/internal-link-card/internal-link-card.component.d.ts.map +1 -1
  81. package/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.d.ts +7 -6
  82. package/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.d.ts.map +1 -1
  83. package/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.d.ts +1 -0
  84. package/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.d.ts.map +1 -1
  85. package/libs/util/app-config/src/lib/app-config.d.ts.map +1 -1
  86. package/libs/util/app-config/src/lib/model.d.ts +2 -0
  87. package/libs/util/app-config/src/lib/model.d.ts.map +1 -1
  88. package/libs/util/shared/src/index.d.ts +1 -1
  89. package/libs/util/shared/src/index.d.ts.map +1 -1
  90. package/libs/util/shared/src/lib/links/link-utils.d.ts +2 -1
  91. package/libs/util/shared/src/lib/links/link-utils.d.ts.map +1 -1
  92. package/libs/util/shared/src/lib/record/index.d.ts +3 -0
  93. package/libs/util/shared/src/lib/record/index.d.ts.map +1 -0
  94. package/libs/util/shared/src/lib/record/quality-score.util.d.ts +13 -0
  95. package/libs/util/shared/src/lib/record/quality-score.util.d.ts.map +1 -0
  96. package/libs/util/shared/src/lib/record/record.util.d.ts +3 -0
  97. package/libs/util/shared/src/lib/record/record.util.d.ts.map +1 -0
  98. package/libs/util/shared/src/lib/utils/geojson.d.ts +7 -2
  99. package/libs/util/shared/src/lib/utils/geojson.d.ts.map +1 -1
  100. package/libs/util/shared/src/lib/utils/index.d.ts +1 -0
  101. package/libs/util/shared/src/lib/utils/index.d.ts.map +1 -1
  102. package/libs/util/shared/src/lib/utils/mobile-screen.d.ts +2 -0
  103. package/libs/util/shared/src/lib/utils/mobile-screen.d.ts.map +1 -0
  104. package/package.json +1 -1
  105. package/src/libs/api/metadata-converter/src/lib/dcat-ap/utils/status.mapper.ts +3 -0
  106. package/src/libs/api/metadata-converter/src/lib/iso19139/utils/status.mapper.ts +3 -0
  107. package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +4 -0
  108. package/src/libs/api/repository/src/lib/gn4/elasticsearch/constant.ts +3 -5
  109. package/src/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.ts +50 -3
  110. package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.ts +38 -4
  111. package/src/libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model.ts +1 -0
  112. package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +4 -0
  113. package/src/libs/common/domain/src/lib/platform.service.interface.ts +2 -0
  114. package/src/libs/common/fixtures/src/lib/editor/editor.fixtures.ts +0 -3
  115. package/src/libs/feature/dataviz/src/lib/chart-view/chart-view.component.ts +10 -1
  116. package/src/libs/feature/dataviz/src/lib/service/data.service.ts +3 -1
  117. package/src/libs/feature/editor/src/index.ts +1 -0
  118. package/src/libs/feature/editor/src/lib/components/metadata-quality-panel/metadata-quality-panel.component.css +0 -0
  119. package/src/libs/feature/editor/src/lib/components/metadata-quality-panel/metadata-quality-panel.component.html +37 -0
  120. package/src/libs/feature/editor/src/lib/components/metadata-quality-panel/metadata-quality-panel.component.ts +90 -0
  121. package/src/libs/feature/editor/src/lib/components/multilingual-panel/multilingual-panel.component.html +2 -1
  122. package/src/libs/feature/editor/src/lib/fields.config.ts +0 -2
  123. package/src/libs/feature/map/src/lib/utils/map-utils.service.ts +8 -8
  124. package/src/libs/feature/record/src/lib/data-view/data-view.component.html +2 -0
  125. package/src/libs/feature/record/src/lib/data-view/data-view.component.ts +34 -15
  126. package/src/libs/feature/record/src/lib/map-view/map-view.component.html +5 -2
  127. package/src/libs/feature/record/src/lib/map-view/map-view.component.ts +70 -23
  128. package/src/libs/feature/record/src/lib/state/mdview.effects.ts +5 -1
  129. package/src/libs/feature/search/src/lib/state/reducer.ts +4 -1
  130. package/src/libs/ui/dataviz/src/lib/data-table/data-table.component.ts +6 -1
  131. package/src/libs/ui/elements/src/lib/downloads-list/downloads-list.component.html +12 -11
  132. package/src/libs/ui/elements/src/lib/downloads-list/downloads-list.component.ts +7 -1
  133. package/src/libs/ui/elements/src/lib/geo-data-badge/geo-data-badge.component.html +4 -1
  134. package/src/libs/ui/elements/src/lib/geo-data-badge/geo-data-badge.component.ts +7 -1
  135. package/src/libs/ui/elements/src/lib/internal-link-card/internal-link-card.component.html +1 -0
  136. package/src/libs/ui/elements/src/lib/internal-link-card/internal-link-card.component.ts +5 -1
  137. package/src/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.html +1 -0
  138. package/src/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.ts +21 -54
  139. package/src/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.html +7 -1
  140. package/src/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.ts +3 -1
  141. package/src/libs/ui/map/src/lib/components/map-legend/map-legend.component.ts +1 -1
  142. package/src/libs/util/app-config/src/lib/app-config.ts +4 -0
  143. package/src/libs/util/app-config/src/lib/model.ts +2 -0
  144. package/src/libs/util/shared/src/index.ts +1 -1
  145. package/src/libs/util/shared/src/lib/links/link-utils.ts +11 -1
  146. package/src/libs/util/shared/src/lib/record/index.ts +2 -0
  147. package/src/libs/util/shared/src/lib/record/quality-score.util.ts +69 -0
  148. package/src/libs/util/shared/src/lib/{record.util.ts → record/record.util.ts} +1 -1
  149. package/src/libs/util/shared/src/lib/utils/geojson.ts +72 -2
  150. package/src/libs/util/shared/src/lib/utils/index.ts +1 -0
  151. package/src/libs/util/shared/src/lib/utils/mobile-screen.ts +14 -0
  152. package/translations/de.json +9 -1
  153. package/translations/en.json +9 -1
  154. package/translations/es.json +9 -1
  155. package/translations/fr.json +10 -2
  156. package/translations/it.json +9 -1
  157. package/translations/nl.json +9 -1
  158. package/translations/pt.json +9 -1
  159. package/translations/sk.json +9 -1
  160. package/esm2022/libs/util/shared/src/lib/record.util.mjs +0 -56
  161. package/libs/util/shared/src/lib/record.util.d.ts +0 -3
  162. package/libs/util/shared/src/lib/record.util.d.ts.map +0 -1
@@ -5,15 +5,16 @@ import {
5
5
  Input,
6
6
  Output,
7
7
  } from '@angular/core'
8
- import { getLinkLabel, getLinkPriority } from '../../../../../../libs/util/shared/src'
8
+ import {
9
+ getLinkId,
10
+ getLinkLabel,
11
+ getLinkPriority,
12
+ } from '../../../../../../libs/util/shared/src'
9
13
  import { BehaviorSubject, combineLatest } from 'rxjs'
10
14
  import { map, tap } from 'rxjs/operators'
11
15
  import { MdViewFacade } from '../state'
12
16
  import { DatavizChartConfigModel } from '../../../../../../libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model'
13
- import {
14
- DatasetOnlineResource,
15
- DatasetServiceDistribution,
16
- } from '../../../../../../libs/common/domain/src/lib/model/record'
17
+ import { DatasetOnlineResource } from '../../../../../../libs/common/domain/src/lib/model/record'
17
18
  import { DropdownSelectorComponent } from '../../../../../../libs/ui/inputs/src'
18
19
  import {
19
20
  ChartViewComponent,
@@ -45,13 +46,28 @@ export class DataViewComponent {
45
46
  @Input() set exceedsLimit(value: boolean) {
46
47
  this.excludeWfs$.next(value)
47
48
  }
49
+ linkMap: Map<string, DatasetOnlineResource> = new Map()
48
50
  _selectedView = ''
51
+ _chartConfig = null
52
+ _selectedChoice = null
49
53
  @Input() set selectedView(value: string) {
50
54
  this._selectedView = value
51
- if (value !== 'map') {
55
+ if (this.mode === value) {
52
56
  this.linkSelected.emit(this.selectedLink$.value)
53
57
  }
54
58
  }
59
+ @Input() set datavizConfig(value: any) {
60
+ this._selectedView = value.view
61
+ if (this.mode === value.view) {
62
+ if (!value.source) {
63
+ this.linkSelected.emit(this.selectedLink$.value)
64
+ } else {
65
+ this._chartConfig = value.chartConfig
66
+ this._selectedChoice = getLinkId(value.source)
67
+ this.selectedLink$.next(value.source)
68
+ }
69
+ }
70
+ }
55
71
  @Output() chartConfig$ = new BehaviorSubject<DatavizChartConfigModel>(null)
56
72
  @Output() linkSelected = new EventEmitter<DatasetOnlineResource>()
57
73
  cacheActive$ = this.mdViewFacade.isHighUpdateFrequency$.pipe(
@@ -69,15 +85,19 @@ export class DataViewComponent {
69
85
  })
70
86
  )
71
87
  dropdownChoices$ = this.compatibleDataLinks$.pipe(
72
- tap((links) => {
73
- if (links.indexOf(this.selectedLink$.value) === -1) {
74
- this.selectLink(JSON.stringify(links[0]))
88
+ tap((links: DatasetOnlineResource[]) => {
89
+ this.linkMap.clear()
90
+ links.forEach((link: DatasetOnlineResource) =>
91
+ this.linkMap.set(getLinkId(link), link)
92
+ )
93
+ if (!links.some((l) => l.url === this.selectedLink$.value?.url)) {
94
+ this.selectLink(getLinkId(links[0]))
75
95
  }
76
96
  }),
77
97
  map((links) =>
78
- links.map((link) => ({
98
+ links.map((link: DatasetOnlineResource) => ({
79
99
  label: getLinkLabel(link),
80
- value: JSON.stringify(link),
100
+ value: getLinkId(link),
81
101
  }))
82
102
  )
83
103
  )
@@ -93,12 +113,11 @@ export class DataViewComponent {
93
113
  this.mdViewFacade.setChartConfig(event)
94
114
  }
95
115
 
96
- selectLink(linkAsString: string) {
97
- const link: DatasetOnlineResource = JSON.parse(linkAsString)
98
- if (this._selectedView && this._selectedView !== 'map') {
116
+ selectLink(linkId: string) {
117
+ const link = this.linkMap.get(linkId)
118
+ if (this._selectedView && this._selectedView === this.mode) {
99
119
  this.linkSelected.emit(link)
100
120
  }
101
- link.url = new URL(link.url)
102
121
  this.selectedLink$.next(link)
103
122
  }
104
123
  }
@@ -8,6 +8,7 @@
8
8
  extraBtnClass="font-sans font-bold"
9
9
  [title]="'map.select.layer' | translate"
10
10
  [choices]="dropdownChoices$ | async"
11
+ [selected]="_selectedChoice"
11
12
  (selectValue)="selectLinkToDisplay($event)"
12
13
  ></gn-ui-dropdown-selector>
13
14
 
@@ -17,6 +18,7 @@
17
18
  extraBtnClass="font-sans font-bold"
18
19
  [title]="'map.select.style' | translate"
19
20
  [choices]="styleDropdownChoices$ | async"
21
+ [selected]="_styleFromConfig"
20
22
  (selectValue)="selectStyleToDisplay($event)"
21
23
  ></gn-ui-dropdown-selector>
22
24
  </ng-container>
@@ -85,7 +87,7 @@
85
87
  [hidden]="!showLegend || !legendExists"
86
88
  >
87
89
  <div class="flex justify-between items-center mb-2">
88
- <div class="text-primary font-bold">Legend</div>
90
+ <div class="text-primary font-bold" translate>map.legend.title</div>
89
91
  <gn-ui-button
90
92
  type="light"
91
93
  (buttonClick)="toggleLegend()"
@@ -110,8 +112,9 @@
110
112
  type="outline"
111
113
  (buttonClick)="toggleLegend()"
112
114
  extraClass="absolute top-[1em] right-[1em] rounded p-1 text-xs bg-white"
115
+ translate
113
116
  >
114
- Legend
117
+ map.legend.title
115
118
  </gn-ui-button>
116
119
 
117
120
  <gn-ui-loading-mask
@@ -9,7 +9,7 @@ import {
9
9
  ViewChild,
10
10
  } from '@angular/core'
11
11
  import { MapUtilsService } from '../../../../../../libs/feature/map/src'
12
- import { getLinkLabel } from '../../../../../../libs/util/shared/src'
12
+ import { getLinkId, getLinkLabel } from '../../../../../../libs/util/shared/src'
13
13
  import {
14
14
  BehaviorSubject,
15
15
  combineLatest,
@@ -100,15 +100,28 @@ export class MapViewComponent implements AfterViewInit {
100
100
  @Input() set exceedsLimit(value: boolean) {
101
101
  this.excludeWfs$.next(value)
102
102
  }
103
+ linkFromConfig$ = new BehaviorSubject(null)
104
+ _selectedChoice = null
105
+ _styleFromConfig = null
106
+
107
+ linkMap: Map<string, DatasetOnlineResource> = new Map()
103
108
  @Input() set selectedView(value: string) {
104
- if (value === 'map') {
105
- this.selectedLink$.pipe(take(1)).subscribe((link) => {
106
- this.linkSelected.emit(link)
107
- })
109
+ this.selectedView$.next(value)
110
+ }
111
+ @Input() set datavizConfig(value: any) {
112
+ if (value.view === 'map') {
113
+ this.selectedView$.next(value.view)
114
+ if (value.styleTMSIndex) {
115
+ this._styleFromConfig = value.styleTMSIndex
116
+ }
117
+ if (value.source) {
118
+ this.linkFromConfig$.next(value.source)
119
+ }
108
120
  }
109
121
  }
110
122
  @Input() displaySource = true
111
123
  @Output() linkSelected = new EventEmitter<DatasetOnlineResource>()
124
+ @Output() styleSelected = new EventEmitter<number>()
112
125
  @ViewChild('mapContainer') mapContainer: MapContainerComponent
113
126
 
114
127
  excludeWfs$ = new BehaviorSubject(false)
@@ -119,12 +132,13 @@ export class MapViewComponent implements AfterViewInit {
119
132
  loading = false
120
133
  error = null
121
134
 
122
- selectLinkToDisplay(i: number) {
123
- this.selectedLinkIndex$.next(i)
135
+ selectLinkToDisplay(id: string) {
136
+ this.selectedLinkId$.next(id)
124
137
  }
125
138
 
126
139
  selectStyleToDisplay(i: number) {
127
- this.selectedStyleIndex$.next(i)
140
+ this.selectedStyleId$.next(i)
141
+ this.styleSelected.emit(i)
128
142
  }
129
143
 
130
144
  toggleLegend() {
@@ -146,29 +160,54 @@ export class MapViewComponent implements AfterViewInit {
146
160
  )
147
161
 
148
162
  dropdownChoices$ = this.compatibleMapLinks$.pipe(
149
- map((links) =>
150
- links.length
151
- ? links.map((link, index) => ({
163
+ map((links) => {
164
+ this.linkMap.clear()
165
+ links.forEach((link: DatasetOnlineResource) =>
166
+ this.linkMap.set(getLinkId(link), link)
167
+ )
168
+ return links.length
169
+ ? links.map((link) => ({
152
170
  label: getLinkLabel(link),
153
- value: index,
171
+ value: getLinkId(link),
154
172
  }))
155
- : [{ label: 'map.dropdown.placeholder', value: 0 }]
156
- )
173
+ : [{ label: 'map.dropdown.placeholder', value: '' }]
174
+ })
157
175
  )
158
176
 
159
- selectedLinkIndex$ = new BehaviorSubject(0)
160
- private selectedStyleIndex$ = new BehaviorSubject(0)
177
+ selectedView$ = new BehaviorSubject(null)
178
+ selectedLinkId$ = new BehaviorSubject(null)
179
+ selectedStyleId$ = new BehaviorSubject(null)
161
180
 
162
181
  selectedSourceLink$ = combineLatest([
163
182
  this.compatibleMapLinks$,
164
- this.selectedLinkIndex$.pipe(distinctUntilChanged()),
183
+ this.linkFromConfig$,
184
+ this.selectedLinkId$.pipe(distinctUntilChanged()),
185
+ this.selectedView$,
165
186
  ]).pipe(
166
187
  tap(() => {
167
188
  this.error = null
168
189
  }),
169
- map(([links, index]) => {
170
- this.linkSelected.emit(links[index])
171
- return links[index]
190
+ map(([compatibleLinks, configLink, id, view]) => {
191
+ if (view === 'map') {
192
+ if (
193
+ configLink &&
194
+ !id &&
195
+ compatibleLinks.some(
196
+ (link) => getLinkId(link) === getLinkId(configLink)
197
+ )
198
+ ) {
199
+ this._selectedChoice = getLinkId(configLink)
200
+ this.linkSelected.emit(configLink)
201
+ return configLink
202
+ } else if (id) {
203
+ this._selectedChoice = id
204
+ this.linkSelected.emit(this.linkMap.get(id))
205
+ return this.linkMap.get(id)
206
+ } else {
207
+ this.linkSelected.emit(compatibleLinks[0])
208
+ return compatibleLinks[0]
209
+ }
210
+ }
172
211
  })
173
212
  )
174
213
 
@@ -205,7 +244,13 @@ export class MapViewComponent implements AfterViewInit {
205
244
  }
206
245
  return of([])
207
246
  }),
208
- tap(() => this.selectedStyleIndex$.next(0)),
247
+ tap((styles) => {
248
+ if (this._styleFromConfig && this._styleFromConfig <= styles.length) {
249
+ this.selectedStyleId$.next(this._styleFromConfig)
250
+ } else {
251
+ this.selectedStyleId$.next(0)
252
+ }
253
+ }),
209
254
  shareReplay(1)
210
255
  )
211
256
 
@@ -228,7 +273,7 @@ export class MapViewComponent implements AfterViewInit {
228
273
  selectedLink$ = combineLatest([
229
274
  this.selectedSourceLink$,
230
275
  this.styleLinks$,
231
- this.selectedStyleIndex$.pipe(distinctUntilChanged()),
276
+ this.selectedStyleId$.pipe(distinctUntilChanged()),
232
277
  ]).pipe(
233
278
  map(([src, styles, styleIdx]) => (styles.length ? styles[styleIdx] : src)),
234
279
  shareReplay(1)
@@ -344,7 +389,9 @@ export class MapViewComponent implements AfterViewInit {
344
389
  ) {
345
390
  // FIXME: here we're assuming that the TMS serves vector tiles only; should be checked with ogc-client first
346
391
  return of({
347
- url: link.url.toString().replace(/\/?$/, '/{z}/{x}/{y}.pbf'),
392
+ url: link.url
393
+ .toString()
394
+ .replace(/\/?$/, `/${link.name}/{z}/{x}/{y}.pbf`),
348
395
  type: 'xyz',
349
396
  tileFormat: 'application/vnd.mapbox-vector-tile',
350
397
  name: link.name,
@@ -23,7 +23,11 @@ export class MdViewEffects {
23
23
  ofType(MdViewActions.loadFullMetadata),
24
24
  switchMap(({ uuid }) => this.recordsRepository.getRecord(uuid)),
25
25
  map((record) => {
26
- if (record === null || !this.router.url.includes(record.kind)) {
26
+ if (
27
+ record === null ||
28
+ (this.router.url !== '/' && // FIXME: special case for WC, find a better way
29
+ !this.router.url.includes(record.kind))
30
+ ) {
27
31
  return MdViewActions.loadFullMetadataFailure({ notFound: true })
28
32
  }
29
33
  return MdViewActions.loadFullMetadataSuccess({ full: record })
@@ -8,6 +8,7 @@ import {
8
8
  SortByField,
9
9
  } from '../../../../../../libs/common/domain/src/lib/model/search'
10
10
  import { DEFAULT_PAGE_SIZE, FIELDS_SUMMARY } from '../constants'
11
+ import { getOptionalSearchConfig } from '../../../../../../libs/util/app-config/src'
11
12
  import { CatalogRecord } from '../../../../../../libs/common/domain/src/lib/model/record'
12
13
 
13
14
  export const SEARCH_FEATURE_KEY = 'searchState'
@@ -55,7 +56,9 @@ export const initSearch = (): SearchStateSearch => {
55
56
  },
56
57
  params: {
57
58
  filters: {},
58
- pageSize: DEFAULT_PAGE_SIZE,
59
+ pageSize: getOptionalSearchConfig()?.LIMIT
60
+ ? getOptionalSearchConfig().LIMIT
61
+ : DEFAULT_PAGE_SIZE,
59
62
  currentPage: 0,
60
63
  favoritesOnly: false,
61
64
  useSpatialFilter: true,
@@ -14,7 +14,11 @@ import {
14
14
  } from '@angular/core'
15
15
  import { MatSort, MatSortModule } from '@angular/material/sort'
16
16
  import { MatTableModule } from '@angular/material/table'
17
- import { TranslatePipe, TranslateService } from '@ngx-translate/core'
17
+ import {
18
+ TranslateDirective,
19
+ TranslatePipe,
20
+ TranslateService,
21
+ } from '@ngx-translate/core'
18
22
  import { DataTableDataSource } from './data-table.data.source'
19
23
  import { BaseReader, FetchError } from '../../../../../../libs/util/data-fetcher/src'
20
24
  import {
@@ -53,6 +57,7 @@ export interface TableItemModel {
53
57
  PopupAlertComponent,
54
58
  LetDirective,
55
59
  TranslatePipe,
60
+ TranslateDirective,
56
61
  ],
57
62
  providers: [{ provide: MatPaginatorIntl, useClass: CustomMatPaginatorIntl }],
58
63
  selector: 'gn-ui-data-table',
@@ -13,8 +13,7 @@
13
13
  <span class="px-3">({{ linksCount }})</span>
14
14
  </div>
15
15
  <gn-ui-previous-next-buttons
16
- class="md:block hidden"
17
- *ngIf="_list?.pagesCount > 1"
16
+ *ngIf="(isMobile$ | async) === false && _list?.pagesCount > 1"
18
17
  [listComponent]="_list"
19
18
  ></gn-ui-previous-next-buttons>
20
19
  </div>
@@ -40,7 +39,7 @@
40
39
 
41
40
  <ng-container>
42
41
  <gn-ui-block-list
43
- class="md:block hidden"
42
+ *ngIf="(isMobile$ | async) === false"
44
43
  #blockList
45
44
  (listChanges)="updateList($event)"
46
45
  containerClass="gap-4 pt-5 pb-7"
@@ -57,12 +56,14 @@
57
56
  </gn-ui-block-list>
58
57
  </ng-container>
59
58
 
60
- <div class="mb-5 md:hidden block" *ngFor="let link of filteredLinks">
61
- <gn-ui-download-item
62
- size="M"
63
- [link]="link"
64
- [color]="getLinkColor(link)"
65
- [format]="getLinkFormat(link)"
66
- [isFromApi]="isFromApi(link)"
67
- ></gn-ui-download-item>
59
+ <div class="mb-5" *ngFor="let link of filteredLinks">
60
+ <ng-container *ngIf="(isMobile$ | async) === true">
61
+ <gn-ui-download-item
62
+ size="M"
63
+ [link]="link"
64
+ [color]="getLinkColor(link)"
65
+ [format]="getLinkFormat(link)"
66
+ [isFromApi]="isFromApi(link)"
67
+ ></gn-ui-download-item>
68
+ </ng-container>
68
69
  </div>
@@ -6,7 +6,11 @@ import {
6
6
  } from '@angular/core'
7
7
  import { TranslateDirective, TranslateService } from '@ngx-translate/core'
8
8
  import { marker } from '@biesbjerg/ngx-translate-extract-marker'
9
- import { getBadgeColor, getFileFormat } from '../../../../../../libs/util/shared/src'
9
+ import {
10
+ getBadgeColor,
11
+ getFileFormat,
12
+ getIsMobile,
13
+ } from '../../../../../../libs/util/shared/src'
10
14
  import { DatasetDownloadDistribution } from '../../../../../../libs/common/domain/src/lib/model/record'
11
15
  import { CommonModule } from '@angular/common'
12
16
  import { ButtonComponent } from '../../../../../../libs/ui/inputs/src'
@@ -50,6 +54,8 @@ export class DownloadsListComponent {
50
54
  return this.filteredLinks?.length || 0
51
55
  }
52
56
 
57
+ isMobile$ = getIsMobile()
58
+
53
59
  activeFilterFormats: FilterFormat[] = ['all']
54
60
 
55
61
  updateList($event: BlockListComponent) {
@@ -7,7 +7,10 @@
7
7
  class="shrink-0 text-[0.75em]"
8
8
  name="matLocationSearchingOutline"
9
9
  ></ng-icon>
10
- <span class="ml-1 hidden sm:inline-block shrink-0" *ngIf="showLabel" translate
10
+ <span
11
+ class="ml-1 inline-block shrink-0"
12
+ *ngIf="(isMobile$ | async) === false && showLabel"
13
+ translate
11
14
  >record.metadata.isGeographical</span
12
15
  >
13
16
  </div>
@@ -4,7 +4,11 @@ import { CatalogRecord } from '../../../../../../libs/common/domain/src/lib/mode
4
4
  import { CommonModule } from '@angular/common'
5
5
  import { TranslateDirective, TranslatePipe } from '@ngx-translate/core'
6
6
  import { NgIcon, provideIcons } from '@ng-icons/core'
7
- import { LinkClassifierService, LinkUsage } from '../../../../../../libs/util/shared/src'
7
+ import {
8
+ getIsMobile,
9
+ LinkClassifierService,
10
+ LinkUsage,
11
+ } from '../../../../../../libs/util/shared/src'
8
12
 
9
13
  @Component({
10
14
  selector: 'gn-ui-geo-data-badge',
@@ -24,6 +28,8 @@ export class GeoDataBadgeComponent {
24
28
  @Input() styling = 'default'
25
29
  @Input() record: CatalogRecord
26
30
 
31
+ isMobile$ = getIsMobile()
32
+
27
33
  isGeodata() {
28
34
  const links =
29
35
  'onlineResources' in this.record ? this.record.onlineResources : []
@@ -68,6 +68,7 @@
68
68
  [smaller]="true"
69
69
  [metadata]="record"
70
70
  [metadataQualityDisplay]="metadataQualityDisplay"
71
+ [popoverDisplay]="true"
71
72
  ></gn-ui-metadata-quality>
72
73
  </div>
73
74
  <div
@@ -21,7 +21,11 @@ import { KindBadgeComponent } from '../kind-badge/kind-badge.component'
21
21
  import { MarkdownParserComponent } from '../markdown-parser/markdown-parser.component'
22
22
  import { MetadataQualityComponent } from '../metadata-quality/metadata-quality.component'
23
23
  import { ThumbnailComponent } from '../thumbnail/thumbnail.component'
24
- import { removeWhitespace, stripHtml } from '../../../../../../libs/util/shared/src'
24
+ import {
25
+ removeWhitespace,
26
+ stripHtml,
27
+ type ValidatorMapperKeys,
28
+ } from '../../../../../../libs/util/shared/src'
25
29
 
26
30
  type CardSize = 'L' | 'M' | 'S' | 'XS'
27
31
 
@@ -10,6 +10,7 @@
10
10
  class="flex-grow"
11
11
  ></gn-ui-progress-bar>
12
12
  <gn-ui-popover
13
+ *ngIf="popoverDisplay"
13
14
  [content]="popoverItems"
14
15
  theme="light-border"
15
16
  [class]="smaller ? 'ml-2' : 'ml-2 mt-1'"
@@ -14,15 +14,16 @@ import {
14
14
  PopoverComponent,
15
15
  ProgressBarComponent,
16
16
  } from '../../../../../../libs/ui/widgets/src'
17
+ import {
18
+ getQualityValidators,
19
+ getAllKeysValidator,
20
+ type ValidatorMapperKeys,
21
+ } from '../../../../../../libs/util/shared/src'
17
22
  import { CommonModule } from '@angular/common'
18
23
  import { TranslateDirective } from '@ngx-translate/core'
19
24
  import { NgIcon, provideIcons, provideNgIconsConfig } from '@ng-icons/core'
20
25
  import { matInfoOutline } from '@ng-icons/material-icons/outline'
21
26
 
22
- type QualityChecks = {
23
- [key: string]: (metadata: Partial<CatalogRecord>) => boolean
24
- }
25
-
26
27
  @Component({
27
28
  selector: 'gn-ui-metadata-quality',
28
29
  templateUrl: './metadata-quality.component.html',
@@ -48,77 +49,43 @@ type QualityChecks = {
48
49
  ],
49
50
  })
50
51
  export class MetadataQualityComponent implements OnChanges {
51
- @Input() metadata: Partial<CatalogRecord>
52
+ @Input() metadata: CatalogRecord
52
53
  @Input() smaller = false
53
54
  @Input() metadataQualityDisplay: boolean
55
+ @Input() popoverDisplay = true
56
+ @Input() propsToValidate?: ValidatorMapperKeys[]
57
+ @Input() forceComputeScore = false // Instead of returning es' quality score
54
58
 
55
59
  items: MetadataQualityItem[] = []
56
60
 
57
61
  get qualityScore() {
58
- const qualityScore = this.metadata?.extras?.qualityScore
62
+ const qualityScore = !this.forceComputeScore
63
+ ? this.metadata?.extras?.qualityScore
64
+ : this.computedQualityScore
65
+
59
66
  return typeof qualityScore === 'number'
60
67
  ? qualityScore
61
- : this.calculatedQualityScore
68
+ : this.computedQualityScore
62
69
  }
63
70
 
64
- get calculatedQualityScore(): number {
71
+ get computedQualityScore(): number {
65
72
  return Math.round(
66
73
  (this.items.filter(({ value }) => value).length * 100) / this.items.length
67
74
  )
68
75
  }
69
76
 
70
- private add(name: string, value: boolean) {
71
- if (this.metadataQualityDisplay?.[name] !== false) {
72
- this.items.push({ name, value })
73
- }
74
- }
75
77
  hasGetCapabilities(url: string): boolean {
76
78
  return url.toLowerCase().includes('capabilities')
77
79
  }
78
80
 
79
- private readonly COMMON_CHECKS: QualityChecks = {
80
- title: (metadata) => !!metadata?.title,
81
- description: (metadata) => !!metadata?.abstract,
82
- keywords: (metadata) => (metadata?.keywords?.length ?? 0) > 0,
83
- legalConstraints: (metadata) =>
84
- (metadata?.legalConstraints?.length ?? 0) > 0,
85
- contact: (metadata) => !!metadata?.contacts?.[0]?.email,
86
- }
87
-
88
- private readonly SPECIFIC_CHECKS: Record<string, QualityChecks> = {
89
- dataset: {
90
- updateFrequency: (metadata) => !!metadata?.updateFrequency,
91
- topic: (metadata) => (metadata?.topics?.length ?? 0) > 0,
92
- organisation: (metadata) => !!metadata?.contacts?.[0]?.organization?.name,
93
- },
94
- service: {
95
- capabilities: (metadata) =>
96
- (metadata?.onlineResources ?? []).some((resource) =>
97
- this.hasGetCapabilities(resource?.url?.href ?? '')
98
- ),
99
- },
100
- reuse: {
101
- topic: (metadata) => (metadata?.topics?.length ?? 0) > 0,
102
- organisation: (metadata) => !!metadata?.contacts?.[0]?.organization?.name,
103
- source: (metadata) => !!metadata?.extras?.sourcesIdentifiers,
104
- },
105
- }
106
-
107
81
  initialize() {
108
- this.items = []
109
-
110
- Object.entries(this.COMMON_CHECKS).forEach(([name, check]) => {
111
- this.add(name, check(this.metadata))
112
- })
113
-
114
- const datasetType = this.metadata?.kind
115
- if (datasetType && this.SPECIFIC_CHECKS[datasetType]) {
116
- Object.entries(this.SPECIFIC_CHECKS[datasetType]).forEach(
117
- ([name, check]) => {
118
- this.add(name, check(this.metadata))
119
- }
120
- )
82
+ if (!this.propsToValidate) {
83
+ this.propsToValidate = getAllKeysValidator()
121
84
  }
85
+
86
+ this.items = getQualityValidators(this.metadata, this.propsToValidate).map(
87
+ ({ name, validator }) => ({ name, value: validator() })
88
+ )
122
89
  }
123
90
 
124
91
  ngOnChanges(changes: SimpleChanges): void {
@@ -1,5 +1,8 @@
1
1
  <div
2
2
  class="flex items-center justify-between p-3 mt-8 bg-white rounded-lg border-b solid border-gray-300"
3
+ *ngIf="
4
+ (isMobile$ | async) === false || featureCatalog?.featureTypes?.length > 1
5
+ "
3
6
  >
4
7
  <div
5
8
  class="relative shrink-0"
@@ -17,7 +20,10 @@
17
20
  name="iconoirSearch"
18
21
  ></ng-icon>
19
22
  </div>
20
- <div class="text-sm px-1 ml-auto hidden sm:inline">
23
+ <div
24
+ *ngIf="(isMobile$ | async) === false"
25
+ class="text-sm px-1 ml-auto inline"
26
+ >
21
27
  <ng-container *ngIf="featureCatalog?.featureTypes?.length > 1">
22
28
  <span
23
29
  class="text-sm font-medium text-gray-900"
@@ -6,7 +6,7 @@ import { DatasetFeatureCatalog } from '../../../../../../libs/common/domain/src/
6
6
  import { FormsModule } from '@angular/forms'
7
7
  import { of } from 'rxjs'
8
8
  import { debounceTime, distinctUntilChanged, tap } from 'rxjs/operators'
9
- import { createFuzzyFilter } from '../../../../../../libs/util/shared/src'
9
+ import { createFuzzyFilter, getIsMobile } from '../../../../../../libs/util/shared/src'
10
10
  import { iconoirSearch } from '@ng-icons/iconoir'
11
11
 
12
12
  @Component({
@@ -39,6 +39,8 @@ export class SearchFeatureCatalogComponent {
39
39
  return this._featureCatalog
40
40
  }
41
41
 
42
+ isMobile$ = getIsMobile()
43
+
42
44
  @Output() filteredFeatureCatalogChange =
43
45
  new EventEmitter<DatasetFeatureCatalog>()
44
46
  filteredFeatureCatalog: DatasetFeatureCatalog
@@ -27,7 +27,7 @@ export class MapLegendComponent implements OnChanges {
27
27
  async ngOnChanges(changes: SimpleChanges) {
28
28
  if ('context' in changes) {
29
29
  const mapContext = changes['context'].currentValue
30
- if (mapContext.layers && mapContext.layers.length > 0) {
30
+ if (mapContext?.layers && mapContext.layers.length > 0) {
31
31
  const mapContextLayer = mapContext.layers[0]
32
32
  this.legendHTML = await createLegendFromLayer(mapContextLayer)
33
33
  if (this.legendHTML) {