geonetwork-ui 2.8.0-dev.c06b26576 → 2.8.0-dev.cba2fd2eb

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 (160) hide show
  1. package/esm2022/index.mjs +2 -1
  2. package/esm2022/libs/api/metadata-converter/src/lib/common/distribution.mapper.mjs +5 -1
  3. package/esm2022/libs/api/metadata-converter/src/lib/dcat-ap/dcat-ap.converter.mjs +3 -3
  4. package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.mjs +26 -1
  5. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.mjs +7 -7
  6. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/read-parts.mjs +3 -2
  7. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +4 -3
  8. package/esm2022/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.mjs +10 -10
  9. package/esm2022/libs/api/repository/src/lib/gn4/settings/gn4-settings.service.mjs +3 -2
  10. package/esm2022/libs/common/domain/src/index.mjs +3 -0
  11. package/esm2022/libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model.mjs +1 -1
  12. package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +3 -1
  13. package/esm2022/libs/common/domain/src/lib/model/search/sort-by.model.mjs +6 -1
  14. package/esm2022/libs/common/domain/src/lib/platform.service.interface.mjs +1 -1
  15. package/esm2022/libs/feature/dataviz/src/index.mjs +2 -1
  16. package/esm2022/libs/feature/dataviz/src/lib/chart-view/chart-view.component.mjs +3 -1
  17. package/esm2022/libs/feature/dataviz/src/lib/service/data.service.mjs +18 -7
  18. package/esm2022/libs/feature/dataviz/src/lib/stac-view/stac-view.component.mjs +51 -0
  19. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.mjs +23 -3
  20. package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +2 -2
  21. package/esm2022/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.mjs +13 -4
  22. package/esm2022/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.mjs +23 -8
  23. package/esm2022/libs/feature/record/src/lib/state/mdview.facade.mjs +14 -1
  24. package/esm2022/libs/feature/router/src/lib/default/router.service.mjs +5 -1
  25. package/esm2022/libs/feature/router/src/lib/default/state/router.effects.mjs +9 -7
  26. package/esm2022/libs/feature/search/src/lib/sort-by/sort-by.component.mjs +8 -12
  27. package/esm2022/libs/ui/elements/src/index.mjs +2 -1
  28. package/esm2022/libs/ui/elements/src/lib/external-link-card/external-link-card.component.mjs +11 -4
  29. package/esm2022/libs/ui/elements/src/lib/metadata-doi/metadata-doi.component.mjs +37 -0
  30. package/esm2022/libs/ui/elements/src/lib/metadata-info/metadata-info.component.mjs +3 -3
  31. package/esm2022/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.mjs +2 -3
  32. package/esm2022/libs/util/shared/src/lib/links/link-classifier.service.mjs +5 -1
  33. package/esm2022/libs/util/shared/src/lib/links/link-utils.mjs +12 -1
  34. package/esm2022/libs/util/shared/src/lib/services/proxy.service.mjs +9 -11
  35. package/esm2022/libs/util/shared/src/lib/utils/sort-by.mjs +9 -6
  36. package/esm2022/translations/de.json +16 -3
  37. package/esm2022/translations/en.json +16 -4
  38. package/esm2022/translations/es.json +15 -2
  39. package/esm2022/translations/fr.json +16 -3
  40. package/esm2022/translations/it.json +17 -4
  41. package/esm2022/translations/nl.json +15 -2
  42. package/esm2022/translations/pt.json +15 -2
  43. package/esm2022/translations/sk.json +16 -3
  44. package/fesm2022/geonetwork-ui.mjs +397 -95
  45. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  46. package/index.d.ts +1 -0
  47. package/index.d.ts.map +1 -1
  48. package/index.ts +1 -0
  49. package/libs/api/metadata-converter/src/lib/common/distribution.mapper.d.ts.map +1 -1
  50. package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts.map +1 -1
  51. package/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.d.ts.map +1 -1
  52. package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts +5 -1
  53. package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts.map +1 -1
  54. package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
  55. package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts +7 -7
  56. package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts.map +1 -1
  57. package/libs/api/repository/src/lib/gn4/settings/gn4-settings.service.d.ts.map +1 -1
  58. package/libs/common/domain/src/index.d.ts +3 -0
  59. package/libs/common/domain/src/index.d.ts.map +1 -0
  60. package/libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model.d.ts +1 -1
  61. package/libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model.d.ts.map +1 -1
  62. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +7 -2
  63. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
  64. package/libs/common/domain/src/lib/model/search/sort-by.model.d.ts.map +1 -1
  65. package/libs/common/domain/src/lib/platform.service.interface.d.ts +1 -1
  66. package/libs/common/domain/src/lib/platform.service.interface.d.ts.map +1 -1
  67. package/libs/feature/dataviz/src/index.d.ts +1 -0
  68. package/libs/feature/dataviz/src/index.d.ts.map +1 -1
  69. package/libs/feature/dataviz/src/lib/chart-view/chart-view.component.d.ts.map +1 -1
  70. package/libs/feature/dataviz/src/lib/service/data.service.d.ts.map +1 -1
  71. package/libs/feature/dataviz/src/lib/stac-view/stac-view.component.d.ts +16 -0
  72. package/libs/feature/dataviz/src/lib/stac-view/stac-view.component.d.ts.map +1 -0
  73. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts +2 -0
  74. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts.map +1 -1
  75. package/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.d.ts +3 -2
  76. package/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.d.ts.map +1 -1
  77. package/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.d.ts +3 -2
  78. package/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.d.ts.map +1 -1
  79. package/libs/feature/record/src/lib/state/mdview.facade.d.ts +28 -24
  80. package/libs/feature/record/src/lib/state/mdview.facade.d.ts.map +1 -1
  81. package/libs/feature/router/src/lib/default/router.service.d.ts +2 -0
  82. package/libs/feature/router/src/lib/default/router.service.d.ts.map +1 -1
  83. package/libs/feature/router/src/lib/default/state/router.effects.d.ts +3 -1
  84. package/libs/feature/router/src/lib/default/state/router.effects.d.ts.map +1 -1
  85. package/libs/feature/search/src/lib/sort-by/sort-by.component.d.ts +4 -3
  86. package/libs/feature/search/src/lib/sort-by/sort-by.component.d.ts.map +1 -1
  87. package/libs/ui/elements/src/index.d.ts +1 -0
  88. package/libs/ui/elements/src/index.d.ts.map +1 -1
  89. package/libs/ui/elements/src/lib/downloads-list/downloads-list.component.d.ts +1 -1
  90. package/libs/ui/elements/src/lib/external-link-card/external-link-card.component.d.ts +3 -2
  91. package/libs/ui/elements/src/lib/external-link-card/external-link-card.component.d.ts.map +1 -1
  92. package/libs/ui/elements/src/lib/metadata-doi/metadata-doi.component.d.ts +8 -0
  93. package/libs/ui/elements/src/lib/metadata-doi/metadata-doi.component.d.ts.map +1 -0
  94. package/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.d.ts.map +1 -1
  95. package/libs/util/shared/src/lib/links/link-classifier.service.d.ts.map +1 -1
  96. package/libs/util/shared/src/lib/links/link-utils.d.ts +6 -0
  97. package/libs/util/shared/src/lib/links/link-utils.d.ts.map +1 -1
  98. package/libs/util/shared/src/lib/services/proxy.service.d.ts +5 -4
  99. package/libs/util/shared/src/lib/services/proxy.service.d.ts.map +1 -1
  100. package/libs/util/shared/src/lib/utils/sort-by.d.ts.map +1 -1
  101. package/package.json +1 -1
  102. package/src/libs/api/metadata-converter/src/lib/common/distribution.mapper.ts +2 -0
  103. package/src/libs/api/metadata-converter/src/lib/dcat-ap/dcat-ap.converter.ts +2 -2
  104. package/src/libs/api/metadata-converter/src/lib/fixtures/generic.records.ts +1 -1
  105. package/src/libs/api/metadata-converter/src/lib/fixtures/geo2france.records.service+eaux-usees.ts +1 -1
  106. package/src/libs/api/metadata-converter/src/lib/fixtures/geo2france.records.ts +5 -2
  107. package/src/libs/api/metadata-converter/src/lib/fixtures/geocat-ch.records.ts +1 -1
  108. package/src/libs/api/metadata-converter/src/lib/fixtures/georhena.records.ts +1 -1
  109. package/src/libs/api/metadata-converter/src/lib/fixtures/metawal.records.ts +2 -2
  110. package/src/libs/api/metadata-converter/src/lib/fixtures/wallonie.records.reuse.ts +1 -1
  111. package/src/libs/api/metadata-converter/src/lib/fixtures/wallonie.records.service+napitswallonia.ts +1 -1
  112. package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +28 -0
  113. package/src/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.ts +13 -6
  114. package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +6 -2
  115. package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +4 -2
  116. package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.ts +37 -36
  117. package/src/libs/api/repository/src/lib/gn4/settings/gn4-settings.service.ts +3 -2
  118. package/src/libs/common/domain/src/index.ts +2 -0
  119. package/src/libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model.ts +1 -1
  120. package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +12 -1
  121. package/src/libs/common/domain/src/lib/model/search/sort-by.model.ts +5 -0
  122. package/src/libs/common/domain/src/lib/platform.service.interface.ts +1 -1
  123. package/src/libs/common/fixtures/src/lib/elasticsearch/metadata-links.fixtures.ts +5 -0
  124. package/src/libs/common/fixtures/src/lib/link.fixtures.ts +19 -0
  125. package/src/libs/feature/dataviz/src/index.ts +1 -0
  126. package/src/libs/feature/dataviz/src/lib/chart-view/chart-view.component.ts +1 -0
  127. package/src/libs/feature/dataviz/src/lib/service/data.service.ts +16 -5
  128. package/src/libs/feature/dataviz/src/lib/stac-view/stac-view.component.css +0 -0
  129. package/src/libs/feature/dataviz/src/lib/stac-view/stac-view.component.html +40 -0
  130. package/src/libs/feature/dataviz/src/lib/stac-view/stac-view.component.ts +62 -0
  131. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +3 -3
  132. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +30 -0
  133. package/src/libs/feature/editor/src/lib/fields.config.ts +1 -1
  134. package/src/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.ts +7 -1
  135. package/src/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.ts +23 -4
  136. package/src/libs/feature/record/src/lib/state/mdview.facade.ts +30 -1
  137. package/src/libs/feature/router/src/lib/default/router.service.ts +8 -0
  138. package/src/libs/feature/router/src/lib/default/state/router.effects.ts +6 -7
  139. package/src/libs/feature/search/src/lib/sort-by/sort-by.component.ts +8 -12
  140. package/src/libs/ui/elements/src/index.ts +1 -0
  141. package/src/libs/ui/elements/src/lib/external-link-card/external-link-card.component.html +43 -22
  142. package/src/libs/ui/elements/src/lib/external-link-card/external-link-card.component.ts +12 -3
  143. package/src/libs/ui/elements/src/lib/metadata-doi/metadata-doi.component.css +0 -0
  144. package/src/libs/ui/elements/src/lib/metadata-doi/metadata-doi.component.html +31 -0
  145. package/src/libs/ui/elements/src/lib/metadata-doi/metadata-doi.component.ts +30 -0
  146. package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html +56 -14
  147. package/src/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.ts +4 -2
  148. package/src/libs/util/shared/src/lib/links/link-classifier.service.ts +4 -0
  149. package/src/libs/util/shared/src/lib/links/link-utils.ts +11 -0
  150. package/src/libs/util/shared/src/lib/services/proxy.service.ts +6 -2
  151. package/src/libs/util/shared/src/lib/utils/sort-by.ts +8 -5
  152. package/translations/de.json +16 -3
  153. package/translations/en.json +16 -4
  154. package/translations/es.json +15 -2
  155. package/translations/fr.json +16 -3
  156. package/translations/it.json +17 -4
  157. package/translations/nl.json +15 -2
  158. package/translations/pt.json +15 -2
  159. package/translations/sk.json +16 -3
  160. package/src/libs/common/domain/src/lib/index.ts +0 -2
