geonetwork-ui 2.11.0-dev.bc1a6d4e2 → 2.11.0-dev.bd615f629

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.
@@ -128,7 +128,8 @@ export class ServiceCapabilitiesComponent implements OnInit {
128
128
  this.loading = true
129
129
  this.availableLayers = await getLayers(
130
130
  this.apiLinks[0].url.href,
131
- this.apiLinks[0].accessServiceProtocol
131
+ this.apiLinks[0].accessServiceProtocol,
132
+ true
132
133
  )
133
134
  this.loading = false
134
135
  this.cdr.detectChanges()
@@ -20,10 +20,13 @@
20
20
  </div>
21
21
  }
22
22
  </div>
23
- <button class="h-6 w-6" data-test="dropdown-clear">
23
+ <button
24
+ class="h-6 w-6 flex items-center justify-center"
25
+ data-test="dropdown-clear"
26
+ >
24
27
  @if (hasSelectedChoices && !overlayOpen) {
25
28
  <ng-icon
26
- class="shrink-0 opacity-40 mr-1.5 hover:opacity-80 transition-colors clear-btn"
29
+ class="shrink-0 opacity-40 hover:opacity-80 transition-colors clear-btn"
27
30
  (click)="clearSelection($event)"
28
31
  name="matClose"
29
32
  ></ng-icon>
@@ -61,13 +64,13 @@
61
64
  #overlayContainer
62
65
  >
63
66
  <div
64
- class="border border-gray-300 rounded mb-2 mx-2 min-h-[44px] flex flex-row gap-[2px] flex-wrap p-2 focus-within:rounded focus-within:border-2 focus-within:border-primary"
67
+ class="border border-gray-300 rounded mb-2 mx-2 min-h-[44px] flex flex-row gap-1 flex-wrap p-2 focus-within:rounded focus-within:border-2 focus-within:border-primary"
65
68
  >
66
69
  @for (selected of selectedChoices; track selected) {
67
70
  <button
68
71
  type="button"
69
72
  [title]="selected.label"
70
- class="max-w-full bg-main text-white rounded pr-[7px] flex gap-1 items-center opacity-70 hover:opacity-100 focus:opacity-100 transition-opacity mb-1"
73
+ class="max-w-full bg-main text-white rounded pr-[7px] flex gap-1 items-center opacity-70 hover:opacity-100 focus:opacity-100 transition-opacity"
71
74
  (click)="select(selected, false)"
72
75
  >
73
76
  <div class="text-sm truncate leading-[26px] px-2">
@@ -24,7 +24,7 @@ import {
24
24
  propagateToDocumentOnly,
25
25
  } from '../../../../../../libs/util/shared/src'
26
26
  import { ButtonComponent } from '../button/button.component'
27
- import { NgIcon, provideIcons } from '@ng-icons/core'
27
+ import { NgIcon, provideIcons, provideNgIconsConfig } from '@ng-icons/core'
28
28
  import { FormsModule } from '@angular/forms'
29
29
  import { TranslatePipe } from '@ngx-translate/core'
30
30
 
@@ -46,19 +46,22 @@ import {
46
46
  matExpandMore,
47
47
  matExpandLess,
48
48
  }),
49
+ provideNgIconsConfig({
50
+ size: '1.5rem',
51
+ }),
49
52
  ],
50
53
  standalone: true,
51
54
  })
