geonetwork-ui 2.5.0-dev.4e621e7b5 → 2.5.0-dev.59720aa72

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 (137) hide show
  1. package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.mjs +2 -2
  2. package/esm2022/libs/api/repository/src/lib/gn4/gn4-repository.mjs +4 -8
  3. package/esm2022/libs/feature/editor/src/index.mjs +2 -1
  4. package/esm2022/libs/feature/editor/src/lib/components/generic-keywords/generic-keywords.component.mjs +2 -2
  5. package/esm2022/libs/feature/editor/src/lib/components/import-record/import-record.component.mjs +4 -4
  6. package/esm2022/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.mjs +2 -2
  7. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts/form-field-contacts.component.mjs +2 -2
  8. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.mjs +9 -12
  9. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/index.mjs +2 -1
  10. package/esm2022/libs/feature/editor/src/lib/components/wizard-field/wizard-field.component.mjs +7 -23
  11. package/esm2022/libs/feature/editor/src/lib/models/wizard-field.type.mjs +3 -4
  12. package/esm2022/libs/feature/map/src/lib/add-layer-from-catalog/add-layer-from-catalog.component.mjs +1 -1
  13. package/esm2022/libs/feature/record/src/lib/data-view/data-view.component.mjs +24 -5
  14. package/esm2022/libs/feature/record/src/lib/map-view/map-view.component.mjs +8 -6
  15. package/esm2022/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.mjs +6 -3
  16. package/esm2022/libs/ui/elements/src/lib/image-input/image-input.component.mjs +7 -8
  17. package/esm2022/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.mjs +3 -3
  18. package/esm2022/libs/ui/inputs/src/index.mjs +1 -2
  19. package/esm2022/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.mjs +37 -2
  20. package/esm2022/libs/ui/inputs/src/lib/ui-inputs.module.mjs +1 -6
  21. package/esm2022/libs/ui/inputs/src/lib/url-input/url-input.component.mjs +2 -7
  22. package/esm2022/libs/ui/widgets/src/index.mjs +1 -2
  23. package/esm2022/libs/ui/widgets/src/lib/ui-widgets.module.mjs +5 -6
  24. package/esm2022/libs/util/data-fetcher/src/lib/utils.mjs +5 -3
  25. package/esm2022/translations/de.json +1 -72
  26. package/esm2022/translations/en.json +1 -64
  27. package/esm2022/translations/es.json +0 -71
  28. package/esm2022/translations/fr.json +1 -72
  29. package/esm2022/translations/it.json +1 -72
  30. package/esm2022/translations/nl.json +0 -71
  31. package/esm2022/translations/pt.json +0 -71
  32. package/fesm2022/geonetwork-ui.mjs +113 -695
  33. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  34. package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts.map +1 -1
  35. package/libs/feature/editor/src/index.d.ts +1 -0
  36. package/libs/feature/editor/src/index.d.ts.map +1 -1
  37. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.d.ts +1 -0
  38. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.d.ts.map +1 -1
  39. package/libs/feature/editor/src/lib/components/record-form/form-field/index.d.ts +1 -0
  40. package/libs/feature/editor/src/lib/components/record-form/form-field/index.d.ts.map +1 -1
  41. package/libs/feature/editor/src/lib/components/wizard-field/wizard-field.component.d.ts +1 -3
  42. package/libs/feature/editor/src/lib/components/wizard-field/wizard-field.component.d.ts.map +1 -1
  43. package/libs/feature/editor/src/lib/models/wizard-field.type.d.ts +2 -3
  44. package/libs/feature/editor/src/lib/models/wizard-field.type.d.ts.map +1 -1
  45. package/libs/feature/record/src/lib/data-view/data-view.component.d.ts +4 -1
  46. package/libs/feature/record/src/lib/data-view/data-view.component.d.ts.map +1 -1
  47. package/libs/feature/record/src/lib/map-view/map-view.component.d.ts +3 -2
  48. package/libs/feature/record/src/lib/map-view/map-view.component.d.ts.map +1 -1
  49. package/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.d.ts +2 -1
  50. package/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.d.ts.map +1 -1
  51. package/libs/ui/elements/src/lib/image-input/image-input.component.d.ts.map +1 -1
  52. package/libs/ui/inputs/src/index.d.ts +0 -1
  53. package/libs/ui/inputs/src/index.d.ts.map +1 -1
  54. package/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.d.ts +16 -1
  55. package/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.d.ts.map +1 -1
  56. package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts +27 -28
  57. package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts.map +1 -1
  58. package/libs/ui/inputs/src/lib/url-input/url-input.component.d.ts +2 -3
  59. package/libs/ui/inputs/src/lib/url-input/url-input.component.d.ts.map +1 -1
  60. package/libs/ui/widgets/src/index.d.ts +0 -1
  61. package/libs/ui/widgets/src/index.d.ts.map +1 -1
  62. package/libs/ui/widgets/src/lib/ui-widgets.module.d.ts +8 -9
  63. package/libs/ui/widgets/src/lib/ui-widgets.module.d.ts.map +1 -1
  64. package/libs/util/data-fetcher/src/lib/utils.d.ts.map +1 -1
  65. package/package.json +1 -1
  66. package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +1 -1
  67. package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +3 -11
  68. package/src/libs/common/fixtures/src/lib/records.fixtures.ts +90 -0
  69. package/src/libs/feature/editor/src/index.ts +1 -0
  70. package/src/libs/feature/editor/src/lib/components/import-record/import-record.component.ts +3 -3
  71. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.html +1 -0
  72. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.ts +10 -11
  73. package/src/libs/feature/editor/src/lib/components/record-form/form-field/index.ts +1 -0
  74. package/src/libs/feature/editor/src/lib/components/wizard-field/wizard-field.component.html +0 -13
  75. package/src/libs/feature/editor/src/lib/components/wizard-field/wizard-field.component.ts +0 -20
  76. package/src/libs/feature/editor/src/lib/models/wizard-field.type.ts +0 -1
  77. package/src/libs/feature/record/src/lib/data-view/data-view.component.html +24 -13
  78. package/src/libs/feature/record/src/lib/data-view/data-view.component.ts +23 -4
  79. package/src/libs/feature/record/src/lib/map-view/map-view.component.html +71 -60
  80. package/src/libs/feature/record/src/lib/map-view/map-view.component.ts +4 -2
  81. package/src/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.html +1 -0
  82. package/src/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.ts +1 -0
  83. package/src/libs/ui/elements/src/lib/image-input/image-input.component.html +8 -8
  84. package/src/libs/ui/elements/src/lib/image-input/image-input.component.ts +4 -6
  85. package/src/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.ts +2 -2
  86. package/src/libs/ui/inputs/src/index.ts +0 -1
  87. package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts +42 -0
  88. package/src/libs/ui/inputs/src/lib/ui-inputs.module.ts +0 -3
  89. package/src/libs/ui/inputs/src/lib/url-input/url-input.component.ts +1 -7
  90. package/src/libs/ui/widgets/src/index.ts +0 -1
  91. package/src/libs/ui/widgets/src/lib/ui-widgets.module.ts +2 -3
  92. package/src/libs/util/data-fetcher/src/lib/utils.ts +4 -2
  93. package/translations/de.json +1 -72
  94. package/translations/en.json +1 -64
  95. package/translations/es.json +0 -71
  96. package/translations/fr.json +1 -72
  97. package/translations/it.json +1 -72
  98. package/translations/nl.json +0 -71
  99. package/translations/pt.json +0 -71
  100. package/translations/sk.json +0 -71
  101. package/esm2022/libs/ui/inputs/src/lib/chips-input/chips-input.component.mjs +0 -78
  102. package/esm2022/libs/ui/widgets/src/lib/step-bar/step-bar.component.mjs +0 -55
  103. package/libs/ui/inputs/src/lib/chips-input/chips-input.component.d.ts +0 -33
  104. package/libs/ui/inputs/src/lib/chips-input/chips-input.component.d.ts.map +0 -1
  105. package/libs/ui/widgets/src/lib/step-bar/step-bar.component.d.ts +0 -21
  106. package/libs/ui/widgets/src/lib/step-bar/step-bar.component.d.ts.map +0 -1
  107. package/src/libs/data-access/datafeeder/src/index.ts +0 -1
  108. package/src/libs/data-access/datafeeder/src/openapi/api/api.ts +0 -11
  109. package/src/libs/data-access/datafeeder/src/openapi/api/config.api.service.ts +0 -168
  110. package/src/libs/data-access/datafeeder/src/openapi/api/dataPublishing.api.service.ts +0 -270
  111. package/src/libs/data-access/datafeeder/src/openapi/api/fileUpload.api.service.ts +0 -734
  112. package/src/libs/data-access/datafeeder/src/openapi/api.module.ts +0 -46
  113. package/src/libs/data-access/datafeeder/src/openapi/configuration.ts +0 -125
  114. package/src/libs/data-access/datafeeder/src/openapi/encoder.ts +0 -20
  115. package/src/libs/data-access/datafeeder/src/openapi/index.ts +0 -5
  116. package/src/libs/data-access/datafeeder/src/openapi/model/analysisStatusEnum.api.model.ts +0 -24
  117. package/src/libs/data-access/datafeeder/src/openapi/model/boundingBox.api.model.ts +0 -20
  118. package/src/libs/data-access/datafeeder/src/openapi/model/cRS.api.model.ts +0 -25
  119. package/src/libs/data-access/datafeeder/src/openapi/model/datasetMetadata.api.model.ts +0 -45
  120. package/src/libs/data-access/datafeeder/src/openapi/model/datasetPublishRequest.api.model.ts +0 -39
  121. package/src/libs/data-access/datafeeder/src/openapi/model/datasetPublishingStatus.api.model.ts +0 -50
  122. package/src/libs/data-access/datafeeder/src/openapi/model/datasetUploadStatus.api.model.ts +0 -39
  123. package/src/libs/data-access/datafeeder/src/openapi/model/models.ts +0 -13
  124. package/src/libs/data-access/datafeeder/src/openapi/model/property.api.model.ts +0 -17
  125. package/src/libs/data-access/datafeeder/src/openapi/model/publishJobStatus.api.model.ts +0 -33
  126. package/src/libs/data-access/datafeeder/src/openapi/model/publishRequest.api.model.ts +0 -16
  127. package/src/libs/data-access/datafeeder/src/openapi/model/publishStatusEnum.api.model.ts +0 -20
  128. package/src/libs/data-access/datafeeder/src/openapi/model/publishStepEnum.api.model.ts +0 -42
  129. package/src/libs/data-access/datafeeder/src/openapi/model/uploadJobStatus.api.model.ts +0 -33
  130. package/src/libs/data-access/datafeeder/src/openapi/variables.ts +0 -9
  131. package/src/libs/data-access/datafeeder/src/spec.yaml +0 -537
  132. package/src/libs/ui/inputs/src/lib/chips-input/chips-input.component.css +0 -36
  133. package/src/libs/ui/inputs/src/lib/chips-input/chips-input.component.html +0 -23
  134. package/src/libs/ui/inputs/src/lib/chips-input/chips-input.component.ts +0 -81
  135. package/src/libs/ui/widgets/src/lib/step-bar/step-bar.component.css +0 -3
  136. package/src/libs/ui/widgets/src/lib/step-bar/step-bar.component.html +0 -13
  137. package/src/libs/ui/widgets/src/lib/step-bar/step-bar.component.ts +0 -55
