geonetwork-ui 2.4.1-dev.e5315d8c8 → 2.4.2-dev.096cd6eb9

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 (123) hide show
  1. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/read-parts.mjs +2 -3
  2. package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +4 -1
  3. package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +1 -1
  4. package/esm2022/libs/feature/dataviz/src/lib/service/data.service.mjs +4 -14
  5. package/esm2022/libs/feature/editor/src/lib/components/contact-card/contact-card.component.mjs +3 -3
  6. package/esm2022/libs/feature/editor/src/lib/components/generic-keywords/generic-keywords.component.mjs +3 -3
  7. package/esm2022/libs/feature/editor/src/lib/components/import-record/import-record.component.mjs +3 -4
  8. package/esm2022/libs/feature/editor/src/lib/components/online-resource-card/online-resource-card.component.mjs +3 -3
  9. package/esm2022/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.mjs +64 -50
  10. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts/form-field-contacts.component.mjs +3 -3
  11. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.mjs +3 -3
  12. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.mjs +3 -3
  13. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.mjs +8 -9
  14. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.mjs +5 -25
  15. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.mjs +5 -4
  16. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.mjs +3 -3
  17. package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +10 -2
  18. package/esm2022/libs/feature/record/src/lib/data-view/data-view.component.mjs +6 -3
  19. package/esm2022/libs/feature/record/src/lib/data-view-share/data-view-share.component.mjs +4 -6
  20. package/esm2022/libs/feature/record/src/lib/map-view/map-view.component.mjs +6 -3
  21. package/esm2022/libs/feature/search/src/lib/results-table/results-table-container.component.mjs +5 -3
  22. package/esm2022/libs/ui/inputs/src/lib/url-input/url-input.component.mjs +7 -2
  23. package/esm2022/libs/ui/search/src/lib/record-preview-feed/record-preview-feed.component.mjs +3 -1
  24. package/esm2022/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.mjs +3 -3
  25. package/esm2022/libs/ui/search/src/lib/results-table/results-table.component.mjs +6 -3
  26. package/esm2022/libs/util/data-fetcher/src/lib/data-fetcher.mjs +5 -1
  27. package/esm2022/libs/util/data-fetcher/src/lib/headers.mjs +3 -2
  28. package/esm2022/libs/util/data-fetcher/src/lib/model.mjs +2 -1
  29. package/esm2022/libs/util/data-fetcher/src/lib/readers/wfs.mjs +79 -0
  30. package/esm2022/libs/util/shared/src/lib/links/link-utils.mjs +4 -7
  31. package/esm2022/translations/de.json +14 -5
  32. package/esm2022/translations/en.json +23 -14
  33. package/esm2022/translations/es.json +14 -5
  34. package/esm2022/translations/fr.json +24 -15
  35. package/esm2022/translations/it.json +33 -26
  36. package/esm2022/translations/nl.json +14 -5
  37. package/esm2022/translations/pt.json +14 -5
  38. package/fesm2022/geonetwork-ui.mjs +350 -205
  39. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  40. package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts.map +1 -1
  41. package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
  42. package/libs/feature/dataviz/src/lib/service/data.service.d.ts.map +1 -1
  43. package/libs/feature/editor/src/lib/components/import-record/import-record.component.d.ts +0 -1
  44. package/libs/feature/editor/src/lib/components/import-record/import-record.component.d.ts.map +1 -1
  45. package/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.d.ts +38 -17
  46. package/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.d.ts.map +1 -1
  47. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.d.ts +2 -2
  48. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.d.ts.map +1 -1
  49. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.d.ts +1 -6
  50. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.d.ts.map +1 -1
  51. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.d.ts.map +1 -1
  52. package/libs/feature/editor/src/lib/fields.config.d.ts.map +1 -1
  53. package/libs/feature/record/src/lib/data-view/data-view.component.d.ts +2 -1
  54. package/libs/feature/record/src/lib/data-view/data-view.component.d.ts.map +1 -1
  55. package/libs/feature/record/src/lib/data-view-share/data-view-share.component.d.ts +1 -2
  56. package/libs/feature/record/src/lib/data-view-share/data-view-share.component.d.ts.map +1 -1
  57. package/libs/feature/record/src/lib/map-view/map-view.component.d.ts +2 -1
  58. package/libs/feature/record/src/lib/map-view/map-view.component.d.ts.map +1 -1
  59. package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts +2 -1
  60. package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts.map +1 -1
  61. package/libs/ui/inputs/src/lib/url-input/url-input.component.d.ts +3 -2
  62. package/libs/ui/inputs/src/lib/url-input/url-input.component.d.ts.map +1 -1
  63. package/libs/ui/search/src/lib/record-preview-feed/record-preview-feed.component.d.ts.map +1 -1
  64. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts +2 -1
  65. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts.map +1 -1
  66. package/libs/util/data-fetcher/src/lib/data-fetcher.d.ts +3 -2
  67. package/libs/util/data-fetcher/src/lib/data-fetcher.d.ts.map +1 -1
  68. package/libs/util/data-fetcher/src/lib/headers.d.ts.map +1 -1
  69. package/libs/util/data-fetcher/src/lib/model.d.ts +1 -1
  70. package/libs/util/data-fetcher/src/lib/model.d.ts.map +1 -1
  71. package/libs/util/data-fetcher/src/lib/readers/wfs.d.ts +21 -0
  72. package/libs/util/data-fetcher/src/lib/readers/wfs.d.ts.map +1 -0
  73. package/libs/util/shared/src/lib/links/link-utils.d.ts.map +1 -1
  74. package/package.json +1 -1
  75. package/src/libs/api/metadata-converter/src/lib/fixtures/geocat-ch.records.ts +1 -0
  76. package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +1 -2
  77. package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +3 -0
  78. package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +1 -1
  79. package/src/libs/feature/dataviz/src/lib/service/data.service.ts +4 -14
  80. package/src/libs/feature/editor/src/lib/components/contact-card/contact-card.component.html +1 -1
  81. package/src/libs/feature/editor/src/lib/components/generic-keywords/generic-keywords.component.html +1 -1
  82. package/src/libs/feature/editor/src/lib/components/import-record/import-record.component.html +4 -1
  83. package/src/libs/feature/editor/src/lib/components/import-record/import-record.component.ts +0 -4
  84. package/src/libs/feature/editor/src/lib/components/online-resource-card/online-resource-card.component.ts +2 -2
  85. package/src/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.html +20 -19
  86. package/src/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.ts +81 -57
  87. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts/form-field-contacts.component.html +1 -1
  88. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.html +3 -1
  89. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.html +1 -1
  90. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.html +0 -1
  91. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.ts +6 -6
  92. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.html +24 -17
  93. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.ts +2 -27
  94. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.html +1 -1
  95. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.ts +2 -1
  96. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.html +1 -1
  97. package/src/libs/feature/editor/src/lib/fields.config.ts +9 -1
  98. package/src/libs/feature/record/src/lib/data-view/data-view.component.html +1 -0
  99. package/src/libs/feature/record/src/lib/data-view/data-view.component.ts +1 -0
  100. package/src/libs/feature/record/src/lib/data-view-share/data-view-share.component.html +1 -1
  101. package/src/libs/feature/record/src/lib/data-view-share/data-view-share.component.ts +0 -1
  102. package/src/libs/feature/record/src/lib/map-view/map-view.component.html +1 -0
  103. package/src/libs/feature/record/src/lib/map-view/map-view.component.ts +1 -0
  104. package/src/libs/feature/search/src/lib/results-table/results-table-container.component.html +1 -0
  105. package/src/libs/feature/search/src/lib/results-table/results-table-container.component.ts +1 -0
  106. package/src/libs/ui/inputs/src/lib/url-input/url-input.component.ts +9 -1
  107. package/src/libs/ui/search/src/lib/record-preview-feed/record-preview-feed.component.ts +3 -0
  108. package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.html +5 -1
  109. package/src/libs/ui/search/src/lib/results-table/results-table.component.html +2 -2
  110. package/src/libs/ui/search/src/lib/results-table/results-table.component.ts +1 -0
  111. package/src/libs/util/data-fetcher/src/lib/data-fetcher.ts +9 -1
  112. package/src/libs/util/data-fetcher/src/lib/headers.ts +4 -3
  113. package/src/libs/util/data-fetcher/src/lib/model.ts +1 -0
  114. package/src/libs/util/data-fetcher/src/lib/readers/wfs.ts +112 -0
  115. package/src/libs/util/shared/src/lib/links/link-utils.ts +3 -6
  116. package/translations/de.json +14 -5
  117. package/translations/en.json +23 -14
  118. package/translations/es.json +14 -5
  119. package/translations/fr.json +24 -15
  120. package/translations/it.json +33 -26
  121. package/translations/nl.json +14 -5
  122. package/translations/pt.json +14 -5
  123. package/translations/sk.json +15 -6
