geonetwork-ui 2.10.0 → 2.11.0-dev.68d9eaa3a
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 +883 -632
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/index.d.ts +101 -54
- package/index.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/libs/api/metadata-converter/src/lib/fixtures/generic.records.ts +5 -5
- package/src/libs/api/metadata-converter/src/lib/fixtures/metawal.records.ts +5 -5
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +43 -13
- package/src/libs/api/metadata-converter/src/lib/gn4/types/elasticsearch.model.ts +13 -1
- package/src/libs/api/metadata-converter/src/lib/iso19115-3/write-parts.ts +2 -2
- package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +9 -5
- package/src/libs/api/metadata-converter/src/lib/iso19139/utils/association-type.mapper.ts +12 -0
- package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +2 -2
- package/src/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.ts +23 -3
- package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +40 -16
- package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +40 -2
- package/src/libs/common/domain/src/lib/model/search/sort-by.model.ts +1 -5
- package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +2 -2
- package/src/libs/feature/dataviz/src/lib/chart-view/chart-view.component.ts +3 -2
- package/src/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.ts +2 -1
- package/src/libs/feature/dataviz/src/lib/service/data.service.ts +22 -22
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-associated-records/form-field-associated-records.component.css +0 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-associated-records/form-field-associated-records.component.html +33 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-associated-records/form-field-associated-records.component.ts +94 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.html +16 -12
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +6 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +6 -0
- package/src/libs/feature/editor/src/lib/fields.config.ts +5 -0
- package/src/libs/feature/record/src/lib/state/mdview.actions.ts +4 -8
- package/src/libs/feature/record/src/lib/state/mdview.effects.ts +7 -16
- package/src/libs/feature/record/src/lib/state/mdview.facade.ts +1 -3
- package/src/libs/feature/record/src/lib/state/mdview.reducer.ts +4 -9
- package/src/libs/feature/record/src/lib/state/mdview.selectors.ts +2 -7
- package/src/libs/feature/router/src/lib/default/router.service.ts +1 -1
- package/src/libs/feature/search/src/lib/sort-by/sort-by.component.ts +1 -1
- package/src/libs/ui/dataviz/src/lib/data-table/data-table.component.html +6 -7
- package/src/libs/ui/dataviz/src/lib/data-table/data-table.component.ts +31 -19
- package/src/libs/ui/dataviz/src/lib/data-table/data-table.fixtures.ts +2 -2
- package/src/libs/util/data-fetcher/src/lib/data-fetcher.ts +19 -22
- package/src/libs/util/data-fetcher/src/lib/engine/duckdb.ts +185 -0
- package/src/libs/util/data-fetcher/src/lib/engine/results.ts +63 -0
- package/src/libs/util/data-fetcher/src/lib/{sql-utils.ts → engine/sql-utils.ts} +28 -13
- package/src/libs/util/data-fetcher/src/lib/model.ts +2 -1
- package/src/libs/util/data-fetcher/src/lib/readers/base-file.ts +53 -38
- package/src/libs/util/data-fetcher/src/lib/readers/base.ts +11 -0
- package/src/libs/util/data-fetcher/src/lib/readers/csv.ts +9 -47
- package/src/libs/util/data-fetcher/src/lib/readers/excel.ts +27 -27
- package/src/libs/util/data-fetcher/src/lib/readers/geojson.ts +5 -24
- package/src/libs/util/data-fetcher/src/lib/readers/gml.ts +5 -49
- package/src/libs/util/data-fetcher/src/lib/readers/json.ts +5 -23
- package/src/libs/util/data-fetcher/src/lib/readers/wfs.ts +184 -128
- package/src/libs/util/data-fetcher/src/lib/utils.ts +0 -143
- package/translations/de.json +14 -1
- package/translations/en.json +14 -1
- package/translations/es.json +13 -0
- package/translations/fr.json +14 -1
- package/translations/it.json +14 -1
- package/translations/nl.json +13 -0
- package/translations/pt.json +13 -0
- package/translations/sk.json +14 -1
- package/src/libs/util/data-fetcher/src/lib/readers/base-cache.ts +0 -14
|
@@ -15,9 +15,11 @@ import {
|
|
|
15
15
|
} from './atomic-operations'
|
|
16
16
|
import { MetadataUrlService } from './metadata-url.service'
|
|
17
17
|
import { inject, Injectable } from '@angular/core'
|
|
18
|
+
import { getAssociationTypeFromCode } from '../iso19139/utils/association-type.mapper'
|
|
18
19
|
import { getStatusFromStatusCode } from '../iso19139/utils/status.mapper'
|
|
19
20
|
import { getUpdateFrequencyFromFrequencyCode } from '../iso19139/utils/update-frequency.mapper'
|
|
20
21
|
import {
|
|
22
|
+
AssociatedRecord,
|
|
21
23
|
CatalogRecord,
|
|
22
24
|
Constraint,
|
|
23
25
|
DatasetSpatialExtent,
|
|
@@ -318,25 +320,16 @@ export class Gn4FieldMapper {
|
|
|
318
320
|
output
|
|
319
321
|
),
|
|
320
322
|
related: (output, source) => {
|
|
323
|
+
const related = <SourceWithUnknownProps>selectField(source, 'related')
|
|
321
324
|
const fcatSource = selectField(
|
|
322
|
-
getFirstValue(
|
|
323
|
-
selectField(
|
|
324
|
-
<SourceWithUnknownProps>selectField(source, 'related'),
|
|
325
|
-
'fcats'
|
|
326
|
-
)
|
|
327
|
-
) ?? {},
|
|
325
|
+
getFirstValue(selectField(related, 'fcats')) ?? {},
|
|
328
326
|
'_source'
|
|
329
327
|
)
|
|
330
328
|
const featureCatalogIdentifier: string = selectField(
|
|
331
329
|
<SourceWithUnknownProps>fcatSource,
|
|
332
330
|
'uuid'
|
|
333
331
|
)
|
|
334
|
-
const sourceOfLinks = getAsArray(
|
|
335
|
-
selectField(
|
|
336
|
-
<SourceWithUnknownProps>selectField(source, 'related'),
|
|
337
|
-
'hassources'
|
|
338
|
-
)
|
|
339
|
-
)
|
|
332
|
+
const sourceOfLinks = getAsArray(selectField(related, 'hassources'))
|
|
340
333
|
const sourceOfIdentifiers: string[] = sourceOfLinks
|
|
341
334
|
.filter((link) => link['origin'] === 'catalog')
|
|
342
335
|
.map((link) => {
|
|
@@ -345,13 +338,50 @@ export class Gn4FieldMapper {
|
|
|
345
338
|
'uuid'
|
|
346
339
|
)
|
|
347
340
|
})
|
|
348
|
-
const
|
|
341
|
+
const siblingLinks = getAsArray(selectField(related, 'siblings'))
|
|
342
|
+
const siblings: AssociatedRecord[] = siblingLinks
|
|
343
|
+
.filter((link) => link['origin'] === 'catalog')
|
|
344
|
+
.map((link) => ({
|
|
345
|
+
uniqueIdentifier: selectField<string>(
|
|
346
|
+
selectField(<SourceWithUnknownProps>link, '_source'),
|
|
347
|
+
'uuid'
|
|
348
|
+
),
|
|
349
|
+
associationType: getAssociationTypeFromCode(
|
|
350
|
+
selectField<string>(
|
|
351
|
+
selectField(<SourceWithUnknownProps>link, 'properties'),
|
|
352
|
+
'associationType'
|
|
353
|
+
)
|
|
354
|
+
),
|
|
355
|
+
}))
|
|
356
|
+
const associatedLinks = getAsArray(selectField(related, 'associated'))
|
|
357
|
+
const associatedIdentifiers: string[] = associatedLinks
|
|
358
|
+
.filter((link) => link['origin'] === 'catalog')
|
|
359
|
+
.map((link) => {
|
|
360
|
+
return selectField<string>(
|
|
361
|
+
selectField(<SourceWithUnknownProps>link, '_source'),
|
|
362
|
+
'uuid'
|
|
363
|
+
)
|
|
364
|
+
})
|
|
365
|
+
.filter(
|
|
366
|
+
(uuid) =>
|
|
367
|
+
!siblings.some((sibling) => sibling.uniqueIdentifier === uuid)
|
|
368
|
+
)
|
|
369
|
+
const extraValues: Record<
|
|
370
|
+
string,
|
|
371
|
+
string | string[] | AssociatedRecord[]
|
|
372
|
+
> = {}
|
|
349
373
|
if (featureCatalogIdentifier) {
|
|
350
374
|
extraValues.featureCatalogIdentifier = featureCatalogIdentifier
|
|
351
375
|
}
|
|
352
376
|
if (sourceOfIdentifiers && sourceOfIdentifiers.length > 0) {
|
|
353
377
|
extraValues.sourceOfIdentifiers = sourceOfIdentifiers
|
|
354
378
|
}
|
|
379
|
+
if (associatedIdentifiers && associatedIdentifiers.length > 0) {
|
|
380
|
+
extraValues.associatedIdentifiers = associatedIdentifiers
|
|
381
|
+
}
|
|
382
|
+
if (siblings && siblings.length > 0) {
|
|
383
|
+
extraValues.siblings = siblings
|
|
384
|
+
}
|
|
355
385
|
return Object.keys(extraValues).length > 0
|
|
356
386
|
? this.addExtra(extraValues, output)
|
|
357
387
|
: output
|
|
@@ -2,7 +2,19 @@ export type SortOrder = 'asc' | 'desc'
|
|
|
2
2
|
interface SortParam {
|
|
3
3
|
[key: string]: SortOrder
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
type EsFieldSort = {
|
|
6
|
+
order: SortOrder
|
|
7
|
+
mode?: 'max' | 'min'
|
|
8
|
+
missing?: '_last'
|
|
9
|
+
nested?: {
|
|
10
|
+
path: string
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
export type SortParams =
|
|
14
|
+
| string
|
|
15
|
+
| SortParam
|
|
16
|
+
| { [property: string]: EsFieldSort }
|
|
17
|
+
| (string | SortParam | { [property: string]: EsFieldSort })[]
|
|
6
18
|
|
|
7
19
|
export interface EsRequestAggTerm {
|
|
8
20
|
field?: string
|
|
@@ -587,7 +587,7 @@ export function writeAssociatedRecords(
|
|
|
587
587
|
removeChildrenByName('mri:associatedResource'),
|
|
588
588
|
appendChildren(
|
|
589
589
|
...record.associatedRecords
|
|
590
|
-
.filter((assoc) => assoc.
|
|
590
|
+
.filter((assoc) => assoc.uniqueIdentifier && assoc.associationType)
|
|
591
591
|
.map((assoc) =>
|
|
592
592
|
pipe(
|
|
593
593
|
createNestedElement(
|
|
@@ -608,7 +608,7 @@ export function writeAssociatedRecords(
|
|
|
608
608
|
),
|
|
609
609
|
pipe(
|
|
610
610
|
createElement('mri:metadataReference'),
|
|
611
|
-
writeAttribute('uuidref', assoc.
|
|
611
|
+
writeAttribute('uuidref', assoc.uniqueIdentifier)
|
|
612
612
|
)
|
|
613
613
|
)
|
|
614
614
|
)
|
|
@@ -51,6 +51,7 @@ import {
|
|
|
51
51
|
readText,
|
|
52
52
|
XmlElement,
|
|
53
53
|
} from '../xml-utils'
|
|
54
|
+
import { getAssociationTypeFromCode } from './utils/association-type.mapper'
|
|
54
55
|
import { readGeometry } from './utils/geometry'
|
|
55
56
|
import { fullNameToParts } from './utils/individual-name'
|
|
56
57
|
import { getKeywordTypeFromKeywordTypeCode } from './utils/keyword.mapper'
|
|
@@ -931,19 +932,22 @@ export function readSourceRecords(rootEl: XmlElement): SourceRecord[] {
|
|
|
931
932
|
export function extractAssociatedRecords(
|
|
932
933
|
containerName: string,
|
|
933
934
|
aggregateName: string,
|
|
934
|
-
|
|
935
|
+
readIdentifier: ChainableFunction<XmlElement, string>
|
|
935
936
|
): ChainableFunction<XmlElement, AssociatedRecord[]> {
|
|
936
937
|
return pipe(
|
|
937
938
|
findChildrenElement(containerName, false),
|
|
938
939
|
mapArray((el) => {
|
|
939
940
|
const aggregateEl = findChildElement(aggregateName, false)(el)
|
|
940
|
-
const
|
|
941
|
-
const
|
|
941
|
+
const uniqueIdentifier = readIdentifier(aggregateEl)
|
|
942
|
+
const associationTypeCode = pipe(
|
|
942
943
|
findNestedElement('gmd:associationType', 'gmd:DS_AssociationTypeCode'),
|
|
943
944
|
readAttribute('codeListValue')
|
|
944
945
|
)(aggregateEl)
|
|
945
|
-
if (!
|
|
946
|
-
return {
|
|
946
|
+
if (!uniqueIdentifier || !associationTypeCode) return null
|
|
947
|
+
return {
|
|
948
|
+
uniqueIdentifier,
|
|
949
|
+
associationType: getAssociationTypeFromCode(associationTypeCode),
|
|
950
|
+
}
|
|
947
951
|
}),
|
|
948
952
|
filterArray((r): r is AssociatedRecord => r !== null)
|
|
949
953
|
)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AssociationType,
|
|
3
|
+
associationTypeValues,
|
|
4
|
+
} from '../../../../../../../libs/common/domain/src/lib/model/record'
|
|
5
|
+
|
|
6
|
+
export function getAssociationTypeFromCode(
|
|
7
|
+
associationTypeCode: string
|
|
8
|
+
): AssociationType {
|
|
9
|
+
return associationTypeValues.includes(associationTypeCode as AssociationType)
|
|
10
|
+
? (associationTypeCode as AssociationType)
|
|
11
|
+
: 'crossReference'
|
|
12
|
+
}
|
|
@@ -1276,7 +1276,7 @@ export function writeAssociatedRecords(
|
|
|
1276
1276
|
removeChildrenByName('gmd:aggregationInfo'),
|
|
1277
1277
|
appendChildren(
|
|
1278
1278
|
...record.associatedRecords
|
|
1279
|
-
.filter((assoc) => assoc.
|
|
1279
|
+
.filter((assoc) => assoc.uniqueIdentifier && assoc.associationType)
|
|
1280
1280
|
.map((assoc) =>
|
|
1281
1281
|
pipe(
|
|
1282
1282
|
createNestedElement(
|
|
@@ -1290,7 +1290,7 @@ export function writeAssociatedRecords(
|
|
|
1290
1290
|
'gmd:MD_Identifier',
|
|
1291
1291
|
'gmd:code'
|
|
1292
1292
|
),
|
|
1293
|
-
writeCharacterString(assoc.
|
|
1293
|
+
writeCharacterString(assoc.uniqueIdentifier)
|
|
1294
1294
|
),
|
|
1295
1295
|
pipe(
|
|
1296
1296
|
createNestedElement(
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
AggregationsParams,
|
|
12
12
|
FieldFilter,
|
|
13
13
|
FieldFilters,
|
|
14
|
+
FieldSort,
|
|
14
15
|
FilterQuery,
|
|
15
16
|
FiltersAggregationParams,
|
|
16
17
|
SortByField,
|
|
@@ -141,6 +142,7 @@ export class ElasticsearchService {
|
|
|
141
142
|
values: uuids,
|
|
142
143
|
},
|
|
143
144
|
},
|
|
145
|
+
size: uuids.length,
|
|
144
146
|
}
|
|
145
147
|
}
|
|
146
148
|
|
|
@@ -199,9 +201,27 @@ export class ElasticsearchService {
|
|
|
199
201
|
}
|
|
200
202
|
|
|
201
203
|
private buildPayloadSort(sortBy: SortByField): SortParams {
|
|
202
|
-
if (sortBy ===
|
|
203
|
-
const fields = Array.isArray(sortBy[0])
|
|
204
|
-
|
|
204
|
+
if (!sortBy || sortBy.length === 0) return undefined
|
|
205
|
+
const fields = Array.isArray(sortBy[0])
|
|
206
|
+
? (sortBy as FieldSort[])
|
|
207
|
+
: [sortBy as FieldSort]
|
|
208
|
+
return fields.map((field) => {
|
|
209
|
+
// Sort by nested array of dates only works with the explicit syntax
|
|
210
|
+
if (field[1].endsWith('.date')) {
|
|
211
|
+
const nestedPath = field[1].slice(0, field[1].lastIndexOf('.date'))
|
|
212
|
+
return {
|
|
213
|
+
[field[1]]: {
|
|
214
|
+
order: field[0] as 'desc' | 'asc',
|
|
215
|
+
mode: field[0] === 'desc' ? 'max' : 'min',
|
|
216
|
+
missing: '_last',
|
|
217
|
+
nested: {
|
|
218
|
+
path: nestedPath,
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return { [field[1]]: field[0] }
|
|
224
|
+
})
|
|
205
225
|
}
|
|
206
226
|
|
|
207
227
|
private injectLangInQueryStringFields(
|
|
@@ -14,10 +14,13 @@ import {
|
|
|
14
14
|
} from '../../../../../../libs/api/metadata-converter/src'
|
|
15
15
|
import { PublicationVersionError } from '../../../../../../libs/common/domain/src/lib/model/error'
|
|
16
16
|
import {
|
|
17
|
+
AssociatedRecord,
|
|
17
18
|
CatalogRecord,
|
|
18
19
|
DatasetFeatureCatalog,
|
|
19
20
|
DatasetFeatureType,
|
|
20
21
|
LanguageCode,
|
|
22
|
+
LinkedRecord,
|
|
23
|
+
RecordRelation,
|
|
21
24
|
} from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
22
25
|
import {
|
|
23
26
|
Aggregations,
|
|
@@ -145,7 +148,7 @@ export class Gn4Repository implements RecordsRepositoryInterface {
|
|
|
145
148
|
return this.gn4SearchApi
|
|
146
149
|
.search(
|
|
147
150
|
'bucket',
|
|
148
|
-
['fcats', 'hassources'],
|
|
151
|
+
['fcats', 'hassources', 'siblings', 'associated'],
|
|
149
152
|
JSON.stringify(
|
|
150
153
|
this.gn4SearchHelper.getMetadataByIdsPayload([uniqueIdentifier])
|
|
151
154
|
)
|
|
@@ -249,22 +252,43 @@ export class Gn4Repository implements RecordsRepositoryInterface {
|
|
|
249
252
|
)
|
|
250
253
|
}
|
|
251
254
|
|
|
252
|
-
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
255
|
+
getLinkedRecords(record: CatalogRecord): Observable<LinkedRecord[]> {
|
|
256
|
+
const siblings = (record.extras?.['siblings'] ?? []) as AssociatedRecord[]
|
|
257
|
+
const relations: Array<[RecordRelation, string[]]> = [
|
|
258
|
+
['source', (record.extras?.['sourcesIdentifiers'] ?? []) as string[]],
|
|
259
|
+
['sourceOf', (record.extras?.['sourceOfIdentifiers'] ?? []) as string[]],
|
|
260
|
+
['sibling', siblings.map(({ uniqueIdentifier }) => uniqueIdentifier)],
|
|
261
|
+
[
|
|
262
|
+
'associated',
|
|
263
|
+
(record.extras?.['associatedIdentifiers'] ?? []) as string[],
|
|
264
|
+
],
|
|
265
|
+
]
|
|
266
|
+
const requested = relations.filter(
|
|
267
|
+
([, identifiers]) => identifiers.length > 0
|
|
268
|
+
)
|
|
269
|
+
if (requested.length === 0) {
|
|
270
|
+
return of([])
|
|
266
271
|
}
|
|
267
|
-
return
|
|
272
|
+
return forkJoin(
|
|
273
|
+
requested.map(([relation, identifiers]) =>
|
|
274
|
+
this.getMultipleRecords(identifiers).pipe(
|
|
275
|
+
map((records) =>
|
|
276
|
+
(records ?? []).map((record) => ({
|
|
277
|
+
record,
|
|
278
|
+
relation,
|
|
279
|
+
associationType:
|
|
280
|
+
relation === 'sibling'
|
|
281
|
+
? siblings.find(
|
|
282
|
+
({ uniqueIdentifier }) =>
|
|
283
|
+
uniqueIdentifier === record.uniqueIdentifier
|
|
284
|
+
)?.associationType
|
|
285
|
+
: undefined,
|
|
286
|
+
}))
|
|
287
|
+
),
|
|
288
|
+
catchError(() => of([]))
|
|
289
|
+
)
|
|
290
|
+
)
|
|
291
|
+
).pipe(map((groups) => groups.flat()))
|
|
268
292
|
}
|
|
269
293
|
|
|
270
294
|
aggregate(params: AggregationsParams): Observable<Aggregations> {
|
|
@@ -260,12 +260,50 @@ export interface SourceRecord {
|
|
|
260
260
|
href?: string
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
+
marker('domain.record.associationType.crossReference')
|
|
264
|
+
marker('domain.record.associationType.largerWorkCitation')
|
|
265
|
+
marker('domain.record.associationType.partOfSeamlessDatabase')
|
|
266
|
+
marker('domain.record.associationType.stereoMate')
|
|
267
|
+
marker('domain.record.associationType.isComposedOf')
|
|
268
|
+
marker('domain.record.associationType.collectiveTitle')
|
|
269
|
+
marker('domain.record.associationType.series')
|
|
270
|
+
marker('domain.record.associationType.dependency')
|
|
271
|
+
marker('domain.record.associationType.revisionOf')
|
|
272
|
+
|
|
273
|
+
// DS_AssociationTypeCode values of the ISO19115-3 codelist, any unrecognized value
|
|
274
|
+
// being mapped to 'crossReference'
|
|
275
|
+
export const associationTypeValues = [
|
|
276
|
+
'crossReference',
|
|
277
|
+
'largerWorkCitation',
|
|
278
|
+
'partOfSeamlessDatabase',
|
|
279
|
+
'stereoMate',
|
|
280
|
+
'isComposedOf',
|
|
281
|
+
'collectiveTitle',
|
|
282
|
+
'series',
|
|
283
|
+
'dependency',
|
|
284
|
+
'revisionOf',
|
|
285
|
+
] as const
|
|
286
|
+
|
|
287
|
+
export type AssociationType = (typeof associationTypeValues)[number]
|
|
288
|
+
|
|
263
289
|
/**
|
|
264
290
|
* Represents another record associated with this one (e.g. a parent/sibling dataset).
|
|
265
291
|
*/
|
|
266
292
|
export interface AssociatedRecord {
|
|
267
|
-
|
|
268
|
-
associationType:
|
|
293
|
+
uniqueIdentifier: string
|
|
294
|
+
associationType: AssociationType
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Nature of the link between a record and another one; the association type is
|
|
299
|
+
* only known for 'sibling' relations, as it is held by the declaring record.
|
|
300
|
+
*/
|
|
301
|
+
export type RecordRelation = 'source' | 'sourceOf' | 'sibling' | 'associated'
|
|
302
|
+
|
|
303
|
+
export interface LinkedRecord {
|
|
304
|
+
record: CatalogRecord
|
|
305
|
+
relation: RecordRelation
|
|
306
|
+
associationType?: AssociationType
|
|
269
307
|
}
|
|
270
308
|
|
|
271
309
|
export interface DatasetRecord extends BaseRecord {
|
|
@@ -6,9 +6,5 @@ export const SortByEnum: Record<string, SortByField> = {
|
|
|
6
6
|
RELEVANCY: ['desc', '_score'],
|
|
7
7
|
QUALITY_SCORE: ['desc', 'qualityScore'],
|
|
8
8
|
CHANGE_DATE: ['desc', 'changeDate'],
|
|
9
|
-
|
|
10
|
-
['desc', 'revisionDateForResource'],
|
|
11
|
-
['desc', 'publicationDateForResource'],
|
|
12
|
-
['desc', 'creationDateForResource'],
|
|
13
|
-
],
|
|
9
|
+
RESOURCE_DATE: ['desc', 'resourceDate.date'],
|
|
14
10
|
}
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
CatalogRecord,
|
|
11
11
|
DatasetFeatureCatalog,
|
|
12
12
|
LanguageCode,
|
|
13
|
+
LinkedRecord,
|
|
13
14
|
} from '../model/record'
|
|
14
15
|
|
|
15
16
|
export abstract class RecordsRepositoryInterface {
|
|
@@ -23,8 +24,7 @@ export abstract class RecordsRepositoryInterface {
|
|
|
23
24
|
abstract getSimilarRecords(
|
|
24
25
|
similarTo: CatalogRecord
|
|
25
26
|
): Observable<CatalogRecord[]>
|
|
26
|
-
abstract
|
|
27
|
-
abstract getSourceOf(record: CatalogRecord): Observable<CatalogRecord[]>
|
|
27
|
+
abstract getLinkedRecords(record: CatalogRecord): Observable<LinkedRecord[]>
|
|
28
28
|
abstract fuzzySearch(query: string): Observable<SearchResults>
|
|
29
29
|
abstract canDuplicate(record: CatalogRecord): boolean
|
|
30
30
|
abstract canDelete(record: CatalogRecord): Observable<boolean>
|
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
ChangeDetectionStrategy,
|
|
3
3
|
ChangeDetectorRef,
|
|
4
4
|
Component,
|
|
5
|
+
inject,
|
|
5
6
|
Input,
|
|
6
7
|
Output,
|
|
7
|
-
inject,
|
|
8
8
|
} from '@angular/core'
|
|
9
9
|
import { marker } from '@biesbjerg/ngx-translate-extract-marker'
|
|
10
10
|
import {
|
|
@@ -183,7 +183,7 @@ export class ChartViewComponent {
|
|
|
183
183
|
yChoices$ = this.properties$.pipe(
|
|
184
184
|
map((properties) =>
|
|
185
185
|
properties
|
|
186
|
-
.filter((prop) => prop.type === 'number'
|
|
186
|
+
.filter((prop) => prop.type === 'number')
|
|
187
187
|
.map((prop) => ({ value: prop.name, label: prop.label || prop.name }))
|
|
188
188
|
),
|
|
189
189
|
tap((choices) => {
|
|
@@ -222,6 +222,7 @@ export class ChartViewComponent {
|
|
|
222
222
|
switchMap(([dataset, xProp, yProp, aggregation]) => {
|
|
223
223
|
const fieldAgg: FieldAggregation =
|
|
224
224
|
aggregation === 'count' ? ['count'] : [aggregation, yProp]
|
|
225
|
+
this.loading = true
|
|
225
226
|
return dataset
|
|
226
227
|
.groupBy(['distinct', xProp])
|
|
227
228
|
.aggregate(fieldAgg)
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
ChangeDetectionStrategy,
|
|
3
3
|
ChangeDetectorRef,
|
|
4
4
|
Component,
|
|
5
|
+
inject,
|
|
5
6
|
Input,
|
|
6
7
|
OnDestroy,
|
|
7
8
|
OnInit,
|
|
8
9
|
ViewChild,
|
|
9
|
-
inject,
|
|
10
10
|
} from '@angular/core'
|
|
11
11
|
import {
|
|
12
12
|
DataTableComponent,
|
|
@@ -75,6 +75,7 @@ export class GeoTableViewComponent implements OnInit, OnDestroy {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
private async initMapContext(): Promise<MapContext> {
|
|
78
|
+
this.dataset.load()
|
|
78
79
|
this.dataset.selectAll()
|
|
79
80
|
return {
|
|
80
81
|
layers: [
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { inject, Injectable } from '@angular/core'
|
|
2
2
|
import { marker } from '@biesbjerg/ngx-translate-extract-marker'
|
|
3
3
|
import {
|
|
4
|
+
GetCollectionItemsOptions,
|
|
4
5
|
OgcApiCollectionInfo,
|
|
5
6
|
OgcApiEndpoint,
|
|
6
7
|
OgcApiRecord,
|
|
7
|
-
WfsEndpoint,
|
|
8
|
-
WfsVersion,
|
|
9
|
-
TmsEndpoint,
|
|
10
8
|
StacEndpoint,
|
|
11
|
-
GetCollectionItemsOptions,
|
|
12
9
|
StacItemsDocument,
|
|
10
|
+
TmsEndpoint,
|
|
11
|
+
WfsEndpoint,
|
|
12
|
+
WfsVersion,
|
|
13
13
|
} from '@camptocamp/ogc-client'
|
|
14
14
|
import {
|
|
15
15
|
BaseReader,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
} from '../../../../../../libs/util/shared/src'
|
|
27
27
|
import type { FeatureCollection } from 'geojson'
|
|
28
28
|
import { from, Observable, throwError } from 'rxjs'
|
|
29
|
-
import { catchError, map, switchMap
|
|
29
|
+
import { catchError, map, switchMap } from 'rxjs/operators'
|
|
30
30
|
import {
|
|
31
31
|
DatasetOnlineResource,
|
|
32
32
|
DatasetServiceDistribution,
|
|
@@ -347,14 +347,11 @@ export class DataService {
|
|
|
347
347
|
if (link.type === 'service' && link.accessServiceProtocol === 'wfs') {
|
|
348
348
|
const wfsUrlEndpoint = this.proxy.getProxiedUrl(link.url.toString())
|
|
349
349
|
return from(
|
|
350
|
-
openDataset(
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
},
|
|
356
|
-
cacheActive
|
|
357
|
-
)
|
|
350
|
+
openDataset(wfsUrlEndpoint, {
|
|
351
|
+
typeHint: 'wfs',
|
|
352
|
+
wfsFeatureType: link.name,
|
|
353
|
+
enableCache: cacheActive,
|
|
354
|
+
})
|
|
358
355
|
)
|
|
359
356
|
} else if (link.type === 'download') {
|
|
360
357
|
const linkProxifiedUrl = this.proxy.getProxiedUrl(link.url.toString())
|
|
@@ -364,7 +361,10 @@ export class DataService {
|
|
|
364
361
|
? (format as SupportedType)
|
|
365
362
|
: undefined
|
|
366
363
|
return from(
|
|
367
|
-
openDataset(linkProxifiedUrl,
|
|
364
|
+
openDataset(linkProxifiedUrl, {
|
|
365
|
+
typeHint: supportedType,
|
|
366
|
+
enableCache: cacheActive,
|
|
367
|
+
})
|
|
368
368
|
).pipe()
|
|
369
369
|
} else if (
|
|
370
370
|
link.type === 'service' &&
|
|
@@ -374,7 +374,9 @@ export class DataService {
|
|
|
374
374
|
link.url.toString(),
|
|
375
375
|
'geojson'
|
|
376
376
|
)
|
|
377
|
-
return from(
|
|
377
|
+
return from(
|
|
378
|
+
openDataset(url, { typeHint: 'geojson', enableCache: cacheActive })
|
|
379
|
+
).pipe()
|
|
378
380
|
} else if (
|
|
379
381
|
link.type === 'service' &&
|
|
380
382
|
link.accessServiceProtocol === 'ogcFeatures'
|
|
@@ -395,12 +397,10 @@ export class DataService {
|
|
|
395
397
|
}
|
|
396
398
|
const urlWithoutLimit = new URL(geojsonUrl)
|
|
397
399
|
urlWithoutLimit.searchParams.delete('limit')
|
|
398
|
-
return openDataset(
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
cacheActive
|
|
403
|
-
)
|
|
400
|
+
return openDataset(urlWithoutLimit.toString(), {
|
|
401
|
+
typeHint: 'geojson',
|
|
402
|
+
enableCache: cacheActive,
|
|
403
|
+
})
|
|
404
404
|
})
|
|
405
405
|
)
|
|
406
406
|
}
|
|
File without changes
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<div class="flex flex-col gap-2">
|
|
2
|
+
<gn-ui-check-toggle
|
|
3
|
+
[label]="'editor.record.form.field.parentLink' | translate"
|
|
4
|
+
[value]="hasParentLink"
|
|
5
|
+
(toggled)="onToggle($event)"
|
|
6
|
+
data-cy="associated-record-toggle"
|
|
7
|
+
></gn-ui-check-toggle>
|
|
8
|
+
@if (hasParentLink) {
|
|
9
|
+
<gn-ui-form-field-wrapper
|
|
10
|
+
[label]="'editor.record.form.field.parentIdentifier' | translate"
|
|
11
|
+
>
|
|
12
|
+
<gn-ui-text-input
|
|
13
|
+
[value]="uniqueIdentifier"
|
|
14
|
+
(valueChange)="onUniqueIdentifierChange($event)"
|
|
15
|
+
placeholder=""
|
|
16
|
+
data-cy="associated-record-identifier"
|
|
17
|
+
></gn-ui-text-input>
|
|
18
|
+
</gn-ui-form-field-wrapper>
|
|
19
|
+
<gn-ui-form-field-wrapper
|
|
20
|
+
[label]="'editor.record.form.field.parentType' | translate"
|
|
21
|
+
>
|
|
22
|
+
<gn-ui-dropdown-selector
|
|
23
|
+
[title]="'editor.record.form.field.parentType' | translate"
|
|
24
|
+
[showTitle]="false"
|
|
25
|
+
[choices]="choices"
|
|
26
|
+
[selected]="selectedType"
|
|
27
|
+
(selectValue)="onTypeChange($event)"
|
|
28
|
+
[extraBtnClass]="'input-as-button gn-ui-text-input'"
|
|
29
|
+
data-cy="associated-record-type"
|
|
30
|
+
></gn-ui-dropdown-selector>
|
|
31
|
+
</gn-ui-form-field-wrapper>
|
|
32
|
+
}
|
|
33
|
+
</div>
|