geonetwork-ui 2.6.0-dev.87d6e6c1b → 2.6.0-dev.913451557
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/dcat-ap.converter.mjs +11 -2
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.mjs +14 -6
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +2 -2
- package/esm2022/libs/api/metadata-converter/src/lib/translate-utils.mjs +17 -0
- package/esm2022/libs/api/repository/src/lib/gn4/gn4-repository.mjs +1 -1
- package/esm2022/libs/common/domain/src/lib/repository/records-repository.interface.mjs +1 -1
- package/esm2022/libs/feature/editor/src/lib/+state/editor.actions.mjs +2 -1
- package/esm2022/libs/feature/editor/src/lib/+state/editor.effects.mjs +13 -7
- package/esm2022/libs/feature/editor/src/lib/+state/editor.facade.mjs +4 -1
- package/esm2022/libs/feature/editor/src/lib/+state/editor.reducer.mjs +5 -1
- package/esm2022/libs/feature/editor/src/lib/components/multilingual-panel/multilingual-panel.component.mjs +7 -6
- package/esm2022/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.mjs +8 -5
- package/esm2022/libs/feature/search/src/lib/results-list/results-list.container.component.mjs +1 -1
- package/esm2022/libs/ui/elements/src/lib/confirmation-dialog/confirmation-dialog.component.mjs +5 -3
- package/esm2022/libs/ui/inputs/src/lib/star-toggle/star-toggle.component.mjs +7 -3
- package/esm2022/libs/ui/search/src/lib/results-table/results-table.component.mjs +8 -4
- package/esm2022/libs/util/i18n/src/lib/language-codes.mjs +3 -3
- package/esm2022/libs/util/shared/src/index.mjs +2 -1
- package/esm2022/libs/util/shared/src/lib/record.util.mjs +56 -0
- package/esm2022/translations/de.json +1 -0
- package/esm2022/translations/en.json +2 -1
- package/esm2022/translations/es.json +1 -0
- package/esm2022/translations/fr.json +6 -5
- package/esm2022/translations/it.json +1 -0
- package/esm2022/translations/nl.json +1 -0
- package/esm2022/translations/pt.json +1 -0
- package/esm2022/translations/sk.json +1 -0
- package/fesm2022/geonetwork-ui.mjs +162 -40
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/api/metadata-converter/src/lib/dcat-ap/dcat-ap.converter.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/translate-utils.d.ts +2 -0
- package/libs/api/metadata-converter/src/lib/translate-utils.d.ts.map +1 -0
- package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts +2 -2
- package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts.map +1 -1
- package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts +2 -2
- package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/+state/editor.actions.d.ts +8 -1
- package/libs/feature/editor/src/lib/+state/editor.actions.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/+state/editor.effects.d.ts +10 -12
- package/libs/feature/editor/src/lib/+state/editor.effects.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/+state/editor.facade.d.ts +2 -1
- package/libs/feature/editor/src/lib/+state/editor.facade.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/+state/editor.reducer.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/multilingual-panel/multilingual-panel.component.d.ts.map +1 -1
- package/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.d.ts +2 -1
- package/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/confirmation-dialog/confirmation-dialog.component.d.ts +2 -0
- package/libs/ui/elements/src/lib/confirmation-dialog/confirmation-dialog.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/star-toggle/star-toggle.component.d.ts +2 -1
- package/libs/ui/inputs/src/lib/star-toggle/star-toggle.component.d.ts.map +1 -1
- package/libs/ui/search/src/lib/results-table/results-table.component.d.ts.map +1 -1
- package/libs/util/shared/src/index.d.ts +1 -0
- package/libs/util/shared/src/index.d.ts.map +1 -1
- package/libs/util/shared/src/lib/record.util.d.ts +3 -0
- package/libs/util/shared/src/lib/record.util.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/libs/api/metadata-converter/src/lib/dcat-ap/dcat-ap.converter.ts +10 -1
- package/src/libs/api/metadata-converter/src/lib/fixtures/metadata-for-i18n.records.ts +4196 -0
- package/src/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.ts +14 -8
- package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +2 -1
- package/src/libs/api/metadata-converter/src/lib/translate-utils.ts +17 -0
- package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +2 -1
- package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +6 -2
- package/src/libs/common/fixtures/src/lib/records.fixtures.ts +52 -0
- package/src/libs/feature/editor/src/lib/+state/editor.actions.ts +9 -1
- package/src/libs/feature/editor/src/lib/+state/editor.effects.ts +23 -12
- package/src/libs/feature/editor/src/lib/+state/editor.facade.ts +13 -1
- package/src/libs/feature/editor/src/lib/+state/editor.reducer.ts +9 -1
- package/src/libs/feature/editor/src/lib/components/multilingual-panel/multilingual-panel.component.ts +9 -8
- package/src/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.html +1 -0
- package/src/libs/feature/search/src/lib/favorites/favorite-star/favorite-star.component.ts +2 -1
- package/src/libs/ui/elements/src/lib/confirmation-dialog/confirmation-dialog.component.html +6 -2
- package/src/libs/ui/elements/src/lib/confirmation-dialog/confirmation-dialog.component.ts +5 -1
- package/src/libs/ui/inputs/src/lib/star-toggle/star-toggle.component.css +0 -1
- package/src/libs/ui/inputs/src/lib/star-toggle/star-toggle.component.html +5 -1
- package/src/libs/ui/inputs/src/lib/star-toggle/star-toggle.component.ts +3 -1
- package/src/libs/ui/search/src/lib/results-table/results-table.component.html +0 -2
- package/src/libs/ui/search/src/lib/results-table/results-table.component.ts +6 -3
- package/src/libs/util/i18n/src/lib/language-codes.ts +2 -2
- package/src/libs/util/shared/src/index.ts +1 -0
- package/src/libs/util/shared/src/lib/record.util.ts +114 -0
- package/translations/de.json +1 -0
- package/translations/en.json +2 -1
- package/translations/es.json +1 -0
- package/translations/fr.json +6 -5
- package/translations/it.json +1 -0
- package/translations/nl.json +1 -0
- package/translations/pt.json +1 -0
- package/translations/sk.json +1 -0
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseRecord,
|
|
3
|
+
CatalogRecord,
|
|
4
|
+
Constraint,
|
|
5
|
+
DatasetDownloadDistribution,
|
|
6
|
+
DatasetServiceDistribution,
|
|
7
|
+
DatasetSpatialExtent,
|
|
8
|
+
Keyword,
|
|
9
|
+
LanguageCode,
|
|
10
|
+
OnlineLinkResource,
|
|
11
|
+
Organization,
|
|
12
|
+
ServiceEndpoint,
|
|
13
|
+
} from '../../../../../libs/common/domain/src/lib/model/record'
|
|
14
|
+
|
|
15
|
+
type TranslatedRecordObjects =
|
|
16
|
+
| BaseRecord
|
|
17
|
+
| Constraint
|
|
18
|
+
| Keyword
|
|
19
|
+
| DatasetServiceDistribution
|
|
20
|
+
| DatasetDownloadDistribution
|
|
21
|
+
| OnlineLinkResource
|
|
22
|
+
| ServiceEndpoint
|
|
23
|
+
| DatasetSpatialExtent
|
|
24
|
+
| Organization
|
|
25
|
+
|
|
26
|
+
export function updateLanguages<T extends CatalogRecord>(
|
|
27
|
+
record: T,
|
|
28
|
+
defaultLanguage: LanguageCode,
|
|
29
|
+
otherLanguages: LanguageCode[]
|
|
30
|
+
): T {
|
|
31
|
+
function updateFieldTranslations<T extends TranslatedRecordObjects>(
|
|
32
|
+
target: T,
|
|
33
|
+
fieldName: string
|
|
34
|
+
): T {
|
|
35
|
+
const fieldTranslations = {}
|
|
36
|
+
for (const lang of otherLanguages) {
|
|
37
|
+
const prevValue =
|
|
38
|
+
record.defaultLanguage === lang
|
|
39
|
+
? target[fieldName]
|
|
40
|
+
: target.translations?.[fieldName]?.[lang]
|
|
41
|
+
fieldTranslations[lang] = prevValue ?? ''
|
|
42
|
+
}
|
|
43
|
+
const defaultPrevValue =
|
|
44
|
+
record.defaultLanguage === defaultLanguage
|
|
45
|
+
? target[fieldName]
|
|
46
|
+
: target.translations?.[fieldName]?.[defaultLanguage]
|
|
47
|
+
return {
|
|
48
|
+
...target,
|
|
49
|
+
[fieldName]: defaultPrevValue ?? '',
|
|
50
|
+
translations: {
|
|
51
|
+
...target.translations,
|
|
52
|
+
[fieldName]: fieldTranslations,
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function updateTranslations<T extends TranslatedRecordObjects>(
|
|
57
|
+
target: T,
|
|
58
|
+
fieldNames: string[]
|
|
59
|
+
): T {
|
|
60
|
+
let result: T = target
|
|
61
|
+
for (const field of fieldNames) {
|
|
62
|
+
result = updateFieldTranslations(result, field)
|
|
63
|
+
}
|
|
64
|
+
return result
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const updatedRecord = updateTranslations(record, [
|
|
68
|
+
'title',
|
|
69
|
+
'abstract',
|
|
70
|
+
'lineage',
|
|
71
|
+
])
|
|
72
|
+
updatedRecord.keywords = updatedRecord.keywords.map((k) =>
|
|
73
|
+
updateTranslations(k, ['label', 'description'])
|
|
74
|
+
)
|
|
75
|
+
updatedRecord.onlineResources = updatedRecord.onlineResources.map((o) =>
|
|
76
|
+
updateTranslations(o, ['name', 'description'])
|
|
77
|
+
)
|
|
78
|
+
updatedRecord.licenses = updatedRecord.licenses.map((l) =>
|
|
79
|
+
updateTranslations(l, ['text'])
|
|
80
|
+
)
|
|
81
|
+
updatedRecord.legalConstraints = updatedRecord.legalConstraints.map((c) =>
|
|
82
|
+
updateTranslations(c, ['text'])
|
|
83
|
+
)
|
|
84
|
+
updatedRecord.securityConstraints = updatedRecord.securityConstraints.map(
|
|
85
|
+
(c) => updateTranslations(c, ['text'])
|
|
86
|
+
)
|
|
87
|
+
updatedRecord.otherConstraints = updatedRecord.otherConstraints.map((c) =>
|
|
88
|
+
updateTranslations(c, ['text'])
|
|
89
|
+
)
|
|
90
|
+
updatedRecord.contacts = updatedRecord.contacts.map((c) => ({
|
|
91
|
+
...c,
|
|
92
|
+
organization: updateTranslations(c.organization, ['name']),
|
|
93
|
+
}))
|
|
94
|
+
updatedRecord.contactsForResource = updatedRecord.contactsForResource.map(
|
|
95
|
+
(c) => ({
|
|
96
|
+
...c,
|
|
97
|
+
organization: updateTranslations(c.organization, ['name']),
|
|
98
|
+
})
|
|
99
|
+
)
|
|
100
|
+
updatedRecord.ownerOrganization = updateTranslations(
|
|
101
|
+
updatedRecord.ownerOrganization,
|
|
102
|
+
['name']
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
if (updatedRecord.kind === 'dataset') {
|
|
106
|
+
updatedRecord.spatialExtents = updatedRecord.spatialExtents.map((e) =>
|
|
107
|
+
updateTranslations(e, ['description'])
|
|
108
|
+
)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
updatedRecord.defaultLanguage = defaultLanguage
|
|
112
|
+
updatedRecord.otherLanguages = otherLanguages
|
|
113
|
+
return updatedRecord
|
|
114
|
+
}
|
package/translations/de.json
CHANGED
|
@@ -280,6 +280,7 @@
|
|
|
280
280
|
"facets.block.title.tag.default": "Stichwort",
|
|
281
281
|
"facets.block.title.th_regions_tree.default": "Regionen",
|
|
282
282
|
"favorite.not.authenticated.tooltip": "<div><a href=' {link} '>Anmelden</a>, um auf diese Funktion zuzugreifen</div>",
|
|
283
|
+
"favorite.starToggle.label": "Zu Favoriten hinzufügen",
|
|
283
284
|
"feature.catalog.attribute.code": "Code",
|
|
284
285
|
"feature.catalog.attribute.definition": "Beschreibung",
|
|
285
286
|
"feature.catalog.attribute.name": "Name",
|
package/translations/en.json
CHANGED
|
@@ -232,7 +232,7 @@
|
|
|
232
232
|
"editor.record.lock.resourceType": "Records of a type other than dataset are not editable",
|
|
233
233
|
"editor.record.multilingual.confirmation.cancelText": "Keep the language(s)",
|
|
234
234
|
"editor.record.multilingual.confirmation.confirmText": "Remove the language(s)",
|
|
235
|
-
"editor.record.multilingual.confirmation.message": "You are about to remove one or several languages, which will delete all of the related translations
|
|
235
|
+
"editor.record.multilingual.confirmation.message": "You are about to remove one or several languages, which will delete all of the related translations. Do you want to proceed?",
|
|
236
236
|
"editor.record.multilingual.confirmation.title": "Remove languages",
|
|
237
237
|
"editor.record.onlineResource.protocol.other": "Other",
|
|
238
238
|
"editor.record.onlineResourceError.body": "An error happened while adding the resource:",
|
|
@@ -280,6 +280,7 @@
|
|
|
280
280
|
"facets.block.title.tag.default": "Tag",
|
|
281
281
|
"facets.block.title.th_regions_tree.default": "Regions",
|
|
282
282
|
"favorite.not.authenticated.tooltip": "<div><a href=' {link} '>Login</a> to access this feature</div>",
|
|
283
|
+
"favorite.starToggle.label": "Add to favorites",
|
|
283
284
|
"feature.catalog.attribute.code": "Code",
|
|
284
285
|
"feature.catalog.attribute.definition": "Description",
|
|
285
286
|
"feature.catalog.attribute.name": "Name",
|
package/translations/es.json
CHANGED
|
@@ -280,6 +280,7 @@
|
|
|
280
280
|
"facets.block.title.tag.default": "",
|
|
281
281
|
"facets.block.title.th_regions_tree.default": "",
|
|
282
282
|
"favorite.not.authenticated.tooltip": "",
|
|
283
|
+
"favorite.starToggle.label": "Añadir a favoritos",
|
|
283
284
|
"feature.catalog.attribute.code": "Código",
|
|
284
285
|
"feature.catalog.attribute.definition": "Descripción",
|
|
285
286
|
"feature.catalog.attribute.name": "Nombre",
|
package/translations/fr.json
CHANGED
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
"editor.record.form.multilingual.activate": "Activez les langues",
|
|
195
195
|
"editor.record.form.multilingual.default": "Par défaut",
|
|
196
196
|
"editor.record.form.multilingual.enable": "Mode Multilingue",
|
|
197
|
-
"editor.record.form.multilingual.forbidden": "Vous ne pouvez pas supprimer
|
|
197
|
+
"editor.record.form.multilingual.forbidden": "Vous ne pouvez pas supprimer la langue par défaut",
|
|
198
198
|
"editor.record.form.multilingual.open": "Ouvrir le menu multilingue",
|
|
199
199
|
"editor.record.form.multilingual.title": "Traductions",
|
|
200
200
|
"editor.record.form.multilingual.validate": "Valider",
|
|
@@ -230,10 +230,10 @@
|
|
|
230
230
|
"editor.record.lock.harvested": "Les jeux de données moissonnés ne sont pas éditables",
|
|
231
231
|
"editor.record.lock.owner": "Vous n'êtes pas éditeur d'un des groupes autorisés",
|
|
232
232
|
"editor.record.lock.resourceType": "Les fiches d'un type autre que jeu de données ne sont pas éditables",
|
|
233
|
-
"editor.record.multilingual.confirmation.cancelText": "Garder le(s)
|
|
234
|
-
"editor.record.multilingual.confirmation.confirmText": "Supprimer le(s)
|
|
235
|
-
"editor.record.multilingual.confirmation.message": "Vous allez supprimer
|
|
236
|
-
"editor.record.multilingual.confirmation.title": "Suppression de
|
|
233
|
+
"editor.record.multilingual.confirmation.cancelText": "Garder le(s) langue(s)",
|
|
234
|
+
"editor.record.multilingual.confirmation.confirmText": "Supprimer le(s) langue(s)",
|
|
235
|
+
"editor.record.multilingual.confirmation.message": "Vous allez supprimer une ou plusieurs langues, ce qui supprimera toutes les traductions qui y sont liées. Voulez-vous procéder ?",
|
|
236
|
+
"editor.record.multilingual.confirmation.title": "Suppression de langue(s)",
|
|
237
237
|
"editor.record.onlineResource.protocol.other": "Autre",
|
|
238
238
|
"editor.record.onlineResourceError.body": "Une erreur est survenue lors de l'ajout de la ressource :",
|
|
239
239
|
"editor.record.onlineResourceError.closeMessage": "Compris",
|
|
@@ -280,6 +280,7 @@
|
|
|
280
280
|
"facets.block.title.tag.default": "Tag",
|
|
281
281
|
"facets.block.title.th_regions_tree.default": "Régions",
|
|
282
282
|
"favorite.not.authenticated.tooltip": "<div><a href=' {link} '>Connectez-vous</a> pour avoir accès à cette fonctionnalité</div>",
|
|
283
|
+
"favorite.starToggle.label": "Ajouter aux favoris",
|
|
283
284
|
"feature.catalog.attribute.code": "Code",
|
|
284
285
|
"feature.catalog.attribute.definition": "Description",
|
|
285
286
|
"feature.catalog.attribute.name": "Nom",
|
package/translations/it.json
CHANGED
|
@@ -280,6 +280,7 @@
|
|
|
280
280
|
"facets.block.title.tag.default": "Tag",
|
|
281
281
|
"facets.block.title.th_regions_tree.default": "Regioni",
|
|
282
282
|
"favorite.not.authenticated.tooltip": "<div><a href=' {link} '>Login</a> per accedere a questa funzionalità</div>",
|
|
283
|
+
"favorite.starToggle.label": "",
|
|
283
284
|
"feature.catalog.attribute.code": "Codice",
|
|
284
285
|
"feature.catalog.attribute.definition": "Descrizione",
|
|
285
286
|
"feature.catalog.attribute.name": "Nome",
|
package/translations/nl.json
CHANGED
|
@@ -280,6 +280,7 @@
|
|
|
280
280
|
"facets.block.title.tag.default": "",
|
|
281
281
|
"facets.block.title.th_regions_tree.default": "",
|
|
282
282
|
"favorite.not.authenticated.tooltip": "",
|
|
283
|
+
"favorite.starToggle.label": "",
|
|
283
284
|
"feature.catalog.attribute.code": "Code",
|
|
284
285
|
"feature.catalog.attribute.definition": "Beschrijving",
|
|
285
286
|
"feature.catalog.attribute.name": "Naam",
|
package/translations/pt.json
CHANGED
|
@@ -280,6 +280,7 @@
|
|
|
280
280
|
"facets.block.title.tag.default": "",
|
|
281
281
|
"facets.block.title.th_regions_tree.default": "",
|
|
282
282
|
"favorite.not.authenticated.tooltip": "",
|
|
283
|
+
"favorite.starToggle.label": "",
|
|
283
284
|
"feature.catalog.attribute.code": "Código",
|
|
284
285
|
"feature.catalog.attribute.definition": "Descrição",
|
|
285
286
|
"feature.catalog.attribute.name": "Nome",
|
package/translations/sk.json
CHANGED
|
@@ -280,6 +280,7 @@
|
|
|
280
280
|
"facets.block.title.tag.default": "Štítok",
|
|
281
281
|
"facets.block.title.th_regions_tree.default": "Regióny",
|
|
282
282
|
"favorite.not.authenticated.tooltip": "<div><a href='{link}'>Prihlásiť sa</a> pre prístup k tejto funkcii</div>",
|
|
283
|
+
"favorite.starToggle.label": "",
|
|
283
284
|
"feature.catalog.attribute.code": "Kód",
|
|
284
285
|
"feature.catalog.attribute.definition": "Popis",
|
|
285
286
|
"feature.catalog.attribute.name": "Názov",
|