52
- export class DropdownMultiselectComponent {
55
+ export class DropdownMultiselectComponent<T = unknown> {
53
56
  private scrollStrategies = inject(ScrollStrategyOptions)
54
57
 
55
58
  @Input() title: string
56
- @Input() choices: Choice[]
57
- @Input() selected: unknown[] = []
59
+ @Input() choices: Choice<T>[]
60
+ @Input() selected: T[] = []
58
61
  @Input() allowSearch = true
59
62
  @Input() maxRows: number
60
63
  @Input() searchInputValue = ''
61
- @Output() selectValues = new EventEmitter<unknown[]>()
64
+ @Output() selectValues = new EventEmitter<T[]>()
62
65
  @ViewChild('overlayOrigin') overlayOrigin: CdkOverlayOrigin
63
66
  @ViewChild(CdkConnectedOverlay) overlay: CdkConnectedOverlay
64
67
  @ViewChild('overlayContainer', { read: ElementRef })
@@ -115,7 +118,7 @@ export class DropdownMultiselectComponent {
115
118
 
116
119
  private setFocus() {
117
120
  setTimeout(() => {
118
- this.searchFieldInput.nativeElement.focus()
121
+ this.searchFieldInput?.nativeElement.focus()
119
122
  }, 0)
120
123
  }
121
124
 
@@ -194,18 +197,18 @@ export class DropdownMultiselectComponent {
194
197
  this.checkboxes.get(newIndex).nativeElement.focus()
195
198
  }
196
199
 
197
- isSelected(choice: Choice) {
200
+ isSelected(choice: Choice<T>) {
198
201
  return this.selected.indexOf(choice.value) > -1
199
202
  }
200
203
 
201
- select(choice: Choice, selected: boolean) {
204
+ select(choice: Choice<T>, selected: boolean) {
202
205
  this.selected = selected
203
206
  ? [...this.selected.filter((v) => v !== choice.value), choice.value]
204
207
  : this.selected.filter((v) => v !== choice.value)
205
208
  this.selectValues.emit(this.selected)
206
209
  }
207
210
 
208
- toggle(choice: Choice) {
211
+ toggle(choice: Choice<T>) {
209
212
  this.select(choice, !this.isSelected(choice))
210
213
  }
211
214
 
@@ -1,4 +1,4 @@
1
- export interface Choice {
2
- value: unknown
1
+ export interface Choice<T = unknown> {
2
+ value: T
3
3
  label: string
4
4
  }
@@ -344,7 +344,11 @@ export function getLinkLabel(
344
344
  return format ? `${label} (${format})` : label
345
345
  }
346
346
 
347
- export async function getLayers(url: string, serviceProtocol: ServiceProtocol) {
347
+ export async function getLayers(
348
+ url: string,
349
+ serviceProtocol: ServiceProtocol,
350
+ deep = false
351
+ ) {
348
352
  switch (serviceProtocol) {
349
353
  case 'ogcFeatures': {
350
354
  const layers = await new OgcApiEndpoint(url).allCollections
@@ -352,7 +356,10 @@ export async function getLayers(url: string, serviceProtocol: ServiceProtocol) {
352
356
  }
353
357
  case 'wfs': {
354
358
  const endpointWfs = await new WfsEndpoint(url).isReady()
355
- const featureTypes = await endpointWfs.getFeatureTypes()
359
+ const featureTypes = endpointWfs.getFeatureTypes()
360
+ if (!deep) {
361
+ return featureTypes
362
+ }
356
363
  const layers = (
357
364
  await Promise.allSettled(
358
365
  featureTypes.map((collection) => {
@@ -366,14 +373,16 @@ export async function getLayers(url: string, serviceProtocol: ServiceProtocol) {
366
373
  }
367
374
  case 'wms': {
368
375
  const endpointWms = await new WmsEndpoint(url).isReady()
369
- const layers = (
370
- await endpointWms
371
- .getLayers()
372
- .flatMap(wmsLayerFlatten)
373
- .filter((l) => l.name)
374
- ).map((collection) => {
375
- return endpointWms.getLayerByName(collection.name)
376
- })
376
+ const layersSummary = endpointWms
377
+ .getLayers()
378
+ .flatMap(wmsLayerFlatten)
379
+ .filter((l) => l.name)
380
+ if (!deep) {
381
+ return layersSummary
382
+ }
383
+ const layers = layersSummary.map((collection) =>
384
+ endpointWms.getLayerByName(collection.name)
385
+ )
377
386
  return layers
378
387
  }
379
388
  case 'wmts': {
@@ -690,6 +690,7 @@
690
690
  "search.filters.recordKind.reuse": "Wiederverwendungen",
691
691
  "search.filters.recordKind.service": "Dienste",
692
692
  "search.filters.representationType": "Repräsentationstyp",
693
+ "search.filters.resourceCreationRevisionDate": "Ressourcendatum",
693
694
  "search.filters.resourceType": "Ressourcentyp",
694
695
  "search.filters.spatialExtent": "",
695
696
  "search.filters.spatialExtent.bboxFromFile": "",
@@ -704,6 +705,7 @@
704
705
  "search.filters.spatialExtent.import": "",
705
706
  "search.filters.standard": "Standard",
706
707
  "search.filters.summaryLabel.changeDate": "Geändert am: ",
708
+ "search.filters.summaryLabel.resourceCreationRevisionDate": "Ressourcendatum: ",
707
709
  "search.filters.summaryLabel.user": "Geändert von: ",
708
710
  "search.filters.title": "Ergebnisse filtern",
709
711
  "search.filters.topic": "Themen",
@@ -690,6 +690,7 @@
690
690
  "search.filters.recordKind.reuse": "Reuses",
691
691
  "search.filters.recordKind.service": "Services",
692
692
  "search.filters.representationType": "Representation type",
693
+ "search.filters.resourceCreationRevisionDate": "Resource date",
693
694
  "search.filters.resourceType": "Resource type",
694
695
  "search.filters.spatialExtent": "Spatial extent",
695
696
  "search.filters.spatialExtent.bboxFromFile": "extent from {fileName}",
@@ -704,6 +705,7 @@
704
705
  "search.filters.spatialExtent.import": "Import a GeoJSON",
705
706
  "search.filters.standard": "Standard",
706
707
  "search.filters.summaryLabel.changeDate": "Updated: ",
708
+ "search.filters.summaryLabel.resourceCreationRevisionDate": "Resource date: ",
707
709
  "search.filters.summaryLabel.user": "Editor: ",
708
710
  "search.filters.title": "Filter your results",
709
711
  "search.filters.topic": "Topics",
@@ -690,6 +690,7 @@
690
690
  "search.filters.recordKind.reuse": "",
691
691
  "search.filters.recordKind.service": "",
692
692
  "search.filters.representationType": "",
693
+ "search.filters.resourceCreationRevisionDate": "",
693
694
  "search.filters.resourceType": "",
694
695
  "search.filters.spatialExtent": "",
695
696
  "search.filters.spatialExtent.bboxFromFile": "",
@@ -704,6 +705,7 @@
704
705
  "search.filters.spatialExtent.import": "",
705
706
  "search.filters.standard": "",
706
707
  "search.filters.summaryLabel.changeDate": "",
708
+ "search.filters.summaryLabel.resourceCreationRevisionDate": "",
707
709
  "search.filters.summaryLabel.user": "",
708
710
  "search.filters.title": "",
709
711
  "search.filters.topic": "",
@@ -690,6 +690,7 @@
690
690
  "search.filters.recordKind.reuse": "Réutilisations",
691
691
  "search.filters.recordKind.service": "Services",
692
692
  "search.filters.representationType": "Type de représentation",
693
+ "search.filters.resourceCreationRevisionDate": "Date de la ressource",
693
694
  "search.filters.resourceType": "Type de ressource",
694
695
  "search.filters.spatialExtent": "Étendue spatiale",
695
696
  "search.filters.spatialExtent.bboxFromFile": "étendue de {fileName}",
@@ -704,6 +705,7 @@
704
705
  "search.filters.spatialExtent.import": "Importer un GeoJSON",
705
706
  "search.filters.standard": "Standard",
706
707
  "search.filters.summaryLabel.changeDate": "Mise à jour : ",
708
+ "search.filters.summaryLabel.resourceCreationRevisionDate": "Date de la ressource : ",
707
709
  "search.filters.summaryLabel.user": "Éditeur : ",
708
710
  "search.filters.title": "Affiner votre recherche",
709
711
  "search.filters.topic": "Thèmes",
@@ -690,6 +690,7 @@
690
690
  "search.filters.recordKind.reuse": "Riutilizzi",
691
691
  "search.filters.recordKind.service": "Servizi",
692
692
  "search.filters.representationType": "Tipo di rappresentazione",
693
+ "search.filters.resourceCreationRevisionDate": "Data della risorsa",
693
694
  "search.filters.resourceType": "Tipo di risorsa",
694
695
  "search.filters.spatialExtent": "",
695
696
  "search.filters.spatialExtent.bboxFromFile": "",
@@ -704,6 +705,7 @@
704
705
  "search.filters.spatialExtent.import": "",
705
706
  "search.filters.standard": "Standard",
706
707
  "search.filters.summaryLabel.changeDate": "Aggiornato: ",
708
+ "search.filters.summaryLabel.resourceCreationRevisionDate": "Data della risorsa: ",
707
709
  "search.filters.summaryLabel.user": "Editor: ",
708
710
  "search.filters.title": "Affina la sua ricerca",
709
711
  "search.filters.topic": "Argomenti",
@@ -690,6 +690,7 @@
690
690
  "search.filters.recordKind.reuse": "",
691
691
  "search.filters.recordKind.service": "",
692
692
  "search.filters.representationType": "",
693
+ "search.filters.resourceCreationRevisionDate": "",
693
694
  "search.filters.resourceType": "",
694
695
  "search.filters.spatialExtent": "",
695
696
  "search.filters.spatialExtent.bboxFromFile": "",
@@ -704,6 +705,7 @@
704
705
  "search.filters.spatialExtent.import": "",
705
706
  "search.filters.standard": "",
706
707
  "search.filters.summaryLabel.changeDate": "",
708
+ "search.filters.summaryLabel.resourceCreationRevisionDate": "",
707
709
  "search.filters.summaryLabel.user": "",
708
710
  "search.filters.title": "",
709
711
  "search.filters.topic": "",
@@ -690,6 +690,7 @@
690
690
  "search.filters.recordKind.reuse": "",
691
691
  "search.filters.recordKind.service": "",
692
692
  "search.filters.representationType": "",
693
+ "search.filters.resourceCreationRevisionDate": "",
693
694
  "search.filters.resourceType": "",
694
695
  "search.filters.spatialExtent": "",
695
696
  "search.filters.spatialExtent.bboxFromFile": "",
@@ -704,6 +705,7 @@
704
705
  "search.filters.spatialExtent.import": "",
705
706
  "search.filters.standard": "",
706
707
  "search.filters.summaryLabel.changeDate": "",
708
+ "search.filters.summaryLabel.resourceCreationRevisionDate": "",
707
709
  "search.filters.summaryLabel.user": "",
708
710
  "search.filters.title": "",
709
711
  "search.filters.topic": "",
@@ -690,6 +690,7 @@
690
690
  "search.filters.recordKind.reuse": "",
691
691
  "search.filters.recordKind.service": "",
692
692
  "search.filters.representationType": "Typ reprezentácie",
693
+ "search.filters.resourceCreationRevisionDate": "",
693
694
  "search.filters.resourceType": "Typ zdroja",
694
695
  "search.filters.spatialExtent": "",
695
696
  "search.filters.spatialExtent.bboxFromFile": "",
@@ -704,6 +705,7 @@
704
705
  "search.filters.spatialExtent.import": "",
705
706
  "search.filters.standard": "Štandard",
706
707
  "search.filters.summaryLabel.changeDate": "",
708
+ "search.filters.summaryLabel.resourceCreationRevisionDate": "",
707
709
  "search.filters.summaryLabel.user": "",
708
710
  "search.filters.title": "Filtrovanie výsledkov",
709
711
  "search.filters.topic": "Témy",