geonetwork-ui 2.4.0-dev.503109c9 → 2.4.0-dev.575f30f2
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/index.mjs +2 -1
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.mjs +10 -3
- package/esm2022/libs/api/metadata-converter/src/lib/iso19115-3/iso19115-3.converter.mjs +5 -5
- package/esm2022/libs/api/metadata-converter/src/lib/iso19115-3/read-parts.mjs +7 -4
- package/esm2022/libs/api/metadata-converter/src/lib/iso19115-3/write-parts.mjs +10 -7
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.mjs +7 -14
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/read-parts.mjs +6 -6
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +28 -18
- package/esm2022/libs/api/metadata-converter/src/lib/xml-utils.mjs +18 -2
- package/esm2022/libs/api/repository/src/lib/gn4/gn4-repository.mjs +78 -39
- package/esm2022/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.mjs +41 -7
- 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/common/domain/src/lib/repository/records-repository.interface.mjs +1 -1
- package/esm2022/libs/feature/dataviz/src/lib/chart-view/chart-view.component.mjs +1 -1
- package/esm2022/libs/feature/dataviz/src/lib/service/data.service.mjs +1 -1
- package/esm2022/libs/feature/dataviz/src/lib/table-view/table-view.component.mjs +1 -1
- package/esm2022/libs/feature/editor/src/index.mjs +2 -1
- package/esm2022/libs/feature/editor/src/lib/components/contact-card/contact-card.component.mjs +4 -16
- package/esm2022/libs/feature/editor/src/lib/components/generic-keywords/generic-keywords.component.mjs +4 -2
- package/esm2022/libs/feature/editor/src/lib/components/import-record/import-record.component.mjs +93 -0
- package/esm2022/libs/feature/editor/src/lib/components/online-resource-card/online-resource-card.component.mjs +71 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.mjs +11 -29
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-date-updated/form-field-date-updated.component.mjs +19 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.mjs +23 -10
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.mjs +3 -3
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.mjs +148 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.mjs +86 -11
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.mjs +4 -8
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.mjs +36 -7
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.mjs +35 -59
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.mjs +3 -3
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.mjs +12 -5
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/index.mjs +2 -2
- package/esm2022/libs/feature/editor/src/lib/components/record-form/record-form.component.mjs +3 -3
- package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +34 -6
- package/esm2022/libs/feature/editor/src/lib/models/editor-config.model.mjs +1 -1
- package/esm2022/libs/feature/map/src/lib/add-layer-from-catalog/add-layer-record-preview/add-layer-record-preview.component.mjs +2 -2
- package/esm2022/libs/feature/record/src/lib/data-view/data-view.component.mjs +1 -1
- package/esm2022/libs/feature/record/src/lib/external-viewer-button/external-viewer-button.component.mjs +1 -1
- package/esm2022/libs/feature/record/src/lib/map-view/map-view.component.mjs +1 -1
- package/esm2022/libs/feature/record/src/lib/state/mdview.facade.mjs +4 -2
- package/esm2022/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/index.mjs +2 -2
- package/esm2022/libs/ui/elements/src/lib/download-item/download-item.component.mjs +2 -2
- package/esm2022/libs/ui/elements/src/lib/downloads-list/downloads-list.component.mjs +1 -1
- package/esm2022/libs/ui/elements/src/lib/link-card/link-card.component.mjs +2 -2
- package/esm2022/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.mjs +6 -6
- package/esm2022/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.mjs +2 -2
- package/esm2022/libs/ui/inputs/src/index.mjs +5 -1
- package/esm2022/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.mjs +7 -4
- package/esm2022/libs/ui/inputs/src/lib/badge/badge.component.mjs +5 -3
- package/esm2022/libs/ui/inputs/src/lib/button/button.component.mjs +8 -1
- package/esm2022/libs/ui/inputs/src/lib/date-picker/date-picker.component.mjs +11 -4
- package/esm2022/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.mjs +9 -3
- package/esm2022/libs/ui/inputs/src/lib/file-input/file-input.component.mjs +87 -0
- package/esm2022/libs/ui/inputs/src/lib/image-input/image-input.component.mjs +5 -4
- package/esm2022/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.mjs +4 -4
- package/esm2022/libs/ui/inputs/src/lib/text-area/text-area.component.mjs +4 -3
- package/esm2022/libs/ui/inputs/src/lib/url-input/url-input.component.mjs +3 -3
- package/esm2022/libs/ui/layout/src/index.mjs +3 -1
- package/esm2022/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.mjs +5 -3
- package/esm2022/libs/ui/layout/src/lib/modal-dialog/modal-dialog.component.mjs +29 -0
- package/esm2022/libs/ui/layout/src/lib/sortable-list/sortable-list.component.mjs +43 -0
- package/esm2022/libs/ui/search/src/lib/results-table/results-table.component.mjs +3 -3
- package/esm2022/libs/util/shared/src/lib/links/link-classifier.service.mjs +1 -1
- package/esm2022/libs/util/shared/src/lib/links/link-utils.mjs +1 -1
- package/esm2022/libs/util/shared/src/lib/services/theme.service.mjs +2 -1
- package/esm2022/libs/util/shared/src/lib/utils/bytes-convert.mjs +4 -1
- package/esm2022/translations/de.json +20 -0
- package/esm2022/translations/en.json +20 -0
- package/esm2022/translations/es.json +20 -0
- package/esm2022/translations/fr.json +21 -1
- package/esm2022/translations/it.json +20 -0
- package/esm2022/translations/nl.json +20 -0
- package/esm2022/translations/pt.json +20 -0
- package/fesm2022/geonetwork-ui.mjs +3136 -2523
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/api/metadata-converter/src/index.d.ts +1 -0
- package/libs/api/metadata-converter/src/index.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts +3 -3
- package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19115-3/read-parts.d.ts +2 -2
- 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 +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/iso19139.converter.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts +4 -5
- 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 +7 -6
- package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/xml-utils.d.ts +6 -0
- package/libs/api/metadata-converter/src/lib/xml-utils.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts +12 -7
- package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts +21 -2
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts.map +1 -1
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +6 -6
- 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 +15 -0
- package/libs/common/domain/src/lib/platform.service.interface.d.ts.map +1 -1
- package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts +7 -0
- package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts.map +1 -1
- package/libs/feature/dataviz/src/lib/chart-view/chart-view.component.d.ts +2 -2
- package/libs/feature/dataviz/src/lib/chart-view/chart-view.component.d.ts.map +1 -1
- package/libs/feature/dataviz/src/lib/service/data.service.d.ts +6 -6
- package/libs/feature/dataviz/src/lib/service/data.service.d.ts.map +1 -1
- package/libs/feature/dataviz/src/lib/table-view/table-view.component.d.ts +3 -3
- package/libs/feature/dataviz/src/lib/table-view/table-view.component.d.ts.map +1 -1
- package/libs/feature/editor/src/index.d.ts +1 -0
- package/libs/feature/editor/src/index.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/contact-card/contact-card.component.d.ts +1 -5
- package/libs/feature/editor/src/lib/components/contact-card/contact-card.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/generic-keywords/generic-keywords.component.d.ts +2 -1
- package/libs/feature/editor/src/lib/components/generic-keywords/generic-keywords.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/import-record/import-record.component.d.ts +33 -0
- package/libs/feature/editor/src/lib/components/import-record/import-record.component.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/components/online-resource-card/online-resource-card.component.d.ts +15 -0
- package/libs/feature/editor/src/lib/components/online-resource-card/online-resource-card.component.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.d.ts +2 -5
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-date-updated/form-field-date-updated.component.d.ts +9 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-date-updated/form-field-date-updated.component.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.d.ts +5 -2
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.d.ts +35 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.d.ts +20 -2
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.d.ts +1 -3
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.d.ts +7 -2
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.d.ts +9 -15
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts +5 -3
- 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 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/index.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/record-form.component.d.ts +3 -2
- package/libs/feature/editor/src/lib/components/record-form/record-form.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/fields.config.d.ts +9 -1
- package/libs/feature/editor/src/lib/fields.config.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/models/editor-config.model.d.ts +6 -0
- package/libs/feature/editor/src/lib/models/editor-config.model.d.ts.map +1 -1
- package/libs/feature/map/src/lib/add-layer-from-catalog/add-layer-record-preview/add-layer-record-preview.component.d.ts +5 -5
- package/libs/feature/map/src/lib/add-layer-from-catalog/add-layer-record-preview/add-layer-record-preview.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/data-view/data-view.component.d.ts +3 -3
- package/libs/feature/record/src/lib/data-view/data-view.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/external-viewer-button/external-viewer-button.component.d.ts +2 -2
- package/libs/feature/record/src/lib/external-viewer-button/external-viewer-button.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/map-view/map-view.component.d.ts +2 -2
- package/libs/feature/record/src/lib/map-view/map-view.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/state/mdview.facade.d.ts +7 -7
- package/libs/feature/record/src/lib/state/mdview.facade.d.ts.map +1 -1
- package/libs/ui/elements/src/index.d.ts +1 -1
- package/libs/ui/elements/src/index.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/download-item/download-item.component.d.ts +2 -2
- package/libs/ui/elements/src/lib/download-item/download-item.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/downloads-list/downloads-list.component.d.ts +7 -7
- package/libs/ui/elements/src/lib/downloads-list/downloads-list.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/link-card/link-card.component.d.ts +2 -2
- package/libs/ui/elements/src/lib/link-card/link-card.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.d.ts +2 -2
- package/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/record-api-form/record-api-form.component.d.ts +1 -1
- package/libs/ui/inputs/src/index.d.ts +4 -0
- package/libs/ui/inputs/src/index.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/badge/badge.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/button/button.component.d.ts +1 -1
- package/libs/ui/inputs/src/lib/button/button.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/date-picker/date-picker.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/file-input/file-input.component.d.ts +24 -0
- package/libs/ui/inputs/src/lib/file-input/file-input.component.d.ts.map +1 -0
- package/libs/ui/inputs/src/lib/image-input/image-input.component.d.ts +1 -1
- package/libs/ui/inputs/src/lib/image-input/image-input.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.d.ts +0 -1
- package/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/text-area/text-area.component.d.ts.map +1 -1
- package/libs/ui/layout/src/index.d.ts +2 -0
- package/libs/ui/layout/src/index.d.ts.map +1 -1
- package/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.d.ts +2 -2
- package/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.d.ts.map +1 -1
- package/libs/ui/layout/src/lib/interactive-table/interactive-table-column/interactive-table-column.component.d.ts +1 -1
- package/libs/ui/layout/src/lib/modal-dialog/modal-dialog.component.d.ts +20 -0
- package/libs/ui/layout/src/lib/modal-dialog/modal-dialog.component.d.ts.map +1 -0
- package/libs/ui/layout/src/lib/sortable-list/sortable-list.component.d.ts +14 -0
- package/libs/ui/layout/src/lib/sortable-list/sortable-list.component.d.ts.map +1 -0
- package/libs/ui/search/src/lib/results-table/results-table.component.d.ts +1 -1
- package/libs/ui/search/src/lib/results-table/results-table.component.d.ts.map +1 -1
- package/libs/util/shared/src/lib/links/link-classifier.service.d.ts +3 -3
- package/libs/util/shared/src/lib/links/link-classifier.service.d.ts.map +1 -1
- package/libs/util/shared/src/lib/links/link-utils.d.ts +6 -6
- package/libs/util/shared/src/lib/links/link-utils.d.ts.map +1 -1
- package/libs/util/shared/src/lib/services/theme.service.d.ts.map +1 -1
- package/libs/util/shared/src/lib/utils/bytes-convert.d.ts +2 -1
- package/libs/util/shared/src/lib/utils/bytes-convert.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/libs/api/metadata-converter/src/index.ts +1 -0
- package/src/libs/api/metadata-converter/src/lib/fixtures/generic.records.ts +1 -1
- package/src/libs/api/metadata-converter/src/lib/fixtures/geo2france.records.ts +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/fixtures/metawal.records.ts +1 -1
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +18 -16
- package/src/libs/api/metadata-converter/src/lib/iso19115-3/iso19115-3.converter.ts +4 -4
- package/src/libs/api/metadata-converter/src/lib/iso19115-3/read-parts.ts +12 -4
- package/src/libs/api/metadata-converter/src/lib/iso19115-3/write-parts.ts +14 -8
- package/src/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.ts +4 -12
- package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +13 -15
- package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +48 -36
- package/src/libs/api/metadata-converter/src/lib/xml-utils.ts +20 -1
- package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +132 -68
- package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.ts +47 -3
- package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +7 -7
- package/src/libs/common/domain/src/lib/platform.service.interface.ts +26 -0
- package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +10 -0
- package/src/libs/common/fixtures/src/lib/link.fixtures.ts +216 -175
- package/src/libs/common/fixtures/src/lib/records.fixtures.ts +3 -3
- package/src/libs/feature/dataviz/src/lib/chart-view/chart-view.component.ts +3 -3
- package/src/libs/feature/dataviz/src/lib/service/data.service.ts +6 -6
- package/src/libs/feature/dataviz/src/lib/table-view/table-view.component.ts +4 -4
- package/src/libs/feature/editor/src/index.ts +1 -0
- package/src/libs/feature/editor/src/lib/components/contact-card/contact-card.component.html +12 -24
- package/src/libs/feature/editor/src/lib/components/contact-card/contact-card.component.ts +1 -13
- package/src/libs/feature/editor/src/lib/components/generic-keywords/generic-keywords.component.ts +1 -0
- package/src/libs/feature/editor/src/lib/components/import-record/import-record.component.html +43 -0
- package/src/libs/feature/editor/src/lib/components/import-record/import-record.component.ts +129 -0
- package/src/libs/feature/editor/src/lib/components/online-resource-card/online-resource-card.component.html +35 -0
- package/src/libs/feature/editor/src/lib/components/online-resource-card/online-resource-card.component.ts +79 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.css +4 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.html +13 -23
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.ts +7 -44
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/{form-field-resource-updated/form-field-resource-updated.component.ts → form-field-date-updated/form-field-date-updated.component.ts} +4 -4
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.html +3 -2
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.ts +35 -3
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.css +8 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.html +34 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.ts +182 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.html +11 -5
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.ts +93 -4
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.html +13 -6
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-rich/form-field-rich.component.ts +0 -9
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.html +7 -2
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-spatial-extent/form-field-spatial-extent.component.ts +62 -6
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.css +4 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.html +23 -3
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.ts +37 -69
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.css +4 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.html +16 -14
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +27 -20
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +10 -3
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/index.ts +1 -1
- package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.html +31 -29
- package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.ts +2 -1
- package/src/libs/feature/editor/src/lib/fields.config.ts +37 -5
- package/src/libs/feature/editor/src/lib/models/editor-config.model.ts +12 -0
- package/src/libs/feature/map/src/lib/add-layer-from-catalog/add-layer-record-preview/add-layer-record-preview.component.ts +7 -7
- package/src/libs/feature/record/src/lib/data-view/data-view.component.ts +3 -3
- package/src/libs/feature/record/src/lib/external-viewer-button/external-viewer-button.component.ts +2 -2
- package/src/libs/feature/record/src/lib/map-view/map-view.component.ts +2 -2
- package/src/libs/feature/record/src/lib/state/mdview.facade.ts +5 -1
- package/src/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.html +1 -0
- package/src/libs/ui/elements/src/index.ts +1 -1
- package/src/libs/ui/elements/src/lib/download-item/download-item.component.ts +4 -4
- package/src/libs/ui/elements/src/lib/downloads-list/downloads-list.component.ts +7 -7
- package/src/libs/ui/elements/src/lib/link-card/link-card.component.ts +3 -3
- package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.html +13 -20
- package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.ts +1 -1
- package/src/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.css +5 -0
- package/src/libs/ui/inputs/src/index.ts +4 -0
- package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.css +25 -18
- package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.html +38 -24
- package/src/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts +4 -1
- package/src/libs/ui/inputs/src/lib/badge/badge.component.html +12 -3
- package/src/libs/ui/inputs/src/lib/badge/badge.component.ts +2 -1
- package/src/libs/ui/inputs/src/lib/button/button.component.ts +15 -1
- package/src/libs/ui/inputs/src/lib/date-picker/date-picker.component.css +7 -2
- package/src/libs/ui/inputs/src/lib/date-picker/date-picker.component.html +13 -6
- package/src/libs/ui/inputs/src/lib/date-picker/date-picker.component.ts +7 -1
- package/src/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.css +7 -2
- package/src/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.html +27 -23
- package/src/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.ts +7 -1
- package/src/libs/ui/inputs/src/lib/file-input/file-input.component.css +4 -0
- package/src/libs/ui/inputs/src/lib/file-input/file-input.component.html +7 -3
- package/src/libs/ui/inputs/src/lib/file-input/file-input.component.ts +2 -1
- package/src/libs/ui/inputs/src/lib/image-input/image-input.component.css +4 -0
- package/src/libs/ui/inputs/src/lib/image-input/image-input.component.html +30 -22
- package/src/libs/ui/inputs/src/lib/image-input/image-input.component.ts +2 -1
- package/src/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.css +4 -3
- package/src/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.html +0 -1
- package/src/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.ts +1 -2
- package/src/libs/ui/inputs/src/lib/text-area/text-area.component.html +1 -1
- package/src/libs/ui/inputs/src/lib/text-area/text-area.component.ts +1 -1
- package/src/libs/ui/inputs/src/lib/url-input/url-input.component.html +1 -1
- package/src/libs/ui/layout/src/index.ts +2 -0
- package/src/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.html +8 -3
- package/src/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.ts +4 -3
- package/src/libs/ui/layout/src/lib/modal-dialog/modal-dialog.component.css +0 -0
- package/src/libs/ui/layout/src/lib/modal-dialog/modal-dialog.component.html +15 -0
- package/src/libs/ui/layout/src/lib/modal-dialog/modal-dialog.component.ts +44 -0
- package/src/libs/ui/layout/src/lib/sortable-list/sortable-list.component.html +37 -0
- package/src/libs/ui/{elements → layout}/src/lib/sortable-list/sortable-list.component.ts +13 -16
- package/src/libs/ui/search/src/lib/results-table/results-table.component.ts +4 -2
- package/src/libs/util/shared/src/lib/links/link-classifier.service.ts +4 -3
- package/src/libs/util/shared/src/lib/links/link-utils.ts +6 -6
- package/src/libs/util/shared/src/lib/services/theme.service.ts +1 -0
- package/src/libs/util/shared/src/lib/utils/bytes-convert.ts +4 -1
- package/tailwind.base.config.js +1 -0
- package/tailwind.base.css +35 -4
- package/translations/de.json +20 -0
- package/translations/en.json +20 -0
- package/translations/es.json +20 -0
- package/translations/fr.json +21 -1
- package/translations/it.json +20 -0
- package/translations/nl.json +20 -0
- package/translations/pt.json +20 -0
- package/translations/sk.json +20 -0
- package/esm2022/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.mjs +0 -96
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.mjs +0 -19
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents-date/form-field-temporal-extents-date.component.mjs +0 -17
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents-range/form-field-temporal-extents-range.component.mjs +0 -17
- package/esm2022/libs/ui/elements/src/lib/sortable-list/sortable-list.component.mjs +0 -39
- package/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.d.ts +0 -27
- package/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.d.ts.map +0 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.d.ts +0 -9
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.d.ts.map +0 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents-date/form-field-temporal-extents-date.component.d.ts +0 -8
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents-date/form-field-temporal-extents-date.component.d.ts.map +0 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents-range/form-field-temporal-extents-range.component.d.ts +0 -8
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents-range/form-field-temporal-extents-range.component.d.ts.map +0 -1
- package/libs/ui/elements/src/lib/sortable-list/sortable-list.component.d.ts +0 -17
- package/libs/ui/elements/src/lib/sortable-list/sortable-list.component.d.ts.map +0 -1
- package/src/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.html +0 -9
- package/src/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.ts +0 -113
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents-date/form-field-temporal-extents-date.component.html +0 -7
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents-date/form-field-temporal-extents-date.component.ts +0 -16
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents-range/form-field-temporal-extents-range.component.html +0 -13
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents-range/form-field-temporal-extents-range.component.ts +0 -16
- package/src/libs/ui/elements/src/lib/sortable-list/sortable-list.component.html +0 -29
- /package/src/libs/feature/editor/src/lib/components/{overview-upload/overview-upload.component.css → import-record/import-record.component.css} +0 -0
- /package/src/libs/feature/editor/src/lib/components/{record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.css → online-resource-card/online-resource-card.component.css} +0 -0
- /package/src/libs/feature/editor/src/lib/components/record-form/form-field/{form-field-temporal-extents/form-field-temporal-extents-date/form-field-temporal-extents-date.component.css → form-field-date-updated/form-field-date-updated.component.css} +0 -0
- /package/src/libs/feature/editor/src/lib/components/record-form/form-field/{form-field-resource-updated/form-field-resource-updated.component.html → form-field-date-updated/form-field-date-updated.component.html} +0 -0
- /package/src/libs/feature/editor/src/lib/components/record-form/form-field/{form-field-temporal-extents/form-field-temporal-extents-range/form-field-temporal-extents-range.component.css → form-field-online-link-resources/form-field-online-link-resources.component.css} +0 -0
- /package/src/libs/ui/{elements → layout}/src/lib/sortable-list/sortable-list.component.css +0 -0
|
@@ -36,7 +36,8 @@ export function createDocument(rootEl: XmlElement): XmlDocument {
|
|
|
36
36
|
if (namespace === 'xmlns' || namespace === null) return
|
|
37
37
|
if (rootEl.attributes[`xmlns:${namespace}`]) return
|
|
38
38
|
if (!NAMESPACES[namespace]) {
|
|
39
|
-
|
|
39
|
+
// the namespace is unknown but it might still be declared correctly: ignore it
|
|
40
|
+
return
|
|
40
41
|
}
|
|
41
42
|
rootEl.attributes[`xmlns:${namespace}`] = NAMESPACES[namespace]
|
|
42
43
|
}
|
|
@@ -456,3 +457,21 @@ export function renameElements(
|
|
|
456
457
|
doReplace(rootElement)
|
|
457
458
|
return rootElement
|
|
458
459
|
}
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* This function use the DOMParser to check if the given xmlString is a valid XML file or throw an error
|
|
463
|
+
* (Generated by chatGPT)
|
|
464
|
+
* @param xmlString
|
|
465
|
+
*/
|
|
466
|
+
export function assertValidXml(xmlString: string): Document {
|
|
467
|
+
const parser = new DOMParser()
|
|
468
|
+
const xmlDoc = parser.parseFromString(xmlString, 'application/xml')
|
|
469
|
+
const parserError = xmlDoc.querySelector('parsererror')
|
|
470
|
+
|
|
471
|
+
if (parserError) {
|
|
472
|
+
console.error(parserError)
|
|
473
|
+
throw new Error('File is not a valid XML.')
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
return xmlDoc
|
|
477
|
+
}
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
import { ElasticsearchService } from './elasticsearch'
|
|
7
7
|
import {
|
|
8
8
|
combineLatest,
|
|
9
|
+
exhaustMap,
|
|
9
10
|
from,
|
|
10
11
|
Observable,
|
|
11
12
|
of,
|
|
@@ -25,22 +26,30 @@ import {
|
|
|
25
26
|
} from '../../../../../../libs/common/domain/src/lib/model/search'
|
|
26
27
|
import { catchError, map, tap } from 'rxjs/operators'
|
|
27
28
|
import {
|
|
29
|
+
assertValidXml,
|
|
28
30
|
findConverterForDocument,
|
|
29
31
|
Gn4Converter,
|
|
30
32
|
Gn4SearchResults,
|
|
31
33
|
Iso19139Converter,
|
|
32
34
|
} from '../../../../../../libs/api/metadata-converter/src'
|
|
33
35
|
import { CatalogRecord } from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
34
|
-
import {
|
|
36
|
+
import {
|
|
37
|
+
HttpClient,
|
|
38
|
+
HttpErrorResponse,
|
|
39
|
+
HttpHeaders,
|
|
40
|
+
} from '@angular/common/http'
|
|
35
41
|
|
|
36
42
|
const TEMPORARY_ID_PREFIX = 'TEMP-ID-'
|
|
37
43
|
|
|
44
|
+
export type RecordAsXml = string
|
|
45
|
+
|
|
38
46
|
@Injectable()
|
|
39
47
|
export class Gn4Repository implements RecordsRepositoryInterface {
|
|
40
48
|
_draftsChanged = new Subject<void>()
|
|
41
49
|
draftsChanged$ = this._draftsChanged.asObservable()
|
|
42
50
|
|
|
43
51
|
constructor(
|
|
52
|
+
private httpClient: HttpClient,
|
|
44
53
|
private gn4SearchApi: SearchApiService,
|
|
45
54
|
private gn4SearchHelper: ElasticsearchService,
|
|
46
55
|
private gn4Mapper: Gn4Converter,
|
|
@@ -140,6 +149,7 @@ export class Gn4Repository implements RecordsRepositoryInterface {
|
|
|
140
149
|
)
|
|
141
150
|
)
|
|
142
151
|
}
|
|
152
|
+
|
|
143
153
|
aggregate(params: AggregationsParams): Observable<Aggregations> {
|
|
144
154
|
// if aggregations are empty, return an empty object right away
|
|
145
155
|
if (Object.keys(params).length === 0) return of({})
|
|
@@ -184,44 +194,12 @@ export class Gn4Repository implements RecordsRepositoryInterface {
|
|
|
184
194
|
)
|
|
185
195
|
}
|
|
186
196
|
|
|
187
|
-
/**
|
|
188
|
-
* Returns null if the record is not found
|
|
189
|
-
*/
|
|
190
|
-
private loadRecordAsXml(uniqueIdentifier: string): Observable<string | null> {
|
|
191
|
-
return this.gn4RecordsApi
|
|
192
|
-
.getRecordAs(
|
|
193
|
-
uniqueIdentifier,
|
|
194
|
-
undefined,
|
|
195
|
-
false,
|
|
196
|
-
undefined,
|
|
197
|
-
undefined,
|
|
198
|
-
undefined,
|
|
199
|
-
'application/xml',
|
|
200
|
-
'response',
|
|
201
|
-
undefined,
|
|
202
|
-
{ httpHeaderAccept: 'text/xml,application/xml' as 'application/xml' } // this is to make sure that the response is parsed as text
|
|
203
|
-
)
|
|
204
|
-
.pipe(
|
|
205
|
-
map((response) => response.body),
|
|
206
|
-
catchError((error: HttpErrorResponse) =>
|
|
207
|
-
error.status === 404 ? of(null) : throwError(() => error)
|
|
208
|
-
)
|
|
209
|
-
)
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
private getLocalStorageKeyForRecord(uniqueIdentifier: string) {
|
|
213
|
-
return `geonetwork-ui-draft-${uniqueIdentifier}`
|
|
214
|
-
}
|
|
215
|
-
|
|
216
197
|
openRecordForEdition(
|
|
217
198
|
uniqueIdentifier: string
|
|
218
199
|
): Observable<[CatalogRecord, string, boolean] | null> {
|
|
219
|
-
const draft$ = of(
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
)
|
|
223
|
-
)
|
|
224
|
-
const recordAsXml$ = this.loadRecordAsXml(uniqueIdentifier)
|
|
200
|
+
const draft$ = of(this.getRecordFromLocalStorage(uniqueIdentifier))
|
|
201
|
+
const recordAsXml$ = this.getRecordAsXml(uniqueIdentifier)
|
|
202
|
+
|
|
225
203
|
return combineLatest([draft$, recordAsXml$]).pipe(
|
|
226
204
|
switchMap(([draft, recordAsXml]) => {
|
|
227
205
|
const xml = draft ?? recordAsXml
|
|
@@ -239,34 +217,27 @@ export class Gn4Repository implements RecordsRepositoryInterface {
|
|
|
239
217
|
openRecordForDuplication(
|
|
240
218
|
uniqueIdentifier: string
|
|
241
219
|
): Observable<[CatalogRecord, string, false] | null> {
|
|
242
|
-
return this.
|
|
243
|
-
switchMap(async (
|
|
244
|
-
const converter = findConverterForDocument(
|
|
245
|
-
const record = await converter.readRecord(
|
|
220
|
+
return this.getRecordAsXml(uniqueIdentifier).pipe(
|
|
221
|
+
switchMap(async (fetchedRecordAsXml) => {
|
|
222
|
+
const converter = findConverterForDocument(fetchedRecordAsXml)
|
|
223
|
+
const record = await converter.readRecord(fetchedRecordAsXml)
|
|
224
|
+
|
|
246
225
|
record.uniqueIdentifier = `${TEMPORARY_ID_PREFIX}${Date.now()}`
|
|
247
226
|
record.title = `${record.title} (Copy)`
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
227
|
+
|
|
228
|
+
const recordAsXml = await converter.writeRecord(
|
|
229
|
+
record,
|
|
230
|
+
fetchedRecordAsXml
|
|
252
231
|
)
|
|
232
|
+
|
|
233
|
+
this.saveRecordToLocalStorage(recordAsXml, record.uniqueIdentifier)
|
|
253
234
|
this._draftsChanged.next()
|
|
254
|
-
|
|
235
|
+
|
|
236
|
+
return [record, recordAsXml, false] as [CatalogRecord, string, false]
|
|
255
237
|
})
|
|
256
238
|
)
|
|
257
239
|
}
|
|
258
240
|
|
|
259
|
-
private serializeRecordToXml(
|
|
260
|
-
record: CatalogRecord,
|
|
261
|
-
referenceRecordSource?: string
|
|
262
|
-
): Observable<string> {
|
|
263
|
-
// if there's a reference record, use that standard; otherwise, use iso19139
|
|
264
|
-
const converter = referenceRecordSource
|
|
265
|
-
? findConverterForDocument(referenceRecordSource)
|
|
266
|
-
: new Iso19139Converter()
|
|
267
|
-
return from(converter.writeRecord(record, referenceRecordSource))
|
|
268
|
-
}
|
|
269
|
-
|
|
270
241
|
saveRecord(
|
|
271
242
|
record: CatalogRecord,
|
|
272
243
|
referenceRecordSource?: string
|
|
@@ -301,6 +272,32 @@ export class Gn4Repository implements RecordsRepositoryInterface {
|
|
|
301
272
|
)
|
|
302
273
|
}
|
|
303
274
|
|
|
275
|
+
duplicateExternalRecord(recordDownloadUrl: string): Observable<string> {
|
|
276
|
+
return this.getExternalRecordAsXml(recordDownloadUrl).pipe(
|
|
277
|
+
exhaustMap(async (fetchedRecordAsXml: string) => {
|
|
278
|
+
const converter = findConverterForDocument(fetchedRecordAsXml)
|
|
279
|
+
const record = await converter.readRecord(fetchedRecordAsXml)
|
|
280
|
+
const tempId = this.generateTemporaryId()
|
|
281
|
+
|
|
282
|
+
record.title = `${record.title} (Copy)`
|
|
283
|
+
record.uniqueIdentifier = tempId
|
|
284
|
+
|
|
285
|
+
const recordAsXml = await converter.writeRecord(
|
|
286
|
+
record,
|
|
287
|
+
fetchedRecordAsXml
|
|
288
|
+
)
|
|
289
|
+
|
|
290
|
+
this.saveRecordToLocalStorage(recordAsXml, record.uniqueIdentifier)
|
|
291
|
+
this._draftsChanged.next()
|
|
292
|
+
|
|
293
|
+
return tempId
|
|
294
|
+
}),
|
|
295
|
+
catchError((error: HttpErrorResponse) => {
|
|
296
|
+
return throwError(() => error)
|
|
297
|
+
})
|
|
298
|
+
)
|
|
299
|
+
}
|
|
300
|
+
|
|
304
301
|
deleteRecord(uniqueIdentifier: string): Observable<void> {
|
|
305
302
|
return this.gn4RecordsApi.deleteRecord(uniqueIdentifier)
|
|
306
303
|
}
|
|
@@ -315,28 +312,19 @@ export class Gn4Repository implements RecordsRepositoryInterface {
|
|
|
315
312
|
): Observable<string> {
|
|
316
313
|
return this.serializeRecordToXml(record, referenceRecordSource).pipe(
|
|
317
314
|
tap((recordXml) => {
|
|
318
|
-
|
|
319
|
-
this.getLocalStorageKeyForRecord(record.uniqueIdentifier),
|
|
320
|
-
recordXml
|
|
321
|
-
)
|
|
315
|
+
this.saveRecordToLocalStorage(recordXml, record.uniqueIdentifier)
|
|
322
316
|
this._draftsChanged.next()
|
|
323
317
|
})
|
|
324
318
|
)
|
|
325
319
|
}
|
|
326
320
|
|
|
327
321
|
clearRecordDraft(uniqueIdentifier: string): void {
|
|
328
|
-
|
|
329
|
-
this.getLocalStorageKeyForRecord(uniqueIdentifier)
|
|
330
|
-
)
|
|
322
|
+
this.removeRecordFromLocalStorage(uniqueIdentifier)
|
|
331
323
|
this._draftsChanged.next()
|
|
332
324
|
}
|
|
333
325
|
|
|
334
326
|
recordHasDraft(uniqueIdentifier: string): boolean {
|
|
335
|
-
return (
|
|
336
|
-
window.localStorage.getItem(
|
|
337
|
-
this.getLocalStorageKeyForRecord(uniqueIdentifier)
|
|
338
|
-
) !== null
|
|
339
|
-
)
|
|
327
|
+
return this.getRecordFromLocalStorage(uniqueIdentifier) !== null
|
|
340
328
|
}
|
|
341
329
|
|
|
342
330
|
isRecordNotYetSaved(uniqueIdentifier: string): boolean {
|
|
@@ -356,4 +344,80 @@ export class Gn4Repository implements RecordsRepositoryInterface {
|
|
|
356
344
|
)
|
|
357
345
|
)
|
|
358
346
|
}
|
|
347
|
+
|
|
348
|
+
private getRecordAsXml(uniqueIdentifier: string): Observable<string | null> {
|
|
349
|
+
return this.gn4RecordsApi
|
|
350
|
+
.getRecordAs(
|
|
351
|
+
uniqueIdentifier,
|
|
352
|
+
undefined,
|
|
353
|
+
false,
|
|
354
|
+
undefined,
|
|
355
|
+
undefined,
|
|
356
|
+
undefined,
|
|
357
|
+
'application/xml',
|
|
358
|
+
'response',
|
|
359
|
+
undefined,
|
|
360
|
+
{ httpHeaderAccept: 'text/xml,application/xml' as 'application/xml' } // this is to make sure that the response is parsed as text
|
|
361
|
+
)
|
|
362
|
+
.pipe(
|
|
363
|
+
map((response) => response.body),
|
|
364
|
+
catchError((error: HttpErrorResponse) =>
|
|
365
|
+
error.status === 404 ? of(null) : throwError(() => error)
|
|
366
|
+
)
|
|
367
|
+
)
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
private serializeRecordToXml(
|
|
371
|
+
record: CatalogRecord,
|
|
372
|
+
referenceRecordSource?: string
|
|
373
|
+
): Observable<string> {
|
|
374
|
+
// if there's a reference record, use that standard; otherwise, use iso19139
|
|
375
|
+
const converter = referenceRecordSource
|
|
376
|
+
? findConverterForDocument(referenceRecordSource)
|
|
377
|
+
: new Iso19139Converter()
|
|
378
|
+
return from(converter.writeRecord(record, referenceRecordSource))
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
private getExternalRecordAsXml(
|
|
382
|
+
recordDownloadUrl: string
|
|
383
|
+
): Observable<string> {
|
|
384
|
+
let headers = new HttpHeaders()
|
|
385
|
+
const responseType_ = 'text'
|
|
386
|
+
headers = headers.set('Accept', 'text/xml,application/xml')
|
|
387
|
+
|
|
388
|
+
return this.httpClient
|
|
389
|
+
.get<string>(recordDownloadUrl, {
|
|
390
|
+
responseType: <any>responseType_,
|
|
391
|
+
headers: headers,
|
|
392
|
+
observe: 'body',
|
|
393
|
+
})
|
|
394
|
+
.pipe(
|
|
395
|
+
map((recordAsXmlFile) => {
|
|
396
|
+
assertValidXml(recordAsXmlFile)
|
|
397
|
+
|
|
398
|
+
return recordAsXmlFile
|
|
399
|
+
})
|
|
400
|
+
)
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
private getLocalStorageKeyForRecord(recordId: string): string {
|
|
404
|
+
return `geonetwork-ui-draft-${recordId}` // Never change this prefix as it is a breaking change
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
private saveRecordToLocalStorage(recordAsXml: RecordAsXml, recordId: string) {
|
|
408
|
+
window.localStorage.setItem(
|
|
409
|
+
this.getLocalStorageKeyForRecord(recordId),
|
|
410
|
+
recordAsXml
|
|
411
|
+
)
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
private getRecordFromLocalStorage(recordId: string): RecordAsXml {
|
|
415
|
+
return window.localStorage.getItem(
|
|
416
|
+
this.getLocalStorageKeyForRecord(recordId)
|
|
417
|
+
)
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
private removeRecordFromLocalStorage(recordId: string): void {
|
|
421
|
+
window.localStorage.removeItem(this.getLocalStorageKeyForRecord(recordId))
|
|
422
|
+
}
|
|
359
423
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core'
|
|
2
2
|
import { combineLatest, Observable, of, switchMap } from 'rxjs'
|
|
3
|
-
import { catchError, map, shareReplay, tap } from 'rxjs/operators'
|
|
3
|
+
import { catchError, filter, map, shareReplay, tap } from 'rxjs/operators'
|
|
4
4
|
import {
|
|
5
5
|
MeApiService,
|
|
6
|
+
RecordsApiService,
|
|
6
7
|
RegistriesApiService,
|
|
7
8
|
SiteApiService,
|
|
8
9
|
ToolsApiService,
|
|
@@ -19,7 +20,7 @@ import {
|
|
|
19
20
|
import { Gn4PlatformMapper } from './gn4-platform.mapper'
|
|
20
21
|
import { ltr } from 'semver'
|
|
21
22
|
import { LangService } from '../../../../../../../libs/util/i18n/src'
|
|
22
|
-
import { HttpClient } from '@angular/common/http'
|
|
23
|
+
import { HttpClient, HttpEventType } from '@angular/common/http'
|
|
23
24
|
import {
|
|
24
25
|
KeywordApiResponse,
|
|
25
26
|
ThesaurusApiResponse,
|
|
@@ -77,7 +78,8 @@ export class Gn4PlatformService implements PlatformServiceInterface {
|
|
|
77
78
|
private registriesApiService: RegistriesApiService,
|
|
78
79
|
private langService: LangService,
|
|
79
80
|
private userfeedbackApiService: UserfeedbackApiService,
|
|
80
|
-
private httpClient: HttpClient
|
|
81
|
+
private httpClient: HttpClient,
|
|
82
|
+
private recordsApiService: RecordsApiService
|
|
81
83
|
) {
|
|
82
84
|
this.me$ = this.meApi.getMe().pipe(
|
|
83
85
|
switchMap((apiUser) => this.mapper.userFromMeApi(apiUser)),
|
|
@@ -274,4 +276,46 @@ export class Gn4PlatformService implements PlatformServiceInterface {
|
|
|
274
276
|
})
|
|
275
277
|
)
|
|
276
278
|
}
|
|
279
|
+
|
|
280
|
+
getRecordAttachments(recordUuid: string) {
|
|
281
|
+
return this.recordsApiService.getAllResources(recordUuid).pipe(
|
|
282
|
+
map((resources) =>
|
|
283
|
+
resources.map((r) => ({
|
|
284
|
+
url: new URL(r.url),
|
|
285
|
+
fileName: r.filename,
|
|
286
|
+
}))
|
|
287
|
+
)
|
|
288
|
+
)
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
attachFileToRecord(recordUuid: string, file: File) {
|
|
292
|
+
let sizeBytes = -1
|
|
293
|
+
return this.recordsApiService
|
|
294
|
+
.putResource(recordUuid, file, 'public', undefined, 'events', true)
|
|
295
|
+
.pipe(
|
|
296
|
+
map((event) => {
|
|
297
|
+
if (event.type === HttpEventType.UploadProgress) {
|
|
298
|
+
sizeBytes = event.total
|
|
299
|
+
return {
|
|
300
|
+
type: 'progress',
|
|
301
|
+
progress: event.total
|
|
302
|
+
? Math.round((100 * event.loaded) / event.total)
|
|
303
|
+
: 0,
|
|
304
|
+
} as const
|
|
305
|
+
}
|
|
306
|
+
if (event.type === HttpEventType.Response) {
|
|
307
|
+
return {
|
|
308
|
+
type: 'success',
|
|
309
|
+
attachment: {
|
|
310
|
+
url: new URL(event.body.url),
|
|
311
|
+
fileName: event.body.filename,
|
|
312
|
+
},
|
|
313
|
+
sizeBytes,
|
|
314
|
+
} as const
|
|
315
|
+
}
|
|
316
|
+
return undefined
|
|
317
|
+
}),
|
|
318
|
+
filter((event) => !!event)
|
|
319
|
+
)
|
|
320
|
+
}
|
|
277
321
|
}
|
|
@@ -115,7 +115,7 @@ export type ServiceProtocol =
|
|
|
115
115
|
| 'ogcFeatures'
|
|
116
116
|
| 'other'
|
|
117
117
|
|
|
118
|
-
export type
|
|
118
|
+
export type OnlineResourceType = 'service' | 'download' | 'link' | 'endpoint'
|
|
119
119
|
|
|
120
120
|
export interface DatasetServiceDistribution {
|
|
121
121
|
type: 'service'
|
|
@@ -146,12 +146,12 @@ export interface OnlineLinkResource {
|
|
|
146
146
|
description?: string
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
export type
|
|
149
|
+
export type DatasetOnlineResource = (
|
|
150
150
|
| DatasetServiceDistribution
|
|
151
151
|
| DatasetDownloadDistribution
|
|
152
152
|
| OnlineLinkResource
|
|
153
153
|
) & {
|
|
154
|
-
type:
|
|
154
|
+
type: OnlineResourceType
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
export interface GraphicOverview {
|
|
@@ -178,14 +178,12 @@ export interface DatasetRecord extends BaseRecord {
|
|
|
178
178
|
kind: 'dataset'
|
|
179
179
|
status: RecordStatus
|
|
180
180
|
lineage: string // Explanation of the origin of this record (e.g: how, why)"
|
|
181
|
-
|
|
181
|
+
onlineResources: Array<DatasetOnlineResource>
|
|
182
182
|
spatialExtents: Array<DatasetSpatialExtent>
|
|
183
183
|
temporalExtents: Array<DatasetTemporalExtent>
|
|
184
184
|
spatialRepresentation?: SpatialRepresentationType
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
export type ServiceOnlineResourceType = 'endpoint' | 'link'
|
|
188
|
-
|
|
189
187
|
export interface ServiceEndpoint {
|
|
190
188
|
endpointUrl: URL
|
|
191
189
|
protocol: string
|
|
@@ -194,7 +192,7 @@ export interface ServiceEndpoint {
|
|
|
194
192
|
}
|
|
195
193
|
|
|
196
194
|
export type ServiceOnlineResource = (ServiceEndpoint | OnlineLinkResource) & {
|
|
197
|
-
type:
|
|
195
|
+
type: OnlineResourceType
|
|
198
196
|
}
|
|
199
197
|
|
|
200
198
|
export interface ServiceRecord extends BaseRecord {
|
|
@@ -202,6 +200,8 @@ export interface ServiceRecord extends BaseRecord {
|
|
|
202
200
|
onlineResources: Array<ServiceOnlineResource>
|
|
203
201
|
}
|
|
204
202
|
|
|
203
|
+
export type OnlineResource = DatasetOnlineResource | ServiceOnlineResource
|
|
204
|
+
|
|
205
205
|
export type CatalogRecord = ServiceRecord | DatasetRecord
|
|
206
206
|
|
|
207
207
|
export type CatalogRecordKeys = keyof ServiceRecord | keyof DatasetRecord
|
|
@@ -4,6 +4,21 @@ import type { Organization } from './model/record/organization.model'
|
|
|
4
4
|
import { Keyword, UserFeedback } from './model/record'
|
|
5
5
|
import { KeywordType } from './model/thesaurus'
|
|
6
6
|
|
|
7
|
+
interface RecordAttachment {
|
|
8
|
+
url: URL
|
|
9
|
+
fileName: string
|
|
10
|
+
}
|
|
11
|
+
type UploadEvent =
|
|
12
|
+
| {
|
|
13
|
+
type: 'progress'
|
|
14
|
+
progress: number // in percent
|
|
15
|
+
}
|
|
16
|
+
| {
|
|
17
|
+
type: 'success'
|
|
18
|
+
attachment: RecordAttachment
|
|
19
|
+
sizeBytes: number
|
|
20
|
+
}
|
|
21
|
+
|
|
7
22
|
export abstract class PlatformServiceInterface {
|
|
8
23
|
abstract getType(): string
|
|
9
24
|
abstract getApiVersion(): Observable<string>
|
|
@@ -15,7 +30,9 @@ export abstract class PlatformServiceInterface {
|
|
|
15
30
|
organisation: Organization
|
|
16
31
|
): Observable<UserModel[]>
|
|
17
32
|
abstract getOrganizations(): Observable<Organization[]>
|
|
33
|
+
|
|
18
34
|
abstract translateKey(key: string): Observable<string>
|
|
35
|
+
|
|
19
36
|
abstract searchKeywords(
|
|
20
37
|
query: string,
|
|
21
38
|
keywordTypes: KeywordType[]
|
|
@@ -25,6 +42,15 @@ export abstract class PlatformServiceInterface {
|
|
|
25
42
|
query: string,
|
|
26
43
|
thesaurusId: string
|
|
27
44
|
): Observable<Keyword[]>
|
|
45
|
+
|
|
28
46
|
abstract getUserFeedbacks(recordUuid: string): Observable<UserFeedback[]>
|
|
29
47
|
abstract postUserFeedbacks(recordUuid: UserFeedback): Observable<void>
|
|
48
|
+
|
|
49
|
+
abstract getRecordAttachments(
|
|
50
|
+
recordUuid: string
|
|
51
|
+
): Observable<RecordAttachment[]>
|
|
52
|
+
abstract attachFileToRecord(
|
|
53
|
+
recordUuid: string,
|
|
54
|
+
file: File
|
|
55
|
+
): Observable<UploadEvent>
|
|
30
56
|
}
|
|
@@ -52,6 +52,16 @@ export abstract class RecordsRepositoryInterface {
|
|
|
52
52
|
referenceRecordSource?: string
|
|
53
53
|
): Observable<string>
|
|
54
54
|
|
|
55
|
+
/**
|
|
56
|
+
* Try to duplicate the external record from given url. If it suceed, then it will save the record as draft and return its temporary id.
|
|
57
|
+
*
|
|
58
|
+
* @param recordDownloadUrl
|
|
59
|
+
* @returns Observable<string>
|
|
60
|
+
*/
|
|
61
|
+
abstract duplicateExternalRecord(
|
|
62
|
+
recordDownloadUrl: string
|
|
63
|
+
): Observable<string>
|
|
64
|
+
|
|
55
65
|
/**
|
|
56
66
|
* @param uniqueIdentifier
|
|
57
67
|
* @returns Observable<void> Returns when record is deleted
|