@@ -154,4 +154,9 @@ export const elasticLinkFixture = (): Record<string, unknown> => ({
154
154
  name: 'myothertmslayer',
155
155
  url: 'https://my.tms.server/MapServer',
156
156
  },
157
+ stacItems: {
158
+ accessServiceProtocol: 'STAC:Items',
159
+ name: 'stac layer',
160
+ url: ' https://stacapi-cdos.apps.okd.crocc.meso.umontpellier.fr/collections/lidarhd/items',
161
+ },
157
162
  })
@@ -259,4 +259,23 @@ export const aSetOfLinksFixture = () => ({
259
259
  accessServiceProtocol: 'wms',
260
260
  type: 'endpoint',
261
261
  }) as ServiceEndpoint,
262
+ postgisLink: () =>
263
+ ({
264
+ name: 'France_Regions',
265
+ description:
266
+ 'Boundaries for the administrative regions of metropolitan France.',
267
+ url: new URL('http://geo.local:5432/france_demo'),
268
+ type: 'service',
269
+ accessServiceProtocol: 'postgis',
270
+ }) as DatasetServiceDistribution,
271
+ stacLink: () =>
272
+ ({
273
+ name: 'Lidar HD point cloud (COPC)',
274
+ description: 'Lidar HD classified point clouds from IGN',
275
+ url: new URL(
276
+ 'https://stacapi-cdos.apps.okd.crocc.meso.umontpellier.fr/collections/lidarhd/items'
277
+ ),
278
+ type: 'service',
279
+ accessServiceProtocol: 'stac',
280
+ }) as DatasetServiceDistribution,
262
281
  })