@@ -4,7 +4,7 @@
4
4
  [thumbnailUrl]="contact.organization?.logoUrl?.href"
5
5
  [fit]="'contain'"
6
6
  ></gn-ui-thumbnail>
7
- <div class="flex flex-col w-full overflow-hidden leading-snug">
7
+ <div class="flex flex-col w-full overflow-hidden leading-snug justify-center">
8
8
  <div class="text-[16px] font-bold text-main" data-test="contactCardName">
9
9
  {{ contact.firstName }} {{ contact.lastName }}
10
10
  </div>
@@ -18,7 +18,7 @@
18
18
 
19
19
  <ng-icon
20
20
  *ngIf="isPlaceWithoutExtent(keyword)"
21
- [title]="'editor.form.placeKeywordWithoutExtent' | translate"
21
+ [title]="'editor.record.form.keywords.place.withoutExtent' | translate"
22
22
  class="badge-warning"
23
23
  name="matWarningAmberOutline"
24
24
  ></ng-icon>
@@ -35,7 +35,10 @@
35
35
  >
36
36
  <ng-icon name="iconoirArrowLeft"></ng-icon>
37
37
  </gn-ui-button>
38
- <span class="font-bold"> {{ externalImportBackLabel }}</span>
38
+ <span class="font-bold" translate
39
+ >dashboard.importRecord.importExternal.title</span
40
+ >
41
+ <span translate>dashboard.importRecord.importExternal.subtitle</span>
39
42
  </div>
