geonetwork-ui 2.7.0-dev.816935147 → 2.7.0-dev.84c2b3081
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/esm2022/libs/api/metadata-converter/src/lib/dcat-ap/read-parts.mjs +4 -7
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.mjs +20 -20
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/metadata-url.service.mjs +3 -3
- package/esm2022/libs/api/metadata-converter/src/lib/iso19115-3/read-parts.mjs +3 -3
- package/esm2022/libs/api/metadata-converter/src/lib/iso19115-3/write-parts.mjs +3 -3
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/read-parts.mjs +4 -4
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +5 -5
- package/esm2022/libs/api/repository/src/index.mjs +2 -2
- package/esm2022/libs/api/repository/src/lib/gn4/auth/auth.service.mjs +5 -5
- package/esm2022/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.mjs +9 -10
- package/esm2022/libs/api/repository/src/lib/gn4/gn4-repository.mjs +3 -3
- package/esm2022/libs/api/repository/src/lib/gn4/organizations/organizations-from-groups.service.mjs +3 -3
- package/esm2022/libs/api/repository/src/lib/gn4/organizations/organizations-from-metadata.service.mjs +3 -3
- package/esm2022/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.mjs +21 -21
- package/esm2022/libs/api/repository/src/lib/gn4/settings/gn4-settings.service.mjs +3 -1
- package/esm2022/libs/api/repository/src/lib/metadata-language.token.mjs +3 -0
- package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +1 -1
- package/esm2022/libs/common/domain/src/lib/platform.service.interface.mjs +1 -1
- package/esm2022/libs/feature/catalog/src/lib/sources/sources.service.mjs +3 -3
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-inspire-field/form-field-inspire-theme.component.mjs +55 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.mjs +8 -3
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/index.mjs +2 -1
- package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +77 -1
- package/esm2022/libs/feature/router/src/lib/default/state/query-params.utils.mjs +4 -3
- package/esm2022/libs/feature/router/src/lib/default/state/router.facade.mjs +3 -2
- package/esm2022/libs/ui/elements/src/lib/metadata-quality-item/metadata-quality-item.component.mjs +7 -7
- package/esm2022/libs/ui/elements/src/lib/service-capabilities/service-capabilities.component.mjs +1 -6
- package/esm2022/libs/util/app-config/src/lib/fixtures.mjs +2 -2
- package/esm2022/libs/util/app-config/src/lib/parse-utils.mjs +5 -4
- package/esm2022/libs/util/i18n/src/lib/language-codes.mjs +50 -9
- package/esm2022/libs/util/shared/src/lib/record/quality-score.util.mjs +6 -4
- package/esm2022/translations/de.json +42 -20
- package/esm2022/translations/en.json +43 -21
- package/esm2022/translations/es.json +29 -7
- package/esm2022/translations/fr.json +47 -25
- package/esm2022/translations/it.json +42 -20
- package/esm2022/translations/nl.json +29 -7
- package/esm2022/translations/pt.json +29 -7
- package/esm2022/translations/sk.json +33 -11
- package/fesm2022/geonetwork-ui.mjs +552 -652
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/api/metadata-converter/src/lib/dcat-ap/read-parts.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts +2 -2
- package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
- package/libs/api/repository/src/index.d.ts +1 -1
- package/libs/api/repository/src/index.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.d.ts +0 -1
- package/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts +6 -7
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/settings/gn4-settings.service.d.ts +2 -0
- package/libs/api/repository/src/lib/gn4/settings/gn4-settings.service.d.ts.map +1 -1
- package/libs/api/repository/src/lib/metadata-language.token.d.ts +5 -0
- package/libs/api/repository/src/lib/metadata-language.token.d.ts.map +1 -0
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +5 -1
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
- package/libs/common/domain/src/lib/platform.service.interface.d.ts +1 -0
- package/libs/common/domain/src/lib/platform.service.interface.d.ts.map +1 -1
- package/libs/feature/catalog/src/lib/sources/sources.service.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-inspire-field/form-field-inspire-theme.component.d.ts +20 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-inspire-field/form-field-inspire-theme.component.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts +1 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/index.d.ts +1 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/index.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/fields.config.d.ts +8 -1
- package/libs/feature/editor/src/lib/fields.config.d.ts.map +1 -1
- package/libs/feature/router/src/lib/default/state/query-params.utils.d.ts.map +1 -1
- package/libs/feature/router/src/lib/default/state/router.facade.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/service-capabilities/service-capabilities.component.d.ts.map +1 -1
- package/libs/util/app-config/src/lib/parse-utils.d.ts.map +1 -1
- package/libs/util/i18n/src/lib/language-codes.d.ts +91 -31
- package/libs/util/i18n/src/lib/language-codes.d.ts.map +1 -1
- package/libs/util/shared/src/lib/record/quality-score.util.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/libs/api/metadata-converter/src/lib/dcat-ap/read-parts.ts +3 -6
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +47 -22
- package/src/libs/api/metadata-converter/src/lib/gn4/metadata-url.service.ts +2 -2
- package/src/libs/api/metadata-converter/src/lib/iso19115-3/read-parts.ts +2 -2
- 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 +3 -3
- package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +6 -6
- package/src/libs/api/repository/src/index.ts +1 -1
- package/src/libs/api/repository/src/lib/gn4/auth/auth.service.ts +4 -4
- package/src/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.ts +15 -11
- package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +2 -2
- package/src/libs/api/repository/src/lib/gn4/organizations/organizations-from-groups.service.ts +2 -2
- package/src/libs/api/repository/src/lib/gn4/organizations/organizations-from-metadata.service.ts +2 -2
- package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.ts +22 -35
- package/src/libs/api/repository/src/lib/gn4/settings/gn4-settings.service.ts +8 -0
- package/src/libs/api/repository/src/lib/metadata-language.token.ts +8 -0
- package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +6 -1
- package/src/libs/common/domain/src/lib/platform.service.interface.ts +1 -0
- package/src/libs/feature/catalog/src/lib/sources/sources.service.ts +2 -5
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-inspire-field/form-field-inspire-theme.component.css +0 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-inspire-field/form-field-inspire-theme.component.html +22 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-inspire-field/form-field-inspire-theme.component.ts +57 -0
- 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 +5 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/index.ts +1 -0
- package/src/libs/feature/editor/src/lib/fields.config.ts +85 -1
- package/src/libs/feature/router/src/lib/default/state/query-params.utils.ts +5 -2
- package/src/libs/feature/router/src/lib/default/state/router.facade.ts +2 -1
- package/src/libs/ui/elements/src/lib/metadata-quality-item/metadata-quality-item.component.ts +6 -6
- package/src/libs/ui/elements/src/lib/service-capabilities/service-capabilities.component.ts +0 -6
- package/src/libs/util/app-config/src/lib/fixtures.ts +1 -1
- package/src/libs/util/app-config/src/lib/parse-utils.ts +4 -7
- package/src/libs/util/i18n/src/lib/language-codes.ts +62 -11
- package/src/libs/util/shared/src/lib/record/quality-score.util.ts +10 -3
- package/translations/de.json +42 -20
- package/translations/en.json +43 -21
- package/translations/es.json +29 -7
- package/translations/fr.json +47 -25
- package/translations/it.json +42 -20
- package/translations/nl.json +29 -7
- package/translations/pt.json +29 -7
- package/translations/sk.json +33 -11
- package/esm2022/libs/api/repository/src/lib/metadata-language.mjs +0 -3
- package/esm2022/libs/util/app-config/src/lib/constants.mjs +0 -439
- package/libs/api/repository/src/lib/metadata-language.d.ts +0 -3
- package/libs/api/repository/src/lib/metadata-language.d.ts.map +0 -1
- package/libs/util/app-config/src/lib/constants.d.ts +0 -2
- package/libs/util/app-config/src/lib/constants.d.ts.map +0 -1
- package/src/libs/api/repository/src/lib/metadata-language.ts +0 -3
|
@@ -28,10 +28,7 @@ import { matchProtocol } from '../common/distribution.mapper'
|
|
|
28
28
|
import { Thesaurus } from './types'
|
|
29
29
|
import { getResourceType, getReuseType } from '../common/resource-types'
|
|
30
30
|
import { TranslateService } from '@ngx-translate/core'
|
|
31
|
-
import {
|
|
32
|
-
getLang2FromLang3,
|
|
33
|
-
getLocalizedIndexKey,
|
|
34
|
-
} from '../../../../../../libs/util/i18n/src'
|
|
31
|
+
import { toLang2, toLang3 } from '../../../../../../libs/util/i18n/src'
|
|
35
32
|
|
|
36
33
|
type ESResponseSource = SourceWithUnknownProps
|
|
37
34
|
|
|
@@ -49,8 +46,8 @@ export class Gn4FieldMapper {
|
|
|
49
46
|
private translateService: TranslateService
|
|
50
47
|
) {}
|
|
51
48
|
|
|
52
|
-
private get
|
|
53
|
-
return
|
|
49
|
+
private get getLocalizedIndexKey() {
|
|
50
|
+
return `lang${toLang3(this.translateService.currentLang)}`
|
|
54
51
|
}
|
|
55
52
|
|
|
56
53
|
protected fields: Record<string, EsFieldMapperFn> = {
|
|
@@ -69,14 +66,22 @@ export class Gn4FieldMapper {
|
|
|
69
66
|
resourceTitleObject: (output, source) => ({
|
|
70
67
|
...output,
|
|
71
68
|
title: selectFallback(
|
|
72
|
-
selectTranslatedField(
|
|
69
|
+
selectTranslatedField(
|
|
70
|
+
source,
|
|
71
|
+
'resourceTitleObject',
|
|
72
|
+
this.getLocalizedIndexKey
|
|
73
|
+
),
|
|
73
74
|
'no title'
|
|
74
75
|
),
|
|
75
76
|
}),
|
|
76
77
|
resourceAbstractObject: (output, source) => ({
|
|
77
78
|
...output,
|
|
78
79
|
abstract: selectFallback(
|
|
79
|
-
selectTranslatedField(
|
|
80
|
+
selectTranslatedField(
|
|
81
|
+
source,
|
|
82
|
+
'resourceAbstractObject',
|
|
83
|
+
this.getLocalizedIndexKey
|
|
84
|
+
),
|
|
80
85
|
'no title'
|
|
81
86
|
),
|
|
82
87
|
}),
|
|
@@ -84,7 +89,7 @@ export class Gn4FieldMapper {
|
|
|
84
89
|
const firstOverview = getFirstValue(selectField(source, 'overview'))
|
|
85
90
|
const description = selectTranslatedValue<string>(
|
|
86
91
|
selectField(firstOverview, 'text'),
|
|
87
|
-
this.
|
|
92
|
+
this.getLocalizedIndexKey
|
|
88
93
|
)
|
|
89
94
|
return {
|
|
90
95
|
...output,
|
|
@@ -102,7 +107,9 @@ export class Gn4FieldMapper {
|
|
|
102
107
|
...(output.topics || []),
|
|
103
108
|
...getAsArray(
|
|
104
109
|
selectField<SourceWithUnknownProps[]>(source, 'cl_topic')
|
|
105
|
-
).map((topic) =>
|
|
110
|
+
).map((topic) =>
|
|
111
|
+
selectTranslatedValue<string>(topic, this.getLocalizedIndexKey)
|
|
112
|
+
),
|
|
106
113
|
],
|
|
107
114
|
}),
|
|
108
115
|
cl_status: (output, source) => ({
|
|
@@ -156,7 +163,7 @@ export class Gn4FieldMapper {
|
|
|
156
163
|
const langList = getAsArray(
|
|
157
164
|
selectField<string>(source, 'resourceLanguage')
|
|
158
165
|
)
|
|
159
|
-
const languages = langList.map(
|
|
166
|
+
const languages = langList.map(toLang2)
|
|
160
167
|
const defaultLanguage = output.defaultLanguage ?? languages[0] ?? null // set the first language as main one as fallback
|
|
161
168
|
|
|
162
169
|
return {
|
|
@@ -166,7 +173,7 @@ export class Gn4FieldMapper {
|
|
|
166
173
|
},
|
|
167
174
|
otherLanguage: (output, source) => {
|
|
168
175
|
const langList = getAsArray(selectField<string>(source, 'otherLanguage'))
|
|
169
|
-
const languages = langList.map(
|
|
176
|
+
const languages = langList.map(toLang2)
|
|
170
177
|
const defaultLanguage = output.defaultLanguage ?? languages[0] ?? null
|
|
171
178
|
const otherLanguages = languages.filter(
|
|
172
179
|
(lang) => lang !== defaultLanguage
|
|
@@ -181,7 +188,7 @@ export class Gn4FieldMapper {
|
|
|
181
188
|
const language = selectField<string>(source, 'mainLanguage')
|
|
182
189
|
return {
|
|
183
190
|
...output,
|
|
184
|
-
defaultLanguage: language ?
|
|
191
|
+
defaultLanguage: language ? toLang2(language) : null,
|
|
185
192
|
}
|
|
186
193
|
},
|
|
187
194
|
link: (output, source) => {
|
|
@@ -199,7 +206,10 @@ export class Gn4FieldMapper {
|
|
|
199
206
|
contact: (output, source) => ({
|
|
200
207
|
...output,
|
|
201
208
|
contacts: [
|
|
202
|
-
mapContact(
|
|
209
|
+
mapContact(
|
|
210
|
+
getFirstValue(selectField(source, 'contact')),
|
|
211
|
+
this.getLocalizedIndexKey
|
|
212
|
+
),
|
|
203
213
|
],
|
|
204
214
|
}),
|
|
205
215
|
contactForResource: (output, source) => ({
|
|
@@ -210,7 +220,7 @@ export class Gn4FieldMapper {
|
|
|
210
220
|
? output.contactsForResource
|
|
211
221
|
: []),
|
|
212
222
|
...getAsArray(selectField(source, 'contactForResource')).map(
|
|
213
|
-
(contact) => mapContact(contact, this.
|
|
223
|
+
(contact) => mapContact(contact, this.getLocalizedIndexKey)
|
|
214
224
|
),
|
|
215
225
|
],
|
|
216
226
|
}),
|
|
@@ -229,7 +239,7 @@ export class Gn4FieldMapper {
|
|
|
229
239
|
...output,
|
|
230
240
|
keywords: mapKeywords(
|
|
231
241
|
selectField<Thesaurus[]>(source, 'allKeywords'),
|
|
232
|
-
this.
|
|
242
|
+
this.getLocalizedIndexKey
|
|
233
243
|
),
|
|
234
244
|
}),
|
|
235
245
|
inspireTheme: (output, source) => ({
|
|
@@ -277,7 +287,11 @@ export class Gn4FieldMapper {
|
|
|
277
287
|
),
|
|
278
288
|
lineageObject: (output, source) => ({
|
|
279
289
|
...output,
|
|
280
|
-
lineage: selectTranslatedField(
|
|
290
|
+
lineage: selectTranslatedField(
|
|
291
|
+
source,
|
|
292
|
+
'lineageObject',
|
|
293
|
+
this.getLocalizedIndexKey
|
|
294
|
+
),
|
|
281
295
|
}),
|
|
282
296
|
userSavedCount: (output, source) =>
|
|
283
297
|
this.addExtra(
|
|
@@ -410,7 +424,7 @@ export class Gn4FieldMapper {
|
|
|
410
424
|
...geoms.map((geom, index) => {
|
|
411
425
|
const description = selectTranslatedValue(
|
|
412
426
|
getArrayItem(extentDescriptions, index),
|
|
413
|
-
this.
|
|
427
|
+
this.getLocalizedIndexKey
|
|
414
428
|
)
|
|
415
429
|
const geometry = shapes[index] ?? geom
|
|
416
430
|
return {
|
|
@@ -465,7 +479,10 @@ export class Gn4FieldMapper {
|
|
|
465
479
|
outputField in output ? output[outputField] : []
|
|
466
480
|
outputArray.push(
|
|
467
481
|
...constraintArray.map((item) => {
|
|
468
|
-
const text = selectTranslatedValue(
|
|
482
|
+
const text = selectTranslatedValue(
|
|
483
|
+
item,
|
|
484
|
+
this.getLocalizedIndexKey
|
|
485
|
+
) as string
|
|
469
486
|
const url = getAsUrl(selectField(item, 'link'))
|
|
470
487
|
return {
|
|
471
488
|
text,
|
|
@@ -508,19 +525,27 @@ export class Gn4FieldMapper {
|
|
|
508
525
|
mapLink = (sourceLink: SourceWithUnknownProps): OnlineResource | null => {
|
|
509
526
|
const url = getAsUrl(
|
|
510
527
|
selectFallback(
|
|
511
|
-
selectTranslatedField<string>(
|
|
528
|
+
selectTranslatedField<string>(
|
|
529
|
+
sourceLink,
|
|
530
|
+
'urlObject',
|
|
531
|
+
this.getLocalizedIndexKey
|
|
532
|
+
),
|
|
512
533
|
selectField<string>(sourceLink, 'url')
|
|
513
534
|
)
|
|
514
535
|
)
|
|
515
536
|
const name = selectFallback(
|
|
516
|
-
selectTranslatedField<string>(
|
|
537
|
+
selectTranslatedField<string>(
|
|
538
|
+
sourceLink,
|
|
539
|
+
'nameObject',
|
|
540
|
+
this.getLocalizedIndexKey
|
|
541
|
+
),
|
|
517
542
|
selectField<string>(sourceLink, 'name')
|
|
518
543
|
)
|
|
519
544
|
const description = selectFallback(
|
|
520
545
|
selectTranslatedField<string>(
|
|
521
546
|
sourceLink,
|
|
522
547
|
'descriptionObject',
|
|
523
|
-
this.
|
|
548
|
+
this.getLocalizedIndexKey
|
|
524
549
|
),
|
|
525
550
|
selectField<string>(sourceLink, 'description')
|
|
526
551
|
)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Inject, Injectable } from '@angular/core'
|
|
2
2
|
import { Configuration } from '../../../../../../libs/data-access/gn4/src'
|
|
3
3
|
import { TranslateService } from '@ngx-translate/core'
|
|
4
|
-
import {
|
|
4
|
+
import { toLang3 } from '../../../../../../libs/util/i18n/src'
|
|
5
5
|
|
|
6
6
|
@Injectable({
|
|
7
7
|
providedIn: 'root',
|
|
@@ -14,7 +14,7 @@ export class MetadataUrlService {
|
|
|
14
14
|
|
|
15
15
|
getUrl(uuid: string, apiPath: string = this.apiConfiguration.basePath) {
|
|
16
16
|
const prefix = `${apiPath}/../`
|
|
17
|
-
return `${prefix}${
|
|
17
|
+
return `${prefix}${toLang3(
|
|
18
18
|
this.translate.currentLang
|
|
19
19
|
)}/catalog.search#/metadata/${uuid}`
|
|
20
20
|
}
|
|
@@ -41,7 +41,7 @@ import {
|
|
|
41
41
|
} from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
42
42
|
import { matchMimeType } from '../common/distribution.mapper'
|
|
43
43
|
import { fullNameToParts } from '../iso19139/utils/individual-name'
|
|
44
|
-
import {
|
|
44
|
+
import { toLang2 } from '../../../../../../libs/util/i18n/src/lib/language-codes'
|
|
45
45
|
import { getResourceType, getReuseType } from '../common/resource-types'
|
|
46
46
|
|
|
47
47
|
export function readKind(rootEl: XmlElement): RecordKind {
|
|
@@ -370,7 +370,7 @@ export function readLocaleElement(): ChainableFunction<
|
|
|
370
370
|
return pipe(
|
|
371
371
|
findChildElement('lan:LanguageCode'),
|
|
372
372
|
readAttribute('codeListValue'),
|
|
373
|
-
map((lang) =>
|
|
373
|
+
map((lang) => toLang2(lang?.toLowerCase()) ?? lang)
|
|
374
374
|
)
|
|
375
375
|
}
|
|
376
376
|
|
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
} from '../iso19139/write-parts'
|
|
50
50
|
import { findIdentification } from '../iso19139/read-parts'
|
|
51
51
|
import { namePartsToFull } from '../iso19139/utils/individual-name'
|
|
52
|
-
import {
|
|
52
|
+
import { toLang3 } from '../../../../../../libs/util/i18n/src/lib/language-codes'
|
|
53
53
|
import { kindToCodeListValue } from '../common/resource-types'
|
|
54
54
|
|
|
55
55
|
export function writeUniqueIdentifier(
|
|
@@ -529,7 +529,7 @@ export function writeOnlineResources(
|
|
|
529
529
|
}
|
|
530
530
|
|
|
531
531
|
function writeLocaleElement(language: LanguageCode) {
|
|
532
|
-
const lang3 =
|
|
532
|
+
const lang3 = toLang3(language.toLowerCase()) ?? language
|
|
533
533
|
return pipe(
|
|
534
534
|
findChildOrCreate('lan:PT_Locale'),
|
|
535
535
|
writeAttribute('id', language.toUpperCase()),
|
|
@@ -55,7 +55,7 @@ import { getKeywordTypeFromKeywordTypeCode } from './utils/keyword.mapper'
|
|
|
55
55
|
import { getRoleFromRoleCode } from './utils/role.mapper'
|
|
56
56
|
import { getStatusFromStatusCode } from './utils/status.mapper'
|
|
57
57
|
import { getUpdateFrequencyFromFrequencyCode } from './utils/update-frequency.mapper'
|
|
58
|
-
import {
|
|
58
|
+
import { toLang2 } from '../../../../../../libs/util/i18n/src/lib/language-codes'
|
|
59
59
|
import { getResourceType, getReuseType } from '../common/resource-types'
|
|
60
60
|
|
|
61
61
|
export function extractCharacterString(): ChainableFunction<
|
|
@@ -1164,7 +1164,7 @@ export function readOtherLanguages(rootEl: XmlElement): LanguageCode[] {
|
|
|
1164
1164
|
pipe(
|
|
1165
1165
|
findChildElement('lan:LanguageCode'),
|
|
1166
1166
|
readAttribute('codeListValue'),
|
|
1167
|
-
map((lang) =>
|
|
1167
|
+
map((lang) => toLang2(lang?.toLowerCase()) ?? lang)
|
|
1168
1168
|
)
|
|
1169
1169
|
),
|
|
1170
1170
|
map((languages) =>
|
|
@@ -1179,7 +1179,7 @@ export function readDefaultLanguage(rootEl: XmlElement): LanguageCode {
|
|
|
1179
1179
|
findChildElement('gmd:language', false),
|
|
1180
1180
|
findChildElement('lan:LanguageCode'),
|
|
1181
1181
|
readAttribute('codeListValue'),
|
|
1182
|
-
map((lang) => (lang ?
|
|
1182
|
+
map((lang) => (lang ? toLang2(lang.toLowerCase()) : null))
|
|
1183
1183
|
)(rootEl)
|
|
1184
1184
|
}
|
|
1185
1185
|
|
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
import { readKind } from './read-parts'
|
|
54
54
|
import { writeGeometry } from './utils/geometry'
|
|
55
55
|
import { namePartsToFull } from './utils/individual-name'
|
|
56
|
-
import {
|
|
56
|
+
import { toLang3 } from '../../../../../../libs/util/i18n/src/lib/language-codes'
|
|
57
57
|
import { kindToCodeListValue } from '../common/resource-types'
|
|
58
58
|
|
|
59
59
|
function writeLocalizedElement(
|
|
@@ -1300,7 +1300,7 @@ export function createOnlineResource(onlineResource: ServiceOnlineResource) {
|
|
|
1300
1300
|
}
|
|
1301
1301
|
|
|
1302
1302
|
export function appendDatasetOnlineResources(
|
|
1303
|
-
record: DatasetRecord,
|
|
1303
|
+
record: DatasetRecord | ReuseRecord,
|
|
1304
1304
|
rootEl: XmlElement
|
|
1305
1305
|
) {
|
|
1306
1306
|
appendChildren(
|
|
@@ -1319,7 +1319,7 @@ export function appendDatasetOnlineResources(
|
|
|
1319
1319
|
}
|
|
1320
1320
|
|
|
1321
1321
|
export function appendServiceOnlineResources(
|
|
1322
|
-
record: ServiceRecord
|
|
1322
|
+
record: ServiceRecord,
|
|
1323
1323
|
rootEl: XmlElement
|
|
1324
1324
|
) {
|
|
1325
1325
|
appendChildren(...record.onlineResources.map(createOnlineResource))(rootEl)
|
|
@@ -1331,7 +1331,7 @@ export function writeOnlineResources(
|
|
|
1331
1331
|
) {
|
|
1332
1332
|
removeOnlineResources()(rootEl)
|
|
1333
1333
|
|
|
1334
|
-
if (record.kind === 'dataset') {
|
|
1334
|
+
if (record.kind === 'dataset' || record.kind === 'reuse') {
|
|
1335
1335
|
appendDatasetOnlineResources(record, rootEl)
|
|
1336
1336
|
return
|
|
1337
1337
|
}
|
|
@@ -1476,7 +1476,7 @@ export function writeLanguages(record: DatasetRecord, rootEl: XmlElement) {
|
|
|
1476
1476
|
writeAttribute('id', lang.toUpperCase()),
|
|
1477
1477
|
createNestedChild('gmd:languageCode', 'gmd:LanguageCode'),
|
|
1478
1478
|
writeAttribute('codeList', 'http://www.loc.gov/standards/iso639-2/'),
|
|
1479
|
-
writeAttribute('codeListValue',
|
|
1479
|
+
writeAttribute('codeListValue', toLang3(lang) ?? lang)
|
|
1480
1480
|
)
|
|
1481
1481
|
|
|
1482
1482
|
// add new languages (only if other than default one)
|
|
@@ -1490,7 +1490,7 @@ export function writeDefaultLanguage(
|
|
|
1490
1490
|
record: DatasetRecord,
|
|
1491
1491
|
rootEl: XmlElement
|
|
1492
1492
|
) {
|
|
1493
|
-
const lang3 =
|
|
1493
|
+
const lang3 = toLang3(record.defaultLanguage.toLowerCase())
|
|
1494
1494
|
return pipe(
|
|
1495
1495
|
findNestedChildOrCreate('gmd:language', 'gmd:LanguageCode'),
|
|
1496
1496
|
writeAttribute('codeList', 'http://www.loc.gov/standards/iso639-2/'),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Inject, Injectable, InjectionToken, Optional } from '@angular/core'
|
|
2
|
-
import {
|
|
2
|
+
import { toLang2, toLang3 } from '../../../../../../../libs/util/i18n/src'
|
|
3
3
|
import { TranslateService } from '@ngx-translate/core'
|
|
4
4
|
import { Location } from '@angular/common'
|
|
5
5
|
|
|
@@ -35,8 +35,8 @@ export class AuthService {
|
|
|
35
35
|
'${current_url}',
|
|
36
36
|
new URL(this.location.path(), window.location.href).toString()
|
|
37
37
|
)
|
|
38
|
-
.replace('${lang2}', this.translateService.currentLang)
|
|
39
|
-
.replace('${lang3}',
|
|
38
|
+
.replace('${lang2}', toLang2(this.translateService.currentLang))
|
|
39
|
+
.replace('${lang3}', toLang3(this.translateService.currentLang))
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
get logoutUrl() {
|
|
@@ -46,7 +46,7 @@ export class AuthService {
|
|
|
46
46
|
get settingsUrl() {
|
|
47
47
|
return this.baseSettingsUrl.replace(
|
|
48
48
|
'${lang3}',
|
|
49
|
-
|
|
49
|
+
toLang3(this.translateService.currentLang)
|
|
50
50
|
)
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
FiltersAggregationParams,
|
|
16
16
|
SortByField,
|
|
17
17
|
} from '../../../../../../../libs/common/domain/src/lib/model/search'
|
|
18
|
-
import { METADATA_LANGUAGE } from '../../metadata-language'
|
|
18
|
+
import { METADATA_LANGUAGE } from '../../metadata-language.token'
|
|
19
19
|
import {
|
|
20
20
|
AggregationResult,
|
|
21
21
|
EsSearchParams,
|
|
@@ -26,9 +26,12 @@ import {
|
|
|
26
26
|
SortParams,
|
|
27
27
|
TermsAggregationResult,
|
|
28
28
|
} from '../../../../../../../libs/api/metadata-converter/src'
|
|
29
|
-
import {
|
|
29
|
+
import { toLang3 } from '../../../../../../../libs/util/i18n/src'
|
|
30
30
|
import { formatDate, isDateRange } from './date-range.utils'
|
|
31
|
-
import {
|
|
31
|
+
import {
|
|
32
|
+
CatalogRecord,
|
|
33
|
+
LanguageCode,
|
|
34
|
+
} from '../../../../../../../libs/common/domain/src/lib/model/record'
|
|
32
35
|
import { TranslateService } from '@ngx-translate/core'
|
|
33
36
|
import { getGeometryBoundingBox } from '../../../../../../../libs/util/shared/src'
|
|
34
37
|
import { getLength as getGeodesicLength } from 'ol/sphere'
|
|
@@ -45,11 +48,9 @@ export class ElasticsearchService {
|
|
|
45
48
|
private runtimeFields: Record<string, string> = {}
|
|
46
49
|
|
|
47
50
|
// we're using getters in case the defined languages change over time
|
|
48
|
-
private get
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
private get metadataLang() {
|
|
52
|
-
return this.injector.get(METADATA_LANGUAGE, null)
|
|
51
|
+
private get metadataLang(): LanguageCode {
|
|
52
|
+
const mdLangValue = this.injector.get(METADATA_LANGUAGE, null)
|
|
53
|
+
return typeof mdLangValue === 'function' ? mdLangValue() : mdLangValue
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
constructor(
|
|
@@ -233,9 +234,12 @@ export class ElasticsearchService {
|
|
|
233
234
|
|
|
234
235
|
private getQueryLang(): string {
|
|
235
236
|
if (this.metadataLang) {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
237
|
+
const lang3 = toLang3(
|
|
238
|
+
this.isCurrentSearchLang()
|
|
239
|
+
? this.translateService.currentLang
|
|
240
|
+
: this.metadataLang
|
|
241
|
+
)
|
|
242
|
+
return `lang${lang3}`
|
|
239
243
|
} else return '*'
|
|
240
244
|
}
|
|
241
245
|
private isCurrentSearchLang() {
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
import { catchError, map, tap } from 'rxjs/operators'
|
|
49
49
|
import { lt } from 'semver'
|
|
50
50
|
import { ElasticsearchService } from './elasticsearch'
|
|
51
|
-
import {
|
|
51
|
+
import { toLang2 } from '../../../../../../libs/util/i18n/src'
|
|
52
52
|
import { Gn4SettingsService } from './settings/gn4-settings.service'
|
|
53
53
|
|
|
54
54
|
const minPublicationApiVersion = '4.2.5'
|
|
@@ -562,7 +562,7 @@ export class Gn4Repository implements RecordsRepositoryInterface {
|
|
|
562
562
|
.pipe(
|
|
563
563
|
map((languages) =>
|
|
564
564
|
languages
|
|
565
|
-
.map((lang) =>
|
|
565
|
+
.map((lang) => toLang2(lang.id))
|
|
566
566
|
.filter((code): code is string => !!code)
|
|
567
567
|
)
|
|
568
568
|
)
|
package/src/libs/api/repository/src/lib/gn4/organizations/organizations-from-groups.service.ts
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import { forkJoin, Observable, of } from 'rxjs'
|
|
8
8
|
import { map, shareReplay } from 'rxjs/operators'
|
|
9
9
|
import { TranslateService } from '@ngx-translate/core'
|
|
10
|
-
import {
|
|
10
|
+
import { toLang3 } from '../../../../../../../libs/util/i18n/src'
|
|
11
11
|
import { FieldFilters } from '../../../../../../../libs/common/domain/src/lib/model/search'
|
|
12
12
|
import {
|
|
13
13
|
CatalogRecord,
|
|
@@ -52,7 +52,7 @@ export class OrganizationsFromGroupsService
|
|
|
52
52
|
organisationsCount$ = this.organisations$.pipe(map((orgs) => orgs.length))
|
|
53
53
|
|
|
54
54
|
private get lang3() {
|
|
55
|
-
return
|
|
55
|
+
return toLang3(this.translateService.currentLang)
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
constructor(
|
package/src/libs/api/repository/src/lib/gn4/organizations/organizations-from-metadata.service.ts
CHANGED
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
tap,
|
|
34
34
|
withLatestFrom,
|
|
35
35
|
} from 'rxjs/operators'
|
|
36
|
-
import {
|
|
36
|
+
import { toLang3 } from '../../../../../../../libs/util/i18n/src'
|
|
37
37
|
import { PlatformServiceInterface } from '../../../../../../../libs/common/domain/src/lib/platform.service.interface'
|
|
38
38
|
import { coerce, satisfies, valid } from 'semver'
|
|
39
39
|
import { TranslateService } from '@ngx-translate/core'
|
|
@@ -126,7 +126,7 @@ export class OrganizationsFromMetadataService
|
|
|
126
126
|
) {}
|
|
127
127
|
|
|
128
128
|
private get langIndex() {
|
|
129
|
-
return
|
|
129
|
+
return `lang${toLang3(this.translateService.currentLang)}`
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
equalsNormalizedStrings(
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
MeApiService,
|
|
12
12
|
RecordsApiService,
|
|
13
13
|
RegistriesApiService,
|
|
14
|
-
SiteApiService,
|
|
15
14
|
ToolsApiService,
|
|
16
15
|
UserfeedbackApiService,
|
|
17
16
|
UsersApiService,
|
|
@@ -45,7 +44,8 @@ import {
|
|
|
45
44
|
throwError,
|
|
46
45
|
} from 'rxjs'
|
|
47
46
|
import { TranslateService } from '@ngx-translate/core'
|
|
48
|
-
import {
|
|
47
|
+
import { toLang3 } from '../../../../../../../libs/util/i18n/src'
|
|
48
|
+
import { Gn4SettingsService } from '../settings/gn4-settings.service'
|
|
49
49
|
|
|
50
50
|
const minApiVersion = '4.2.2'
|
|
51
51
|
|
|
@@ -66,31 +66,6 @@ export class Gn4PlatformService implements PlatformServiceInterface {
|
|
|
66
66
|
}),
|
|
67
67
|
shareReplay(1)
|
|
68
68
|
)
|
|
69
|
-
|
|
70
|
-
private settings$ = of(true).pipe(
|
|
71
|
-
switchMap(() => this.siteApiService.getSiteOrPortalDescription()),
|
|
72
|
-
shareReplay(1)
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
private readonly apiVersion$ = this.settings$.pipe(
|
|
76
|
-
map((info) => info['system/platform/version'] as string),
|
|
77
|
-
tap((version) => {
|
|
78
|
-
if (ltr(version, minApiVersion)) {
|
|
79
|
-
throw new Error(
|
|
80
|
-
`Gn4 API version is not compatible.\nMinimum: ${minApiVersion}\nYour version: ${version}`
|
|
81
|
-
)
|
|
82
|
-
}
|
|
83
|
-
}),
|
|
84
|
-
shareReplay(1)
|
|
85
|
-
)
|
|
86
|
-
|
|
87
|
-
private readonly allowEditHarvestedMd$ = this.settings$.pipe(
|
|
88
|
-
map((info) => {
|
|
89
|
-
return info['system/harvester/enableEditing'] as boolean
|
|
90
|
-
}),
|
|
91
|
-
shareReplay(1)
|
|
92
|
-
)
|
|
93
|
-
|
|
94
69
|
/**
|
|
95
70
|
* A map of already loaded thesauri (groups of keywords); the key is a URI
|
|
96
71
|
* @private
|
|
@@ -98,11 +73,10 @@ export class Gn4PlatformService implements PlatformServiceInterface {
|
|
|
98
73
|
private keywordsByThesauri: Record<string, Observable<Keyword[]>> = {}
|
|
99
74
|
|
|
100
75
|
private get lang3() {
|
|
101
|
-
return
|
|
76
|
+
return toLang3(this.translateService.currentLang)
|
|
102
77
|
}
|
|
103
78
|
|
|
104
79
|
constructor(
|
|
105
|
-
private siteApiService: SiteApiService,
|
|
106
80
|
private meApi: MeApiService,
|
|
107
81
|
private usersApi: UsersApiService,
|
|
108
82
|
private mapper: Gn4PlatformMapper,
|
|
@@ -111,7 +85,8 @@ export class Gn4PlatformService implements PlatformServiceInterface {
|
|
|
111
85
|
private translateService: TranslateService,
|
|
112
86
|
private userfeedbackApiService: UserfeedbackApiService,
|
|
113
87
|
private httpClient: HttpClient,
|
|
114
|
-
private recordsApiService: RecordsApiService
|
|
88
|
+
private recordsApiService: RecordsApiService,
|
|
89
|
+
private settingsService: Gn4SettingsService
|
|
115
90
|
) {
|
|
116
91
|
this.me$ = this.meApi.getMe().pipe(
|
|
117
92
|
switchMap((apiUser) => this.mapper.userFromMeApi(apiUser)),
|
|
@@ -128,16 +103,28 @@ export class Gn4PlatformService implements PlatformServiceInterface {
|
|
|
128
103
|
)
|
|
129
104
|
}
|
|
130
105
|
|
|
106
|
+
getFeedbacksAllowed(): Observable<boolean> {
|
|
107
|
+
return this.settingsService.allowFeedbacks$
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
getAllowEditHarvestedMd(): Observable<boolean> {
|
|
111
|
+
return this.settingsService.allowEditHarvested$
|
|
112
|
+
}
|
|
113
|
+
|
|
131
114
|
getType(): string {
|
|
132
115
|
return this.type
|
|
133
116
|
}
|
|
134
117
|
|
|
135
118
|
getApiVersion(): Observable<string> {
|
|
136
|
-
return this.apiVersion
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
119
|
+
return this.settingsService.apiVersion$.pipe(
|
|
120
|
+
tap((version) => {
|
|
121
|
+
if (ltr(version, minApiVersion)) {
|
|
122
|
+
throw new Error(
|
|
123
|
+
`Gn4 API version is not compatible.\nMinimum: ${minApiVersion}\nYour version: ${version}`
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
})
|
|
127
|
+
)
|
|
141
128
|
}
|
|
142
129
|
|
|
143
130
|
getMe(): Observable<UserModel> {
|
|
@@ -14,6 +14,14 @@ export class Gn4SettingsService {
|
|
|
14
14
|
public allowEditHarvested$: Observable<boolean> =
|
|
15
15
|
this.getSettingsSetValueByKey('system/harvester/enableEditing')
|
|
16
16
|
|
|
17
|
+
public allowFeedbacks$: Observable<boolean> = this.getSettingsSetValueByKey(
|
|
18
|
+
'system/userFeedback/enable'
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
public apiVersion$: Observable<string> = this.getSettingsSetValueByKey(
|
|
22
|
+
'system/platform/version'
|
|
23
|
+
)
|
|
24
|
+
|
|
17
25
|
constructor(private siteApiService: SiteApiService) {}
|
|
18
26
|
|
|
19
27
|
private getSettingsSetValueByKey(key: string) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core'
|
|
2
|
+
import { LanguageCode } from '../../../../../libs/common/domain/src/lib/model/record'
|
|
3
|
+
|
|
4
|
+
export type LanguageCodeFactory = () => LanguageCode
|
|
5
|
+
|
|
6
|
+
export const METADATA_LANGUAGE = new InjectionToken<
|
|
7
|
+
LanguageCode | LanguageCodeFactory
|
|
8
|
+
>('metadata-language')
|
|
@@ -108,6 +108,11 @@ export interface Keyword {
|
|
|
108
108
|
translations?: KeywordTranslations
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
+
export interface INSPIRE_theme {
|
|
112
|
+
value: string
|
|
113
|
+
label: string
|
|
114
|
+
}
|
|
115
|
+
|
|
111
116
|
export interface BaseRecord {
|
|
112
117
|
uniqueIdentifier: Uuid
|
|
113
118
|
ownerOrganization: Organization
|
|
@@ -269,7 +274,7 @@ export interface ServiceRecord extends BaseRecord {
|
|
|
269
274
|
export interface ReuseRecord extends BaseRecord {
|
|
270
275
|
kind: 'reuse'
|
|
271
276
|
lineage: string // Explanation of the origin of this record (e.g: how, why)"
|
|
272
|
-
onlineResources: Array<
|
|
277
|
+
onlineResources: Array<DatasetOnlineResource>
|
|
273
278
|
reuseType: ReuseType
|
|
274
279
|
spatialExtents: Array<DatasetSpatialExtent>
|
|
275
280
|
temporalExtents: Array<DatasetTemporalExtent>
|
|
@@ -4,7 +4,7 @@ import { Observable } from 'rxjs'
|
|
|
4
4
|
import { filter, map, shareReplay } from 'rxjs/operators'
|
|
5
5
|
import { CatalogSource } from './sources.model'
|
|
6
6
|
import { TranslateService } from '@ngx-translate/core'
|
|
7
|
-
import {
|
|
7
|
+
import { toLang3 } from '../../../../../../libs/util/i18n/src'
|
|
8
8
|
|
|
9
9
|
@Injectable({
|
|
10
10
|
providedIn: 'root',
|
|
@@ -23,10 +23,7 @@ export class SourcesService {
|
|
|
23
23
|
return this.sources$.pipe(
|
|
24
24
|
map((sources) => sources.filter((source) => source.uuid === uuid)[0]),
|
|
25
25
|
filter((source) => !!source),
|
|
26
|
-
map(
|
|
27
|
-
(source) =>
|
|
28
|
-
source.label[getLang3FromLang2(this.translateService.currentLang)]
|
|
29
|
-
)
|
|
26
|
+
map((source) => source.label[toLang3(this.translateService.currentLang)])
|
|
30
27
|
)
|
|
31
28
|
}
|
|
32
29
|
}
|