geonetwork-ui 2.8.0-dev.83aaa1736 → 2.8.0-dev.8cb6904b7

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 (106) hide show
  1. package/esm2022/index.mjs +2 -1
  2. package/esm2022/libs/api/metadata-converter/src/lib/common/distribution.mapper.mjs +3 -1
  3. package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.mjs +2 -1
  4. package/esm2022/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.mjs +10 -10
  5. package/esm2022/libs/api/repository/src/lib/gn4/settings/gn4-settings.service.mjs +3 -2
  6. package/esm2022/libs/common/domain/src/index.mjs +3 -0
  7. package/esm2022/libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model.mjs +1 -1
  8. package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +2 -1
  9. package/esm2022/libs/common/domain/src/lib/model/search/sort-by.model.mjs +6 -1
  10. package/esm2022/libs/common/domain/src/lib/platform.service.interface.mjs +1 -1
  11. package/esm2022/libs/feature/dataviz/src/index.mjs +2 -1
  12. package/esm2022/libs/feature/dataviz/src/lib/chart-view/chart-view.component.mjs +3 -1
  13. package/esm2022/libs/feature/dataviz/src/lib/stac-view/stac-view.component.mjs +22 -0
  14. package/esm2022/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.mjs +13 -4
  15. package/esm2022/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.mjs +23 -8
  16. package/esm2022/libs/feature/record/src/lib/state/mdview.facade.mjs +2 -1
  17. package/esm2022/libs/feature/router/src/lib/default/router.service.mjs +5 -1
  18. package/esm2022/libs/feature/router/src/lib/default/state/router.effects.mjs +9 -7
  19. package/esm2022/libs/feature/search/src/lib/sort-by/sort-by.component.mjs +8 -12
  20. package/esm2022/libs/ui/elements/src/lib/metadata-info/metadata-info.component.mjs +3 -3
  21. package/esm2022/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.mjs +2 -3
  22. package/esm2022/libs/util/shared/src/lib/links/link-classifier.service.mjs +3 -1
  23. package/esm2022/libs/util/shared/src/lib/utils/sort-by.mjs +9 -6
  24. package/esm2022/translations/de.json +7 -3
  25. package/esm2022/translations/en.json +7 -4
  26. package/esm2022/translations/es.json +6 -2
  27. package/esm2022/translations/fr.json +7 -3
  28. package/esm2022/translations/it.json +8 -4
  29. package/esm2022/translations/nl.json +6 -2
  30. package/esm2022/translations/pt.json +6 -2
  31. package/esm2022/translations/sk.json +7 -3
  32. package/fesm2022/geonetwork-ui.mjs +150 -62
  33. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  34. package/index.d.ts +1 -0
  35. package/index.d.ts.map +1 -1
  36. package/index.ts +1 -0
  37. package/libs/api/metadata-converter/src/lib/common/distribution.mapper.d.ts.map +1 -1
  38. package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts.map +1 -1
  39. package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts +7 -7
  40. package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts.map +1 -1
  41. package/libs/api/repository/src/lib/gn4/settings/gn4-settings.service.d.ts.map +1 -1
  42. package/libs/common/domain/src/index.d.ts +3 -0
  43. package/libs/common/domain/src/index.d.ts.map +1 -0
  44. package/libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model.d.ts +1 -1
  45. package/libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model.d.ts.map +1 -1
  46. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +1 -1
  47. package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
  48. package/libs/common/domain/src/lib/model/search/sort-by.model.d.ts.map +1 -1
  49. package/libs/common/domain/src/lib/platform.service.interface.d.ts +1 -1
  50. package/libs/common/domain/src/lib/platform.service.interface.d.ts.map +1 -1
  51. package/libs/feature/dataviz/src/index.d.ts +1 -0
  52. package/libs/feature/dataviz/src/index.d.ts.map +1 -1
  53. package/libs/feature/dataviz/src/lib/chart-view/chart-view.component.d.ts.map +1 -1
  54. package/libs/feature/dataviz/src/lib/stac-view/stac-view.component.d.ts +11 -0
  55. package/libs/feature/dataviz/src/lib/stac-view/stac-view.component.d.ts.map +1 -0
  56. package/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.d.ts +3 -2
  57. package/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.d.ts.map +1 -1
  58. package/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.d.ts +3 -2
  59. package/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.d.ts.map +1 -1
  60. package/libs/feature/record/src/lib/state/mdview.facade.d.ts +24 -24
  61. package/libs/feature/record/src/lib/state/mdview.facade.d.ts.map +1 -1
  62. package/libs/feature/router/src/lib/default/router.service.d.ts +2 -0
  63. package/libs/feature/router/src/lib/default/router.service.d.ts.map +1 -1
  64. package/libs/feature/router/src/lib/default/state/router.effects.d.ts +3 -1
  65. package/libs/feature/router/src/lib/default/state/router.effects.d.ts.map +1 -1
  66. package/libs/feature/search/src/lib/sort-by/sort-by.component.d.ts +4 -3
  67. package/libs/feature/search/src/lib/sort-by/sort-by.component.d.ts.map +1 -1
  68. package/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.d.ts.map +1 -1
  69. package/libs/util/shared/src/lib/links/link-classifier.service.d.ts.map +1 -1
  70. package/libs/util/shared/src/lib/utils/sort-by.d.ts.map +1 -1
  71. package/package.json +1 -1
  72. package/src/libs/api/metadata-converter/src/lib/common/distribution.mapper.ts +1 -0
  73. package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +1 -0
  74. package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.ts +37 -36
  75. package/src/libs/api/repository/src/lib/gn4/settings/gn4-settings.service.ts +3 -2
  76. package/src/libs/common/domain/src/index.ts +2 -0
  77. package/src/libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model.ts +1 -1
  78. package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +2 -0
  79. package/src/libs/common/domain/src/lib/model/search/sort-by.model.ts +5 -0
  80. package/src/libs/common/domain/src/lib/platform.service.interface.ts +1 -1
  81. package/src/libs/common/fixtures/src/lib/elasticsearch/metadata-links.fixtures.ts +5 -0
  82. package/src/libs/common/fixtures/src/lib/link.fixtures.ts +10 -0
  83. package/src/libs/feature/dataviz/src/index.ts +1 -0
  84. package/src/libs/feature/dataviz/src/lib/chart-view/chart-view.component.ts +1 -0
  85. package/src/libs/feature/dataviz/src/lib/stac-view/stac-view.component.css +0 -0
  86. package/src/libs/feature/dataviz/src/lib/stac-view/stac-view.component.html +5 -0
  87. package/src/libs/feature/dataviz/src/lib/stac-view/stac-view.component.ts +27 -0
  88. package/src/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.ts +7 -1
  89. package/src/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.ts +23 -4
  90. package/src/libs/feature/record/src/lib/state/mdview.facade.ts +11 -1
  91. package/src/libs/feature/router/src/lib/default/router.service.ts +8 -0
  92. package/src/libs/feature/router/src/lib/default/state/router.effects.ts +6 -7
  93. package/src/libs/feature/search/src/lib/sort-by/sort-by.component.ts +8 -12
  94. package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html +56 -14
  95. package/src/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.ts +4 -2
  96. package/src/libs/util/shared/src/lib/links/link-classifier.service.ts +2 -0
  97. package/src/libs/util/shared/src/lib/utils/sort-by.ts +8 -5
  98. package/translations/de.json +7 -3
  99. package/translations/en.json +7 -4
  100. package/translations/es.json +6 -2
  101. package/translations/fr.json +7 -3
  102. package/translations/it.json +8 -4
  103. package/translations/nl.json +6 -2
  104. package/translations/pt.json +6 -2
  105. package/translations/sk.json +7 -3
  106. package/src/libs/common/domain/src/lib/index.ts +0 -2
