geonetwork-ui 2.11.0-dev.fb3fea50c → 2.11.0-dev.fb48cfeee
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.
- package/fesm2022/geonetwork-ui.mjs +1675 -1322
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/index.d.ts +205 -111
- package/index.d.ts.map +1 -1
- package/package.json +6 -5
- package/src/libs/api/metadata-converter/src/lib/dcat-ap/dcat-ap.converter.ts +2 -0
- package/src/libs/api/metadata-converter/src/lib/fixtures/mel.records.dataset+featurecatalog.ts +395 -0
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +35 -8
- package/src/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.ts +19 -0
- package/src/libs/api/metadata-converter/src/lib/iso19115-3/iso19115-3.converter.ts +17 -6
- package/src/libs/api/metadata-converter/src/lib/iso19115-3/read-parts.ts +110 -0
- package/src/libs/api/metadata-converter/src/lib/iso19115-3/write-parts.ts +131 -0
- package/src/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.ts +9 -0
- package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +2 -1
- package/src/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.ts +67 -10
- package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +83 -35
- package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.ts +11 -0
- package/src/libs/common/domain/src/lib/model/record/flags.model.ts +1 -0
- package/src/libs/common/domain/src/lib/model/record/index.ts +1 -0
- package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +14 -18
- package/src/libs/common/domain/src/lib/model/search/aggregation.model.ts +2 -0
- package/src/libs/common/domain/src/lib/model/search/filter.model.ts +12 -2
- package/src/libs/common/domain/src/lib/platform.service.interface.ts +1 -0
- package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +20 -1
- package/src/libs/common/fixtures/src/lib/records.fixtures.ts +42 -62
- package/src/libs/feature/dataviz/src/lib/service/data.service.ts +32 -19
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-constraints/form-field-constraints.component.ts +3 -5
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts/form-field-contacts.component.ts +2 -2
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-record-flags/form-field-record-flag-component.html +18 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-record-flags/form-field-record-flag-component.ts +86 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +100 -88
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +11 -4
- package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.ts +18 -4
- package/src/libs/feature/editor/src/lib/expressions.ts +67 -0
- package/src/libs/feature/editor/src/lib/fields.config.ts +13 -0
- package/src/libs/feature/editor/src/lib/models/editor-config.model.ts +10 -4
- package/src/libs/feature/map/src/index.ts +0 -2
- package/src/libs/feature/map/src/lib/feature-map.module.ts +1 -8
- package/src/libs/feature/notify-reuse/src/lib/notify-reuse-form/notify-reuse-form.component.ts +8 -3
- package/src/libs/feature/record/src/lib/state/mdview.effects.ts +3 -1
- package/src/libs/feature/record/src/lib/state/mdview.facade.ts +1 -1
- package/src/libs/feature/search/src/index.ts +2 -0
- package/src/libs/feature/search/src/lib/filter-dropdown/filter-dropdown.component.html +7 -1
- package/src/libs/feature/search/src/lib/filter-dropdown/filter-dropdown.component.ts +26 -4
- package/src/libs/feature/search/src/lib/geocoding/geocoding.service.ts +105 -0
- package/src/libs/feature/search/src/lib/location-search/location-search.component.html +18 -0
- package/src/libs/feature/search/src/lib/location-search/location-search.component.ts +114 -0
- package/src/libs/feature/search/src/lib/search-filters-summary-item/search-filters-summary-item.component.ts +1 -0
- package/src/libs/feature/search/src/lib/state/reducer.ts +1 -4
- package/src/libs/feature/search/src/lib/utils/service/fields.service.ts +56 -4
- package/src/libs/feature/search/src/lib/utils/service/fields.ts +58 -16
- package/src/libs/ui/elements/src/lib/record-feature-catalog/feature-catalog-list/feature-catalog-list.component.html +3 -3
- package/src/libs/ui/elements/src/lib/record-feature-catalog/feature-catalog-list/feature-catalog-list.component.ts +2 -2
- package/src/libs/ui/elements/src/lib/service-capabilities/service-capabilities.component.ts +2 -1
- package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.css +0 -4
- package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.html +12 -3
- package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts +11 -3
- package/src/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.html +7 -4
- package/src/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.component.ts +12 -9
- package/src/libs/ui/inputs/src/lib/dropdown-multiselect/dropdown-multiselect.model.ts +2 -2
- package/src/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.ts +2 -1
- package/src/libs/ui/inputs/src/lib/spatial-extent-dropdown/spatial-extent-dropdown.component.html +8 -2
- package/src/libs/ui/inputs/src/lib/spatial-extent-dropdown/spatial-extent-dropdown.component.ts +34 -5
- package/src/libs/ui/layout/src/lib/block-list/block-list.component.css +1 -0
- package/src/libs/util/app-config/src/lib/app-config.ts +34 -0
- package/src/libs/util/app-config/src/lib/fixtures.ts +37 -1
- package/src/libs/util/app-config/src/lib/model.ts +24 -1
- package/src/libs/util/shared/src/lib/links/link-utils.ts +19 -10
- package/src/libs/util/shared/src/lib/utils/geojson.ts +16 -0
- package/translations/de.json +12 -2
- package/translations/en.json +14 -4
- package/translations/es.json +12 -2
- package/translations/fr.json +19 -9
- package/translations/it.json +12 -2
- package/translations/nl.json +12 -2
- package/translations/pt.json +12 -2
- package/translations/sk.json +12 -2
- package/src/libs/feature/map/src/lib/geocoding/geocoding.component.html +0 -41
- package/src/libs/feature/map/src/lib/geocoding/geocoding.component.ts +0 -112
- package/src/libs/feature/map/src/lib/geocoding.service.ts +0 -57
- package/src/libs/feature/map/src/lib/style/index.ts +0 -2
- package/src/libs/feature/map/src/lib/style/map-style.fixtures.ts +0 -47
- package/src/libs/feature/map/src/lib/style/map-style.service.ts +0 -108
- /package/src/libs/feature/{map/src/lib/geocoding/geocoding.component.css → editor/src/lib/components/record-form/form-field/form-field-record-flags/form-field-record-flag-component.css} +0 -0
|
@@ -164,69 +164,49 @@ As such, **it is not very interesting at all.**`,
|
|
|
164
164
|
extras: {
|
|
165
165
|
isPublishedToAll: true,
|
|
166
166
|
edit: true,
|
|
167
|
-
featureTypes: [
|
|
168
|
-
{
|
|
169
|
-
attributeTable: [
|
|
170
|
-
{
|
|
171
|
-
code: 'OBJECTID',
|
|
172
|
-
name: 'OBJECTID',
|
|
173
|
-
link: '',
|
|
174
|
-
definition: 'Object identifier',
|
|
175
|
-
type: 'OID',
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
code: 'NOM',
|
|
179
|
-
name: 'Nom',
|
|
180
|
-
link: '',
|
|
181
|
-
definition: 'Nom de la rue',
|
|
182
|
-
type: 'String (48)',
|
|
183
|
-
values: [
|
|
184
|
-
{
|
|
185
|
-
code: 'Pomme',
|
|
186
|
-
label: 'Les Pommiers',
|
|
187
|
-
description: 'Sous les pommiers',
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
code: 'Cotton',
|
|
191
|
-
label: 'Rue Cotton',
|
|
192
|
-
description: 'Rue Cotton',
|
|
193
|
-
},
|
|
194
|
-
{ code: "Passage de l'échiquier" },
|
|
195
|
-
{ description: 'Rue du Charlieu' },
|
|
196
|
-
],
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
code: 'RUE',
|
|
200
|
-
name: 'Rue',
|
|
201
|
-
link: '',
|
|
202
|
-
definition: '',
|
|
203
|
-
type: 'String (50)',
|
|
204
|
-
},
|
|
205
|
-
],
|
|
206
|
-
code: '',
|
|
207
|
-
aliases: '',
|
|
208
|
-
typeName: "Catalogue d'attributs N°1",
|
|
209
|
-
definition: 'Définition du catalogue d attributs N°1',
|
|
210
|
-
isAbstract: 'false',
|
|
211
|
-
},
|
|
212
|
-
{
|
|
213
|
-
attributeTable: [
|
|
214
|
-
{
|
|
215
|
-
code: 'UniqueObject',
|
|
216
|
-
name: 'unique object ',
|
|
217
|
-
link: '',
|
|
218
|
-
definition: 'this is the only object of this catalog',
|
|
219
|
-
type: 'String (50)',
|
|
220
|
-
},
|
|
221
|
-
],
|
|
222
|
-
code: '',
|
|
223
|
-
aliases: '',
|
|
224
|
-
typeName: "Catalogue d'attributs N°2",
|
|
225
|
-
definition: 'Définition du catalogue d attributs N°2',
|
|
226
|
-
isAbstract: 'false',
|
|
227
|
-
},
|
|
228
|
-
],
|
|
229
167
|
},
|
|
168
|
+
featureTypeDescriptions: [
|
|
169
|
+
{
|
|
170
|
+
name: "Catalogue d'attributs N°1",
|
|
171
|
+
description: 'Définition du catalogue d attributs N°1',
|
|
172
|
+
attributes: [
|
|
173
|
+
{
|
|
174
|
+
name: 'OBJECTID',
|
|
175
|
+
description: 'Object identifier',
|
|
176
|
+
code: 'OBJECTID',
|
|
177
|
+
type: 'OID',
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: 'Nom',
|
|
181
|
+
description: 'Nom de la rue',
|
|
182
|
+
code: 'NOM',
|
|
183
|
+
type: 'String (48)',
|
|
184
|
+
values: [
|
|
185
|
+
{ value: 'Pomme', label: 'Les Pommiers' },
|
|
186
|
+
{ value: 'Cotton', label: 'Rue Cotton' },
|
|
187
|
+
{ value: "Passage de l'échiquier" },
|
|
188
|
+
],
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: 'Rue',
|
|
192
|
+
code: 'RUE',
|
|
193
|
+
type: 'String (50)',
|
|
194
|
+
},
|
|
195
|
+
],
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
name: "Catalogue d'attributs N°2",
|
|
199
|
+
description: 'Définition du catalogue d attributs N°2',
|
|
200
|
+
attributes: [
|
|
201
|
+
{
|
|
202
|
+
name: 'unique object ',
|
|
203
|
+
description: 'this is the only object of this catalog',
|
|
204
|
+
code: 'UniqueObject',
|
|
205
|
+
type: 'String (50)',
|
|
206
|
+
},
|
|
207
|
+
],
|
|
208
|
+
},
|
|
209
|
+
],
|
|
230
210
|
},
|
|
231
211
|
{
|
|
232
212
|
uniqueIdentifier: '7d002c4c-92ef-4b9f-a568-d732f740b99e',
|
|
@@ -209,7 +209,8 @@ export class DataService {
|
|
|
209
209
|
ogcApiLink: DatasetServiceDistribution
|
|
210
210
|
): Promise<DatasetOnlineResource[]> {
|
|
211
211
|
const collectionInfo = await this.getDownloadUrlsFromOgcApi(
|
|
212
|
-
ogcApiLink.url.href
|
|
212
|
+
ogcApiLink.url.href,
|
|
213
|
+
ogcApiLink.name
|
|
213
214
|
)
|
|
214
215
|
|
|
215
216
|
return Object.keys(collectionInfo.bulkDownloadLinks).map((mimeType) => {
|
|
@@ -229,31 +230,41 @@ export class DataService {
|
|
|
229
230
|
})
|
|
230
231
|
}
|
|
231
232
|
|
|
232
|
-
async
|
|
233
|
+
private async getTargetCollectionId(
|
|
234
|
+
endpoint: OgcApiEndpoint,
|
|
235
|
+
collectionId?: string
|
|
236
|
+
): Promise<string | undefined> {
|
|
237
|
+
const collections = await endpoint.featureCollections
|
|
238
|
+
return collections.length === 1 && !collectionId
|
|
239
|
+
? collections[0]
|
|
240
|
+
: collectionId
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
async getDownloadUrlsFromOgcApi(
|
|
244
|
+
url: string,
|
|
245
|
+
collectionId?: string
|
|
246
|
+
): Promise<OgcApiCollectionInfo> {
|
|
233
247
|
const endpoint = new OgcApiEndpoint(url)
|
|
234
|
-
|
|
235
|
-
.
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
.
|
|
239
|
-
|
|
240
|
-
})
|
|
248
|
+
try {
|
|
249
|
+
const id = await this.getTargetCollectionId(endpoint, collectionId)
|
|
250
|
+
return await endpoint.getCollectionInfo(id)
|
|
251
|
+
} catch {
|
|
252
|
+
throw new Error('ogc.unreachable.unknown')
|
|
253
|
+
}
|
|
241
254
|
}
|
|
242
255
|
|
|
243
256
|
async getItemsFromOgcApi(
|
|
244
257
|
url: string,
|
|
258
|
+
collectionId?: string,
|
|
245
259
|
limit?: number
|
|
246
260
|
): Promise<OgcApiRecord[]> {
|
|
247
261
|
const endpoint = new OgcApiEndpoint(url)
|
|
248
|
-
|
|
249
|
-
.
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
.catch(() => {
|
|
255
|
-
throw new Error(`ogc.unreachable.unknown`)
|
|
256
|
-
})
|
|
262
|
+
try {
|
|
263
|
+
const id = await this.getTargetCollectionId(endpoint, collectionId)
|
|
264
|
+
return await endpoint.getCollectionItems(id, limit)
|
|
265
|
+
} catch {
|
|
266
|
+
throw new Error('ogc.unreachable.unknown')
|
|
267
|
+
}
|
|
257
268
|
}
|
|
258
269
|
|
|
259
270
|
async getItemsFromStacApi(
|
|
@@ -381,7 +392,9 @@ export class DataService {
|
|
|
381
392
|
link.type === 'service' &&
|
|
382
393
|
link.accessServiceProtocol === 'ogcFeatures'
|
|
383
394
|
) {
|
|
384
|
-
return from(
|
|
395
|
+
return from(
|
|
396
|
+
this.getDownloadUrlsFromOgcApi(link.url.href, link.name)
|
|
397
|
+
).pipe(
|
|
385
398
|
switchMap((collectionInfo) => {
|
|
386
399
|
const isMimeTypeJson = (mimeType: string): boolean => {
|
|
387
400
|
return mimeType.toLowerCase().indexOf('json') > -1
|
|
@@ -9,10 +9,7 @@ import {
|
|
|
9
9
|
|
|
10
10
|
import { SortableListComponent } from '../../../../../../../../../libs/ui/layout/src'
|
|
11
11
|
import { ConstraintCardComponent } from '../../../constraint-card/constraint-card.component'
|
|
12
|
-
import {
|
|
13
|
-
CatalogRecordKeys,
|
|
14
|
-
Constraint,
|
|
15
|
-
} from '../../../../../../../../../libs/common/domain/src/lib/model/record'
|
|
12
|
+
import { Constraint } from '../../../../../../../../../libs/common/domain/src/lib/model/record'
|
|
16
13
|
import { ButtonComponent } from '../../../../../../../../../libs/ui/inputs/src'
|
|
17
14
|
import { marker } from '@biesbjerg/ngx-translate-extract-marker'
|
|
18
15
|
import { TranslatePipe } from '@ngx-translate/core'
|
|
@@ -22,6 +19,7 @@ import {
|
|
|
22
19
|
provideNgIconsConfig,
|
|
23
20
|
} from '@ng-icons/core'
|
|
24
21
|
import { iconoirPlus } from '@ng-icons/iconoir'
|
|
22
|
+
import { FormFieldModel } from '../../../../models'
|
|
25
23
|
|
|
26
24
|
marker('editor.record.form.constraint.add.legalConstraints')
|
|
27
25
|
marker('editor.record.form.constraint.add.securityConstraints')
|
|
@@ -53,7 +51,7 @@ marker('editor.record.form.constraint.header.otherConstraints')
|
|
|
53
51
|
export class FormFieldConstraintsComponent implements OnInit {
|
|
54
52
|
@Input() label: string
|
|
55
53
|
@Input() value: Constraint[]
|
|
56
|
-
@Input() constraintType:
|
|
54
|
+
@Input() constraintType: FormFieldModel
|
|
57
55
|
@Output() valueChange = new EventEmitter<Constraint[]>()
|
|
58
56
|
|
|
59
57
|
constraintsHeader = ''
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
} from '../../../../../../../../../libs/util/shared/src'
|
|
37
37
|
import { map } from 'rxjs/operators'
|
|
38
38
|
import { SortableListComponent } from '../../../../../../../../../libs/ui/layout/src'
|
|
39
|
-
import {
|
|
39
|
+
import { FormFieldModelSpecifier } from '../../../../models/editor-config.model'
|
|
40
40
|
|
|
41
41
|
@Component({
|
|
42
42
|
selector: 'gn-ui-form-field-contacts',
|
|
@@ -59,7 +59,7 @@ export class FormFieldContactsComponent implements OnDestroy, OnChanges {
|
|
|
59
59
|
private changeDetectorRef = inject(ChangeDetectorRef)
|
|
60
60
|
|
|
61
61
|
@Input() value: Individual[]
|
|
62
|
-
@Input() modelSpecifier:
|
|
62
|
+
@Input() modelSpecifier: FormFieldModelSpecifier
|
|
63
63
|
@Output() valueChange: EventEmitter<Individual[]> = new EventEmitter()
|
|
64
64
|
|
|
65
65
|
contacts: Individual[] = []
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<div class="flex-1 flex justify-between items-center">
|
|
2
|
+
<gn-ui-check-toggle
|
|
3
|
+
[label]="labelKey() | translate"
|
|
4
|
+
[value]="initialValue$ | async"
|
|
5
|
+
(toggled)="onToggle($event)"
|
|
6
|
+
[attr.data-cy]="'record-flag-toggle-' + flagName()"
|
|
7
|
+
></gn-ui-check-toggle>
|
|
8
|
+
|
|
9
|
+
@if (hintKey()) {
|
|
10
|
+
<ng-icon
|
|
11
|
+
name="matHelpOutline"
|
|
12
|
+
size="16"
|
|
13
|
+
class="m-2"
|
|
14
|
+
[matTooltip]="hintKey() | translate"
|
|
15
|
+
matTooltipPosition="above"
|
|
16
|
+
></ng-icon>
|
|
17
|
+
}
|
|
18
|
+
</div>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
inject,
|
|
5
|
+
input,
|
|
6
|
+
} from '@angular/core'
|
|
7
|
+
import { AsyncPipe } from '@angular/common'
|
|
8
|
+
import { CheckToggleComponent } from '../../../../../../../../../libs/ui/inputs/src'
|
|
9
|
+
import { EditorFacade } from '../../../../+state/editor.facade'
|
|
10
|
+
import { TranslatePipe, TranslateService } from '@ngx-translate/core'
|
|
11
|
+
import { RecordFlag } from '../../../../../../../../../libs/common/domain/src/lib/model'
|
|
12
|
+
import { RecordsRepositoryInterface } from '../../../../../../../../../libs/common/domain/src/lib/repository/records-repository.interface'
|
|
13
|
+
import { toSignal } from '@angular/core/rxjs-interop'
|
|
14
|
+
import { filter } from 'rxjs'
|
|
15
|
+
import { NgIcon, provideIcons } from '@ng-icons/core'
|
|
16
|
+
import { MatTooltip } from '@angular/material/tooltip'
|
|
17
|
+
import { map, switchMap } from 'rxjs/operators'
|
|
18
|
+
import { matHelpOutline } from '@ng-icons/material-icons/outline'
|
|
19
|
+
import { NotificationsService } from '../../../../../../../../../libs/feature/notifications/src'
|
|
20
|
+
|
|
21
|
+
@Component({
|
|
22
|
+
selector: 'gn-ui-form-field-record-flag',
|
|
23
|
+
standalone: true,
|
|
24
|
+
imports: [AsyncPipe, CheckToggleComponent, TranslatePipe, NgIcon, MatTooltip],
|
|
25
|
+
viewProviders: [
|
|
26
|
+
provideIcons({
|
|
27
|
+
matHelpOutline,
|
|
28
|
+
}),
|
|
29
|
+
],
|
|
30
|
+
templateUrl: './form-field-record-flag-component.html',
|
|
31
|
+
styleUrls: ['./form-field-record-flag-component.css'],
|
|
32
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
33
|
+
})
|
|
34
|
+
export class FormFieldRecordFlagComponent {
|
|
35
|
+
flagName = input<RecordFlag>()
|
|
36
|
+
labelKey = input<string>()
|
|
37
|
+
hintKey = input<string>()
|
|
38
|
+
|
|
39
|
+
private editorFacade = inject(EditorFacade)
|
|
40
|
+
private repository = inject(RecordsRepositoryInterface)
|
|
41
|
+
private notificationsService = inject(NotificationsService)
|
|
42
|
+
private translateService = inject(TranslateService)
|
|
43
|
+
|
|
44
|
+
private record = toSignal(this.editorFacade.record$)
|
|
45
|
+
|
|
46
|
+
recordKind = toSignal(
|
|
47
|
+
this.editorFacade.record$.pipe(map((record) => record.kind))
|
|
48
|
+
)
|
|
49
|
+
initialValue$ = this.editorFacade.record$.pipe(
|
|
50
|
+
filter((record) => !!record),
|
|
51
|
+
switchMap((record) =>
|
|
52
|
+
this.repository.getRecordFlag(record.uniqueIdentifier, this.flagName())
|
|
53
|
+
)
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
onToggle(enabled: boolean) {
|
|
57
|
+
if (this.record() === null) {
|
|
58
|
+
return
|
|
59
|
+
}
|
|
60
|
+
this.repository
|
|
61
|
+
.setRecordFlag(this.record().uniqueIdentifier, this.flagName(), enabled)
|
|
62
|
+
.subscribe({
|
|
63
|
+
next: () => {
|
|
64
|
+
// do nothing
|
|
65
|
+
},
|
|
66
|
+
error: (error) => {
|
|
67
|
+
this.notificationsService.showNotification(
|
|
68
|
+
{
|
|
69
|
+
type: 'error',
|
|
70
|
+
title: this.translateService.instant(
|
|
71
|
+
'editor.record.flag.saveError.title'
|
|
72
|
+
),
|
|
73
|
+
text: `${this.translateService.instant(
|
|
74
|
+
'editor.record.flag.saveError.body',
|
|
75
|
+
{
|
|
76
|
+
recordKind: this.recordKind(),
|
|
77
|
+
}
|
|
78
|
+
)} ${error.message}`,
|
|
79
|
+
},
|
|
80
|
+
undefined,
|
|
81
|
+
error
|
|
82
|
+
)
|
|
83
|
+
},
|
|
84
|
+
})
|
|
85
|
+
}
|
|
86
|
+
}
|
package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html
CHANGED
|
@@ -7,23 +7,22 @@
|
|
|
7
7
|
></gn-ui-form-field-open-data>
|
|
8
8
|
</ng-container> -->
|
|
9
9
|
<div class="flex flex-col h-full">
|
|
10
|
-
|
|
10
|
+
@if (withoutWrapper) {
|
|
11
11
|
<ng-container *ngTemplateOutlet="fieldContent"></ng-container>
|
|
12
|
-
|
|
13
|
-
<ng-template #withGenericWrapper>
|
|
12
|
+
} @else {
|
|
14
13
|
<gn-ui-form-field-wrapper
|
|
15
14
|
[label]="config.labelKey! | translate: { recordKind }"
|
|
16
15
|
[hint]="config.hintKey! | translate: { recordKind }"
|
|
17
16
|
>
|
|
18
17
|
<ng-container *ngTemplateOutlet="fieldContent"></ng-container>
|
|
19
18
|
</gn-ui-form-field-wrapper>
|
|
20
|
-
|
|
19
|
+
}
|
|
21
20
|
</div>
|
|
22
21
|
|
|
23
22
|
<ng-template #fieldContent>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<div class="flex flex-row flex-start items-center gap-3
|
|
23
|
+
@switch (model) {
|
|
24
|
+
@case ('title') {
|
|
25
|
+
<div class="flex flex-row flex-start items-center gap-3">
|
|
27
26
|
<textarea
|
|
28
27
|
#titleInput
|
|
29
28
|
cdkTextareaAutosize
|
|
@@ -45,158 +44,171 @@
|
|
|
45
44
|
class="m-2 cursor-pointer"
|
|
46
45
|
(click)="focusTitleInput()"
|
|
47
46
|
></ng-icon>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
47
|
+
@if (config.hintKey) {
|
|
48
|
+
<ng-icon
|
|
49
|
+
name="matHelpOutline"
|
|
50
|
+
size="16"
|
|
51
|
+
class="m-2"
|
|
52
|
+
[matTooltip]="config.hintKey! | translate: { recordKind }"
|
|
53
|
+
matTooltipPosition="above"
|
|
54
|
+
></ng-icon>
|
|
55
|
+
}
|
|
56
56
|
</div>
|
|
57
57
|
</div>
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
}
|
|
59
|
+
@case ('abstract') {
|
|
60
60
|
<gn-ui-form-field-rich
|
|
61
61
|
[label]="config.labelKey! | translate: { recordKind }"
|
|
62
62
|
[hint]="config.hintKey! | translate: { recordKind }"
|
|
63
63
|
[value]="valueAsString"
|
|
64
64
|
(valueChange)="valueChange.emit($event)"
|
|
65
65
|
></gn-ui-form-field-rich>
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
}
|
|
67
|
+
@case ('overviews') {
|
|
68
68
|
<gn-ui-form-field-overviews
|
|
69
69
|
[metadataUuid]="uniqueIdentifier"
|
|
70
70
|
[recordKind]="recordKind"
|
|
71
71
|
[value]="valueAsOverviews"
|
|
72
72
|
(valueChange)="valueChange.emit($event)"
|
|
73
73
|
></gn-ui-form-field-overviews>
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
}
|
|
75
|
+
@case ('resourceIdentifiers') {
|
|
76
76
|
<gn-ui-form-field-simple
|
|
77
77
|
[type]="'text'"
|
|
78
78
|
[value]="valueAsResourceIdentifierCode"
|
|
79
79
|
(valueChange)="handleResourceIdentifierChange($event)"
|
|
80
80
|
></gn-ui-form-field-simple>
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
}
|
|
82
|
+
@case ('resourceCreated') {
|
|
83
83
|
<gn-ui-form-field-date
|
|
84
84
|
[value]="valueAsDate"
|
|
85
85
|
(valueChange)="valueChange.emit($event)"
|
|
86
86
|
></gn-ui-form-field-date>
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
}
|
|
88
|
+
@case ('resourceUpdated') {
|
|
89
89
|
<gn-ui-form-field-date
|
|
90
90
|
[value]="valueAsDate"
|
|
91
91
|
(valueChange)="valueChange.emit($event)"
|
|
92
92
|
></gn-ui-form-field-date>
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
}
|
|
94
|
+
@case ('updateFrequency') {
|
|
95
95
|
<gn-ui-form-field-update-frequency
|
|
96
96
|
[value]="valueAsUpdateFrequency"
|
|
97
97
|
(valueChange)="valueChange.emit($event)"
|
|
98
98
|
[recordKind]="recordKind"
|
|
99
99
|
></gn-ui-form-field-update-frequency>
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
}
|
|
101
|
+
@case ('associatedRecords') {
|
|
102
102
|
<gn-ui-form-field-associated-records
|
|
103
103
|
[value]="valueAsAssociatedRecords"
|
|
104
104
|
(valueChange)="valueChange.emit($event)"
|
|
105
105
|
></gn-ui-form-field-associated-records>
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
}
|
|
107
|
+
@case ('temporalExtents') {
|
|
108
108
|
<gn-ui-form-field-temporal-extents
|
|
109
109
|
[value]="valueAsTemporalExtents"
|
|
110
110
|
(valueChange)="valueChange.emit($event)"
|
|
111
111
|
></gn-ui-form-field-temporal-extents>
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
}
|
|
113
|
+
@case ('spatialExtents') {
|
|
114
114
|
<gn-ui-form-field-spatial-extent></gn-ui-form-field-spatial-extent>
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
}
|
|
116
|
+
@case ('keywords') {
|
|
117
117
|
<gn-ui-form-field-keywords
|
|
118
118
|
[value]="valueAsKeywords"
|
|
119
119
|
(valueChange)="valueChange.emit($event)"
|
|
120
120
|
></gn-ui-form-field-keywords>
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
}
|
|
122
|
+
@case ('topics') {
|
|
123
123
|
<gn-ui-form-field-topics
|
|
124
124
|
[value]="valueAsTopics"
|
|
125
125
|
(valueChange)="valueChange.emit($event)"
|
|
126
126
|
></gn-ui-form-field-topics>
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
}
|
|
128
|
+
@case ('licenses') {
|
|
129
129
|
<gn-ui-form-field-license
|
|
130
130
|
[label]="config.labelKey! | translate: { recordKind }"
|
|
131
131
|
[recordLicences]="valueAsConstraints"
|
|
132
132
|
(recordLicencesChange)="valueChange.emit($event)"
|
|
133
133
|
></gn-ui-form-field-license>
|
|
134
|
-
|
|
134
|
+
}
|
|
135
135
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
136
|
+
<!-- TODO: merge these cases together when migrated to angular 21 -->
|
|
137
|
+
@case ('legalConstraints') {
|
|
138
|
+
<gn-ui-form-field-constraints
|
|
139
|
+
[label]="config.labelKey"
|
|
140
|
+
[value]="valueAsConstraints"
|
|
141
|
+
[constraintType]="model"
|
|
142
|
+
(valueChange)="valueChange.emit($event)"
|
|
143
|
+
></gn-ui-form-field-constraints>
|
|
144
|
+
}
|
|
145
|
+
@case ('securityConstraints') {
|
|
146
|
+
<gn-ui-form-field-constraints
|
|
147
|
+
[label]="config.labelKey"
|
|
148
|
+
[value]="valueAsConstraints"
|
|
149
|
+
[constraintType]="model"
|
|
150
|
+
(valueChange)="valueChange.emit($event)"
|
|
151
|
+
></gn-ui-form-field-constraints>
|
|
152
|
+
}
|
|
153
|
+
@case ('otherConstraints') {
|
|
146
154
|
<gn-ui-form-field-constraints
|
|
147
155
|
[label]="config.labelKey"
|
|
148
156
|
[value]="valueAsConstraints"
|
|
149
157
|
[constraintType]="model"
|
|
150
158
|
(valueChange)="valueChange.emit($event)"
|
|
151
|
-
></gn-ui-form-field-constraints
|
|
152
|
-
|
|
159
|
+
></gn-ui-form-field-constraints>
|
|
160
|
+
}
|
|
153
161
|
|
|
154
|
-
|
|
162
|
+
@case ('contactsForResource') {
|
|
155
163
|
<gn-ui-form-field-contacts-for-resource
|
|
156
164
|
[value]="valueAsIndividuals"
|
|
157
165
|
(valueChange)="valueChange.emit($event)"
|
|
158
166
|
></gn-ui-form-field-contacts-for-resource>
|
|
159
|
-
|
|
160
|
-
|
|
167
|
+
}
|
|
168
|
+
@case ('contacts') {
|
|
161
169
|
<gn-ui-form-field-contacts
|
|
162
170
|
[value]="valueAsIndividuals"
|
|
163
171
|
[modelSpecifier]="modelSpecifier"
|
|
164
172
|
(valueChange)="valueChange.emit($event)"
|
|
165
173
|
></gn-ui-form-field-contacts>
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
174
|
+
}
|
|
175
|
+
@case ('onlineResources') {
|
|
176
|
+
@if (modelSpecifier === 'onlineResourceType:!link') {
|
|
177
|
+
<gn-ui-form-field-online-resources
|
|
178
|
+
[metadataUuid]="uniqueIdentifier"
|
|
179
|
+
[value]="valueAsOnlineResources"
|
|
180
|
+
(valueChange)="valueChange.emit($event)"
|
|
181
|
+
></gn-ui-form-field-online-resources>
|
|
182
|
+
} @else if (modelSpecifier === 'onlineResourceType:link') {
|
|
183
|
+
<gn-ui-form-field-online-link-resources
|
|
184
|
+
[metadataUuid]="uniqueIdentifier"
|
|
185
|
+
[value]="valueAsOnlineResources"
|
|
186
|
+
(valueChange)="valueChange.emit($event)"
|
|
187
|
+
></gn-ui-form-field-online-link-resources>
|
|
188
|
+
} @else if (modelSpecifier === 'onlineResourceType:singleLink') {
|
|
189
|
+
<gn-ui-form-field-online-single-link-resource
|
|
190
|
+
[value]="valueAsOnlineResources"
|
|
191
|
+
(valueChange)="valueChange.emit($event)"
|
|
192
|
+
></gn-ui-form-field-online-single-link-resource>
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
@case ('flags') {
|
|
196
|
+
<gn-ui-form-field-record-flag
|
|
197
|
+
[flagName]="recordFlag"
|
|
198
|
+
[labelKey]="config.labelKey"
|
|
199
|
+
[hintKey]="config.hintKey"
|
|
200
|
+
></gn-ui-form-field-record-flag>
|
|
201
|
+
}
|
|
202
|
+
}
|
|
191
203
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
204
|
+
@if (!model) {
|
|
205
|
+
@switch (componentName) {
|
|
206
|
+
@case ('form-field-constraints-shortcuts') {
|
|
195
207
|
<gn-ui-form-field-constraints-shortcuts></gn-ui-form-field-constraints-shortcuts>
|
|
196
|
-
|
|
197
|
-
|
|
208
|
+
}
|
|
209
|
+
@case ('form-field-spatial-toggle') {
|
|
198
210
|
<gn-ui-form-field-spatial-toggle></gn-ui-form-field-spatial-toggle>
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
202
214
|
</ng-template>
|