40
43
  <gn-ui-url-input
41
44
  (uploadClick)="importRecord($event)"
@@ -84,10 +84,6 @@ export class ImportRecordComponent {
84
84
 
85
85
  sectionDisplayed: ImportMenuPage = 'mainMenu'
86
86
 
87
- externalImportBackLabel = this.translateService.instant(
88
- 'dashboard.importRecord.importExternalLabel'
89
- )
90
-
91
87
  constructor(
92
88
  private router: Router,
93
89
  private translateService: TranslateService,
@@ -54,8 +54,8 @@ export class OnlineResourceCardComponent {
54
54
  case 'service':
55
55
  case 'download':
56
56
  return (
57
- this.onlineResource.name ??
58
- this.onlineResource.description ??
57
+ this.onlineResource.description ||
58
+ this.onlineResource.name ||
59
59
  '(unknown)'
60
60
  )
61
61
  case 'endpoint':
@@ -15,9 +15,9 @@
15
15
  <mat-radio-group
16
16
  aria-labelledby="example-radio-group-label"
17
17
  class="flex flex-row gap-[8px]"
18
- [(ngModel)]="service.accessServiceProtocol"
18
+ [(ngModel)]="_service.accessServiceProtocol"
19
19
  [disabled]="disabled"
20
- (change)="resetLayersSuggestion()"
20
+ (change)="resetAllFormFields()"
21
21
  >
22
22
  <mat-radio-button
23
23
  *ngFor="let protocolOption of protocolOptions"
@@ -34,11 +34,11 @@
34
34
  (uploadClick)="handleUploadClick($event)"
35
35
  (valueChange)="handleUrlValueChange($event)"
36
36
  [disabled]="disabled"
37
- [value]="url"
37
+ [value]="_service.url?.toString()"
38
38
  [showValidateButton]="activeLayerSuggestion"
39
39
  >
40
40
  <ng-content *ngIf="activeLayerSuggestion">
41
- <ng-icon name="iconoirCloudUpload"></ng-icon>
41
+ <ng-icon name="iconoirRefresh"></ng-icon>
42
42
  </ng-content>
43
43
  </gn-ui-url-input>
44
44
 
@@ -48,38 +48,39 @@
48
48
 
49
49
  <gn-ui-text-input
50
50
  class="grow border-b border-gray-300 pb-4"
51
- [(value)]="service.identifierInService"
51
+ [(value)]="_service.identifierInService"
52
52
  [placeholder]="getIdentifierPlaceholder() | translate"
53
53
  data-cy="identifier-in-service"
54
54
  [disabled]="disabled"
55
55
  *ngIf="
56
56
  !activeLayerSuggestion ||
57
- (url && errorMessage) ||
58
- (modifyMode && layers === undefined)
57
+ (_service.url && errorMessage) ||
58
+ (modifyMode && (layers$ | async).length === 0)
59
59
  "
60
60
  ></gn-ui-text-input>
61
- <gn-ui-dropdown-selector
61
+ <gn-ui-autocomplete
62
62
  class="border-b border-gray-300 pb-4"
63
- [showTitle]="false"
64
- [title]="
63
+ [placeholder]="
65
64
  'editor.record.form.field.onlineResource.edit.identifier.select.label'
66
65
  | translate
67
66
  "
68
- [choices]="layers || []"
69
- *ngIf="activeLayerSuggestion && layers !== undefined"
70
- [selected]="service.identifierInService"
71
- (selectValue)="handleSelectValue($event)"
67
+ [action]="autoCompleteAction"
68
+ (itemSelected)="handleSelectValue($event)"
69
+ [displayWithFn]="displayWithFn"
70
+ [minCharacterCount]="0"
71
+ [clearOnSelection]="false"
72
+ *ngIf="activeLayerSuggestion && (layers$ | async)?.length > 0"
72
73
  >
73
- </gn-ui-dropdown-selector>
74
+ </gn-ui-autocomplete>
74
75
  <gn-ui-button
75
- (buttonClick)="submitIdentifier(service.identifierInService)"
76
- [disabled]="disabled || !service.identifierInService"
76
+ (buttonClick)="submit()"
77
+ [disabled]="disabled || !_service.identifierInService"
77
78
  type="primary"
78
79
  *ngIf="
79
80
  !modifyMode &&
80
- ((activeLayerSuggestion && layers) ||
81
+ ((activeLayerSuggestion && (layers$ | async)) ||
81
82
  !activeLayerSuggestion ||
82
- (url && errorMessage))
83
+ (_service.url && errorMessage))
83
84
  "
84
85
  >
85
86
  <span class="text-white font-bold" translate>
@@ -5,8 +5,6 @@ import {
5
5
  Component,
6
6
  EventEmitter,
7
7
  Input,
8
- OnChanges,
9
- OnInit,
10
8
  Output,
11
9
  } from '@angular/core'
12
10
  import { FormsModule } from '@angular/forms'
@@ -18,20 +16,31 @@ import {
18
16
  ServiceProtocol,
19
17
  } from '../../../../../../../libs/common/domain/src/lib/model/record'
20
18
  import {
19
+ AutocompleteComponent,
21
20
  ButtonComponent,
22
- DropdownChoice,
23
- DropdownSelectorComponent,
24
21
  TextInputComponent,
25
22
  UrlInputComponent,
26
23
  } from '../../../../../../../libs/ui/inputs/src'
27
- import { TranslateModule } from '@ngx-translate/core'
24
+ import { createFuzzyFilter, getLayers } from '../../../../../../../libs/util/shared/src'
28
25
  import {
29
26
  NgIconComponent,
30
27
  provideIcons,
31
28
  provideNgIconsConfig,
32
29
  } from '@ng-icons/core'
33
- import { iconoirCloudUpload } from '@ng-icons/iconoir'
34
- import { getLayers } from '../../../../../../../libs/util/shared/src'
30
+ import { iconoirRefresh } from '@ng-icons/iconoir'
31
+ import { TranslateModule } from '@ngx-translate/core'
32
+ import {
33
+ BehaviorSubject,
34
+ debounceTime,
35
+ distinctUntilChanged,
36
+ Observable,
37
+ switchMap,
38
+ } from 'rxjs'
39
+
40
+ marker('editor.record.form.field.onlineResource.edit.identifier.placeholder')
41
+ marker(
42
+ 'editor.record.form.field.onlineResource.edit.identifier.placeholder.wps'
43
+ )
35
44
 
36
45
  @Component({
37
46
  selector: 'gn-ui-online-service-resource-input',
@@ -40,7 +49,7 @@ import { getLayers } from '../../../../../../../libs/util/shared/src'
40
49
  changeDetection: ChangeDetectionStrategy.OnPush,
41
50
  standalone: true,
42
51
  imports: [
43
- DropdownSelectorComponent,
52
+ AutocompleteComponent,
44
53
  ButtonComponent,
45
54
  CommonModule,
46
55
  FormsModule,
@@ -52,27 +61,28 @@ import { getLayers } from '../../../../../../../libs/util/shared/src'
52
61
  UrlInputComponent,
53
62
  ],
54
63
  providers: [
55
- provideIcons({ iconoirCloudUpload }),
64
+ provideIcons({ iconoirRefresh }),
56
65
  provideNgIconsConfig({
57
66
  size: '1.5em',
58
67
  }),
59
68
  ],
60
69
  })
61
- export class OnlineServiceResourceInputComponent implements OnChanges, OnInit {
62
- @Input() service: DatasetServiceDistribution
70
+ export class OnlineServiceResourceInputComponent {
71
+ _service: DatasetServiceDistribution
72
+ @Input() set service(service: DatasetServiceDistribution) {
73
+ this._service = { ...service }
74
+ }
63
75
  @Input() protocolHint?: string
64
76
  @Input() disabled? = false
65
77
  @Input() modifyMode? = false
66
- @Output() urlChange: EventEmitter<string> = new EventEmitter()
67
- @Output() identifierSubmit: EventEmitter<{
68
- url: string
69
- identifier: string
70
- }> = new EventEmitter()
78
+ @Output() serviceChange: EventEmitter<DatasetServiceDistribution> =
79
+ new EventEmitter()
71
80
 
72
81
  errorMessage = false
73
- selectedProtocol: ServiceProtocol
74
- url: string
75
- layers: DropdownChoice[] | undefined = undefined
82
+
83
+ layersSubject = new BehaviorSubject<{ name: string; title: string }[]>([])
84
+ layers$: Observable<{ name: string; title: string }[]> =
85
+ this.layersSubject.asObservable()
76
86
 
77
87
  protocolOptions: {
78
88
  label: string
@@ -112,74 +122,88 @@ export class OnlineServiceResourceInputComponent implements OnChanges, OnInit {
112
122
 
113
123
  get activeLayerSuggestion() {
114
124
  return !['wps', 'GPFDL', 'esriRest', 'other'].includes(
115
- this.service.accessServiceProtocol
125
+ this._service.accessServiceProtocol
116
126
  )
117
127
  }
118
128
 
119
- ngOnChanges() {
120
- this.selectedProtocol =
121
- this.protocolOptions.find(
122
- (option) => option.value === this.service.accessServiceProtocol
123
- )?.value ?? 'other'
124
- }
125
-
126
- ngOnInit() {
127
- if (this.service.url) {
128
- this.url = this.service.url.toString()
129
- }
130
- }
131
-
132
129
  handleUrlValueChange(url: string) {
133
- this.url = url
134
- this.service.url = new URL(url)
130
+ this._service.url = url ? new URL(url) : undefined
135
131
  this.resetLayersSuggestion()
136
- this.urlChange.emit(this.url)
137
132
  }
138
133
 
139
134
  async handleUploadClick(url: string) {
140
- this.url = url
141
-
142
135
  try {
143
- const layers = await getLayers(url, this.service.accessServiceProtocol)
144
- this.layers = layers.map((l) => {
145
- return {
146
- label: l.title ? `${l.title} ${l.name ? `(${l.name})` : ''}` : l.name,
147
- value: l.name || l.title,
148
- }
149
- })
150
-
151
- if (this.layers.length === 0) {
136
+ const layers = await getLayers(url, this._service.accessServiceProtocol)
137
+
138
+ if (layers.length === 0) {
152
139
  throw new Error('No layers found')
153
140
  }
141
+
142
+ this.layersSubject.next([...layers])
154
143
  } catch (e) {
155
144
  this.errorMessage = true
156
- this.layers = undefined
145
+ this.layersSubject.next([])
157
146
  }
158
147
 
159
148
  this.cdr.detectChanges()
160
149
  }
161
150
 
162
- handleSelectValue(val: string) {
163
- this.service.identifierInService = val
151
+ resetAllFormFields() {
152
+ this._service.url = null
153
+ this.resetLayersSuggestion()
164
154
  }
165
155
 
166
156
  resetLayersSuggestion() {
167
157
  this.errorMessage = false
168
- this.layers = undefined
169
- this.service.identifierInService = null
158
+ this.layersSubject.next([])
159
+ this._service.identifierInService = null
170
160
  }
171
161
 
172
- submitIdentifier(identifier: string) {
173
- if (!identifier) return
174
- this.identifierSubmit.emit({ url: this.url, identifier })
175
- this.service.identifierInService = null
162
+ submit() {
163
+ this.serviceChange.emit({
164
+ ...this._service,
165
+ name: this._service.identifierInService, // should we keep the identifierInService? read-write duplicate with name
166
+ })
167
+ this._service.accessServiceProtocol = 'ogcFeatures'
168
+ this.resetAllFormFields()
176
169
  }
177
170
 
178
171
  getIdentifierPlaceholder(): string {
179
172
  const baseKey =
180
173
  'editor.record.form.field.onlineResource.edit.identifier.placeholder'
181
- return this.service.accessServiceProtocol === 'wps'
174
+ return this._service.accessServiceProtocol === 'wps'
182
175
  ? `${baseKey}.wps`
183
176
  : baseKey
184
177
  }
178
+
179
+ /**
180
+ * gn-ui-autocomplete
181
+ */
182
+ displayWithFn(item: { name: string; title: string }) {
183
+ return item.title
184
+ ? `${item.title} ${item.name ? `(${item.name})` : ''}`
185
+ : item.name
186
+ }
187
+
188
+ /**
189
+ * gn-ui-autocomplete
190
+ */
191
+ autoCompleteAction = (query: string) => {
192
+ const fuzzyFilter = createFuzzyFilter(query)
193
+ return this.layers$.pipe(
194
+ switchMap((layers) => [
195
+ layers.filter((layer) => fuzzyFilter(layer.name)),
196
+ ]),
197
+ debounceTime(100),
198
+ distinctUntilChanged()
199
+ )
200
+ }
201
+
202
+ /**
203
+ * gn-ui-autocomplete
204
+ */
205
+ handleSelectValue(val: { name: string; title: string }) {
206
+ this._service.identifierInService = val.name // should we keep the identifierInService? read-write duplicate with name
207
+ this._service.description = val.title
208
+ }
185
209
  }
@@ -1,6 +1,6 @@
1
1
  <div class="flex flex-col gap-3">
2
2
  <gn-ui-autocomplete
3
- [placeholder]="'Choose a contact'"
3
+ [placeholder]="'editor.record.form.field.contacts.placeholder' | translate"
4
4
  [action]="autoCompleteAction"
5
5
  (itemSelected)="addContact($event)"
6
6
  [displayWithFn]="displayWithFn"
@@ -31,7 +31,9 @@
31
31
  </div>
32
32
 
33
33
  <gn-ui-autocomplete
34
- [placeholder]="'Choose a contact'"
34
+ [placeholder]="
35
+ 'editor.record.form.field.contactsForResource.placeholder' | translate
36
+ "
35
37
  [action]="autoCompleteAction"
36
38
  (itemSelected)="addContact($event, role)"
37
39
  [displayWithFn]="displayWithFn"
@@ -2,7 +2,7 @@
2
2
  <gn-ui-generic-keywords
3
3
  [keywords]="filteredKeywords"
4
4
  [keywordTypes]="keywordTypes"
5
- [placeholder]="'editor.form.keywords.placeholder' | translate"
5
+ [placeholder]="'editor.record.form.keywords.placeholder' | translate"
6
6
  (changedKeywords)="handleKeywordsChange($event)"
7
7
  [allowSubmit]="false"
8
8
  >
@@ -41,7 +41,6 @@
41
41
  class="w-full"
42
42
  [disabled]="true"
43
43
  [value]="onlineResource.url"
44
- [disabled]="disabled$ | async"
45
44
  [showValidateButton]="false"
46
45
  ></gn-ui-url-input>
47
46
  </div>
@@ -1,3 +1,4 @@
1
+ import { CommonModule } from '@angular/common'
1
2
  import {
2
3
  ChangeDetectionStrategy,
3
4
  ChangeDetectorRef,
@@ -8,28 +9,27 @@ import {
8
9
  TemplateRef,
9
10
  ViewChild,
10
11
  } from '@angular/core'
12
+ import { MatDialog } from '@angular/material/dialog'
11
13
  import {
12
14
  OnlineLinkResource,
13
15
  OnlineResource,
14
16
  } from '../../../../../../../../../libs/common/domain/src/lib/model/record'
17
+ import { PlatformServiceInterface } from '../../../../../../../../../libs/common/domain/src/lib/platform.service.interface'
18
+ import { NotificationsService } from '../../../../../../../../../libs/feature/notifications/src'
15
19
  import {
16
20
  FileInputComponent,
17
21
  TextAreaComponent,
18
22
  TextInputComponent,
19
23
  UrlInputComponent,
20
24
  } from '../../../../../../../../../libs/ui/inputs/src'
21
- import { CommonModule } from '@angular/common'
22
- import { OnlineResourceCardComponent } from '../../../online-resource-card/online-resource-card.component'
23
25
  import {
24
26
  ModalDialogComponent,
25
27
  SortableListComponent,
26
28
  } from '../../../../../../../../../libs/ui/layout/src'
27
- import { NotificationsService } from '../../../../../../../../../libs/feature/notifications/src'
28
29
  import { TranslateModule, TranslateService } from '@ngx-translate/core'
29
- import { PlatformServiceInterface } from '../../../../../../../../../libs/common/domain/src/lib/platform.service.interface'
30
- import { map, Subscription } from 'rxjs'
31
- import { MatDialog } from '@angular/material/dialog'
30
+ import { Subscription } from 'rxjs'
32
31
  import { MAX_UPLOAD_SIZE_MB } from '../../../../fields.config'
32
+ import { OnlineResourceCardComponent } from '../../../online-resource-card/online-resource-card.component'
33
33
 
34
34
  @Component({
35
35
  selector: 'gn-ui-form-field-online-link-resources',
@@ -20,8 +20,7 @@
20
20
  >
21
21
  <gn-ui-online-service-resource-input
22
22
  [service]="newService"
23
- [disabled]="disabled$ | async"
24
- (identifierSubmit)="handleIdentifierSubmit($event)"
23
+ (serviceChange)="handleServiceChange($event)"
25
24
  ></gn-ui-online-service-resource-input>
26
25
  </div>
27
26
  <div class="h-[8px]"></div>
@@ -40,28 +39,36 @@
40
39
 
41
40
  <ng-template #dialogTemplate let-onlineResource>
42
41
  <div class="flex flex-col gap-[16px]">
43
- <div>
44
- <h3 class="text-[16px] font-bold text-main mb-[12px]" translate>
45
- editor.record.form.field.onlineResource.edit.title
46
- </h3>
47
- <gn-ui-text-input [(value)]="onlineResource.name"></gn-ui-text-input>
48
- </div>
49
- <div>
50
- <h3 class="text-[16px] font-bold text-main mb-[12px]" translate>
51
- editor.record.form.field.onlineResource.edit.description
52
- </h3>
53
- <gn-ui-text-area
54
- [(value)]="onlineResource.description"
55
- ></gn-ui-text-area>
56
- </div>
57
42
  <ng-container *ngIf="onlineResource.type === 'service'; else urlInput">
58
- <span class="w-full border-b border-gray-300"></span>
59
43
  <gn-ui-online-service-resource-input
60
44
  [service]="onlineResource"
61
45
  [modifyMode]="true"
46
+ [disabled]="true"
62
47
  ></gn-ui-online-service-resource-input>
48
+ <div>
49
+ <h3 class="text-[16px] font-bold text-main mb-[12px]" translate>
50
+ editor.record.form.field.onlineResource.edit.description
51
+ </h3>
52
+ <gn-ui-text-area
53
+ [(value)]="onlineResource.description"
54
+ ></gn-ui-text-area>
55
+ </div>
63
56
  </ng-container>
64
57
  <ng-template #urlInput>
58
+ <div>
59
+ <h3 class="text-[16px] font-bold text-main mb-[12px]" translate>
60
+ editor.record.form.field.onlineResource.edit.title
61
+ </h3>
62
+ <gn-ui-text-input [(value)]="onlineResource.name"></gn-ui-text-input>
63
+ </div>
64
+ <div>
65
+ <h3 class="text-[16px] font-bold text-main mb-[12px]" translate>
66
+ editor.record.form.field.onlineResource.edit.description
67
+ </h3>
68
+ <gn-ui-text-area
69
+ [(value)]="onlineResource.description"
70
+ ></gn-ui-text-area>
71
+ </div>
65
72
  <span class="w-full border-b border-gray-300"></span>
66
73
  <gn-ui-url-input
67
74
  class="w-full"
@@ -159,33 +159,8 @@ export class FormFieldOnlineResourcesComponent {
159
159
  }
160
160
  }
161
161
 
162
- handleServiceUrlChange(url: string) {
163
- this.valueChange.emit([
164
- ...this.allResources,
165
- {
166
- ...this.newService,
167
- url: new URL(url),
168
- },
169
- ])
170
- }
171
-
172
- handleIdentifierSubmit(payload: { url: string; identifier: string }) {
173
- this.valueChange.emit([
174
- ...this.allResources,
175
- {
176
- ...this.newService,
177
- url: new URL(payload.url),
178
- },
179
- ])
180
- }
181
-
182
- handleServiceModify(
183
- oldService: DatasetServiceDistribution,
184
- newService: DatasetServiceDistribution
185
- ) {
186
- oldService.accessServiceProtocol = newService.accessServiceProtocol
187
- oldService.identifierInService = newService.identifierInService
188
- oldService.url = newService.url
162
+ handleServiceChange(service: DatasetServiceDistribution) {
163
+ this.valueChange.emit([...this.allResources, service])
189
164
  }
190
165
 
191
166
  handleResourcesChange(items: unknown[]) {
@@ -1,6 +1,6 @@
1
1
  <div class="flex flex-col gap-3">
2
2
  <gn-ui-generic-keywords
3
- [placeholder]="'Search for place keywords'"
3
+ [placeholder]="'editor.record.form.keywords.place.placeholder' | translate"
4
4
  [keywords]="shownKeywords$ | async"
5
5
  [keywordTypes]="['place']"
6
6
  (deletedKeyword)="handleKeywordDelete($event)"
@@ -10,7 +10,7 @@ import { firstValueFrom, map, shareReplay } from 'rxjs'
10
10
  import { EditorFacade } from '../../../../+state/editor.facade'
11
11
  import { switchMap } from 'rxjs/operators'
12
12
  import { FormFieldMapContainerComponent } from '../form-field-map-container/form-field-map-container.component'
13
- import { TranslateService } from '@ngx-translate/core'
13
+ import { TranslateModule, TranslateService } from '@ngx-translate/core'
14
14
  import { SPATIAL_SCOPES } from '../../../../fields.config'
15
15
 
16
16
  // This intermediary type will let us keep track of which keyword is bound to
@@ -36,6 +36,7 @@ type KeywordWithExtent = Keyword & {
36
36
  CommonModule,
37
37
  GenericKeywordsComponent,
38
38
  FormFieldMapContainerComponent,
39
+ TranslateModule,
39
40
  ],
40
41
  })
41
42
  export class FormFieldSpatialExtentComponent {
@@ -5,7 +5,7 @@
5
5
  (toggled)="onPlannedToggled()"
6
6
  ></gn-ui-check-toggle>
7
7
  <gn-ui-dropdown-selector
8
- title="updateFrequency"
8
+ [title]="'editor.record.form.field.updateFrequency' | translate"
9
9
  [showTitle]="false"
10
10
  [choices]="choices"
11
11
  [selected]="selectedFrequency"
@@ -63,6 +63,8 @@ export const RECORD_KEYWORDS_FIELD: EditorField = {
63
63
  model: 'keywords',
64
64
  formFieldConfig: {},
65
65
  }
66
+ // keeping track of the label to not lose existing translation
67
+ marker('editor.record.form.field.keywords')
66
68
 
67
69
  export const RECORD_RESOURCE_CREATED_FIELD: EditorField = {
68
70
  model: 'resourceCreated',
@@ -156,18 +158,24 @@ export const RECORD_SPATIAL_EXTENTS_FIELD: EditorField = {
156
158
  model: 'spatialExtents',
157
159
  formFieldConfig: {},
158
160
  }
161
+ // keeping track of the label to not lose existing translation
162
+ marker('editor.record.form.field.spatialExtents')
159
163
 
160
164
  export const RECORD_ONLINE_RESOURCES: EditorField = {
161
165
  model: 'onlineResources',
162
166
  modelSpecifier: 'onlineResourceType:!link',
163
167
  formFieldConfig: {},
164
168
  }
169
+ // keeping track of the label to not lose existing translation
170
+ marker('editor.record.form.field.onlineResources')
165
171
 
166
172
  export const RECORD_ONLINE_LINK_RESOURCES: EditorField = {
167
173
  model: 'onlineResources',
168
174
  modelSpecifier: 'onlineResourceType:link',
169
175
  formFieldConfig: {},
170
176
  }
177
+ // keeping track of the label to not lose existing translation
178
+ marker('editor.record.form.field.onlineLinkResources')
171
179
 
172
180
  /************************************************************
173
181
  *************** SECTIONS *****************
@@ -273,7 +281,7 @@ export const DEFAULT_CONFIGURATION: EditorConfig = {
273
281
  ],
274
282
  },
275
283
  {
276
- labelKey: marker('editor.record.form.page.ressources'),
284
+ labelKey: marker('editor.record.form.page.resources'),
277
285
  sections: [ASSOCIATED_RESOURCES_SECTION, ANNEXES_SECTION],
278
286
  },
279
287
  {
@@ -1,6 +1,7 @@
1
1
  <div class="w-full h-full flex flex-col p-1">
2
2
  <gn-ui-dropdown-selector
3
3
  *ngIf="dropdownChoices$ | async as choices"
4
+ [ngClass]="{ hidden: !displaySource }"
4
5
  [title]="'table.select.data' | translate"
5
6
  class="truncate p-1 -mx-1 self-end mb-1"
6
7
  extraBtnClass="!text-primary font-sans font-medium"
@@ -34,6 +34,7 @@ import { TranslateModule } from '@ngx-translate/core'
34
34
  })
35
35
  export class DataViewComponent {
36
36
  @Input() mode: 'table' | 'chart'
37
+ @Input() displaySource = true
37
38
  @Output() chartConfig$ = new BehaviorSubject<DatavizConfigurationModel>(null)
38
39
  compatibleDataLinks$ = combineLatest([
39
40
  this.mdViewFacade.dataLinks$,
@@ -1,4 +1,4 @@
1
- <div class="px-5 my-1" [ngClass]="extraClass">
1
+ <div class="px-5 my-1">
2
2
  <mat-tab-group
3
3
  [selectedIndex]="0"
4
4
  animationDuration="0ms"
@@ -30,7 +30,6 @@ import { TranslateModule } from '@ngx-translate/core'
30
30
  })
31
31
  export class DataViewShareComponent {
32
32
  private _viewType: string
33
- @Input() extraClass: string
34
33
 
35
34
  @Input()
36
35
  set viewType(value: string) {
@@ -1,6 +1,7 @@
1
1
  <div class="w-full h-full flex flex-col p-1">
2
2
  <div class="w-full flex justify-end">
3
3
  <gn-ui-dropdown-selector
4
+ [ngClass]="{ hidden: !displaySource }"
4
5
  class="truncate p-1 -mx-1 mb-1"
5
6
  extraBtnClass="!text-primary font-sans font-medium"
6
7
  [title]="'map.select.layer' | translate"