geonetwork-ui 2.6.0-dev.9d3ad45e2 → 2.6.0-dev.a225a5e7a
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/gn4/gn4.field.mapper.mjs +36 -4
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.mjs +1 -1
- package/esm2022/libs/api/metadata-converter/src/lib/iso19115-3/read-parts.mjs +8 -4
- package/esm2022/libs/api/metadata-converter/src/lib/iso19115-3/write-parts.mjs +5 -2
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/read-parts.mjs +3 -3
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +2 -2
- package/esm2022/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.mjs +3 -3
- package/esm2022/libs/api/repository/src/lib/gn4/gn4-repository.mjs +36 -6
- package/esm2022/libs/common/domain/src/lib/repository/records-repository.interface.mjs +1 -1
- package/esm2022/libs/feature/editor/src/lib/components/multilingual-panel/multilingual-panel.component.mjs +266 -11
- package/esm2022/libs/feature/record/src/lib/state/mdview.actions.mjs +3 -1
- package/esm2022/libs/feature/record/src/lib/state/mdview.effects.mjs +7 -1
- package/esm2022/libs/feature/record/src/lib/state/mdview.facade.mjs +3 -1
- package/esm2022/libs/feature/record/src/lib/state/mdview.reducer.mjs +7 -1
- package/esm2022/libs/feature/record/src/lib/state/mdview.selectors.mjs +3 -1
- package/esm2022/libs/ui/elements/src/lib/internal-link-card/internal-link-card.component.mjs +19 -34
- package/esm2022/libs/ui/elements/src/lib/internal-link-card-contact/internal-link-card-contact.component.mjs +59 -0
- package/esm2022/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.mjs +3 -3
- package/esm2022/libs/ui/layout/src/lib/interactive-table/interactive-table.component.mjs +3 -3
- package/esm2022/libs/ui/search/src/index.mjs +2 -1
- package/esm2022/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.mjs +19 -12
- package/esm2022/libs/ui/search/src/lib/results-table/results-table.component.mjs +27 -14
- package/esm2022/libs/ui/search/src/lib/ui-search.module.mjs +10 -4
- package/esm2022/libs/util/i18n/src/lib/i18n.constants.mjs +42 -1
- package/esm2022/libs/util/i18n/src/lib/language-codes.mjs +24 -2
- package/esm2022/translations/de.json +29 -4
- package/esm2022/translations/en.json +29 -4
- package/esm2022/translations/es.json +28 -3
- package/esm2022/translations/fr.json +29 -4
- package/esm2022/translations/it.json +28 -3
- package/esm2022/translations/nl.json +28 -3
- package/esm2022/translations/pt.json +28 -3
- package/fesm2022/geonetwork-ui.mjs +775 -150
- package/fesm2022/geonetwork-ui.mjs.map +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/gn4/types/metadata.model.d.ts +0 -1
- package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19115-3/read-parts.d.ts +1 -0
- package/libs/api/metadata-converter/src/lib/iso19115-3/read-parts.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19115-3/write-parts.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.d.ts +1 -1
- package/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts +7 -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 +3 -0
- package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/multilingual-panel/multilingual-panel.component.d.ts +48 -3
- package/libs/feature/editor/src/lib/components/multilingual-panel/multilingual-panel.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/state/mdview.actions.d.ts +10 -0
- package/libs/feature/record/src/lib/state/mdview.actions.d.ts.map +1 -1
- package/libs/feature/record/src/lib/state/mdview.effects.d.ts +6 -0
- package/libs/feature/record/src/lib/state/mdview.effects.d.ts.map +1 -1
- package/libs/feature/record/src/lib/state/mdview.facade.d.ts +2 -0
- package/libs/feature/record/src/lib/state/mdview.facade.d.ts.map +1 -1
- package/libs/feature/record/src/lib/state/mdview.reducer.d.ts +2 -0
- package/libs/feature/record/src/lib/state/mdview.reducer.d.ts.map +1 -1
- package/libs/feature/record/src/lib/state/mdview.selectors.d.ts +2 -0
- package/libs/feature/record/src/lib/state/mdview.selectors.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/internal-link-card/internal-link-card.component.d.ts +3 -6
- package/libs/ui/elements/src/lib/internal-link-card/internal-link-card.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/internal-link-card-contact/internal-link-card-contact.component.d.ts +14 -0
- package/libs/ui/elements/src/lib/internal-link-card-contact/internal-link-card-contact.component.d.ts.map +1 -0
- package/libs/ui/search/src/index.d.ts +1 -0
- package/libs/ui/search/src/index.d.ts.map +1 -1
- package/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.d.ts +3 -3
- package/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.d.ts.map +1 -1
- package/libs/ui/search/src/lib/results-table/results-table.component.d.ts +5 -1
- package/libs/ui/search/src/lib/results-table/results-table.component.d.ts.map +1 -1
- package/libs/ui/search/src/lib/ui-search.module.d.ts +2 -1
- package/libs/ui/search/src/lib/ui-search.module.d.ts.map +1 -1
- package/libs/util/i18n/src/lib/i18n.constants.d.ts +1 -0
- package/libs/util/i18n/src/lib/i18n.constants.d.ts.map +1 -1
- package/libs/util/i18n/src/lib/language-codes.d.ts +23 -1
- package/libs/util/i18n/src/lib/language-codes.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/libs/api/metadata-converter/src/lib/fixtures/geocat-ch.records.ts +1 -1
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +54 -4
- package/src/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.ts +0 -1
- package/src/libs/api/metadata-converter/src/lib/iso19115-3/read-parts.ts +13 -3
- package/src/libs/api/metadata-converter/src/lib/iso19115-3/write-parts.ts +5 -1
- package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +6 -3
- package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +4 -1
- package/src/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.ts +2 -2
- package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +57 -4
- package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +3 -0
- package/src/libs/feature/editor/src/lib/components/multilingual-panel/multilingual-panel.component.html +117 -11
- package/src/libs/feature/editor/src/lib/components/multilingual-panel/multilingual-panel.component.ts +316 -6
- package/src/libs/feature/record/src/lib/state/mdview.actions.ts +10 -0
- package/src/libs/feature/record/src/lib/state/mdview.effects.ts +22 -0
- package/src/libs/feature/record/src/lib/state/mdview.facade.ts +4 -0
- package/src/libs/feature/record/src/lib/state/mdview.reducer.ts +12 -0
- package/src/libs/feature/record/src/lib/state/mdview.selectors.ts +9 -0
- package/src/libs/ui/elements/src/lib/internal-link-card/internal-link-card.component.html +7 -75
- package/src/libs/ui/elements/src/lib/internal-link-card/internal-link-card.component.ts +20 -51
- package/src/libs/ui/elements/src/lib/internal-link-card-contact/internal-link-card-contact.component.html +69 -0
- package/src/libs/ui/elements/src/lib/internal-link-card-contact/internal-link-card-contact.component.ts +61 -0
- package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.html +1 -1
- package/src/libs/ui/layout/src/lib/interactive-table/interactive-table.component.html +1 -0
- package/src/libs/ui/search/src/index.ts +1 -0
- package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.html +11 -3
- package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.ts +14 -11
- package/src/libs/ui/search/src/lib/results-table/results-table.component.css +4 -0
- package/src/libs/ui/search/src/lib/results-table/results-table.component.html +27 -17
- package/src/libs/ui/search/src/lib/results-table/results-table.component.ts +20 -10
- package/src/libs/ui/search/src/lib/ui-search.module.ts +3 -0
- package/src/libs/util/i18n/src/lib/i18n.constants.ts +42 -0
- package/src/libs/util/i18n/src/lib/language-codes.ts +23 -1
- package/tailwind.base.css +1 -1
- package/translations/de.json +29 -4
- package/translations/en.json +29 -4
- package/translations/es.json +28 -3
- package/translations/fr.json +29 -4
- package/translations/it.json +28 -3
- package/translations/nl.json +28 -3
- package/translations/pt.json +28 -3
- package/translations/sk.json +28 -3
|
@@ -27,9 +27,10 @@ import * as i25 from "../../../layout/src/lib/interactive-table/interactive-tabl
|
|
|
27
27
|
import * as i26 from "@ng-icons/core";
|
|
28
28
|
import * as i27 from "../../../elements/src/lib/kind-badge/kind-badge.component";
|
|
29
29
|
import * as i28 from "../../../elements/src/lib/metadata-quality/metadata-quality.component";
|
|
30
|
+
import * as i29 from "./results-table/action-menu/action-menu.component";
|
|
30
31
|
export declare class UiSearchModule {
|
|
31
32
|
static ɵfac: i0.ɵɵFactoryDeclaration<UiSearchModule, never>;
|
|
32
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<UiSearchModule, [typeof i1.RecordPreviewComponent, typeof i2.RecordPreviewListComponent, typeof i3.RecordPreviewCardComponent, typeof i4.RecordPreviewTextComponent, typeof i5.RecordPreviewTitleComponent, typeof i6.RecordMetricComponent, typeof i7.ResultsListComponent, typeof i8.ResultsHitsNumberComponent, typeof i9.ResultsHitsSearchKindComponent, typeof i10.ResultsListItemComponent, typeof i11.RecordPreviewFeedComponent, typeof i12.RecordPreviewRowComponent], [typeof i13.CommonModule, typeof i14.TranslateModule, typeof i15.NgxDropzoneModule, typeof i16.FacetsModule, typeof i17.FormsModule, typeof i17.ReactiveFormsModule, typeof i18.TagInputModule, typeof i19.UtilSharedModule, typeof i20.UiWidgetsModule, typeof i21.UiInputsModule, typeof i22.UiElementsModule, typeof i23.MatCheckboxModule, typeof i24.RouterLink, typeof i25.InteractiveTableComponent, typeof i26.NgIconsModule, typeof i27.KindBadgeComponent, typeof i28.MetadataQualityComponent], [typeof i2.RecordPreviewListComponent, typeof i3.RecordPreviewCardComponent, typeof i4.RecordPreviewTextComponent, typeof i5.RecordPreviewTitleComponent, typeof i6.RecordMetricComponent, typeof i7.ResultsListComponent, typeof i16.FacetsModule, typeof i1.RecordPreviewComponent, typeof i8.ResultsHitsNumberComponent, typeof i9.ResultsHitsSearchKindComponent, typeof i11.RecordPreviewFeedComponent, typeof i12.RecordPreviewRowComponent]>;
|
|
33
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<UiSearchModule, [typeof i1.RecordPreviewComponent, typeof i2.RecordPreviewListComponent, typeof i3.RecordPreviewCardComponent, typeof i4.RecordPreviewTextComponent, typeof i5.RecordPreviewTitleComponent, typeof i6.RecordMetricComponent, typeof i7.ResultsListComponent, typeof i8.ResultsHitsNumberComponent, typeof i9.ResultsHitsSearchKindComponent, typeof i10.ResultsListItemComponent, typeof i11.RecordPreviewFeedComponent, typeof i12.RecordPreviewRowComponent], [typeof i13.CommonModule, typeof i14.TranslateModule, typeof i15.NgxDropzoneModule, typeof i16.FacetsModule, typeof i17.FormsModule, typeof i17.ReactiveFormsModule, typeof i18.TagInputModule, typeof i19.UtilSharedModule, typeof i20.UiWidgetsModule, typeof i21.UiInputsModule, typeof i22.UiElementsModule, typeof i23.MatCheckboxModule, typeof i24.RouterLink, typeof i25.InteractiveTableComponent, typeof i26.NgIconsModule, typeof i27.KindBadgeComponent, typeof i28.MetadataQualityComponent, typeof i29.ActionMenuComponent], [typeof i2.RecordPreviewListComponent, typeof i3.RecordPreviewCardComponent, typeof i4.RecordPreviewTextComponent, typeof i5.RecordPreviewTitleComponent, typeof i6.RecordMetricComponent, typeof i7.ResultsListComponent, typeof i16.FacetsModule, typeof i1.RecordPreviewComponent, typeof i8.ResultsHitsNumberComponent, typeof i9.ResultsHitsSearchKindComponent, typeof i11.RecordPreviewFeedComponent, typeof i12.RecordPreviewRowComponent, typeof i29.ActionMenuComponent]>;
|
|
33
34
|
static ɵinj: i0.ɵɵInjectorDeclaration<UiSearchModule>;
|
|
34
35
|
}
|
|
35
36
|
//# sourceMappingURL=ui-search.module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-search.module.d.ts","sourceRoot":"","sources":["../../../../../src/libs/ui/search/src/lib/ui-search.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ui-search.module.d.ts","sourceRoot":"","sources":["../../../../../src/libs/ui/search/src/lib/ui-search.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,qBA+Da,cAAc;yCAAd,cAAc;0CAAd,cAAc;0CAAd,cAAc;CAAG"}
|
|
@@ -4,6 +4,7 @@ import { TranslateMessageFormatCompiler } from 'ngx-translate-messageformat-comp
|
|
|
4
4
|
import { FileTranslateLoader } from './file.translate.loader';
|
|
5
5
|
export declare const DEFAULT_LANG = "en";
|
|
6
6
|
export declare const LANGUAGE_STORAGE_KEY = "geonetwork-ui-language";
|
|
7
|
+
export declare const SUPPORTED_LANGUAGES: string[];
|
|
7
8
|
export declare function HttpLoaderFactory(http: HttpClient): FileTranslateLoader;
|
|
8
9
|
export declare function getLangFromBrowser(): string;
|
|
9
10
|
export declare const TRANSLATE_DEFAULT_CONFIG: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.constants.d.ts","sourceRoot":"","sources":["../../../../../src/libs/util/i18n/src/lib/i18n.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACxE,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAA;AACrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"i18n.constants.d.ts","sourceRoot":"","sources":["../../../../../src/libs/util/i18n/src/lib/i18n.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACxE,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAA;AACrF,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AA+B7D,eAAO,MAAM,YAAY,OAAO,CAAA;AAGhC,eAAO,MAAM,oBAAoB,2BAA2B,CAAA;AAE5D,eAAO,MAAM,mBAAmB,UA4B/B,CAAA;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,uBAEjD;AAED,wBAAgB,kBAAkB,WAEjC;AAKD,eAAO,MAAM,wBAAwB;;;;;;;;;;;CAQpC,CAAA"}
|
|
@@ -15,6 +15,17 @@ export declare const LANG_3_TO_2_MAPPER: {
|
|
|
15
15
|
chi: string;
|
|
16
16
|
slo: string;
|
|
17
17
|
roh: string;
|
|
18
|
+
ara: string;
|
|
19
|
+
dan: string;
|
|
20
|
+
nor: string;
|
|
21
|
+
pol: string;
|
|
22
|
+
swe: string;
|
|
23
|
+
tur: string;
|
|
24
|
+
arm: string;
|
|
25
|
+
aze: string;
|
|
26
|
+
geo: string;
|
|
27
|
+
ukr: string;
|
|
28
|
+
wel: string;
|
|
18
29
|
};
|
|
19
30
|
export declare const LANGUAGE_NAMES: {
|
|
20
31
|
en: string;
|
|
@@ -32,7 +43,18 @@ export declare const LANGUAGE_NAMES: {
|
|
|
32
43
|
ru: string;
|
|
33
44
|
zh: string;
|
|
34
45
|
sk: string;
|
|
35
|
-
|
|
46
|
+
rm: string;
|
|
47
|
+
ar: string;
|
|
48
|
+
da: string;
|
|
49
|
+
no: string;
|
|
50
|
+
pl: string;
|
|
51
|
+
sv: string;
|
|
52
|
+
tr: string;
|
|
53
|
+
hy: string;
|
|
54
|
+
az: string;
|
|
55
|
+
ka: string;
|
|
56
|
+
uk: string;
|
|
57
|
+
wel: string;
|
|
36
58
|
};
|
|
37
59
|
export declare const LANG_2_TO_3_MAPPER: {};
|
|
38
60
|
//# sourceMappingURL=language-codes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"language-codes.d.ts","sourceRoot":"","sources":["../../../../../src/libs/util/i18n/src/lib/language-codes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"language-codes.d.ts","sourceRoot":"","sources":["../../../../../src/libs/util/i18n/src/lib/language-codes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4B9B,CAAA;AAED,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4B1B,CAAA;AAED,eAAO,MAAM,kBAAkB,IAK9B,CAAA"}
|
package/package.json
CHANGED
|
@@ -617,7 +617,7 @@ Die Quelle ist zu bezeichnen: „Quelle: Stadt Zürich“.`,
|
|
|
617
617
|
status: 'completed',
|
|
618
618
|
updateFrequency: 'asNeeded',
|
|
619
619
|
defaultLanguage: 'de',
|
|
620
|
-
otherLanguages: ['fr', 'it', 'en', 'rm'],
|
|
620
|
+
otherLanguages: ['fr', 'it', 'en', 'rm', 'aar'],
|
|
621
621
|
translations: {
|
|
622
622
|
abstract: {
|
|
623
623
|
en: 'The perimeters of the Alpine Convention in Switzerland. The Alpine Convention is an international treaty between the eight Alpine countries: Germany, France, Italy, Liechtenstein, Monaco, Austria, Switzerland and Slovenia, plus the European Union. The aim of the treaty is to protect the Alps by means of cross-sectoral, integrated and sustainable policies.',
|
|
@@ -152,12 +152,22 @@ export class Gn4FieldMapper {
|
|
|
152
152
|
)
|
|
153
153
|
const languages = langList.map((lang) => LANG_3_TO_2_MAPPER[lang])
|
|
154
154
|
const defaultLanguage = output.defaultLanguage ?? languages[0] ?? null // set the first language as main one as fallback
|
|
155
|
+
|
|
156
|
+
return {
|
|
157
|
+
...output,
|
|
158
|
+
defaultLanguage,
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
otherLanguage: (output, source) => {
|
|
162
|
+
const langList = getAsArray(selectField<string>(source, 'otherLanguage'))
|
|
163
|
+
const languages = langList.map((lang) => LANG_3_TO_2_MAPPER[lang])
|
|
164
|
+
const defaultLanguage = output.defaultLanguage ?? languages[0] ?? null
|
|
155
165
|
const otherLanguages = languages.filter(
|
|
156
166
|
(lang) => lang !== defaultLanguage
|
|
157
167
|
)
|
|
168
|
+
|
|
158
169
|
return {
|
|
159
170
|
...output,
|
|
160
|
-
defaultLanguage,
|
|
161
171
|
otherLanguages,
|
|
162
172
|
}
|
|
163
173
|
},
|
|
@@ -294,12 +304,52 @@ export class Gn4FieldMapper {
|
|
|
294
304
|
) ?? {},
|
|
295
305
|
'_source'
|
|
296
306
|
)
|
|
297
|
-
const featureCatalogIdentifier = selectField(
|
|
307
|
+
const featureCatalogIdentifier: string = selectField(
|
|
298
308
|
<SourceWithUnknownProps>fcatSource,
|
|
299
309
|
'uuid'
|
|
300
310
|
)
|
|
301
|
-
|
|
302
|
-
|
|
311
|
+
const sourceOfLinks = getAsArray(
|
|
312
|
+
selectField(
|
|
313
|
+
<SourceWithUnknownProps>selectField(source, 'related'),
|
|
314
|
+
'hassources'
|
|
315
|
+
)
|
|
316
|
+
)
|
|
317
|
+
const sourceOfIdentifiers: string[] = sourceOfLinks
|
|
318
|
+
.filter((link) => link['origin'] === 'catalog')
|
|
319
|
+
.map((link) => {
|
|
320
|
+
return selectField(
|
|
321
|
+
selectField(<SourceWithUnknownProps>link, '_source'),
|
|
322
|
+
'uuid'
|
|
323
|
+
)
|
|
324
|
+
})
|
|
325
|
+
const extraValues: Record<string, string | string[]> = {}
|
|
326
|
+
if (featureCatalogIdentifier) {
|
|
327
|
+
extraValues.featureCatalogIdentifier = featureCatalogIdentifier
|
|
328
|
+
}
|
|
329
|
+
if (sourceOfIdentifiers && sourceOfIdentifiers.length > 0) {
|
|
330
|
+
extraValues.sourceOfIdentifiers = sourceOfIdentifiers
|
|
331
|
+
}
|
|
332
|
+
return Object.keys(extraValues).length > 0
|
|
333
|
+
? this.addExtra(extraValues, output)
|
|
334
|
+
: output
|
|
335
|
+
},
|
|
336
|
+
recordLink: (output, source) => {
|
|
337
|
+
const recordLinks = getAsArray(
|
|
338
|
+
selectField<SourceWithUnknownProps[]>(source, 'recordLink')
|
|
339
|
+
)
|
|
340
|
+
const sourcesIdentifiers: string[] = recordLinks
|
|
341
|
+
.filter(
|
|
342
|
+
(link) => link['origin'] === 'catalog' && link['type'] === 'sources'
|
|
343
|
+
)
|
|
344
|
+
.map((link) => selectField(<SourceWithUnknownProps>link, 'to'))
|
|
345
|
+
|
|
346
|
+
return sourcesIdentifiers && sourcesIdentifiers.length > 0
|
|
347
|
+
? this.addExtra(
|
|
348
|
+
{
|
|
349
|
+
sourcesIdentifiers,
|
|
350
|
+
},
|
|
351
|
+
output
|
|
352
|
+
)
|
|
303
353
|
: output
|
|
304
354
|
},
|
|
305
355
|
isPublishedToAll: (output, source) =>
|
|
@@ -164,7 +164,6 @@ export type MetadataObject = Partial<{
|
|
|
164
164
|
resourceDate: ResourceDate[]
|
|
165
165
|
resourceEdition: string
|
|
166
166
|
resourceIdentifier: ResourceIdentifier[]
|
|
167
|
-
resourceLanguage: string[]
|
|
168
167
|
resourceTemporalDateRange: ResourceTemporalDateRange[]
|
|
169
168
|
resourceTemporalExtentDateRange: ResourceTemporalDateRange[]
|
|
170
169
|
resourceTitleObject: MultilingualField
|
|
@@ -363,11 +363,18 @@ export function readOnlineResources(rootEl: XmlElement): OnlineResource[] {
|
|
|
363
363
|
)(rootEl)
|
|
364
364
|
}
|
|
365
365
|
|
|
366
|
-
function readLocaleElement(): ChainableFunction<
|
|
366
|
+
export function readLocaleElement(): ChainableFunction<
|
|
367
|
+
XmlElement,
|
|
368
|
+
LanguageCode
|
|
369
|
+
> {
|
|
367
370
|
return pipe(
|
|
368
371
|
findChildElement('lan:LanguageCode'),
|
|
369
372
|
readAttribute('codeListValue'),
|
|
370
|
-
map((lang) =>
|
|
373
|
+
map((lang) => {
|
|
374
|
+
const normalized = lang?.toLowerCase()
|
|
375
|
+
const iso2Lang = LANG_3_TO_2_MAPPER[normalized]
|
|
376
|
+
return iso2Lang ?? lang
|
|
377
|
+
})
|
|
371
378
|
)
|
|
372
379
|
}
|
|
373
380
|
|
|
@@ -381,6 +388,9 @@ export function readDefaultLanguage(rootEl: XmlElement): LanguageCode {
|
|
|
381
388
|
export function readOtherLanguages(rootEl: XmlElement): LanguageCode[] {
|
|
382
389
|
return pipe(
|
|
383
390
|
findChildrenElement('mdb:otherLocale', false),
|
|
384
|
-
mapArray(readLocaleElement())
|
|
391
|
+
mapArray(readLocaleElement()),
|
|
392
|
+
map((languages) =>
|
|
393
|
+
languages.filter((lang): lang is LanguageCode => lang !== null)
|
|
394
|
+
)
|
|
385
395
|
)(rootEl)
|
|
386
396
|
}
|
|
@@ -529,7 +529,11 @@ export function writeOnlineResources(
|
|
|
529
529
|
}
|
|
530
530
|
|
|
531
531
|
function writeLocaleElement(language: LanguageCode) {
|
|
532
|
-
const
|
|
532
|
+
const normalizedLang = language.toLowerCase()
|
|
533
|
+
const lang3 =
|
|
534
|
+
normalizedLang.length === 2
|
|
535
|
+
? LANG_2_TO_3_MAPPER[normalizedLang]
|
|
536
|
+
: normalizedLang
|
|
533
537
|
return pipe(
|
|
534
538
|
findChildOrCreate('lan:PT_Locale'),
|
|
535
539
|
writeAttribute('id', language.toUpperCase()),
|
|
@@ -1162,11 +1162,14 @@ export function readOtherLanguages(rootEl: XmlElement): LanguageCode[] {
|
|
|
1162
1162
|
findChildrenElement('gmd:locale', false),
|
|
1163
1163
|
mapArray(
|
|
1164
1164
|
pipe(
|
|
1165
|
-
findChildElement('
|
|
1165
|
+
findChildElement('lan:LanguageCode'),
|
|
1166
1166
|
readAttribute('codeListValue'),
|
|
1167
|
-
map((lang) => LANG_3_TO_2_MAPPER[lang.toLowerCase()])
|
|
1167
|
+
map((lang) => LANG_3_TO_2_MAPPER[lang.toLowerCase()] ?? lang)
|
|
1168
1168
|
)
|
|
1169
1169
|
),
|
|
1170
|
+
map((languages) =>
|
|
1171
|
+
languages.filter((lang): lang is LanguageCode => lang !== null)
|
|
1172
|
+
),
|
|
1170
1173
|
map((languages) => (languages.length ? languages : [defaultLanguage]))
|
|
1171
1174
|
)(rootEl)
|
|
1172
1175
|
}
|
|
@@ -1174,7 +1177,7 @@ export function readOtherLanguages(rootEl: XmlElement): LanguageCode[] {
|
|
|
1174
1177
|
export function readDefaultLanguage(rootEl: XmlElement): LanguageCode {
|
|
1175
1178
|
return pipe(
|
|
1176
1179
|
findChildElement('gmd:language', false),
|
|
1177
|
-
findChildElement('
|
|
1180
|
+
findChildElement('lan:LanguageCode'),
|
|
1178
1181
|
readAttribute('codeListValue'),
|
|
1179
1182
|
map((lang) => (lang ? LANG_3_TO_2_MAPPER[lang.toLowerCase()] : null))
|
|
1180
1183
|
)(rootEl)
|
|
@@ -1471,7 +1471,10 @@ export function writeLanguages(record: DatasetRecord, rootEl: XmlElement) {
|
|
|
1471
1471
|
writeAttribute('id', lang.toUpperCase()),
|
|
1472
1472
|
createNestedChild('gmd:languageCode', 'gmd:LanguageCode'),
|
|
1473
1473
|
writeAttribute('codeList', 'http://www.loc.gov/standards/iso639-2/'),
|
|
1474
|
-
writeAttribute(
|
|
1474
|
+
writeAttribute(
|
|
1475
|
+
'codeListValue',
|
|
1476
|
+
lang.length === 2 ? LANG_2_TO_3_MAPPER[lang] : lang
|
|
1477
|
+
)
|
|
1475
1478
|
)
|
|
1476
1479
|
|
|
1477
1480
|
// add new languages (only if other than default one)
|
|
@@ -124,11 +124,11 @@ export class ElasticsearchService {
|
|
|
124
124
|
this.runtimeFields[fieldName] = expression
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
getMetadataByIdsPayload(uuids: string[]): EsSearchParams {
|
|
128
128
|
return {
|
|
129
129
|
query: {
|
|
130
130
|
ids: {
|
|
131
|
-
values:
|
|
131
|
+
values: uuids,
|
|
132
132
|
},
|
|
133
133
|
},
|
|
134
134
|
}
|
|
@@ -31,7 +31,7 @@ import { RecordsRepositoryInterface } from '../../../../../../libs/common/domain
|
|
|
31
31
|
import {
|
|
32
32
|
RecordsApiService,
|
|
33
33
|
SearchApiService,
|
|
34
|
-
|
|
34
|
+
LanguagesApiService,
|
|
35
35
|
} from '../../../../../../libs/data-access/gn4/src'
|
|
36
36
|
import {
|
|
37
37
|
combineLatest,
|
|
@@ -47,6 +47,7 @@ import {
|
|
|
47
47
|
import { catchError, map, tap } from 'rxjs/operators'
|
|
48
48
|
import { lt } from 'semver'
|
|
49
49
|
import { ElasticsearchService } from './elasticsearch'
|
|
50
|
+
import { LANG_3_TO_2_MAPPER } from '../../../../../../libs/util/i18n/src'
|
|
50
51
|
|
|
51
52
|
const minPublicationApiVersion = '4.2.5'
|
|
52
53
|
|
|
@@ -65,7 +66,8 @@ export class Gn4Repository implements RecordsRepositoryInterface {
|
|
|
65
66
|
private gn4SearchHelper: ElasticsearchService,
|
|
66
67
|
private gn4Mapper: Gn4Converter,
|
|
67
68
|
private gn4RecordsApi: RecordsApiService,
|
|
68
|
-
private platformService: PlatformServiceInterface
|
|
69
|
+
private platformService: PlatformServiceInterface,
|
|
70
|
+
private gn4LanguagesApi: LanguagesApiService
|
|
69
71
|
) {}
|
|
70
72
|
|
|
71
73
|
search({
|
|
@@ -129,9 +131,9 @@ export class Gn4Repository implements RecordsRepositoryInterface {
|
|
|
129
131
|
return this.gn4SearchApi
|
|
130
132
|
.search(
|
|
131
133
|
'bucket',
|
|
132
|
-
['fcats'],
|
|
134
|
+
['fcats', 'hassources'],
|
|
133
135
|
JSON.stringify(
|
|
134
|
-
this.gn4SearchHelper.
|
|
136
|
+
this.gn4SearchHelper.getMetadataByIdsPayload([uniqueIdentifier])
|
|
135
137
|
)
|
|
136
138
|
)
|
|
137
139
|
.pipe(
|
|
@@ -142,6 +144,27 @@ export class Gn4Repository implements RecordsRepositoryInterface {
|
|
|
142
144
|
)
|
|
143
145
|
}
|
|
144
146
|
|
|
147
|
+
getMultipleRecords(
|
|
148
|
+
uniqueIdentifiers: string[]
|
|
149
|
+
): Observable<CatalogRecord[] | null> {
|
|
150
|
+
return this.gn4SearchApi
|
|
151
|
+
.search(
|
|
152
|
+
'bucket',
|
|
153
|
+
undefined,
|
|
154
|
+
JSON.stringify(
|
|
155
|
+
this.gn4SearchHelper.getMetadataByIdsPayload(uniqueIdentifiers)
|
|
156
|
+
)
|
|
157
|
+
)
|
|
158
|
+
.pipe(
|
|
159
|
+
map((results: Gn4SearchResults) => results.hits.hits),
|
|
160
|
+
switchMap((records) =>
|
|
161
|
+
records && records.length > 0
|
|
162
|
+
? this.gn4Mapper.readRecords(records)
|
|
163
|
+
: of(null)
|
|
164
|
+
)
|
|
165
|
+
)
|
|
166
|
+
}
|
|
167
|
+
|
|
145
168
|
private mapEmbeddedFeatureCatalog(
|
|
146
169
|
featureTypes: Array<DatasetFeatureType>
|
|
147
170
|
): DatasetFeatureCatalog {
|
|
@@ -203,6 +226,24 @@ export class Gn4Repository implements RecordsRepositoryInterface {
|
|
|
203
226
|
)
|
|
204
227
|
}
|
|
205
228
|
|
|
229
|
+
getSources(record: CatalogRecord): Observable<CatalogRecord[]> {
|
|
230
|
+
const sourcesIdentifiers = record.extras?.['sourcesIdentifiers'] as string[]
|
|
231
|
+
if (sourcesIdentifiers && sourcesIdentifiers.length > 0) {
|
|
232
|
+
return this.getMultipleRecords(sourcesIdentifiers)
|
|
233
|
+
}
|
|
234
|
+
return of(null)
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
getSourceOf(record: CatalogRecord): Observable<CatalogRecord[]> {
|
|
238
|
+
const sourceOfIdentifiers = record.extras?.[
|
|
239
|
+
'sourceOfIdentifiers'
|
|
240
|
+
] as string[]
|
|
241
|
+
if (sourceOfIdentifiers && sourceOfIdentifiers.length > 0) {
|
|
242
|
+
return this.getMultipleRecords(sourceOfIdentifiers)
|
|
243
|
+
}
|
|
244
|
+
return of(null)
|
|
245
|
+
}
|
|
246
|
+
|
|
206
247
|
aggregate(params: AggregationsParams): Observable<Aggregations> {
|
|
207
248
|
// if aggregations are empty, return an empty object right away
|
|
208
249
|
if (Object.keys(params).length === 0) return of({})
|
|
@@ -471,6 +512,18 @@ export class Gn4Repository implements RecordsRepositoryInterface {
|
|
|
471
512
|
)
|
|
472
513
|
}
|
|
473
514
|
|
|
515
|
+
getApplicationLanguages(): Observable<string[]> {
|
|
516
|
+
return this.gn4LanguagesApi
|
|
517
|
+
.getApplicationLanguages()
|
|
518
|
+
.pipe(
|
|
519
|
+
map((languages) =>
|
|
520
|
+
languages
|
|
521
|
+
.map((lang) => LANG_3_TO_2_MAPPER[lang.id ?? ''])
|
|
522
|
+
.filter((code): code is string => !!code)
|
|
523
|
+
)
|
|
524
|
+
)
|
|
525
|
+
}
|
|
526
|
+
|
|
474
527
|
private getRecordAsXml(uniqueIdentifier: string): Observable<string | null> {
|
|
475
528
|
return this.gn4RecordsApi
|
|
476
529
|
.getRecordAs(
|
|
@@ -19,6 +19,8 @@ export abstract class RecordsRepositoryInterface {
|
|
|
19
19
|
abstract getSimilarRecords(
|
|
20
20
|
similarTo: CatalogRecord
|
|
21
21
|
): Observable<CatalogRecord[]>
|
|
22
|
+
abstract getSources(record: CatalogRecord): Observable<CatalogRecord[]>
|
|
23
|
+
abstract getSourceOf(record: CatalogRecord): Observable<CatalogRecord[]>
|
|
22
24
|
abstract fuzzySearch(query: string): Observable<SearchResults>
|
|
23
25
|
abstract canEditRecord(uniqueIdentifier: string): Observable<boolean>
|
|
24
26
|
/**
|
|
@@ -95,4 +97,5 @@ export abstract class RecordsRepositoryInterface {
|
|
|
95
97
|
localRecord: CatalogRecord
|
|
96
98
|
): Observable<{ user: string; date: Date }>
|
|
97
99
|
abstract getRecordPublicationStatus(uuid: string): Observable<boolean>
|
|
100
|
+
abstract getApplicationLanguages(): Observable<string[]>
|
|
98
101
|
}
|
|
@@ -1,14 +1,120 @@
|
|
|
1
1
|
<div
|
|
2
|
-
class="flex flex-col h-full w-[302px] bg-neutral-100 border-l border-gray-300 py-
|
|
2
|
+
class="flex flex-col h-full w-[302px] bg-neutral-100 border-l border-gray-300 py-8 px-3 gap-6 overflow-auto"
|
|
3
3
|
>
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
<div class="flex flex-row px-2 justify-between">
|
|
5
|
+
<span class="text-3xl font-title text-black/80" translate
|
|
6
|
+
>editor.record.form.multilingual.title</span
|
|
7
|
+
>
|
|
8
|
+
<button
|
|
9
|
+
[title]="'editor.record.form.multilingual.open' | translate"
|
|
10
|
+
(click)="toggleLanguageSelection()"
|
|
11
|
+
*ngIf="isMultilingual"
|
|
12
|
+
data-test="activateSelection"
|
|
13
|
+
>
|
|
14
|
+
<ng-icon class="mt-1" name="iconoirSettings"></ng-icon>
|
|
15
|
+
</button>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="flex flex-col gap-2" *ngIf="editTranslations || !isMultilingual">
|
|
18
|
+
<gn-ui-check-toggle
|
|
19
|
+
class="p-2"
|
|
20
|
+
[label]="'editor.record.form.multilingual.enable' | translate"
|
|
21
|
+
[color]="'primary'"
|
|
22
|
+
[(value)]="isMultilingual"
|
|
23
|
+
(toggled)="switchMultilingual($event)"
|
|
24
|
+
></gn-ui-check-toggle>
|
|
25
|
+
<div *ngIf="isMultilingual" class="flex flex-col gap-2">
|
|
26
|
+
<div class="flex flex-row justify-between border-t border-gray-300 p-3">
|
|
27
|
+
<span class="mt-2 text-sm text-gray-600" translate
|
|
28
|
+
>editor.record.form.multilingual.activate</span
|
|
29
|
+
>
|
|
30
|
+
<gn-ui-button
|
|
31
|
+
extraClass="w-16 h-8 font-bold"
|
|
32
|
+
type="gray"
|
|
33
|
+
(buttonClick)="validateTranslations()"
|
|
34
|
+
data-test="validateSelection"
|
|
35
|
+
>{{ 'editor.record.form.multilingual.validate' | translate }}
|
|
36
|
+
</gn-ui-button>
|
|
37
|
+
</div>
|
|
38
|
+
<ng-container *ngIf="supportedLanguages$ | async as languages">
|
|
39
|
+
<div
|
|
40
|
+
class="flex flex-col gap-2 w-full px-2"
|
|
41
|
+
data-test="langAvailable"
|
|
42
|
+
*ngFor="let lang of languages"
|
|
43
|
+
>
|
|
44
|
+
<gn-ui-button
|
|
45
|
+
[extraClass]="getExtraClass(lang)"
|
|
46
|
+
type="gray"
|
|
47
|
+
(buttonClick)="toggleLanguage(lang)"
|
|
48
|
+
[disabled]="lang === _record.defaultLanguage"
|
|
49
|
+
[title]="getToggleTitle(lang)"
|
|
50
|
+
>
|
|
51
|
+
<span [class]="getIconClass(lang)"></span>
|
|
52
|
+
<span class="ml-2">{{ 'language.' + lang | translate }}</span>
|
|
53
|
+
</gn-ui-button>
|
|
54
|
+
</div>
|
|
55
|
+
</ng-container>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
<div *ngIf="!editTranslations && isMultilingual" class="flex flex-col gap-2">
|
|
59
|
+
<gn-ui-button
|
|
60
|
+
*ngFor="let recordLang of sortLanguages(recordLanguages); let i = index"
|
|
61
|
+
extraClass="flex flex-row justify-between bg-white border border-white rounded mb-1 h-[34px] w-full"
|
|
62
|
+
[ngClass]="{
|
|
63
|
+
'mt-8': isFirstUnsupported(i),
|
|
64
|
+
'': true,
|
|
65
|
+
}"
|
|
66
|
+
(buttonClick)="switchFormLang(recordLang)"
|
|
67
|
+
type="outline"
|
|
68
|
+
data-test="langSwitch"
|
|
69
|
+
>
|
|
70
|
+
<div class="flex flex-row gap-2 items-center">
|
|
71
|
+
<ng-icon
|
|
72
|
+
*ngIf="recordLang === formLanguage"
|
|
73
|
+
class="text-primary mt-1"
|
|
74
|
+
name="iconoirCheckCircle"
|
|
75
|
+
></ng-icon>
|
|
76
|
+
<ng-icon
|
|
77
|
+
*ngIf="recordLang !== formLanguage"
|
|
78
|
+
class="text-gray-800 mt-1"
|
|
79
|
+
name="iconoirCircle"
|
|
80
|
+
></ng-icon>
|
|
81
|
+
<span
|
|
82
|
+
*ngIf="recordLang.length === 2"
|
|
83
|
+
[class]="getIconClass(recordLang) + 'mt-1'"
|
|
84
|
+
></span>
|
|
85
|
+
<span [ngClass]="recordLang === formLanguage ? 'text-black' : ''">{{
|
|
86
|
+
isLangSupported(recordLang)
|
|
87
|
+
? ('language.' + recordLang | translate)
|
|
88
|
+
: recordLang.toUpperCase()
|
|
89
|
+
}}</span>
|
|
90
|
+
</div>
|
|
91
|
+
<div class="flex flex-row gap-2 items-center">
|
|
92
|
+
<span
|
|
93
|
+
*ngIf="recordLang === formLanguage"
|
|
94
|
+
class="text-xs text-base"
|
|
95
|
+
translate
|
|
96
|
+
>editor.record.form.multilingual.default</span
|
|
97
|
+
>
|
|
98
|
+
<button
|
|
99
|
+
(click)="
|
|
100
|
+
openActionMenu(recordLang, template); $event.stopPropagation()
|
|
101
|
+
"
|
|
102
|
+
cdkOverlayOrigin
|
|
103
|
+
#actionMenuButton
|
|
104
|
+
>
|
|
105
|
+
<ng-icon class="pb-5" name="matMoreHorizOutline"></ng-icon>
|
|
106
|
+
</button>
|
|
107
|
+
<ng-template #template>
|
|
108
|
+
<gn-ui-action-menu
|
|
109
|
+
[canDelete]="recordLang !== _record.defaultLanguage"
|
|
110
|
+
page="record"
|
|
111
|
+
(delete)="confirmDeleteAction(recordLang)"
|
|
112
|
+
(closeActionMenu)="closeActionMenu()"
|
|
113
|
+
(switch)="switchDefaultLang(recordLang)"
|
|
114
|
+
>
|
|
115
|
+
</gn-ui-action-menu>
|
|
116
|
+
</ng-template>
|
|
117
|
+
</div>
|
|
118
|
+
</gn-ui-button>
|
|
119
|
+
</div>
|
|
14
120
|
</div>
|