@@ -3,3 +3,4 @@ export * from './lib/chart-view/chart-view.component'
3
3
  export * from './lib/figure/figure-container/figure-container.component'
4
4
  export * from './lib/geo-table-view/geo-table-view.component'
5
5
  export * from './lib/table-view/table-view.component'
6
+ export * from './lib/stac-view/stac-view.component'
@@ -108,6 +108,7 @@ export class ChartViewComponent {
108
108
  chartType$ = new BehaviorSubject<InputChartType>('bar')
109
109
 
110
110
  @Input() set userChartConfig(config: DatavizChartConfigModel) {
111
+ if (!config) return
111
112
  this.aggregation$.next(config.aggregation)
112
113
  this.xProperty$.next(config.xProperty)
113
114
  this.yProperty$.next(config.yProperty)
@@ -97,16 +97,27 @@ export class DataService {
97
97
  if (!featureType) {
98
98
  throw new Error('wfs.featuretype.notfound')
99
99
  }
100
+
101
+ const wfsVersion = endpoint.getVersion()
102
+ const addSrsName = wfsVersion === '1.1.0' || wfsVersion === '2.0.0'
103
+ const defaultCrs = featureType.defaultCrs
104
+
105
+ const shouldAddOutputCrs = addSrsName && defaultCrs
106
+
100
107
  return {
101
- all: featureType.outputFormats.reduce(
102
- (prev, curr) => ({
108
+ all: featureType.outputFormats.reduce((prev, curr) => {
109
+ const isJsonFormat = curr.toLowerCase().includes('json')
110
+ return {
103
111
  ...prev,
104
112
  [curr]: endpoint.getFeatureUrl(featureType.name, {
105
113
  outputFormat: curr,
114
+ ...(shouldAddOutputCrs &&
115
+ !isJsonFormat && {
116
+ outputCrs: defaultCrs,
117
+ }),
106
118
  }),
107
- }),
108
- {}
109
- ),
119
+ }
120
+ }, {}),
110
121
  geojson: endpoint.supportsJson(featureType.name)
111
122
  ? endpoint.getFeatureUrl(featureType.name, {
112
123
  asJson: true,
@@ -0,0 +1,40 @@
1
+ <div
2
+ class="w-full h-full flex flex-row mt-6 bg-white border border-gray-300 rounded-lg overflow-hidden"
3
+ >
4
+ <div class="flex-1 flex flex-col">
5
+ <div class="m-8">
6
+ <p class="mb-4" translate>stac.filter.period</p>
7
+ <p translate>stac.filter.from</p>
8
+ <gn-ui-date-picker
9
+ id="start-date-picker"
10
+ [date]="currentTemporalExtent?.start"
11
+ (dateChange)="onStartDateChange($event)"
12
+ />
13
+ <p class="mt-4" translate>stac.filter.to</p>
14
+ <gn-ui-date-picker
15
+ id="end-date-picker"
16
+ [date]="currentTemporalExtent?.end"
17
+ (dateChange)="onEndDateChange($event)"
18
+ />
19
+ </div>
20
+
21
+ <div class="mt-auto mb-8 mx-8" *ngIf="isTemporalFilterModified">
22
+ <button
23
+ id="reset-filters-button"
24
+ type="button"
25
+ class="flex items-center"
26
+ (click)="onResetFilters()"
27
+ >
28
+ <span translate>stac.filter.reset</span>
29
+ <ng-icon
30
+ name="matDeleteOutline"
31
+ class="pointer-events-none ml-2"
32
+ ></ng-icon>
33
+ </button>
34
+ </div>
35
+ </div>
36
+
37
+ <div class="w-[655px] flex-shrink-0 flex items-center justify-center">
38
+ <span>Map...</span>
39
+ </div>
40
+ </div>
@@ -0,0 +1,62 @@
1
+ import { CommonModule } from '@angular/common'
2
+ import {
3
+ ChangeDetectionStrategy,
4
+ Component,
5
+ Input,
6
+ OnInit,
7
+ } from '@angular/core'
8
+ import {
9
+ DatasetServiceDistribution,
10
+ DatasetTemporalExtent,
11
+ } from '../../../../../../libs/common/domain/src/lib/model/record'
12
+ import { DatePickerComponent } from '../../../../../../libs/ui/inputs/src'
13
+ import { NgIconComponent, provideIcons } from '@ng-icons/core'
14
+ import { matDeleteOutline } from '@ng-icons/material-icons/outline'
15
+ import { TranslateDirective } from '@ngx-translate/core'
16
+
17
+ @Component({
18
+ selector: 'gn-ui-stac-view',
19
+ templateUrl: './stac-view.component.html',
20
+ styleUrls: ['./stac-view.component.css'],
21
+ changeDetection: ChangeDetectionStrategy.OnPush,
22
+ standalone: true,
23
+ imports: [
24
+ CommonModule,
25
+ DatePickerComponent,
26
+ NgIconComponent,
27
+ TranslateDirective,
28
+ ],
29
+ viewProviders: [provideIcons({ matDeleteOutline })],
30
+ })
31
+ export class StacViewComponent implements OnInit {
32
+ @Input() link: DatasetServiceDistribution
33
+ @Input() initialTemporalExtent: DatasetTemporalExtent | null
34
+
35
+ currentTemporalExtent: DatasetTemporalExtent | null = null
36
+ isTemporalFilterModified = false
37
+
38
+ onStartDateChange(date: Date) {
39
+ this.currentTemporalExtent = {
40
+ ...this.currentTemporalExtent,
41
+ start: date,
42
+ }
43
+ this.isTemporalFilterModified = true
44
+ }
45
+
46
+ onEndDateChange(date: Date) {
47
+ this.currentTemporalExtent = {
48
+ ...this.currentTemporalExtent,
49
+ end: date,
50
+ }
51
+ this.isTemporalFilterModified = true
52
+ }
53
+
54
+ onResetFilters() {
55
+ this.currentTemporalExtent = this.initialTemporalExtent
56
+ this.isTemporalFilterModified = false
57
+ }
58
+
59
+ ngOnInit() {
60
+ this.currentTemporalExtent = this.initialTemporalExtent
61
+ }
62
+ }
@@ -69,11 +69,11 @@
69
69
  (valueChange)="valueChange.emit($event)"
70
70
  ></gn-ui-form-field-overviews>
71
71
  </ng-container>
72
- <ng-container *ngSwitchCase="'resourceIdentifier'">
72
+ <ng-container *ngSwitchCase="'resourceIdentifiers'">
73
73
  <gn-ui-form-field-simple
74
74
  [type]="'text'"
75
- [value]="valueAsString"
76
- (valueChange)="valueChange.emit($event)"
75
+ [value]="valueAsResourceIdentifierCode"
76
+ (valueChange)="handleResourceIdentifierChange($event)"
77
77
  ></gn-ui-form-field-simple>
78
78
  </ng-container>
79
79
  <ng-container *ngSwitchCase="'resourceCreated'">
@@ -142,4 +142,34 @@ export class FormFieldComponent {
142
142
  get valueAsOnlineResources() {
143
143
  return this.value as Array<OnlineResource>
144
144
  }
145
+ get valueAsResourceIdentifierCode() {
146
+ const identifiers = this.value as Array<{
147
+ code: string
148
+ codeSpace?: string
149
+ url?: string
150
+ }>
151
+ return identifiers?.[0]?.code || ''
152
+ }
153
+
154
+ handleResourceIdentifierChange(code: string) {
155
+ const identifiers = this.value as Array<{
156
+ code: string
157
+ codeSpace?: string
158
+ url?: string
159
+ }>
160
+
161
+ if (!code) {
162
+ this.valueChange.emit(identifiers?.slice(1) || [])
163
+ return
164
+ }
165
+
166
+ if (identifiers?.[0]) {
167
+ this.valueChange.emit([
168
+ { ...identifiers[0], code },
169
+ ...identifiers.slice(1),
170
+ ])
171
+ } else {
172
+ this.valueChange.emit([{ code }])
173
+ }
174
+ }
145
175
  }
@@ -81,7 +81,7 @@ export const RECORD_RESOURCE_CREATED_FIELD: EditorField = {
81
81
  }
82
82
 
83
83
  export const RESOURCE_IDENTIFIER_FIELD: EditorField = {
84
- model: 'resourceIdentifier',
84
+ model: 'resourceIdentifiers',
85
85
  formFieldConfig: {
86
86
  labelKey: marker('editor.record.form.field.resourceIdentifier'),
87
87
  },
@@ -12,7 +12,7 @@ import { MdViewFacade } from '../state'
12
12
  import { CopyTextButtonComponent } from '../../../../../../libs/ui/inputs/src'
13
13
  import { CommonModule } from '@angular/common'
14
14
  import { TranslatePipe } from '@ngx-translate/core'
15
- import { GEONETWORK_UI_TAG_NAME } from '../../../../../../libs/util/shared/src'
15
+ import { GEONETWORK_UI_TAG_NAME, PROXY_PATH } from '../../../../../../libs/util/shared/src'
16
16
 
17
17
  export const WEB_COMPONENT_EMBEDDER_URL = new InjectionToken<string>(
18
18
  'webComponentEmbedderUrl'
@@ -60,6 +60,9 @@ export class DataViewPermalinkComponent {
60
60
  url.searchParams.append('e', `gn-dataset-view-map`)
61
61
  }
62
62
  url.searchParams.append('a', `api-url=${this.config.basePath}`)
63
+ if (this.proxyPath) {
64
+ url.searchParams.append('a', `proxy-path=${this.proxyPath}`)
65
+ }
63
66
  url.searchParams.append('a', `dataset-id=${metadata.uniqueIdentifier}`)
64
67
  url.searchParams.append('a', `primary-color=#0f4395`)
65
68
  url.searchParams.append('a', `secondary-color=#8bc832`)
@@ -72,6 +75,9 @@ export class DataViewPermalinkComponent {
72
75
  constructor(
73
76
  @Inject(Configuration) private config: Configuration,
74
77
  @Optional()
78
+ @Inject(PROXY_PATH)
79
+ private proxyPath: string,
80
+ @Optional()
75
81
  @Inject(WEB_COMPONENT_EMBEDDER_URL)
76
82
  protected wcEmbedderBaseUrl: string,
77
83
  private facade: MdViewFacade
@@ -3,6 +3,7 @@ import {
3
3
  Component,
4
4
  Inject,
5
5
  Input,
6
+ Optional,
6
7
  } from '@angular/core'
7
8
  import { Configuration } from '../../../../../../libs/data-access/gn4/src'
8
9
  import { MdViewFacade } from '../state'
@@ -10,7 +11,7 @@ import { BehaviorSubject, combineLatest, map } from 'rxjs'
10
11
  import { CopyTextButtonComponent } from '../../../../../../libs/ui/inputs/src'
11
12
  import { CommonModule } from '@angular/common'
12
13
  import { TranslatePipe } from '@ngx-translate/core'
13
- import { GEONETWORK_UI_TAG_NAME } from '../../../../../../libs/util/shared/src'
14
+ import { GEONETWORK_UI_TAG_NAME, PROXY_PATH } from '../../../../../../libs/util/shared/src'
14
15
 
15
16
  @Component({
16
17
  selector: 'gn-ui-data-view-web-component',
@@ -42,7 +43,12 @@ export class DataViewWebComponentComponent {
42
43
  api-url="${new URL(
43
44
  this.config.basePath,
44
45
  window.location.origin
45
- ).toString()}"
46
+ ).toString()}"${
47
+ this.proxyPath
48
+ ? `
49
+ proxy-path="${this.proxyPath}"`
50
+ : ''
51
+ }
46
52
  dataset-id="${metadata.uniqueIdentifier}"
47
53
  aggregation="${aggregation}"
48
54
  x-property="${xProperty}"
@@ -65,7 +71,12 @@ export class DataViewWebComponentComponent {
65
71
  api-url="${new URL(
66
72
  this.config.basePath,
67
73
  window.location.origin
68
- ).toString()}"
74
+ ).toString()}"${
75
+ this.proxyPath
76
+ ? `
77
+ proxy-path="${this.proxyPath}"`
78
+ : ''
79
+ }
69
80
  dataset-id="${metadata.uniqueIdentifier}"
70
81
  primary-color="#0f4395"
71
82
  secondary-color="#8bc832"
@@ -82,7 +93,12 @@ export class DataViewWebComponentComponent {
82
93
  api-url="${new URL(
83
94
  this.config.basePath,
84
95
  window.location.origin
85
- ).toString()}"
96
+ ).toString()}"${
97
+ this.proxyPath
98
+ ? `
99
+ proxy-path="${this.proxyPath}"`
100
+ : ''
101
+ }
86
102
  dataset-id="${metadata.uniqueIdentifier}"