@@ -1,12 +1,21 @@
1
+ import { HttpClient, HttpEventType } from '@angular/common/http'
1
2
  import { Inject, Injectable, InjectionToken, Optional } from '@angular/core'
2
3
  import {
3
- catchError,
4
- filter,
5
- map,
6
- mergeMap,
7
- shareReplay,
8
- tap,
9
- } from 'rxjs/operators'
4
+ KeywordApiResponse,
5
+ ThesaurusApiResponse,
6
+ } from '../../../../../../../libs/api/metadata-converter/src'
7
+ import {
8
+ CatalogRecord,
9
+ Keyword,
10
+ Organization,
11
+ UserFeedback,
12
+ } from '../../../../../../../libs/common/domain/src/lib/model/record'
13
+ import { KeywordType } from '../../../../../../../libs/common/domain/src/lib/model/thesaurus'
14
+ import { UserModel } from '../../../../../../../libs/common/domain/src/lib/model/user/user.model'
15
+ import {
16
+ PlatformServiceInterface,
17
+ UploadEvent,
18
+ } from '../../../../../../../libs/common/domain/src/lib/platform.service.interface'
10
19
  import {
11
20
  MeApiService,
12
21
  RecordsApiService,
@@ -15,26 +24,9 @@ import {
15
24
  UserfeedbackApiService,
16
25
  UsersApiService,
17
26
  } from '../../../../../../../libs/data-access/gn4/src'
18
- import {
19
- PlatformServiceInterface,
20
- UploadEvent,
21
- } from '../../../../../../../libs/common/domain/src/lib/platform.service.interface'
22
- import { UserModel } from '../../../../../../../libs/common/domain/src/lib/model/user/user.model'
23
- import {
24
- CatalogRecord,
25
- Keyword,
26
- Organization,
27
- UserFeedback,
28
- } from '../../../../../../../libs/common/domain/src/lib/model/record'
29
- import { Gn4PlatformMapper } from './gn4-platform.mapper'
30
- import { ltr } from 'semver'
31
- import { HttpClient, HttpEventType } from '@angular/common/http'
32
- import {
33
- KeywordApiResponse,
34
- ThesaurusApiResponse,
35
- } from '../../../../../../../libs/api/metadata-converter/src'
36
- import { KeywordType } from '../../../../../../../libs/common/domain/src/lib/model/thesaurus'
27
+ import { toLang3 } from '../../../../../../../libs/util/i18n/src'
37
28
  import { noDuplicateFileName } from '../../../../../../../libs/util/shared/src'
29
+ import { TranslateService } from '@ngx-translate/core'
38
30
  import {
39
31
  combineLatest,
40
32
  forkJoin,
@@ -43,9 +35,17 @@ import {
43
35
  switchMap,
44
36
  throwError,
45
37
  } from 'rxjs'
46
- import { TranslateService } from '@ngx-translate/core'
47
- import { toLang3 } from '../../../../../../../libs/util/i18n/src'
38
+ import {
39
+ catchError,
40
+ filter,
41
+ map,
42
+ mergeMap,
43
+ shareReplay,
44
+ tap,
45
+ } from 'rxjs/operators'
46
+ import { ltr } from 'semver'
48
47
  import { Gn4SettingsService } from '../settings/gn4-settings.service'
48
+ import { Gn4PlatformMapper } from './gn4-platform.mapper'
49
49
 
50
50
  const minApiVersion = '4.2.2'
51
51
 
@@ -56,7 +56,6 @@ export const DISABLE_AUTH = new InjectionToken<boolean>('gnDisableAuth', {
56
56
  @Injectable()
57
57
  export class Gn4PlatformService implements PlatformServiceInterface {
58
58
  private readonly type = 'GeoNetwork'
59
- private readonly me$: Observable<UserModel>
60
59
  private readonly users$: Observable<UserModel[]>
61
60
  private readonly isUserAnonymous$: Observable<boolean>
62
61
  private readonly gnParseVersion = '4.2.5'
@@ -70,6 +69,15 @@ export class Gn4PlatformService implements PlatformServiceInterface {
70
69
  }),
71
70
  shareReplay(1)
72
71
  )
72
+
73
+ private me$ = this.disableAuth
74
+ ? of(null)
75
+ : of(true).pipe(
76
+ switchMap(() => this.meApi.getMe()),
77
+ switchMap((apiUser) => this.mapper.userFromMeApi(apiUser)),
78
+ shareReplay({ bufferSize: 1, refCount: true })
79
+ )
80
+
73
81
  /**
74
82
  * A map of already loaded thesauri (groups of keywords); the key is a URI
75
83
  * @private
@@ -93,13 +101,6 @@ export class Gn4PlatformService implements PlatformServiceInterface {
93
101
  private settingsService: Gn4SettingsService,
94
102
  @Inject(DISABLE_AUTH) @Optional() private disableAuth: boolean
95
103
  ) {
96
- this.me$ = this.disableAuth
97
- ? of(null)
98
- : this.meApi.getMe().pipe(
99
- switchMap((apiUser) => this.mapper.userFromMeApi(apiUser)),
100
- shareReplay({ bufferSize: 1, refCount: true })
101
- )
102
-
103
104
  this.isUserAnonymous$ = this.me$.pipe(
104
105
  map((user) => !user || !('id' in user))
105
106
  )
@@ -1,7 +1,7 @@
1
1
  import { Injectable } from '@angular/core'
2
2
  import { SiteApiService } from '../../../../../../../libs/data-access/gn4/src'
3
+ import { Observable, of, switchMap } from 'rxjs'
3
4
  import { map, shareReplay } from 'rxjs/operators'
4
- import { Observable } from 'rxjs'
5
5
 
6
6
  @Injectable({
7
7
  providedIn: 'root',
@@ -25,7 +25,8 @@ export class Gn4SettingsService {
25
25
  constructor(private siteApiService: SiteApiService) {}
26
26
 
27
27
  private getSettingsSetValueByKey(key: string) {
28
- return this.siteApiService.getSettingsSet(null, [key]).pipe(
28
+ return of(true).pipe(
29
+ switchMap(() => this.siteApiService.getSettingsSet(null, [key])),
29
30
  map((v) => v[key]),
30
31
  shareReplay({ bufferSize: 1, refCount: true })
31
32
  )
@@ -0,0 +1,2 @@
1
+ export * from './lib/organizations.service.interface'
2
+ export * from './lib/platform.service.interface'
@@ -24,5 +24,5 @@ export interface DatavizConfigModel {
24
24
  view: string
25
25
  source: DatasetOnlineResource
26
26
  chartConfig?: DatavizChartConfigModel
27
- styleTMSIndex: number
27
+ styleTMSIndex?: number
28
28
  }
@@ -164,6 +164,7 @@ export type ServiceProtocol =
164
164
  | 'tms'
165
165
  | 'maplibre-style'
166
166
  | 'postgis'
167
+ | 'stac'
167
168
  | 'other'
168
169
 
169
170
  marker('record.metadata.api.accessServiceProtocol.wms')
@@ -176,6 +177,7 @@ marker('record.metadata.api.accessServiceProtocol.GPFDL')
176
177
  marker('record.metadata.api.accessServiceProtocol.tms')
177
178
  marker('record.metadata.api.accessServiceProtocol.maplibre-style')
178
179
  marker('record.metadata.api.accessServiceProtocol.postgis')
180
+ marker('record.metadata.api.accessServiceProtocol.stac')
179
181
  marker('record.metadata.api.accessServiceProtocol.other')
180
182
 
181
183
  export type OnlineResourceType = 'service' | 'download' | 'link' | 'endpoint'
@@ -6,4 +6,9 @@ export const SortByEnum: Record<string, SortByField> = {
6
6
  RELEVANCY: ['desc', '_score'],
7
7
  QUALITY_SCORE: ['desc', 'qualityScore'],
8
8
  CHANGE_DATE: ['desc', 'changeDate'],
9
+ RESOURCE_DATES: [
10
+ ['desc', 'revisionDateForResource'],
11
+ ['desc', 'publicationDateForResource'],
12
+ ['desc', 'creationDateForResource'],
13
+ ],
9
14
  }
@@ -45,6 +45,7 @@ export abstract class PlatformServiceInterface {
45
45
  thesaurusId: string
46
46
  ): Observable<Keyword[]>
47
47
 
48
+ abstract getFeedbacksAllowed(): Observable<boolean>
48
49
  abstract getUserFeedbacks(recordUuid: string): Observable<UserFeedback[]>
49
50
  abstract postUserFeedbacks(recordUuid: UserFeedback): Observable<void>
50
51
 
@@ -58,5 +59,4 @@ export abstract class PlatformServiceInterface {
58
59
  removeDuplicate?: boolean
59
60
  ): Observable<UploadEvent>
60
61
  abstract getFileContent(url: URL): Observable<any>
61
- abstract getFeedbacksAllowed(): Observable<boolean>
62
62
  }
@@ -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
  })
@@ -268,4 +268,14 @@ export const aSetOfLinksFixture = () => ({
268
268
  type: 'service',
269
269
  accessServiceProtocol: 'postgis',
270
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,
271
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)
@@ -0,0 +1,5 @@
1
+ <div class="w-full h-full flex flex-col">
2
+ <div
3
+ class="relative h-full mt-6 bg-white border border-gray-300 rounded-lg overflow-hidden"
4
+ ></div>
5
+ </div>
@@ -0,0 +1,27 @@
1
+ import { CommonModule } from '@angular/common'
2
+ import {
3
+ ChangeDetectionStrategy,
4
+ Component,
5
+ Input,
6
+ OnDestroy,
7
+ } from '@angular/core'
8
+ import { DatasetServiceDistribution } from '../../../../../../libs/common/domain/src/lib/model/record'
9
+ import { TranslatePipe } from '@ngx-translate/core'
10
+ import { Subscription } from 'rxjs'
11
+
12
+ @Component({
13
+ selector: 'gn-ui-stac-view',
14
+ templateUrl: './stac-view.component.html',
15
+ styleUrls: ['./stac-view.component.css'],
16
+ changeDetection: ChangeDetectionStrategy.OnPush,
17
+ standalone: true,
18
+ imports: [CommonModule, TranslatePipe],
19
+ })
20
+ export class StacViewComponent implements OnDestroy {
21
+ @Input() link: DatasetServiceDistribution
22
+ private subscription = new Subscription()
23
+
24
+ ngOnDestroy() {
25
+ this.subscription.unsubscribe()
26
+ }
27
+ }
@@ -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()
@@ -105,6 +105,16 @@ export class MdViewFacade {
105
105
  shareReplay(1)
106
106
  )
107
107
 
108
+ stacLinks$ = this.allLinks$.pipe(
109
+ map((links) =>
110
+ links.filter(
111
+ (link) =>
112
+ link.type === 'service' && link.accessServiceProtocol === 'stac'
113
+ )
114
+ ),
115
+ shareReplay(1)
116
+ )
117
+
108
118
  downloadLinks$ = this.allLinks$.pipe(
109
119
  map((links) =>
110
120
  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
  }
@@ -3,7 +3,11 @@
3
3
  ghostClass="h-[178px]"
4
4
  [showContent]="fieldReady('abstract')"
5
5
  >
6
- <gn-ui-max-lines [maxLines]="6" *ngIf="metadata.abstract">
6
+ <gn-ui-max-lines
7
+ [maxLines]="6"
8
+ *ngIf="metadata.abstract"
9
+ data-test="metadata-info-abstract"
10
+ >
7
11
  <div class="mb-6">
8
12
  <gn-ui-markdown-parser
9
13
  [textContent]="metadata.abstract"
@@ -101,19 +105,31 @@
101
105
  <gn-ui-expandable-panel
102
106
  *ngIf="
103
107
  (metadata.kind === 'dataset' && metadata.lineage) ||
108
+ resourceContact ||
109
+ metadata.resourceCreated ||
110
+ metadata.resourcePublished ||
104
111
  metadata.resourceUpdated ||
105
- metadata.updateFrequency ||
106
- (metadata.kind === 'dataset' && metadata.status)
112
+ (metadata.kind === 'dataset' && metadata.updateFrequency) ||
113
+ metadata.otherLanguages?.length ||
114
+ (metadata.kind === 'dataset' && temporalExtent)
107
115
  "
108
116
  [title]="'record.metadata.details' | translate"
109
117
  data-test="details-panel"
110
118
  >
111
- <div *ngIf="metadata.lineage" class="text-gray-900 flex flex-col mt-4 gap-2">
119
+ <div
120
+ *ngIf="metadata.kind === 'dataset' && metadata.lineage"
121
+ class="text-gray-900 flex flex-col mt-4 gap-2"
122
+ data-test="details-panel-lineage"
123
+ >
112
124
  <p class="whitespace-pre-line break-words text-gray-900" gnUiLinkify>
113
125
  {{ metadata.lineage }}
114
126
  </p>
115
127
  </div>
116
- <div class="flex flex-row gap-6 mt-5 mb-8" *ngIf="resourceContact">
128
+ <div
129
+ class="flex flex-row gap-6 mt-5 mb-8 resource-contact"
130
+ *ngIf="resourceContact"
131
+ data-test="details-panel-resource-contact"
132
+ >
117
133
  <div
118
134
  *ngIf="resourceContact.organization?.logoUrl?.href"
119
135
  class="flex items-center justify-center border-solid border border-gray-300 rounded-md bg-white h-32 overflow-hidden"
@@ -165,19 +181,37 @@
165
181
  <div
166
182
  class="py-6 px-6 rounded bg-gray-100 grid grid-cols-2 gap-y-6 gap-x-[20px] text-gray-700"
167
183
  >
168
- <div *ngIf="metadata.resourceCreated">
184
+ <div
185
+ *ngIf="metadata.resourceCreated"
186
+ data-test="details-panel-resource-created"
187
+ >
169
188
  <p class="text-sm" translate>record.metadata.creation</p>
170
- <p class="text-primary font-medium mt-1">
189
+ <p class="text-primary font-medium mt-1 resource-created">
171
190
  {{ formatDate(metadata.resourceCreated) }}
172
191
  </p>
173
192
  </div>
174
- <div *ngIf="metadata.resourcePublished">
193
+ <div
194
+ *ngIf="metadata.resourcePublished"
195
+ data-test="details-panel-resource-published"
196
+ >
175
197
  <p class="text-sm" translate>record.metadata.publication</p>
176
- <p class="text-primary font-medium mt-1">
198
+ <p class="text-primary font-medium mt-1 resource-published">
177
199
  {{ formatDate(metadata.resourcePublished) }}
178
200
  </p>
179
201
  </div>
180
- <div *ngIf="updateFrequency">
202
+ <div
203
+ *ngIf="metadata.resourceUpdated"
204
+ data-test="details-panel-resource-updated"
205
+ >
206
+ <p class="text-sm" translate>record.metadata.update</p>
207
+ <p class="text-primary font-medium mt-1 resource-updated">
208
+ {{ formatDate(metadata.resourceUpdated) }}
209
+ </p>
210
+ </div>
211
+ <div
212
+ *ngIf="metadata.kind === 'dataset' && metadata.updateFrequency"
213
+ data-test="details-panel-update-frequency"
214
+ >
181
215
  <p class="text-sm" translate>record.metadata.updateFrequency</p>
182
216
  <p
183
217
  class="text-primary font-medium mt-1 updateFrequency"
@@ -187,11 +221,14 @@
187
221
  {{ updateFrequency }}
188
222
  </p>
189
223
  </div>
190
- <div *ngIf="metadata.otherLanguages?.length">
224
+ <div
225
+ *ngIf="metadata.otherLanguages?.length"
226
+ data-test="details-panel-other-languages"
227
+ >
191
228
  <p class="text-sm mb-1" translate>record.metadata.languages</p>
192
229
  <div class="flex flex-row gap-1 flex-wrap">
193
230
  <p
194
- class="text-primary font-medium"
231
+ class="text-primary font-medium other-languages"
195
232
  translate
196
233
  *ngFor="let language of metadata.otherLanguages"
197
234
  >
@@ -199,9 +236,14 @@
199
236
  </p>
200
237
  </div>
201
238
  </div>
202
- <div *ngIf="temporalExtent">
239
+ <div
240
+ *ngIf="metadata.kind === 'dataset' && temporalExtent"
241
+ data-test="details-panel-temporal-extent"
242
+ >
203
243
  <p class="text-sm" translate>record.metadata.temporalExtent</p>
204
- <div class="flex flex-row gap-1 mb-1 text-primary font-medium">
244
+ <div
245
+ class="flex flex-row gap-1 mb-1 text-primary font-medium temporal-extent"
246
+ >
205
247
  <p
206
248
  *ngIf="temporalExtent.start && temporalExtent.end"
207
249
  translate
@@ -90,8 +90,10 @@ export class DropdownSelectorComponent implements OnInit {
90
90
 
91
91
  get selectedChoice(): DropdownChoice {
92
92
  return (
93
- this.choices.find((choice) => choice.value === this.selected) ??
94
- this.choices[0]
93
+ this.choices.find(
94
+ (choice) =>
95
+ JSON.stringify(choice.value) === JSON.stringify(this.selected)
96
+ ) ?? this.choices[0]
95
97
  )
96
98
  }
97
99
 
@@ -41,6 +41,8 @@ export class LinkClassifierService {
41
41
  return [LinkUsage.API]
42
42
  case 'postgis':
43
43
  return [LinkUsage.UNKNOWN]
44
+ case 'stac':
45
+ return [LinkUsage.API]
44
46
  default:
45
47
  return [LinkUsage.UNKNOWN]
46
48
  }