@@ -106,8 +106,8 @@ export class ImportRecordComponent {
106
106
  this.isRecordImportInProgress = true
107
107
 
108
108
  this.recordsRepository.duplicateExternalRecord(url).subscribe({
109
- next: (recordTempId) => {
110
- if (recordTempId) {
109
+ next: (uuid) => {
110
+ if (uuid) {
111
111
  this.notificationsService.showNotification(
112
112
  {
113
113
  type: 'success',
@@ -122,7 +122,7 @@ export class ImportRecordComponent {
122
122
  )
123
123
 
124
124
  this.router
125
- .navigate(['/edit', recordTempId])
125
+ .navigate(['/edit', uuid])
126
126
  .catch((err) => console.error(err))
127
127
  }
128
128
  this.closeImportMenu.next()
@@ -31,6 +31,7 @@
31
31
  </div>
32
32
 
33
33
  <gn-ui-autocomplete
34
+ *ngIf="role !== 'unspecified' && role !== 'other'"
34
35
  [placeholder]="
35
36
  'editor.record.form.field.contactsForResource.placeholder' | translate
36
37
  "
@@ -40,6 +40,7 @@ import {
40
40
  provideNgIconsConfig,
41
41
  } from '@ng-icons/core'
42
42
  import { iconoirPlus } from '@ng-icons/iconoir'
43
+ import { RoleValues } from '../../../../../../../../../libs/common/domain/src/lib/model/record'
43
44
 
44
45
  @Component({
45
46
  selector: 'gn-ui-form-field-contacts-for-resource',
@@ -72,15 +73,11 @@ export class FormFieldContactsForResourceComponent
72
73
  @Output() valueChange: EventEmitter<Individual[]> = new EventEmitter()
73
74
 
74
75
  contactsForRessourceByRole: Map<Role, Individual[]> = new Map()
76
+ roleValues = RoleValues
75
77
 
76
- rolesToPick: Role[] = [
77
- 'resource_provider',
78
- 'custodian',
79
- 'owner',
80
- 'point_of_contact',
81
- 'author',
82
- 'publisher',
83
- ]
78
+ rolesToPick: Role[] = this.roleValues.filter(
79
+ (role) => role !== 'other' && role !== 'unspecified'
80
+ )
84
81
 
85
82
  roleSectionsToDisplay: Role[] = []
86
83
 
@@ -178,9 +175,11 @@ export class FormFieldContactsForResourceComponent
178
175
  * gn-ui-autocomplete
179
176
  */
180
177
  displayWithFn: (user: UserModel) => string = (user) =>
181
- `${user.name} ${user.surname} ${
182
- user.organisation ? `(${user.organisation})` : ''
183
- }`
178
+ user.name
179
+ ? `${user.name} ${user.surname} ${
180
+ user.organisation ? `(${user.organisation})` : ''
181
+ }`
182
+ : ``
184
183
 
185
184
  /**
186
185
  * gn-ui-autocomplete
@@ -9,3 +9,4 @@ export * from './form-field-object/form-field-object.component'
9
9
  export * from './form-field-array/form-field-array.component'
10
10
  export * from './form-field-spatial-extent/form-field-spatial-extent.component'
11
11
  export * from './form-field.component'
12
+ export * from './form-field-constraints-shortcuts/constraints.utils'
@@ -16,19 +16,6 @@
16
16
  placeholder=""
17
17
  ></gn-ui-text-input>
18
18
  </div>
19
- <div
20
- class="flex-1 w-11/12"
21
- *ngIf="wizardFieldType.CHIPS === wizardFieldConfig.type"
22
- >
23
- <gn-ui-chips-input
24
- #chips
25
- [selectedItems]="wizardFieldData"
26
- placeholder=""
27
- [id]="wizardFieldConfig.id"
28
- [url]="wizardFieldConfig.options.url"
29
- [loadOnce]="wizardFieldConfig.options.loadOnce"
30
- ></gn-ui-chips-input>
31
- </div>
32
19
  <div
33
20
  class="h-32 w-11/12"
34
21
  *ngIf="wizardFieldType.TEXT_AREA === wizardFieldConfig.type"
@@ -23,7 +23,6 @@ import { WizardFieldModel } from '../../models/wizard-field.model'
23
23
  import { WizardFieldType } from '../../models/wizard-field.type'
24
24
  import { WizardService } from '../../services/wizard.service'
25
25
  import {
26
- ChipsInputComponent,
27
26
  DropdownSelectorComponent,
28
27
  TextAreaComponent,
29
28
  TextInputComponent,
@@ -74,7 +73,6 @@ export class WizardFieldComponent implements AfterViewInit, OnDestroy {
74
73
  @Input() wizardFieldConfig: WizardFieldModel
75
74
 
76
75
  @ViewChild('searchText') searchText: TextInputComponent
77
- @ViewChild('chips') chips: ChipsInputComponent
78
76
  @ViewChild('textArea') textArea: TextAreaComponent
79
77
  @ViewChild('dropdown') dropdown: DropdownSelectorComponent
80
78
 
@@ -96,9 +94,6 @@ export class WizardFieldComponent implements AfterViewInit, OnDestroy {
96
94
  case WizardFieldType.TEXT: {
97
95
  return data || ''
98
96
  }
99
- case WizardFieldType.CHIPS: {
100
- return data ? JSON.parse(data) : []
101
- }
102
97
  case WizardFieldType.TEXT_AREA: {
103
98
  return data || ''
104
99
  }
@@ -131,10 +126,6 @@ export class WizardFieldComponent implements AfterViewInit, OnDestroy {
131
126
  this.initializeTextInputListener()
132
127
  break
133
128
  }
134
- case WizardFieldType.CHIPS: {
135
- this.initializeChipsListener()
136
- break
137
- }
138
129
  case WizardFieldType.TEXT_AREA: {
139
130
  this.initializeTextAreaListener()
140
131
  return
@@ -161,17 +152,6 @@ export class WizardFieldComponent implements AfterViewInit, OnDestroy {
161
152
  )
162
153
  }
163
154
 
164
- private initializeChipsListener() {
165
- this.subs.add(
166
- this.chips.itemsChange.subscribe((items) => {
167
- this.wizardService.onWizardWizardFieldDataChanged(
168
- this.wizardFieldConfig.id,
169
- JSON.stringify(items)
170
- )
171
- })
172
- )
173
- }
174
-
175
155
  private initializeTextAreaListener() {
176
156
  this.subs.add(
177
157
  this.textArea.valueChange.subscribe((value) => {
@@ -1,7 +1,6 @@
1
1
  export enum WizardFieldType {
2
2
  TEXT,
3
3
  TEXT_AREA,
4
- CHIPS,
5
4
  DATA_PICKER,
6
5
  DROPDOWN,
7
6
  }
@@ -8,17 +8,28 @@
8
8
  [choices]="choices"
9
9
  (selectValue)="selectLink($event)"
10
10
  ></gn-ui-dropdown-selector>
11
- <div class="relative h-[460px]">
12
- <gn-ui-table-view
13
- *ngIf="mode === 'table'"
14
- [cacheActive]="cacheActive$ | async"
15
- [link]="selectedLink$ | async"
16
- ></gn-ui-table-view>
17
- <gn-ui-chart-view
18
- *ngIf="mode === 'chart'"
19
- (chartConfig$)="setChartConfig($event)"
20
- [cacheActive]="cacheActive$ | async"
21
- [link]="selectedLink$ | async"
22
- ></gn-ui-chart-view>
23
- </div>
11
+ <ng-container *ngIf="hidePreview; else dataView">
12
+ <gn-ui-popup-alert
13
+ type="warning"
14
+ icon="matErrorOutlineOutline"
15
+ class="block h-12 p-1"
16
+ >
17
+ <span translate>record.feature.limit</span>
18
+ </gn-ui-popup-alert>
19
+ </ng-container>
20
+ <ng-template #dataView>
21
+ <div class="relative h-[460px]">
22
+ <gn-ui-table-view
23
+ *ngIf="mode === 'table'"
24
+ [cacheActive]="cacheActive$ | async"
25
+ [link]="selectedLink$ | async"
26
+ ></gn-ui-table-view>
27
+ <gn-ui-chart-view
28
+ *ngIf="mode === 'chart'"
29
+ (chartConfig$)="setChartConfig($event)"
30
+ [cacheActive]="cacheActive$ | async"
31
+ [link]="selectedLink$ | async"
32
+ ></gn-ui-chart-view>
33
+ </div>
34
+ </ng-template>
24
35
  </div>
@@ -5,8 +5,8 @@ import {
5
5
  Output,
6
6
  } from '@angular/core'
7
7
  import { getLinkLabel, getLinkPriority } from '../../../../../../libs/util/shared/src'
8
- import { BehaviorSubject, combineLatest } from 'rxjs'
9
- import { map, tap } from 'rxjs/operators'
8
+ import { BehaviorSubject, combineLatest, of } from 'rxjs'
9
+ import { catchError, finalize, map, switchMap, tap } from 'rxjs/operators'
10
10
  import { MdViewFacade } from '../state'
11
11
  import { DatavizConfigurationModel } from '../../../../../../libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model'
12
12
  import { DatasetOnlineResource } from '../../../../../../libs/common/domain/src/lib/model/record'
@@ -17,6 +17,7 @@ import {
17
17
  } from '../../../../../../libs/feature/dataviz/src'
18
18
  import { CommonModule } from '@angular/common'
19
19
  import { TranslateModule } from '@ngx-translate/core'
20
+ import { PopupAlertComponent } from '../../../../../../libs/ui/widgets/src'
20
21
 
21
22
  @Component({
22
23
  selector: 'gn-ui-data-view',
@@ -30,15 +31,21 @@ import { TranslateModule } from '@ngx-translate/core'
30
31
  TableViewComponent,
31
32
  TranslateModule,
32
33
  ChartViewComponent,
34
+ PopupAlertComponent,
33
35
  ],
34
36
  })
35
37
  export class DataViewComponent {
36
38
  @Input() mode: 'table' | 'chart'
37
39
  @Input() displaySource = true
40
+ @Input() set exceedsLimit(value: boolean) {
41
+ this.excludeWfs$.next(value)
42
+ }
38
43
  @Output() chartConfig$ = new BehaviorSubject<DatavizConfigurationModel>(null)
39
44
  cacheActive$ = this.mdViewFacade.isHighUpdateFrequency$.pipe(
40
45
  map((highF) => !highF)
41
46
  )
47
+ hidePreview = false
48
+ excludeWfs$ = new BehaviorSubject(false)
42
49
  compatibleDataLinks$ = combineLatest([
43
50
  this.mdViewFacade.dataLinks$,
44
51
  this.mdViewFacade.geoDataLinks$,
@@ -52,7 +59,7 @@ export class DataViewComponent {
52
59
  dropdownChoices$ = this.compatibleDataLinks$.pipe(
53
60
  tap((links) => {
54
61
  if (links.indexOf(this.selectedLink$.value) === -1) {
55
- this.selectedLink$.next(links[0])
62
+ this.selectLink(JSON.stringify(links[0]))
56
63
  }
57
64
  }),
58
65
  map((links) =>
@@ -73,6 +80,18 @@ export class DataViewComponent {
73
80
  selectLink(linkAsString: string) {
74
81
  const link: DatasetOnlineResource = JSON.parse(linkAsString)
75
82
  link.url = new URL(link.url)
76
- this.selectedLink$.next(link)
83
+ this.excludeWfs$
84
+ .pipe(
85
+ tap((excludeWfs) => {
86
+ this.hidePreview =
87
+ link['accessServiceProtocol'] === 'wfs' &&
88
+ excludeWfs &&
89
+ this.mode === 'chart'
90
+ ? true
91
+ : false
92
+ this.selectedLink$.next(link)
93
+ })
94
+ )
95
+ .subscribe()
77
96
  }
78
97
  }
@@ -14,80 +14,91 @@
14
14
  >
15
15
  </gn-ui-external-viewer-button>
16
16
  </div>
17
- <div
18
- class="relative w-full h-full bg-white border border-gray-300 rounded-lg overflow-hidden"
19
- >
20
- <gn-ui-map-container
21
- #mapContainer
22
- [context]="mapContext$ | async"
23
- (featuresClick)="onMapFeatureSelect($event)"
24
- ></gn-ui-map-container>
25
- <div
26
- class="top-[1em] right-[1em] p-3 bg-white absolute overflow-y-auto overflow-x-hidden max-h-72 w-56"
27
- [class.hidden]="!selection"
17
+ <ng-container *ngIf="hidePreview; else mapView">
18
+ <gn-ui-popup-alert
19
+ type="warning"
20
+ icon="matErrorOutlineOutline"
21
+ class="block h-12 p-1"
28
22
  >
29
- <gn-ui-button
30
- type="light"
31
- (buttonClick)="resetSelection()"
32
- style="
33
- --gn-ui-button-padding: 0px;
34
- --gn-ui-button-width: 24px;
35
- --gn-ui-button-height: 24px;
36
- "
37
- extraClass="absolute right-[0.5em] ml-[8px] mr-[10px]"
38
- >
39
- <ng-icon name="matClose" class="align-middle text-sm"></ng-icon>
40
- </gn-ui-button>
41
- <gn-ui-feature-detail [feature]="selection"></gn-ui-feature-detail>
42
- </div>
43
-
23
+ <span translate>record.feature.limit</span>
24
+ </gn-ui-popup-alert>
25
+ </ng-container>
26
+ <ng-template #mapView>
44
27
  <div
45
- class="top-[1em] p-3 bg-white absolute overflow-y-auto overflow-x-hidden max-h-72 w-56"
46
- [ngClass]="{ 'right-[1em]': !selection, 'right-[16em]': selection }"
47
- [hidden]="!showLegend || !legendExists"
28
+ class="relative w-full h-full bg-white border border-gray-300 rounded-lg overflow-hidden"
48
29
  >
49
- <div class="flex justify-between items-center mb-2">
50
- <div class="text-primary font-bold">Legend</div>
30
+ <gn-ui-map-container
31
+ #mapContainer
32
+ [context]="mapContext$ | async"
33
+ (featuresClick)="onMapFeatureSelect($event)"
34
+ ></gn-ui-map-container>
35
+ <div
36
+ class="top-[1em] right-[1em] p-3 bg-white absolute overflow-y-auto overflow-x-hidden max-h-72 w-56"
37
+ [class.hidden]="!selection"
38
+ >
51
39
  <gn-ui-button
52
40
  type="light"
53
- (buttonClick)="toggleLegend()"
41
+ (buttonClick)="resetSelection()"
54
42
  style="
55
43
  --gn-ui-button-padding: 0px;
56
44
  --gn-ui-button-width: 24px;
57
45
  --gn-ui-button-height: 24px;
58
46
  "
59
- extraClass="ml-[8px] mr-[10px]"
47
+ extraClass="absolute right-[0.5em] ml-[8px] mr-[10px]"
60
48
  >
61
49
  <ng-icon name="matClose" class="align-middle text-sm"></ng-icon>
62
50
  </gn-ui-button>
51
+ <gn-ui-feature-detail [feature]="selection"></gn-ui-feature-detail>
63
52
  </div>
64
- <gn-ui-map-legend
65
- [context]="mapContext$ | async"
66
- (legendStatusChange)="onLegendStatusChange($event)"
67
- ></gn-ui-map-legend>
68
- </div>
69
53
 
70
- <gn-ui-button
71
- *ngIf="!showLegend && legendExists && !selection"
72
- type="outline"
73
- (buttonClick)="toggleLegend()"
74
- extraClass="absolute top-[1em] right-[1em] rounded p-1 text-xs bg-white"
75
- >
76
- Legend
77
- </gn-ui-button>
54
+ <div
55
+ class="top-[1em] p-3 bg-white absolute overflow-y-auto overflow-x-hidden max-h-72 w-56"
56
+ [ngClass]="{ 'right-[1em]': !selection, 'right-[16em]': selection }"
57
+ [hidden]="!showLegend || !legendExists"
58
+ >
59
+ <div class="flex justify-between items-center mb-2">
60
+ <div class="text-primary font-bold">Legend</div>
61
+ <gn-ui-button
62
+ type="light"
63
+ (buttonClick)="toggleLegend()"
64
+ style="
65
+ --gn-ui-button-padding: 0px;
66
+ --gn-ui-button-width: 24px;
67
+ --gn-ui-button-height: 24px;
68
+ "
69
+ extraClass="ml-[8px] mr-[10px]"
70
+ >
71
+ <ng-icon name="matClose" class="align-middle text-sm"></ng-icon>
72
+ </gn-ui-button>
73
+ </div>
74
+ <gn-ui-map-legend
75
+ [context]="mapContext$ | async"
76
+ (legendStatusChange)="onLegendStatusChange($event)"
77
+ ></gn-ui-map-legend>
78
+ </div>
78
79
 
79
- <gn-ui-loading-mask
80
- *ngIf="loading"
81
- class="absolute inset-0"
82
- [message]="'map.loading.data' | translate"
83
- ></gn-ui-loading-mask>
84
- <gn-ui-popup-alert
85
- *ngIf="error"
86
- type="warning"
87
- icon="matErrorOutlineOutline"
88
- class="absolute m-2 inset-0"
89
- >
90
- <span translate>{{ error }}</span>
91
- </gn-ui-popup-alert>
92
- </div>
80
+ <gn-ui-button
81
+ *ngIf="!showLegend && legendExists && !selection"
82
+ type="outline"
83
+ (buttonClick)="toggleLegend()"
84
+ extraClass="absolute top-[1em] right-[1em] rounded p-1 text-xs bg-white"
85
+ >
86
+ Legend
87
+ </gn-ui-button>
88
+
89
+ <gn-ui-loading-mask
90
+ *ngIf="loading"
91
+ class="absolute inset-0"
92
+ [message]="'map.loading.data' | translate"
93
+ ></gn-ui-loading-mask>
94
+ <gn-ui-popup-alert
95
+ *ngIf="error"
96
+ type="warning"
97
+ icon="matErrorOutlineOutline"
98
+ class="absolute m-2 inset-0"
99
+ >
100
+ <span translate>{{ error }}</span>
101
+ </gn-ui-popup-alert>
102
+ </div>
103
+ </ng-template>
93
104
  </div>
@@ -82,13 +82,14 @@ marker('wfs.feature.limit')
82
82
  viewProviders: [provideIcons({ matClose })],
83
83
  })
84
84
  export class MapViewComponent implements AfterViewInit {
85
- @Input() set excludeWfs(value: boolean) {
85
+ @Input() set exceedsLimit(value: boolean) {
86
86
  this.excludeWfs$.next(value)
87
87
  }
88
88
  @Input() displaySource = true
89
89
  @ViewChild('mapContainer') mapContainer: MapContainerComponent
90
90
 
91
91
  excludeWfs$ = new BehaviorSubject(false)
92
+ hidePreview = false
92
93
  selection: Feature
93
94
  showLegend = true
94
95
  legendExists = false
@@ -139,9 +140,10 @@ export class MapViewComponent implements AfterViewInit {
139
140
  return of([])
140
141
  }
141
142
  if (excludeWfs && link.accessServiceProtocol === 'wfs') {
142
- this.error = 'wfs.feature.limit'
143
+ this.hidePreview = true
143
144
  return of([])
144
145
  }
146
+ this.hidePreview = false
145
147
  this.loading = true
146
148
  this.error = null
147
149
  return this.getLayerFromLink(link).pipe(
@@ -9,4 +9,5 @@
9
9
  [preventCompleteOnSelection]="true"
10
10
  [autoFocus]="autoFocus"
11
11
  [allowSubmit]="true"
12
+ [forceTrackPosition]="forceTrackPosition"
12
13
  ></gn-ui-autocomplete>
@@ -28,6 +28,7 @@ import { SearchFilters } from '../../../../../../libs/api/metadata-converter/src
28
28
  export class FuzzySearchComponent implements OnInit {
29
29
  @ViewChild(AutocompleteComponent) autocomplete: AutocompleteComponent
30
30
  @Input() autoFocus = false
31
+ @Input() forceTrackPosition = false
31
32
  @Output() itemSelected = new EventEmitter<CatalogRecord>()
32
33
  @Output() inputSubmitted = new EventEmitter<string>()
33
34
  searchInputValue$: Observable<{ title: string }>
@@ -14,7 +14,11 @@
14
14
  [disabled]="true"
15
15
  ></gn-ui-text-input>
16
16
  <div class="flex flex-row gap-2 mt-2">
17
- <gn-ui-button type="gray" (buttonClick)="handleDelete()">
17
+ <gn-ui-button
18
+ type="gray"
19
+ (buttonClick)="handleDelete()"
20
+ data-cy="delete-image"
21
+ >
18
22
  <ng-icon class="me-1 text-primary" name="iconoirBin"></ng-icon>
19
23
  {{ 'input.image.delete' | translate }}
20
24
  </gn-ui-button>
@@ -39,12 +43,10 @@
39
43
  'border-primary-lighter bg-primary-white': dragFilesOver,
40
44
  'border-gray-300': !dragFilesOver,
41
45
  'cursor-pointer hover:border-gray-500':
42
- !isUploadInProgress && !uploadError && !showUrlInput && !disabled,
46
+ !isUploadInProgress && !uploadError && !disabled,
43
47
  'cursor-not-allowed': disabled,
44
48
  }"
45
- [attr.tabindex]="
46
- isUploadInProgress || uploadError || showUrlInput || disabled ? null : 0
47
- "
49
+ [attr.tabindex]="isUploadInProgress || uploadError || disabled ? null : 0"
48
50
  (keydown.enter)="fileInput.click()"
49
51
  (dragFilesOver)="handleDragFilesOver($event)"
50
52
  (dropFiles)="handleDropFiles($event)"
@@ -114,9 +116,7 @@
114
116
  type="file"
115
117
  class="hidden"
116
118
  (change)="handleFileInput($event)"
117
- [disabled]="
118
- showUrlInput || isUploadInProgress || uploadError || disabled
119
- "
119
+ [disabled]="isUploadInProgress || uploadError || disabled"
120
120
  />
121
121
  </label>
122
122
 
@@ -123,11 +123,10 @@ export class ImageInputComponent {
123
123
  }
124
124
 
125
125
  handleDropFiles(files: File[]) {
126
- if (!this.showUrlInput) {
127
- const validFiles = this.filterTypeImage(files)
128
- if (validFiles.length > 0) {
129
- this.resizeAndEmit(validFiles[0])
130
- }
126
+ const validFiles = this.filterTypeImage(files)
127
+ if (validFiles.length > 0) {
128
+ this.showUrlInput = false
129
+ this.resizeAndEmit(validFiles[0])
131
130
  }
132
131
  }
133
132
 
@@ -147,7 +146,6 @@ export class ImageInputComponent {
147
146
  async downloadUrl(url: string) {
148
147
  this.downloadError = false
149
148
  const name = url.split('/').pop()
150
-
151
149
  try {
152
150
  const response = await firstValueFrom(
153
151
  this.http.head(url, { observe: 'response' })
@@ -1,4 +1,4 @@
1
- import { Component, Input, ChangeDetectionStrategy } from '@angular/core'
1
+ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
2
2
  import { marked } from 'marked'
3
3
 
4
4
  @Component({
@@ -13,6 +13,6 @@ export class MarkdownParserComponent {
13
13
  @Input() whitoutStyles?: boolean
14
14
 
15
15
  get parsedMarkdown() {
16
- return marked.parse(this.textContent)
16
+ return marked.parse(this.textContent ?? '')
17
17
  }
18
18
  }
@@ -3,7 +3,6 @@ export * from './lib/badge/badge.component'
3
3
  export * from './lib/button/button.component'
4
4
  export * from './lib/check-toggle/check-toggle.component'
5
5
  export * from './lib/checkbox/checkbox.component'
6
- export * from './lib/chips-input/chips-input.component'
7
6
  export * from './lib/copy-text-button/copy-text-button.component'
8
7
  export * from './lib/date-picker/date-picker.component'
9
8
  export * from './lib/date-range-dropdown/date-range-dropdown.component'
@@ -83,6 +83,7 @@ export class AutocompleteComponent
83
83
  @Input() minCharacterCount? = 3
84
84
  // this will show a submit button next to the input; if false, a search icon will appear on the left
85
85
  @Input() allowSubmit = false
86
+ @Input() forceTrackPosition = false
86
87
  @Output() itemSelected = new EventEmitter<AutocompleteItem>()
87
88
  @Output() inputSubmitted = new EventEmitter<string>()
88
89
  @Output() inputCleared = new EventEmitter<void>()
@@ -98,6 +99,8 @@ export class AutocompleteComponent
98
99
  error: string | null = null
99
100
  suggestions$: Observable<AutocompleteItem[]>
100
101
  subscription = new Subscription()
102
+ private lastPosition: DOMRect | null = null
103
+ private intervalIdPosition: number | undefined
101
104
 
102
105
  @Input() displayWithFn: (item: AutocompleteItem) => string = (item) =>
103
106
  item.toString()
@@ -197,10 +200,49 @@ export class AutocompleteComponent
197
200
  this.inputRef.nativeElement.focus()
198
201
  this.cdRef.detectChanges()
199
202
  }
203
+
204
+ this.startTrackingPosition()
205
+ }
206
+
207
+ /**
208
+ * !!! This function is used only for web component mode,
209
+ * the autocomplete dropdown may not update its position
210
+ * if the page or container is disabling wind scroll.
211
+ */
212
+ private trackPosition = () => {
213
+ const dropdownOpened = this.triggerRef && this.triggerRef.panelOpen
214
+ const rect = this.inputRef.nativeElement.getBoundingClientRect()
215
+
216
+ if (
217
+ dropdownOpened &&
218
+ (!this.lastPosition ||
219
+ rect.top !== this.lastPosition.top ||
220
+ rect.left !== this.lastPosition.left)
221
+ ) {
222
+ this.triggerRef.updatePosition()
223
+ }
224
+
225
+ this.lastPosition = rect
226
+ requestAnimationFrame(this.trackPosition)
227
+ }
228
+
229
+ /**
230
+ * !!! This function is used only for web component mode,
231
+ * the autocomplete dropdown may not update its position
232
+ * if the page or container is disabling wind scroll.
233
+ */
234
+ startTrackingPosition() {
235
+ if (this.forceTrackPosition) {
236
+ requestAnimationFrame(this.trackPosition)
237
+ }
200
238
  }
201
239
 
202
240
  ngOnDestroy(): void {
203
241
  this.subscription?.unsubscribe()
242
+
243
+ if (this.intervalIdPosition) {
244
+ clearInterval(this.intervalIdPosition)
245
+ }
204
246
  }
205
247
 
206
248
  updateInputValue(value: AutocompleteItem) {
@@ -28,7 +28,6 @@ import { BadgeComponent } from './badge/badge.component'
28
28
  import { ButtonComponent } from './button/button.component'
29
29
  import { CheckToggleComponent } from './check-toggle/check-toggle.component'
30
30
  import { CheckboxComponent } from './checkbox/checkbox.component'
31
- import { ChipsInputComponent } from './chips-input/chips-input.component'
32
31
  import { DateRangePickerComponent } from './date-range-picker/date-range-picker.component'
33
32
  import { DragAndDropFileInputComponent } from './drag-and-drop-file-input/drag-and-drop-file-input.component'
34
33
  import { DropdownMultiselectComponent } from './dropdown-multiselect/dropdown-multiselect.component'
@@ -40,7 +39,6 @@ import { ViewportIntersectorComponent } from './viewport-intersector/viewport-in
40
39
  @NgModule({
41
40
  declarations: [
42
41
  DragAndDropFileInputComponent,
43
- ChipsInputComponent,
44
42
  DropdownMultiselectComponent,
45
43
  ViewportIntersectorComponent,
46
44
  CheckboxComponent,
@@ -86,7 +84,6 @@ import { ViewportIntersectorComponent } from './viewport-intersector/viewport-in
86
84
  ButtonComponent,
87
85
  DragAndDropFileInputComponent,
88
86
  TextAreaComponent,
89
- ChipsInputComponent,
90
87
  DropdownMultiselectComponent,
91
88
  ViewportIntersectorComponent,
92
89
  CheckToggleComponent,