87
103
  primary-color="#0f4395"
88
104
  secondary-color="#8bc832"
@@ -97,6 +113,9 @@ export class DataViewWebComponentComponent {
97
113
 
98
114
  constructor(
99
115
  @Inject(Configuration) private config: Configuration,
116
+ @Optional()
117
+ @Inject(PROXY_PATH)
118
+ private proxyPath: string,
100
119
  private facade: MdViewFacade
101
120
  ) {}
102
121
  }
@@ -20,7 +20,7 @@ import {
20
20
  } from '../../../../../../libs/common/domain/src/lib/model/record'
21
21
  import { AvatarServiceInterface } from '../../../../../../libs/api/repository/src'
22
22
  import { OgcApiRecord } from '@camptocamp/ogc-client'
23
- import { from, of, Observable } from 'rxjs'
23
+ import { from, of } from 'rxjs'
24
24
  import { DataService } from '../../../../../../libs/feature/dataviz/src'
25
25
 
26
26
  @Injectable()
@@ -89,6 +89,25 @@ export class MdViewFacade {
89
89
  shareReplay(1)
90
90
  )
91
91
 
92
+ resourceDoi$ = this.metadata$.pipe(
93
+ map((record) => {
94
+ if (!record?.resourceIdentifiers?.length) return null
95
+ const doiIdentifier = record.resourceIdentifiers.find(
96
+ (id) =>
97
+ id.codeSpace?.toLowerCase().includes('doi.org') ||
98
+ id.code.startsWith('10.')
99
+ )
100
+
101
+ if (!doiIdentifier) return null
102
+
103
+ return {
104
+ code: doiIdentifier.code,
105
+ url: doiIdentifier.url ? doiIdentifier.url : null,
106
+ }
107
+ }),
108
+ shareReplay(1)
109
+ )
110
+
92
111
  apiLinks$ = this.allLinks$.pipe(
93
112
  map((links) =>
94
113
  links.filter((link) => this.linkClassifier.hasUsage(link, LinkUsage.API))
@@ -105,6 +124,16 @@ export class MdViewFacade {
105
124
  shareReplay(1)
106
125
  )
107
126
 
127
+ stacLinks$ = this.allLinks$.pipe(
128
+ map((links) =>
129
+ links.filter(
130
+ (link) =>
131
+ link.type === 'service' && link.accessServiceProtocol === 'stac'
132
+ )
133
+ ),
134
+ shareReplay(1)
135
+ )
136
+
108
137
  downloadLinks$ = this.allLinks$.pipe(
109
138
  map((links) =>
110
139
  links.filter((link) =>
@@ -8,6 +8,10 @@ import {
8
8
  } from '.'
9
9
  import { Router, Routes } from '@angular/router'
10
10
  import { ROUTER_CONFIG, RouterConfigModel } from './router.config'
11
+ import {
12
+ SortByEnum,
13
+ SortByField,
14
+ } from '../../../../../../libs/common/domain/src/lib/model/search'
11
15
 
12
16
  @Injectable({
13
17
  providedIn: 'root',
@@ -58,4 +62,8 @@ export class RouterService {
58
62
  getOrganizationPageRoute(): string {
59
63
  return ROUTER_ROUTE_ORGANIZATION
60
64
  }
65
+
66
+ getDefaultSort(): SortByField {
67
+ return SortByEnum.RESOURCE_DATES
68
+ }
61
69
  }
@@ -9,10 +9,7 @@ import {
9
9
  SetFilters,
10
10
  SetSortBy,
11
11
  } from '../../../../../../../libs/feature/search/src'
12
- import {
13
- FieldFilters,
14
- SortByEnum,
15
- } from '../../../../../../../libs/common/domain/src/lib/model/search'
12
+ import { FieldFilters } from '../../../../../../../libs/common/domain/src/lib/model/search'
16
13
  import { Actions, createEffect, ofType } from '@ngrx/effects'
17
14
  import { navigation } from '@ngrx/router-store/data-persistence'
18
15
  import { of, pairwise, startWith } from 'rxjs'
@@ -22,6 +19,7 @@ import { RouterFacade } from './router.facade'
22
19
  import { ROUTE_PARAMS } from '../constants'
23
20
  import { sortByFromString } from '../../../../../../../libs/util/shared/src'
24
21
  import { ROUTER_CONFIG, RouterConfigModel } from '../router.config'
22
+ import { RouterService } from '../router.service'
25
23
 
26
24
  @Injectable()
27
25
  export class RouterEffects {
@@ -31,7 +29,8 @@ export class RouterEffects {
31
29
  private _location: Location,
32
30
  private facade: RouterFacade,
33
31
  @Inject(ROUTER_CONFIG) private routerConfig: RouterConfigModel,
34
- private fieldsService: FieldsService
32
+ private fieldsService: FieldsService,
33
+ private routerService: RouterService
35
34
  ) {}
36
35
 
37
36
  navigate$ = createEffect(
@@ -61,7 +60,7 @@ export class RouterEffects {
61
60
  let sortBy =
62
61
  ROUTE_PARAMS.SORT in newParams
63
62
  ? sortByFromString(newParams[ROUTE_PARAMS.SORT])
64
- : SortByEnum.CHANGE_DATE
63
+ : this.routerService.getDefaultSort()
65
64
  let pageNumber =
66
65
  ROUTE_PARAMS.PAGE in newParams
67
66
  ? parseInt(newParams[ROUTE_PARAMS.PAGE])
@@ -70,7 +69,7 @@ export class RouterEffects {
70
69
  const oldSort =
71
70
  ROUTE_PARAMS.SORT in oldParams
72
71
  ? sortByFromString(oldParams[ROUTE_PARAMS.SORT])
73
- : SortByEnum.CHANGE_DATE
72
+ : this.routerService.getDefaultSort()
74
73
  if (JSON.stringify(sortBy) === JSON.stringify(oldSort)) {
75
74
  sortBy = null
76
75
  }
@@ -13,7 +13,7 @@ import { TranslatePipe } from '@ngx-translate/core'
13
13
 
14
14
  interface SortChoice {
15
15
  label: string
16
- value: string
16
+ value: SortByField
17
17
  }
18
18
 
19
19
  @Component({
@@ -27,24 +27,20 @@ export class SortByComponent implements OnInit {
27
27
  choices: SortChoice[] = [
28
28
  {
29
29
  label: marker('results.sortBy.relevancy'),
30
- value: SortByEnum.RELEVANCY.join(','),
30
+ value: SortByEnum.RELEVANCY,
31
31
  },
32
32
  {
33
33
  label: marker('results.sortBy.dateStamp'),
34
- value: SortByEnum.CREATE_DATE.join(','),
35
- },
36
- {
37
- label: marker('results.sortBy.changeDate'),
38
- value: SortByEnum.CHANGE_DATE.join(','),
34
+ value: SortByEnum.RESOURCE_DATES,
39
35
  },
40
36
  {
41
37
  label: marker('results.sortBy.popularity'),
42
- value: SortByEnum.POPULARITY.join(','),
38
+ value: SortByEnum.POPULARITY,
43
39
  },
44
40
  ]
45
41
  currentSortBy$ = this.facade.sortBy$.pipe(
46
42
  filter((sortBy) => !!sortBy),
47
- map((sortBy) => sortBy.join(','))
43
+ map((sortBy) => sortBy)
48
44
  )
49
45
 
50
46
  constructor(
@@ -56,12 +52,12 @@ export class SortByComponent implements OnInit {
56
52
  if (this.isQualitySortable) {
57
53
  this.choices.push({
58
54
  label: marker('results.sortBy.qualityScore'),
59
- value: SortByEnum.QUALITY_SCORE.join(','),
55
+ value: SortByEnum.QUALITY_SCORE,
60
56
  })
61
57
  }
62
58
  }
63
59
 
64
- changeSortBy(criteriaAsString: string) {
65
- this.searchService.setSortBy(criteriaAsString.split(',') as SortByField)
60
+ changeSortBy(criteria: SortByField): void {
61
+ this.searchService.setSortBy(criteria)
66
62
  }
67
63
  }
@@ -14,6 +14,7 @@ export * from './lib/markdown-editor/markdown-editor.component'
14
14
  export * from './lib/markdown-parser/markdown-parser.component'
15
15
  export * from './lib/metadata-catalog/metadata-catalog.component'
16
16
  export * from './lib/metadata-contact/metadata-contact.component'
17
+ export * from './lib/metadata-doi/metadata-doi.component'
17
18
  export * from './lib/metadata-info/metadata-info.component'
18
19
  export * from './lib/metadata-quality-item/metadata-quality-item.component'
19
20
  export * from './lib/metadata-quality/metadata-quality.component'
@@ -1,15 +1,48 @@
1
- <a
2
- [href]="link.url"
3
- target="_blank"
4
- class="group flex flex-row justify-between card-shadow cursor-pointer rounded overflow-hidden"
5
- [ngClass]="cardClass"
6
- [title]="title"
7
- >
1
+ <ng-container *ngIf="isDatabase; else clickableLink">
2
+ <div [ngClass]="cardClass" [title]="title">
3
+ <ng-container *ngTemplateOutlet="cardContent"></ng-container>
4
+ <div
5
+ class="flex min-w-[32px]"
6
+ [ngClass]="size === 'S' ? 'items-end' : 'items-center'"
7
+ >
8
+ <div
9
+ class="gn-ui-card-icon"
10
+ [title]="'record.metadata.link.postgis.tooltip' | translate"
11
+ >
12
+ <ng-icon
13
+ class="inline-block card-icon align-middle"
14
+ name="iconoirDatabase"
15
+ ></ng-icon>
16
+ </div>
17
+ </div>
18
+ </div>
19
+ </ng-container>
20
+
21
+ <ng-template #clickableLink>
22
+ <a [href]="link.url" target="_blank" [ngClass]="cardClass" [title]="title">
23
+ <ng-container *ngTemplateOutlet="cardContent"></ng-container>
24
+ <div
25
+ class="flex min-w-[32px]"
26
+ [ngClass]="size === 'S' ? 'items-end' : 'items-center'"
27
+ >
28
+ <div class="gn-ui-card-icon">
29
+ <ng-icon
30
+ class="inline-block card-icon align-middle"
31
+ name="matOpenInNew"
32
+ ></ng-icon>
33
+ </div>
34
+ </div>
35
+ </a>
36
+ </ng-template>
37
+ <ng-template #cardContent>
8
38
  <div class="flex flex-col justify-between flex-1 min-w-0">
9
39
  <div class="gn-ui-card-title">
10
40
  {{ link.description || link.name }}
11
41
  </div>
12
42
  <div class="gn-ui-card-detail">
43
+ <ng-container *ngIf="isDatabase">
44
+ {{ 'record.metadata.link.postgis.table' | translate }}
45
+ </ng-container>
13
46
  {{ link.name }}
14
47
  </div>
15
48
  <p *ngIf="!link.name && !link.description" class="gn-ui-card-title">
@@ -20,21 +53,9 @@
20
53
  class="inline-flex items-center justify-center px-2 py-1 text-13 font-medium leading-none text-white rounded transition-opacity opacity-70 group-hover:opacity-100"
21
54
  [style.background-color]="getLinkColor(link)"
22
55
  data-cy="download-format"
23
- >{{
24
- getLinkFormat(link) || ('downloads.format.unknown' | translate)
25
- }}</span
26
56
  >
57
+ {{ getLinkFormat(link) || ('downloads.format.unknown' | translate) }}
58
+ </span>
27
59
  </div>
28
60
  </div>
29
- <div
30
- class="flex min-w-[32px]"
31
- [ngClass]="size === 'S' ? 'items-end' : 'items-center'"
32
- >
33
- <div class="gn-ui-card-icon">
34
- <ng-icon
35
- class="inline-block card-icon align-middle"
36
- name="matOpenInNew"
37
- ></ng-icon>
38
- </div>
39
- </div>
40
- </a>
61
+ </ng-template>
@@ -7,6 +7,7 @@ import {
7
7
  provideNgIconsConfig,
8
8
  } from '@ng-icons/core'
9
9
  import { matOpenInNew } from '@ng-icons/material-icons/baseline'
10
+ import { iconoirDatabase } from '@ng-icons/iconoir'
10
11
  import { getBadgeColor, getFileFormat } from '../../../../../../libs/util/shared/src'
11
12
  import { TranslatePipe } from '@ngx-translate/core'
12
13
 
@@ -21,6 +22,7 @@ type CardSize = 'L' | 'M' | 'S' | 'XS'
21
22
  providers: [
22
23
  provideIcons({
23
24
  matOpenInNew,
25
+ iconoirDatabase,
24
26
  }),
25
27
  provideNgIconsConfig({ size: '1.5em' }),
26
28
  ],
@@ -37,7 +39,7 @@ export class ExternalLinkCardComponent {
37
39
 
38
40
  @Input() set size(value: CardSize) {
39
41
  this._size = value
40
- this.cardClass = this.sizeClassMap[value]
42
+ this.cardClass = `group flex flex-row justify-between card-shadow rounded overflow-hidden ${this.sizeClassMap[value]}`
41
43
  }
42
44
  get size(): CardSize {
43
45
  return this._size
@@ -51,11 +53,18 @@ export class ExternalLinkCardComponent {
51
53
  return this.link.name || this.link.description || ''
52
54
  }
53
55
 
54
- getLinkFormat(link: any) {
56
+ get isDatabase(): boolean {
57
+ return (
58
+ this.link.type === 'service' &&
59
+ this.link.accessServiceProtocol === 'postgis'
60
+ )
61
+ }
62
+
63
+ getLinkFormat(link: DatasetOnlineResource): string {
55
64
  return getFileFormat(link)
56
65
  }
57
66
 
58
- getLinkColor(link: any) {
67
+ getLinkColor(link: DatasetOnlineResource): string {
59
68
  return getBadgeColor(getFileFormat(link))
60
69
  }
61
70
  }