geonetwork-ui 2.4.0-dev.344a92f2 → 2.4.0-dev.3b6b95eb
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 +4 -1
- package/esm2022/libs/api/metadata-converter/src/lib/common/license.mjs +64 -0
- package/esm2022/libs/api/metadata-converter/src/lib/common/url.mjs +14 -0
- package/esm2022/libs/api/metadata-converter/src/lib/dcat-ap/dcat-ap.converter.mjs +254 -0
- package/esm2022/libs/api/metadata-converter/src/lib/dcat-ap/index.mjs +2 -0
- package/esm2022/libs/api/metadata-converter/src/lib/dcat-ap/namespaces.mjs +17 -0
- package/esm2022/libs/api/metadata-converter/src/lib/dcat-ap/read-parts.mjs +196 -0
- package/esm2022/libs/api/metadata-converter/src/lib/dcat-ap/utils/graph-utils.mjs +46 -0
- package/esm2022/libs/api/metadata-converter/src/lib/dcat-ap/utils/serialize-to-xml.mjs +74 -0
- package/esm2022/libs/api/metadata-converter/src/lib/dcat-ap/utils/uri.mjs +2 -0
- package/esm2022/libs/api/metadata-converter/src/lib/dcat-ap/write-parts.mjs +27 -0
- package/esm2022/libs/api/metadata-converter/src/lib/find-converter.mjs +11 -1
- package/esm2022/libs/api/metadata-converter/src/lib/iso19115-3/iso19115-3.converter.mjs +3 -3
- package/esm2022/libs/api/metadata-converter/src/lib/iso19115-3/write-parts.mjs +8 -23
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.mjs +3 -3
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +27 -37
- package/esm2022/libs/api/metadata-converter/src/lib/xml-utils.mjs +35 -3
- 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 +34 -26
- package/esm2022/libs/common/domain/src/lib/model/record/contact.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/catalog/src/lib/feature-catalog.module.mjs +7 -4
- package/esm2022/libs/feature/catalog/src/lib/organisations/organisations.component.mjs +6 -6
- package/esm2022/libs/feature/dataviz/src/lib/feature-dataviz.module.mjs +10 -7
- package/esm2022/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.mjs +40 -50
- package/esm2022/libs/feature/editor/src/index.mjs +2 -1
- package/esm2022/libs/feature/editor/src/lib/+state/editor.effects.mjs +5 -5
- package/esm2022/libs/feature/editor/src/lib/components/contact-card/contact-card.component.mjs +3 -3
- package/esm2022/libs/feature/editor/src/lib/components/import-record/import-record.component.mjs +95 -0
- package/esm2022/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.mjs +72 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts/form-field-contacts.component.mjs +109 -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 +9 -8
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-map-container/form-field-map-container.component.mjs +38 -60
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.mjs +10 -7
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.mjs +191 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.mjs +5 -4
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.mjs +2 -2
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.mjs +10 -6
- package/esm2022/libs/feature/editor/src/lib/components/wizard/wizard.component.mjs +3 -3
- package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +17 -3
- package/esm2022/libs/feature/editor/src/lib/services/editor.service.mjs +5 -5
- package/esm2022/libs/feature/map/src/index.mjs +2 -9
- package/esm2022/libs/feature/map/src/lib/+state/map.actions.mjs +4 -7
- package/esm2022/libs/feature/map/src/lib/+state/map.facade.mjs +9 -15
- package/esm2022/libs/feature/map/src/lib/+state/map.reducer.mjs +13 -44
- package/esm2022/libs/feature/map/src/lib/+state/map.selectors.mjs +3 -2
- package/esm2022/libs/feature/map/src/lib/add-layer-from-catalog/add-layer-record-preview/add-layer-record-preview.component.mjs +15 -15
- package/esm2022/libs/feature/map/src/lib/add-layer-from-file/add-layer-from-file.component.mjs +16 -10
- package/esm2022/libs/feature/map/src/lib/add-layer-from-ogc-api/add-layer-from-ogc-api.component.mjs +10 -8
- package/esm2022/libs/feature/map/src/lib/add-layer-from-wfs/add-layer-from-wfs.component.mjs +11 -7
- package/esm2022/libs/feature/map/src/lib/add-layer-from-wms/add-layer-from-wms.component.mjs +10 -6
- package/esm2022/libs/feature/map/src/lib/constant/index.mjs +1 -2
- package/esm2022/libs/feature/map/src/lib/feature-map.module.mjs +4 -44
- package/esm2022/libs/feature/map/src/lib/geocoding/geocoding.component.mjs +43 -29
- package/esm2022/libs/feature/map/src/lib/layers-panel/layers-panel.component.mjs +17 -8
- package/esm2022/libs/feature/map/src/lib/map-state-container/map-state-container.component.mjs +27 -0
- package/esm2022/libs/feature/map/src/lib/utils/map-utils.service.mjs +4 -168
- package/esm2022/libs/feature/record/src/lib/external-viewer-button/external-viewer-button.component.mjs +21 -17
- package/esm2022/libs/feature/record/src/lib/feature-record.module.mjs +14 -8
- package/esm2022/libs/feature/record/src/lib/map-view/map-view.component.mjs +40 -52
- package/esm2022/libs/feature/router/src/lib/default/state/router.facade.mjs +1 -1
- package/esm2022/libs/feature/search/src/lib/results-table/results-table-container.component.mjs +11 -6
- package/esm2022/libs/ui/catalog/src/lib/organisations-filter/organisations-filter.component.mjs +7 -7
- package/esm2022/libs/ui/catalog/src/lib/ui-catalog.module.mjs +1 -6
- package/esm2022/libs/ui/inputs/src/index.mjs +2 -1
- package/esm2022/libs/ui/inputs/src/lib/badge/badge.component.mjs +3 -3
- package/esm2022/libs/ui/inputs/src/lib/date-picker/date-picker.component.mjs +3 -3
- package/esm2022/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.mjs +3 -3
- package/esm2022/libs/ui/inputs/src/lib/file-input/file-input.component.mjs +3 -3
- package/esm2022/libs/ui/inputs/src/lib/image-input/image-input.component.mjs +2 -2
- package/esm2022/libs/ui/inputs/src/lib/search-input/search-input.component.mjs +6 -4
- package/esm2022/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.mjs +5 -3
- package/esm2022/libs/ui/inputs/src/lib/ui-inputs.module.mjs +2 -7
- package/esm2022/libs/ui/inputs/src/lib/url-input/url-input.component.mjs +20 -4
- package/esm2022/libs/ui/layout/src/lib/interactive-table/interactive-table.component.mjs +3 -3
- package/esm2022/libs/ui/layout/src/lib/sortable-list/sortable-list.component.mjs +3 -3
- package/esm2022/libs/ui/map/src/index.mjs +4 -3
- package/esm2022/libs/ui/map/src/lib/components/feature-detail/feature-detail.component.mjs +8 -6
- package/esm2022/libs/ui/map/src/lib/components/map-container/map-container.component.mjs +137 -0
- package/esm2022/libs/ui/map/src/lib/components/map-container/map-settings.token.mjs +13 -0
- package/esm2022/libs/ui/map/src/lib/map-utils.mjs +37 -0
- package/esm2022/libs/ui/search/src/lib/results-table/results-table.component.mjs +3 -3
- package/esm2022/libs/util/app-config/src/index.mjs +2 -1
- package/esm2022/libs/util/app-config/src/lib/map-layers.mjs +27 -0
- package/esm2022/libs/util/shared/src/lib/utils/index.mjs +2 -1
- package/esm2022/libs/util/shared/src/lib/utils/no-duplicate-file-name.mjs +19 -0
- package/esm2022/translations/de.json +19 -0
- package/esm2022/translations/en.json +51 -32
- package/esm2022/translations/es.json +19 -0
- package/esm2022/translations/fr.json +82 -63
- package/esm2022/translations/it.json +19 -0
- package/esm2022/translations/nl.json +19 -0
- package/esm2022/translations/pt.json +19 -0
- package/fesm2022/geonetwork-ui.mjs +6871 -6029
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/api/metadata-converter/src/index.d.ts +3 -0
- package/libs/api/metadata-converter/src/index.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/common/license.d.ts +3 -0
- package/libs/api/metadata-converter/src/lib/common/license.d.ts.map +1 -0
- package/libs/api/metadata-converter/src/lib/common/url.d.ts +7 -0
- package/libs/api/metadata-converter/src/lib/common/url.d.ts.map +1 -0
- package/libs/api/metadata-converter/src/lib/dcat-ap/dcat-ap.converter.d.ts +13 -0
- package/libs/api/metadata-converter/src/lib/dcat-ap/dcat-ap.converter.d.ts.map +1 -0
- package/libs/api/metadata-converter/src/lib/dcat-ap/index.d.ts +2 -0
- package/libs/api/metadata-converter/src/lib/dcat-ap/index.d.ts.map +1 -0
- package/libs/api/metadata-converter/src/lib/dcat-ap/namespaces.d.ts +16 -0
- package/libs/api/metadata-converter/src/lib/dcat-ap/namespaces.d.ts.map +1 -0
- package/libs/api/metadata-converter/src/lib/dcat-ap/read-parts.d.ts +20 -0
- package/libs/api/metadata-converter/src/lib/dcat-ap/read-parts.d.ts.map +1 -0
- package/libs/api/metadata-converter/src/lib/dcat-ap/utils/graph-utils.d.ts +9 -0
- package/libs/api/metadata-converter/src/lib/dcat-ap/utils/graph-utils.d.ts.map +1 -0
- package/libs/api/metadata-converter/src/lib/dcat-ap/utils/serialize-to-xml.d.ts +8 -0
- package/libs/api/metadata-converter/src/lib/dcat-ap/utils/serialize-to-xml.d.ts.map +1 -0
- package/libs/api/metadata-converter/src/lib/dcat-ap/utils/uri.d.ts +2 -0
- package/libs/api/metadata-converter/src/lib/dcat-ap/utils/uri.d.ts.map +1 -0
- package/libs/api/metadata-converter/src/lib/dcat-ap/write-parts.d.ts +6 -0
- package/libs/api/metadata-converter/src/lib/dcat-ap/write-parts.d.ts.map +1 -0
- package/libs/api/metadata-converter/src/lib/find-converter.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19115-3/iso19115-3.converter.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19115-3/write-parts.d.ts +0 -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/write-parts.d.ts +4 -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 +58 -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 +2 -15
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts.map +1 -1
- package/libs/common/domain/src/lib/model/record/contact.model.d.ts +1 -1
- package/libs/common/domain/src/lib/model/record/contact.model.d.ts.map +1 -1
- package/libs/common/domain/src/lib/platform.service.interface.d.ts +2 -3
- 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/catalog/src/lib/feature-catalog.module.d.ts +2 -1
- package/libs/feature/catalog/src/lib/feature-catalog.module.d.ts.map +1 -1
- package/libs/feature/dataviz/src/lib/feature-dataviz.module.d.ts +10 -9
- package/libs/feature/dataviz/src/lib/feature-dataviz.module.d.ts.map +1 -1
- package/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.d.ts +13 -20
- package/libs/feature/dataviz/src/lib/geo-table-view/geo-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/+state/editor.effects.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/import-record/import-record.component.d.ts +34 -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-service-resource-input/online-service-resource-input.component.d.ts +16 -0
- package/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts/form-field-contacts.component.d.ts +38 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts/form-field-contacts.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 +1 -1
- 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-map-container/form-field-map-container.component.d.ts +6 -13
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-map-container/form-field-map-container.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 +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.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.d.ts +44 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-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 +1 -1
- 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.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/fields.config.d.ts +2 -0
- package/libs/feature/editor/src/lib/fields.config.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/services/editor.service.d.ts +2 -2
- package/libs/feature/editor/src/lib/services/editor.service.d.ts.map +1 -1
- package/libs/feature/map/src/index.d.ts +1 -8
- package/libs/feature/map/src/index.d.ts.map +1 -1
- package/libs/feature/map/src/lib/+state/map.actions.d.ts +13 -39
- package/libs/feature/map/src/lib/+state/map.actions.d.ts.map +1 -1
- package/libs/feature/map/src/lib/+state/map.facade.d.ts +9 -10
- package/libs/feature/map/src/lib/+state/map.facade.d.ts.map +1 -1
- package/libs/feature/map/src/lib/+state/map.reducer.d.ts +4 -2
- package/libs/feature/map/src/lib/+state/map.reducer.d.ts.map +1 -1
- package/libs/feature/map/src/lib/+state/map.selectors.d.ts +6 -1
- package/libs/feature/map/src/lib/+state/map.selectors.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 +3 -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/map/src/lib/add-layer-from-file/add-layer-from-file.component.d.ts.map +1 -1
- package/libs/feature/map/src/lib/add-layer-from-ogc-api/add-layer-from-ogc-api.component.d.ts +2 -2
- package/libs/feature/map/src/lib/add-layer-from-ogc-api/add-layer-from-ogc-api.component.d.ts.map +1 -1
- package/libs/feature/map/src/lib/add-layer-from-wfs/add-layer-from-wfs.component.d.ts +1 -1
- package/libs/feature/map/src/lib/add-layer-from-wfs/add-layer-from-wfs.component.d.ts.map +1 -1
- package/libs/feature/map/src/lib/add-layer-from-wms/add-layer-from-wms.component.d.ts +1 -1
- package/libs/feature/map/src/lib/add-layer-from-wms/add-layer-from-wms.component.d.ts.map +1 -1
- package/libs/feature/map/src/lib/constant/index.d.ts +0 -1
- package/libs/feature/map/src/lib/constant/index.d.ts.map +1 -1
- package/libs/feature/map/src/lib/feature-map.module.d.ts +12 -18
- package/libs/feature/map/src/lib/feature-map.module.d.ts.map +1 -1
- package/libs/feature/map/src/lib/geocoding/geocoding.component.d.ts +7 -7
- package/libs/feature/map/src/lib/geocoding/geocoding.component.d.ts.map +1 -1
- package/libs/feature/map/src/lib/layers-panel/layers-panel.component.d.ts +4 -3
- package/libs/feature/map/src/lib/layers-panel/layers-panel.component.d.ts.map +1 -1
- package/libs/feature/map/src/lib/map-state-container/map-state-container.component.d.ts +14 -0
- package/libs/feature/map/src/lib/map-state-container/map-state-container.component.d.ts.map +1 -0
- package/libs/feature/map/src/lib/utils/map-utils.service.d.ts +0 -30
- package/libs/feature/map/src/lib/utils/map-utils.service.d.ts.map +1 -1
- package/libs/feature/record/src/lib/external-viewer-button/external-viewer-button.component.d.ts +8 -5
- package/libs/feature/record/src/lib/external-viewer-button/external-viewer-button.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/feature-record.module.d.ts +13 -11
- package/libs/feature/record/src/lib/feature-record.module.d.ts.map +1 -1
- package/libs/feature/record/src/lib/map-view/map-view.component.d.ts +13 -19
- package/libs/feature/record/src/lib/map-view/map-view.component.d.ts.map +1 -1
- package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts +4 -3
- package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts.map +1 -1
- package/libs/ui/catalog/src/lib/organisations-filter/organisations-filter.component.d.ts +1 -1
- package/libs/ui/catalog/src/lib/organisations-filter/organisations-filter.component.d.ts.map +1 -1
- package/libs/ui/catalog/src/lib/ui-catalog.module.d.ts +9 -10
- package/libs/ui/catalog/src/lib/ui-catalog.module.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/downloads-list/downloads-list.component.d.ts +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 +1 -0
- package/libs/ui/inputs/src/index.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/search-input/search-input.component.d.ts +1 -1
- package/libs/ui/inputs/src/lib/search-input/search-input.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.d.ts +1 -0
- package/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts +25 -26
- package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/url-input/url-input.component.d.ts +6 -3
- package/libs/ui/inputs/src/lib/url-input/url-input.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/map/src/index.d.ts +3 -2
- package/libs/ui/map/src/index.d.ts.map +1 -1
- package/libs/ui/map/src/lib/components/feature-detail/feature-detail.component.d.ts +3 -4
- package/libs/ui/map/src/lib/components/feature-detail/feature-detail.component.d.ts.map +1 -1
- package/libs/ui/map/src/lib/components/map-container/map-container.component.d.ts +37 -0
- package/libs/ui/map/src/lib/components/map-container/map-container.component.d.ts.map +1 -0
- package/libs/ui/map/src/lib/components/map-container/map-settings.token.d.ts +18 -0
- package/libs/ui/map/src/lib/components/map-container/map-settings.token.d.ts.map +1 -0
- package/libs/ui/map/src/lib/map-utils.d.ts +7 -0
- package/libs/ui/map/src/lib/map-utils.d.ts.map +1 -0
- package/libs/ui/search/src/lib/results-table/results-table.component.d.ts +1 -1
- package/libs/util/app-config/src/index.d.ts +1 -0
- package/libs/util/app-config/src/index.d.ts.map +1 -1
- package/libs/util/app-config/src/lib/map-layers.d.ts +4 -0
- package/libs/util/app-config/src/lib/map-layers.d.ts.map +1 -0
- package/libs/util/shared/src/lib/utils/index.d.ts +1 -0
- package/libs/util/shared/src/lib/utils/index.d.ts.map +1 -1
- package/libs/util/shared/src/lib/utils/no-duplicate-file-name.d.ts +2 -0
- package/libs/util/shared/src/lib/utils/no-duplicate-file-name.d.ts.map +1 -0
- package/package.json +5 -3
- package/src/libs/api/metadata-converter/src/index.ts +3 -0
- package/src/libs/api/metadata-converter/src/lib/common/license.ts +66 -0
- package/src/libs/api/metadata-converter/src/lib/common/url.ts +15 -0
- package/src/libs/api/metadata-converter/src/lib/dcat-ap/dcat-ap.converter.ts +378 -0
- package/src/libs/api/metadata-converter/src/lib/dcat-ap/index.ts +1 -0
- package/src/libs/api/metadata-converter/src/lib/dcat-ap/namespaces.ts +17 -0
- package/src/libs/api/metadata-converter/src/lib/dcat-ap/read-parts.ts +370 -0
- package/src/libs/api/metadata-converter/src/lib/dcat-ap/utils/graph-utils.ts +95 -0
- package/src/libs/api/metadata-converter/src/lib/dcat-ap/utils/individual-name.ts +20 -0
- package/src/libs/api/metadata-converter/src/lib/dcat-ap/utils/keyword.mapper.ts +16 -0
- package/src/libs/api/metadata-converter/src/lib/dcat-ap/utils/role.mapper.ts +48 -0
- package/src/libs/api/metadata-converter/src/lib/dcat-ap/utils/serialize-to-xml.ts +97 -0
- package/src/libs/api/metadata-converter/src/lib/dcat-ap/utils/status.mapper.ts +19 -0
- package/src/libs/api/metadata-converter/src/lib/dcat-ap/utils/update-frequency.mapper.ts +67 -0
- package/src/libs/api/metadata-converter/src/lib/dcat-ap/utils/uri.ts +1 -0
- package/src/libs/api/metadata-converter/src/lib/dcat-ap/write-parts.ts +68 -0
- package/src/libs/api/metadata-converter/src/lib/find-converter.ts +13 -0
- package/src/libs/api/metadata-converter/src/lib/fixtures/eu.dcat-ap.records.ts +272 -0
- package/src/libs/api/metadata-converter/src/lib/fixtures/opendataswiss.records.ts +110 -0
- package/src/libs/api/metadata-converter/src/lib/fixtures/sextant.records.ts +85 -0
- package/src/libs/api/metadata-converter/src/lib/fixtures/vlaanderen.dcat-ap.records.ts +73 -0
- package/src/libs/api/metadata-converter/src/lib/iso19115-3/iso19115-3.converter.ts +1 -2
- package/src/libs/api/metadata-converter/src/lib/iso19115-3/write-parts.ts +7 -35
- package/src/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.ts +1 -2
- package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +85 -120
- package/src/libs/api/metadata-converter/src/lib/xml-utils.ts +37 -2
- 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 +57 -30
- package/src/libs/common/domain/src/lib/model/record/contact.model.ts +1 -1
- package/src/libs/common/domain/src/lib/platform.service.interface.ts +2 -2
- package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +10 -0
- package/src/libs/common/fixtures/src/index.ts +3 -0
- package/src/libs/common/fixtures/src/lib/individual.fixtures.ts +61 -0
- package/src/libs/common/fixtures/src/lib/map/index.ts +1 -0
- package/src/libs/common/fixtures/src/lib/map/map-context.fixtures.ts +53 -0
- package/src/libs/common/fixtures/src/lib/user.fixtures.ts +13 -0
- package/src/libs/feature/catalog/src/lib/feature-catalog.module.ts +5 -1
- package/src/libs/feature/dataviz/src/lib/feature-dataviz.module.ts +6 -2
- package/src/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.html +5 -2
- package/src/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.ts +38 -78
- package/src/libs/feature/editor/src/index.ts +1 -0
- package/src/libs/feature/editor/src/lib/+state/editor.effects.ts +11 -4
- package/src/libs/feature/editor/src/lib/components/contact-card/contact-card.component.html +1 -1
- package/src/libs/feature/editor/src/lib/components/import-record/import-record.component.html +47 -0
- package/src/libs/feature/editor/src/lib/components/import-record/import-record.component.ts +132 -0
- package/src/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.html +31 -0
- package/src/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.ts +82 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts/form-field-contacts.component.html +40 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts/form-field-contacts.component.ts +170 -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 +1 -1
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.ts +6 -8
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-map-container/form-field-map-container.component.html +1 -4
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-map-container/form-field-map-container.component.ts +41 -83
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.html +20 -11
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-link-resources/form-field-online-link-resources.component.ts +9 -5
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.css +0 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.html +71 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-resources/form-field-online-resources.component.ts +241 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.ts +4 -3
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.ts +1 -1
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +15 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +7 -3
- package/src/libs/feature/editor/src/lib/components/wizard/wizard.component.html +2 -6
- package/src/libs/feature/editor/src/lib/fields.config.ts +18 -2
- package/src/libs/feature/editor/src/lib/services/editor.service.ts +7 -3
- package/src/libs/feature/map/src/index.ts +1 -8
- package/src/libs/feature/map/src/lib/+state/map.actions.ts +10 -25
- package/src/libs/feature/map/src/lib/+state/map.facade.ts +11 -15
- package/src/libs/feature/map/src/lib/+state/map.reducer.ts +16 -53
- package/src/libs/feature/map/src/lib/+state/map.selectors.ts +7 -2
- package/src/libs/feature/map/src/lib/add-layer-from-catalog/add-layer-record-preview/add-layer-record-preview.component.ts +12 -15
- package/src/libs/feature/map/src/lib/add-layer-from-file/add-layer-from-file.component.ts +17 -11
- package/src/libs/feature/map/src/lib/add-layer-from-ogc-api/add-layer-from-ogc-api.component.ts +11 -12
- package/src/libs/feature/map/src/lib/add-layer-from-wfs/add-layer-from-wfs.component.ts +12 -10
- package/src/libs/feature/map/src/lib/add-layer-from-wms/add-layer-from-wms.component.ts +11 -9
- package/src/libs/feature/map/src/lib/constant/index.ts +0 -1
- package/src/libs/feature/map/src/lib/feature-map.module.ts +0 -26
- package/src/libs/feature/map/src/lib/geocoding/geocoding.component.ts +38 -20
- package/src/libs/feature/map/src/lib/layers-panel/layers-panel.component.html +2 -2
- package/src/libs/feature/map/src/lib/layers-panel/layers-panel.component.ts +15 -5
- package/src/libs/feature/map/src/lib/map-state-container/map-state-container.component.css +0 -0
- package/src/libs/feature/map/src/lib/map-state-container/map-state-container.component.html +4 -0
- package/src/libs/feature/map/src/lib/map-state-container/map-state-container.component.ts +29 -0
- package/src/libs/feature/map/src/lib/utils/map-utils.service.ts +1 -229
- package/src/libs/feature/record/src/lib/external-viewer-button/external-viewer-button.component.ts +27 -18
- package/src/libs/feature/record/src/lib/feature-record.module.ts +11 -3
- package/src/libs/feature/record/src/lib/map-view/map-view.component.html +4 -4
- package/src/libs/feature/record/src/lib/map-view/map-view.component.ts +44 -71
- package/src/libs/feature/router/src/lib/default/state/router.facade.ts +1 -1
- package/src/libs/feature/search/src/lib/results-table/results-table-container.component.html +4 -1
- package/src/libs/feature/search/src/lib/results-table/results-table-container.component.ts +4 -2
- package/src/libs/ui/catalog/src/lib/organisations-filter/organisations-filter.component.ts +8 -1
- package/src/libs/ui/catalog/src/lib/ui-catalog.module.ts +0 -3
- package/src/libs/ui/inputs/src/index.ts +1 -0
- package/src/libs/ui/inputs/src/lib/badge/badge.component.html +1 -2
- package/src/libs/ui/inputs/src/lib/date-picker/date-picker.component.html +2 -1
- package/src/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.html +2 -1
- package/src/libs/ui/inputs/src/lib/file-input/file-input.component.html +8 -8
- package/src/libs/ui/inputs/src/lib/search-input/search-input.component.ts +5 -1
- package/src/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.html +1 -1
- package/src/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.ts +3 -1
- package/src/libs/ui/inputs/src/lib/ui-inputs.module.ts +0 -3
- package/src/libs/ui/inputs/src/lib/url-input/url-input.component.html +5 -1
- package/src/libs/ui/inputs/src/lib/url-input/url-input.component.ts +25 -2
- package/src/libs/ui/layout/src/lib/interactive-table/interactive-table.component.css +1 -1
- package/src/libs/ui/layout/src/lib/interactive-table/interactive-table.component.html +2 -2
- package/src/libs/ui/layout/src/lib/sortable-list/sortable-list.component.html +1 -1
- package/src/libs/ui/map/src/index.ts +3 -2
- package/src/libs/ui/map/src/lib/components/feature-detail/feature-detail.component.html +1 -1
- package/src/libs/ui/map/src/lib/components/feature-detail/feature-detail.component.ts +8 -5
- package/src/libs/ui/map/src/lib/components/map-container/map-container.component.css +0 -0
- package/src/libs/ui/map/src/lib/components/map-container/map-container.component.ts +203 -0
- package/src/libs/ui/map/src/lib/components/map-container/map-settings.token.ts +23 -0
- package/src/libs/ui/map/src/lib/map-utils.ts +54 -0
- package/src/libs/ui/search/src/lib/results-table/results-table.component.html +18 -14
- package/src/libs/util/app-config/src/index.ts +1 -0
- package/src/libs/util/app-config/src/lib/map-layers.ts +31 -0
- package/src/libs/util/shared/src/lib/utils/index.ts +1 -0
- package/src/libs/util/shared/src/lib/utils/no-duplicate-file-name.ts +23 -0
- package/tailwind.base.css +3 -2
- package/translations/de.json +19 -0
- package/translations/en.json +51 -32
- package/translations/es.json +19 -0
- package/translations/fr.json +82 -63
- package/translations/it.json +19 -0
- package/translations/nl.json +19 -0
- package/translations/pt.json +19 -0
- package/translations/sk.json +19 -0
- package/esm2022/libs/feature/map/src/lib/+state/map.effects.mjs +0 -15
- package/esm2022/libs/feature/map/src/lib/+state/map.models.mjs +0 -2
- package/esm2022/libs/feature/map/src/lib/constant/map-options.mjs +0 -8
- package/esm2022/libs/feature/map/src/lib/constant/style.constant.mjs +0 -17
- package/esm2022/libs/feature/map/src/lib/feature-info/feature-info.service.mjs +0 -38
- package/esm2022/libs/feature/map/src/lib/manager/map-instance.directive.mjs +0 -19
- package/esm2022/libs/feature/map/src/lib/manager/map-manager.service.mjs +0 -19
- package/esm2022/libs/feature/map/src/lib/map-container/map-container.component.mjs +0 -27
- package/esm2022/libs/feature/map/src/lib/map-context/component/map-context.component.mjs +0 -46
- package/esm2022/libs/feature/map/src/lib/map-context/map-context.model.mjs +0 -10
- package/esm2022/libs/feature/map/src/lib/map-context/map-context.service.mjs +0 -289
- package/esm2022/libs/ui/map/src/lib/components/map/map.component.mjs +0 -40
- package/esm2022/libs/ui/map/src/lib/ui-map.module.mjs +0 -33
- package/libs/feature/map/src/lib/+state/map.effects.d.ts +0 -9
- package/libs/feature/map/src/lib/+state/map.effects.d.ts.map +0 -1
- package/libs/feature/map/src/lib/+state/map.models.d.ts +0 -9
- package/libs/feature/map/src/lib/+state/map.models.d.ts.map +0 -1
- package/libs/feature/map/src/lib/constant/map-options.d.ts +0 -9
- package/libs/feature/map/src/lib/constant/map-options.d.ts.map +0 -1
- package/libs/feature/map/src/lib/constant/style.constant.d.ts +0 -4
- package/libs/feature/map/src/lib/constant/style.constant.d.ts.map +0 -1
- package/libs/feature/map/src/lib/feature-info/feature-info.service.d.ts +0 -16
- package/libs/feature/map/src/lib/feature-info/feature-info.service.d.ts.map +0 -1
- package/libs/feature/map/src/lib/manager/map-instance.directive.d.ts +0 -9
- package/libs/feature/map/src/lib/manager/map-instance.directive.d.ts.map +0 -1
- package/libs/feature/map/src/lib/manager/map-manager.service.d.ts +0 -11
- package/libs/feature/map/src/lib/manager/map-manager.service.d.ts.map +0 -1
- package/libs/feature/map/src/lib/map-container/map-container.component.d.ts +0 -12
- package/libs/feature/map/src/lib/map-container/map-container.component.d.ts.map +0 -1
- package/libs/feature/map/src/lib/map-context/component/map-context.component.d.ts +0 -26
- package/libs/feature/map/src/lib/map-context/component/map-context.component.d.ts.map +0 -1
- package/libs/feature/map/src/lib/map-context/map-context.model.d.ts +0 -77
- package/libs/feature/map/src/lib/map-context/map-context.model.d.ts.map +0 -1
- package/libs/feature/map/src/lib/map-context/map-context.service.d.ts +0 -26
- package/libs/feature/map/src/lib/map-context/map-context.service.d.ts.map +0 -1
- package/libs/ui/map/src/lib/components/map/map.component.d.ts +0 -19
- package/libs/ui/map/src/lib/components/map/map.component.d.ts.map +0 -1
- package/libs/ui/map/src/lib/ui-map.module.d.ts +0 -13
- package/libs/ui/map/src/lib/ui-map.module.d.ts.map +0 -1
- package/src/libs/feature/map/src/lib/+state/map.effects.ts +0 -7
- package/src/libs/feature/map/src/lib/+state/map.models.ts +0 -9
- package/src/libs/feature/map/src/lib/constant/map-options.ts +0 -17
- package/src/libs/feature/map/src/lib/feature-info/feature-info.service.ts +0 -42
- package/src/libs/feature/map/src/lib/manager/map-instance.directive.ts +0 -10
- package/src/libs/feature/map/src/lib/manager/map-manager.service.ts +0 -13
- package/src/libs/feature/map/src/lib/map-container/map-container.component.html +0 -1
- package/src/libs/feature/map/src/lib/map-container/map-container.component.ts +0 -26
- package/src/libs/feature/map/src/lib/map-context/component/map-context.component.html +0 -1
- package/src/libs/feature/map/src/lib/map-context/component/map-context.component.ts +0 -57
- package/src/libs/feature/map/src/lib/map-context/map-context.fixtures.ts +0 -55
- package/src/libs/feature/map/src/lib/map-context/map-context.model.ts +0 -95
- package/src/libs/feature/map/src/lib/map-context/map-context.service.ts +0 -318
- package/src/libs/ui/map/src/lib/components/map/map.component.ts +0 -57
- package/src/libs/ui/map/src/lib/ui-map.module.ts +0 -19
- /package/src/libs/feature/{map/src/lib/map-container/map-container.component.css → editor/src/lib/components/import-record/import-record.component.css} +0 -0
- /package/src/libs/feature/{map/src/lib/map-context/component/map-context.component.css → editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.css} +0 -0
- /package/src/libs/{ui/map/src/lib/components/map/map.component.css → feature/editor/src/lib/components/record-form/form-field/form-field-contacts/form-field-contacts.component.css} +0 -0
- /package/src/libs/ui/map/src/lib/components/{map/map.component.html → map-container/map-container.component.html} +0 -0
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common'
|
|
2
|
+
import {
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
ChangeDetectorRef,
|
|
5
|
+
Component,
|
|
6
|
+
EventEmitter,
|
|
7
|
+
Input,
|
|
8
|
+
Output,
|
|
9
|
+
TemplateRef,
|
|
10
|
+
ViewChild,
|
|
11
|
+
} from '@angular/core'
|
|
12
|
+
import { MatDialog } from '@angular/material/dialog'
|
|
13
|
+
import { marker } from '@biesbjerg/ngx-translate-extract-marker'
|
|
14
|
+
import {
|
|
15
|
+
DatasetDownloadDistribution,
|
|
16
|
+
DatasetServiceDistribution,
|
|
17
|
+
OnlineResource,
|
|
18
|
+
ServiceEndpoint,
|
|
19
|
+
} from '../../../../../../../../../libs/common/domain/src/lib/model/record'
|
|
20
|
+
import { PlatformServiceInterface } from '../../../../../../../../../libs/common/domain/src/lib/platform.service.interface'
|
|
21
|
+
import { NotificationsService } from '../../../../../../../../../libs/feature/notifications/src'
|
|
22
|
+
import {
|
|
23
|
+
FileInputComponent,
|
|
24
|
+
SwitchToggleComponent,
|
|
25
|
+
SwitchToggleOption,
|
|
26
|
+
TextAreaComponent,
|
|
27
|
+
TextInputComponent,
|
|
28
|
+
UrlInputComponent,
|
|
29
|
+
} from '../../../../../../../../../libs/ui/inputs/src'
|
|
30
|
+
import {
|
|
31
|
+
ModalDialogComponent,
|
|
32
|
+
SortableListComponent,
|
|
33
|
+
} from '../../../../../../../../../libs/ui/layout/src'
|
|
34
|
+
import { TranslateModule, TranslateService } from '@ngx-translate/core'
|
|
35
|
+
import { Subscription } from 'rxjs'
|
|
36
|
+
import { MAX_UPLOAD_SIZE_MB } from '../../../../fields.config'
|
|
37
|
+
import { OnlineResourceCardComponent } from '../../../online-resource-card/online-resource-card.component'
|
|
38
|
+
import { OnlineServiceResourceInputComponent } from '../../../online-service-resource-input/online-service-resource-input.component'
|
|
39
|
+
|
|
40
|
+
type OnlineNotLinkResource =
|
|
41
|
+
| DatasetDownloadDistribution
|
|
42
|
+
| DatasetServiceDistribution
|
|
43
|
+
| ServiceEndpoint
|
|
44
|
+
|
|
45
|
+
@Component({
|
|
46
|
+
selector: 'gn-ui-form-field-online-resources',
|
|
47
|
+
templateUrl: './form-field-online-resources.component.html',
|
|
48
|
+
styleUrls: ['./form-field-online-resources.component.css'],
|
|
49
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
50
|
+
standalone: true,
|
|
51
|
+
imports: [
|
|
52
|
+
CommonModule,
|
|
53
|
+
SwitchToggleComponent,
|
|
54
|
+
FileInputComponent,
|
|
55
|
+
OnlineServiceResourceInputComponent,
|
|
56
|
+
UrlInputComponent,
|
|
57
|
+
SortableListComponent,
|
|
58
|
+
OnlineResourceCardComponent,
|
|
59
|
+
TextInputComponent,
|
|
60
|
+
TextAreaComponent,
|
|
61
|
+
TranslateModule,
|
|
62
|
+
],
|
|
63
|
+
})
|
|
64
|
+
export class FormFieldOnlineResourcesComponent {
|
|
65
|
+
@Input() metadataUuid: string
|
|
66
|
+
@Input() set value(onlineResources: Array<OnlineResource>) {
|
|
67
|
+
this.allResources = onlineResources
|
|
68
|
+
this.notLinkResources = onlineResources.filter(
|
|
69
|
+
(res): res is OnlineNotLinkResource => res.type !== 'link'
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
@Output() valueChange: EventEmitter<Array<OnlineResource>> =
|
|
73
|
+
new EventEmitter()
|
|
74
|
+
|
|
75
|
+
@ViewChild('dialogTemplate') dialogTemplate: TemplateRef<OnlineResource>
|
|
76
|
+
|
|
77
|
+
typeOptions: SwitchToggleOption[] = [
|
|
78
|
+
{
|
|
79
|
+
label: marker('editor.record.form.field.onlineResource.toggle.dataset'),
|
|
80
|
+
value: 'download',
|
|
81
|
+
checked: true,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
label: marker('editor.record.form.field.onlineResource.toggle.service'),
|
|
85
|
+
value: 'service',
|
|
86
|
+
checked: false,
|
|
87
|
+
},
|
|
88
|
+
]
|
|
89
|
+
selectedType: 'download' | 'service' = 'download'
|
|
90
|
+
|
|
91
|
+
private allResources: OnlineResource[] = []
|
|
92
|
+
notLinkResources: OnlineNotLinkResource[] = []
|
|
93
|
+
uploadProgress = undefined
|
|
94
|
+
uploadSubscription: Subscription = null
|
|
95
|
+
newService = {
|
|
96
|
+
type: 'service',
|
|
97
|
+
accessServiceProtocol: 'ogcFeatures',
|
|
98
|
+
identifierInService: '',
|
|
99
|
+
} as Omit<DatasetServiceDistribution, 'url'>
|
|
100
|
+
|
|
101
|
+
protected MAX_UPLOAD_SIZE_MB = MAX_UPLOAD_SIZE_MB
|
|
102
|
+
|
|
103
|
+
constructor(
|
|
104
|
+
private notificationsService: NotificationsService,
|
|
105
|
+
private translateService: TranslateService,
|
|
106
|
+
private platformService: PlatformServiceInterface,
|
|
107
|
+
private cd: ChangeDetectorRef,
|
|
108
|
+
private dialog: MatDialog
|
|
109
|
+
) {}
|
|
110
|
+
|
|
111
|
+
onSelectedTypeChange(selectedType: unknown) {
|
|
112
|
+
this.selectedType = selectedType as 'download' | 'service'
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
handleFileChange(file: File) {
|
|
116
|
+
this.uploadProgress = 0
|
|
117
|
+
this.uploadSubscription = this.platformService
|
|
118
|
+
.attachFileToRecord(this.metadataUuid, file)
|
|
119
|
+
.subscribe({
|
|
120
|
+
next: (event) => {
|
|
121
|
+
if (event.type === 'progress') {
|
|
122
|
+
this.uploadProgress = event.progress
|
|
123
|
+
this.cd.detectChanges()
|
|
124
|
+
} else if (event.type === 'success') {
|
|
125
|
+
this.uploadProgress = undefined
|
|
126
|
+
this.cd.detectChanges()
|
|
127
|
+
const newResource: DatasetDownloadDistribution = {
|
|
128
|
+
type: 'download',
|
|
129
|
+
url: new URL(event.attachment.url),
|
|
130
|
+
name: event.attachment.fileName,
|
|
131
|
+
sizeBytes: event.sizeBytes, // WARNING: this is the only time that sizeBytes is set
|
|
132
|
+
}
|
|
133
|
+
this.valueChange.emit([...this.allResources, newResource])
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
error: (error: Error) => this.handleError(error),
|
|
137
|
+
})
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
handleUploadCancel() {
|
|
141
|
+
if (this.uploadSubscription) {
|
|
142
|
+
this.uploadProgress = undefined
|
|
143
|
+
this.uploadSubscription.unsubscribe()
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
handleDownloadUrlChange(url: string) {
|
|
148
|
+
try {
|
|
149
|
+
const name = url.split('/').pop()
|
|
150
|
+
const newLink: DatasetDownloadDistribution = {
|
|
151
|
+
type: 'download',
|
|
152
|
+
url: new URL(url),
|
|
153
|
+
name,
|
|
154
|
+
}
|
|
155
|
+
this.valueChange.emit([...this.allResources, newLink])
|
|
156
|
+
} catch (e) {
|
|
157
|
+
this.handleError(e as Error)
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
handleServiceUrlChange(url: string) {
|
|
162
|
+
this.valueChange.emit([
|
|
163
|
+
...this.allResources,
|
|
164
|
+
{
|
|
165
|
+
...this.newService,
|
|
166
|
+
url: new URL(url),
|
|
167
|
+
},
|
|
168
|
+
])
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
handleServiceModify(
|
|
172
|
+
oldService: DatasetServiceDistribution,
|
|
173
|
+
newService: DatasetServiceDistribution
|
|
174
|
+
) {
|
|
175
|
+
oldService.accessServiceProtocol = newService.accessServiceProtocol
|
|
176
|
+
oldService.identifierInService = newService.identifierInService
|
|
177
|
+
oldService.url = newService.url
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
handleResourcesChange(items: unknown[]) {
|
|
181
|
+
const notLinks = items as OnlineNotLinkResource[]
|
|
182
|
+
const newResources = [
|
|
183
|
+
...this.allResources.filter((r) => r.type === 'link'),
|
|
184
|
+
...notLinks,
|
|
185
|
+
]
|
|
186
|
+
this.valueChange.emit(newResources)
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
handleResourceModify(resource: OnlineNotLinkResource, index: number) {
|
|
190
|
+
this.openEditDialog(resource, index)
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
private handleError(error: Error) {
|
|
194
|
+
this.uploadProgress = undefined
|
|
195
|
+
this.notificationsService.showNotification({
|
|
196
|
+
type: 'error',
|
|
197
|
+
title: this.translateService.instant(
|
|
198
|
+
'editor.record.onlineResourceError.title'
|
|
199
|
+
),
|
|
200
|
+
text: `${this.translateService.instant(
|
|
201
|
+
'editor.record.onlineResourceError.body'
|
|
202
|
+
)} ${error.message}`,
|
|
203
|
+
closeMessage: this.translateService.instant(
|
|
204
|
+
'editor.record.onlineResourceError.closeMessage'
|
|
205
|
+
),
|
|
206
|
+
})
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
private openEditDialog(resource: OnlineNotLinkResource, index: number) {
|
|
210
|
+
const resourceCopy = {
|
|
211
|
+
...resource,
|
|
212
|
+
}
|
|
213
|
+
this.dialog
|
|
214
|
+
.open(ModalDialogComponent, {
|
|
215
|
+
width: '800px',
|
|
216
|
+
data: {
|
|
217
|
+
title: this.translateService.instant(
|
|
218
|
+
'editor.record.form.field.onlineResource.dialogTitle'
|
|
219
|
+
),
|
|
220
|
+
body: this.dialogTemplate,
|
|
221
|
+
bodyContext: resourceCopy,
|
|
222
|
+
confirmText: this.translateService.instant(
|
|
223
|
+
'editor.record.form.field.onlineResource.confirm'
|
|
224
|
+
),
|
|
225
|
+
cancelText: this.translateService.instant(
|
|
226
|
+
'editor.record.form.field.onlineResource.cancel'
|
|
227
|
+
),
|
|
228
|
+
},
|
|
229
|
+
})
|
|
230
|
+
.afterClosed()
|
|
231
|
+
.subscribe((confirmed: boolean) => {
|
|
232
|
+
if (!confirmed) return
|
|
233
|
+
const newNotLinks = [...this.notLinkResources]
|
|
234
|
+
newNotLinks.splice(index, 1, resourceCopy)
|
|
235
|
+
this.valueChange.emit([
|
|
236
|
+
...this.allResources.filter((r) => r.type === 'link'),
|
|
237
|
+
...newNotLinks,
|
|
238
|
+
])
|
|
239
|
+
})
|
|
240
|
+
}
|
|
241
|
+
}
|
|
@@ -68,7 +68,7 @@ export class FormFieldOverviewsComponent {
|
|
|
68
68
|
})
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
|
-
error: this.
|
|
71
|
+
error: (error: Error) => this.handleError(error),
|
|
72
72
|
})
|
|
73
73
|
}
|
|
74
74
|
|
|
@@ -87,7 +87,7 @@ export class FormFieldOverviewsComponent {
|
|
|
87
87
|
description: filename,
|
|
88
88
|
})
|
|
89
89
|
} catch (e) {
|
|
90
|
-
this.
|
|
90
|
+
this.handleError(e as Error)
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
@@ -106,8 +106,9 @@ export class FormFieldOverviewsComponent {
|
|
|
106
106
|
this.valueChange.emit(overView ? [overView] : [])
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
private
|
|
109
|
+
private handleError = (error: Error) => {
|
|
110
110
|
this.uploadProgress = undefined
|
|
111
|
+
this.cd.markForCheck()
|
|
111
112
|
this.notificationsService.showNotification({
|
|
112
113
|
type: 'error',
|
|
113
114
|
title: this.translateService.instant('editor.record.resourceError.title'),
|
|
@@ -70,7 +70,7 @@ export class FormFieldUpdateFrequencyComponent implements OnInit {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
get selectedFrequency(): string {
|
|
73
|
-
if (typeof this.value === 'string') return null
|
|
73
|
+
if (!this.value || typeof this.value === 'string') return null
|
|
74
74
|
const { updatedTimes, per } = this.value
|
|
75
75
|
return `${per}.${updatedTimes}`
|
|
76
76
|
}
|
package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html
CHANGED
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
<div class="flex flex-row flex-start items-center gap-3 mb-[12px]">
|
|
26
26
|
<span
|
|
27
27
|
#titleInput
|
|
28
|
+
data-test="recordTitleInput"
|
|
28
29
|
class="grow font-title text-3xl font-normal"
|
|
29
30
|
[gnUiEditableLabel]="valueAsString"
|
|
30
31
|
(editableLabelChanged)="valueChange.emit($event)"
|
|
@@ -114,6 +115,20 @@
|
|
|
114
115
|
(valueChange)="valueChange.emit($event)"
|
|
115
116
|
></gn-ui-form-field-contacts-for-resource>
|
|
116
117
|
</ng-container>
|
|
118
|
+
<ng-container *ngSwitchCase="'contacts'">
|
|
119
|
+
<gn-ui-form-field-contacts
|
|
120
|
+
[value]="valueAsIndividuals"
|
|
121
|
+
(valueChange)="valueChange.emit($event)"
|
|
122
|
+
></gn-ui-form-field-contacts>
|
|
123
|
+
</ng-container>
|
|
124
|
+
<ng-container *ngSwitchCase="'onlineResources'">
|
|
125
|
+
<gn-ui-form-field-online-resources
|
|
126
|
+
*ngIf="modelSpecifier === 'onlineResourceType:!link'"
|
|
127
|
+
[metadataUuid]="uniqueIdentifier"
|
|
128
|
+
[value]="valueAsOnlineResources"
|
|
129
|
+
(valueChange)="valueChange.emit($event)"
|
|
130
|
+
></gn-ui-form-field-online-resources>
|
|
131
|
+
</ng-container>
|
|
117
132
|
<ng-container *ngSwitchCase="'onlineResources'">
|
|
118
133
|
<gn-ui-form-field-online-link-resources
|
|
119
134
|
*ngIf="modelSpecifier === 'onlineResourceType:link'"
|
package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts
CHANGED
|
@@ -24,23 +24,25 @@ import { EditableLabelDirective } from '../../../../../../../../libs/ui/inputs/s
|
|
|
24
24
|
import { FormFieldWrapperComponent } from '../../../../../../../../libs/ui/layout/src'
|
|
25
25
|
import { TranslateModule } from '@ngx-translate/core'
|
|
26
26
|
import {
|
|
27
|
-
FormFieldLicenseComponent,
|
|
28
27
|
FormFieldDateUpdatedComponent,
|
|
28
|
+
FormFieldLicenseComponent,
|
|
29
29
|
FormFieldTemporalExtentsComponent,
|
|
30
30
|
} from '.'
|
|
31
31
|
import { FieldModelSpecifier, FormFieldConfig } from '../../../models'
|
|
32
32
|
import { FormFieldArrayComponent } from './form-field-array/form-field-array.component'
|
|
33
33
|
import { FormFieldContactsForResourceComponent } from './form-field-contacts-for-resource/form-field-contacts-for-resource.component'
|
|
34
|
+
import { FormFieldContactsComponent } from './form-field-contacts/form-field-contacts.component'
|
|
34
35
|
import { FormFieldFileComponent } from './form-field-file/form-field-file.component'
|
|
35
36
|
import { FormFieldKeywordsComponent } from './form-field-keywords/form-field-keywords.component'
|
|
36
37
|
import { FormFieldObjectComponent } from './form-field-object/form-field-object.component'
|
|
38
|
+
import { FormFieldOnlineLinkResourcesComponent } from './form-field-online-link-resources/form-field-online-link-resources.component'
|
|
39
|
+
import { FormFieldOnlineResourcesComponent } from './form-field-online-resources/form-field-online-resources.component'
|
|
40
|
+
import { FormFieldOpenDataComponent } from './form-field-open-data/form-field-open-data.component'
|
|
37
41
|
import { FormFieldOverviewsComponent } from './form-field-overviews/form-field-overviews.component'
|
|
38
42
|
import { FormFieldRichComponent } from './form-field-rich/form-field-rich.component'
|
|
39
43
|
import { FormFieldSimpleComponent } from './form-field-simple/form-field-simple.component'
|
|
40
44
|
import { FormFieldSpatialExtentComponent } from './form-field-spatial-extent/form-field-spatial-extent.component'
|
|
41
45
|
import { FormFieldUpdateFrequencyComponent } from './form-field-update-frequency/form-field-update-frequency.component'
|
|
42
|
-
import { FormFieldOpenDataComponent } from './form-field-open-data/form-field-open-data.component'
|
|
43
|
-
import { FormFieldOnlineLinkResourcesComponent } from './form-field-online-link-resources/form-field-online-link-resources.component'
|
|
44
46
|
|
|
45
47
|
@Component({
|
|
46
48
|
selector: 'gn-ui-form-field',
|
|
@@ -69,7 +71,9 @@ import { FormFieldOnlineLinkResourcesComponent } from './form-field-online-link-
|
|
|
69
71
|
FormFieldOverviewsComponent,
|
|
70
72
|
FormFieldContactsForResourceComponent,
|
|
71
73
|
FormFieldOpenDataComponent,
|
|
74
|
+
FormFieldOnlineResourcesComponent,
|
|
72
75
|
FormFieldOnlineLinkResourcesComponent,
|
|
76
|
+
FormFieldContactsComponent,
|
|
73
77
|
],
|
|
74
78
|
})
|
|
75
79
|
export class FormFieldComponent {
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
<div class="pl-5 pt-24 flex flex-1 flex-col justify-between">
|
|
2
|
-
<div
|
|
3
|
-
#wizardFields
|
|
4
|
-
class="flex-1 flex"
|
|
5
|
-
*ngFor="let config of configuration; let i = index"
|
|
6
|
-
>
|
|
1
|
+
<div class="pl-5 pt-24 flex flex-1 flex-col justify-between" #wizardFields>
|
|
2
|
+
<div class="flex-1 flex" *ngFor="let config of configuration; let i = index">
|
|
7
3
|
<gn-ui-wizard-field [wizardFieldConfig]="config"></gn-ui-wizard-field>
|
|
8
4
|
</div>
|
|
9
5
|
</div>
|
|
@@ -93,6 +93,13 @@ export const CONTACTS_FOR_RESOURCE_FIELD: EditorField = {
|
|
|
93
93
|
},
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
+
export const CONTACTS: EditorField = {
|
|
97
|
+
model: 'contacts',
|
|
98
|
+
formFieldConfig: {
|
|
99
|
+
labelKey: '',
|
|
100
|
+
},
|
|
101
|
+
}
|
|
102
|
+
|
|
96
103
|
export const RECORD_GRAPHICAL_OVERVIEW_FIELD: EditorField = {
|
|
97
104
|
model: 'overviews',
|
|
98
105
|
formFieldConfig: {
|
|
@@ -107,6 +114,14 @@ export const RECORD_SPATIAL_EXTENTS_FIELD: EditorField = {
|
|
|
107
114
|
},
|
|
108
115
|
}
|
|
109
116
|
|
|
117
|
+
export const RECORD_ONLINE_RESOURCES: EditorField = {
|
|
118
|
+
model: 'onlineResources',
|
|
119
|
+
modelSpecifier: 'onlineResourceType:!link',
|
|
120
|
+
formFieldConfig: {
|
|
121
|
+
labelKey: marker('editor.record.form.field.onlineResources'),
|
|
122
|
+
},
|
|
123
|
+
}
|
|
124
|
+
|
|
110
125
|
export const RECORD_ONLINE_LINK_RESOURCES: EditorField = {
|
|
111
126
|
model: 'onlineResources',
|
|
112
127
|
modelSpecifier: 'onlineResourceType:link',
|
|
@@ -154,11 +169,12 @@ export const ASSOCIATED_RESOURCES_SECTION: EditorSection = {
|
|
|
154
169
|
'editor.record.form.section.associatedResources.description'
|
|
155
170
|
),
|
|
156
171
|
hidden: false,
|
|
157
|
-
fields: [],
|
|
172
|
+
fields: [RECORD_ONLINE_RESOURCES],
|
|
158
173
|
}
|
|
159
174
|
|
|
160
175
|
export const ANNEXES_SECTION: EditorSection = {
|
|
161
176
|
labelKey: marker('editor.record.form.section.annexes.label'),
|
|
177
|
+
descriptionKey: marker('editor.record.form.section.annexes.description'),
|
|
162
178
|
hidden: false,
|
|
163
179
|
fields: [RECORD_ONLINE_LINK_RESOURCES],
|
|
164
180
|
}
|
|
@@ -191,7 +207,7 @@ export const DATA_POINT_OF_CONTACT_SECTION: EditorSection = {
|
|
|
191
207
|
'editor.record.form.section.dataPointOfContact.description'
|
|
192
208
|
),
|
|
193
209
|
hidden: false,
|
|
194
|
-
fields: [],
|
|
210
|
+
fields: [CONTACTS],
|
|
195
211
|
}
|
|
196
212
|
|
|
197
213
|
/************************************************************
|
|
@@ -15,6 +15,7 @@ export class EditorService {
|
|
|
15
15
|
// returns the record as it was when saved, alongside its source
|
|
16
16
|
saveRecord(
|
|
17
17
|
record: CatalogRecord,
|
|
18
|
+
recordSource: string,
|
|
18
19
|
fieldsConfig: EditorConfig,
|
|
19
20
|
generateNewUniqueIdentifier = false
|
|
20
21
|
): Observable<[CatalogRecord, string]> {
|
|
@@ -40,7 +41,7 @@ export class EditorService {
|
|
|
40
41
|
savedRecord.uniqueIdentifier = null
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
return this.recordsRepository.saveRecord(savedRecord).pipe(
|
|
44
|
+
return this.recordsRepository.saveRecord(savedRecord, recordSource).pipe(
|
|
44
45
|
switchMap((uniqueIdentifier) =>
|
|
45
46
|
this.recordsRepository.openRecordForEdition(uniqueIdentifier)
|
|
46
47
|
),
|
|
@@ -54,9 +55,12 @@ export class EditorService {
|
|
|
54
55
|
|
|
55
56
|
// emits and completes once saving is done
|
|
56
57
|
// note: onSave processes are not run for drafts
|
|
57
|
-
saveRecordAsDraft(
|
|
58
|
+
saveRecordAsDraft(
|
|
59
|
+
record: CatalogRecord,
|
|
60
|
+
recordSource: string
|
|
61
|
+
): Observable<void> {
|
|
58
62
|
return this.recordsRepository
|
|
59
|
-
.saveRecordAsDraft(record)
|
|
63
|
+
.saveRecordAsDraft(record, recordSource)
|
|
60
64
|
.pipe(map(() => undefined))
|
|
61
65
|
}
|
|
62
66
|
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
export * from './lib/+state/map.facade'
|
|
2
|
-
export * from './lib/+state/map.models'
|
|
3
2
|
export * from './lib/+state/map.selectors'
|
|
4
3
|
export * from './lib/+state/map.reducer'
|
|
5
4
|
export * from './lib/+state/map.actions'
|
|
6
5
|
export * from './lib/feature-map.module'
|
|
7
|
-
export * from './lib/
|
|
8
|
-
export * from './lib/manager/map-instance.directive'
|
|
9
|
-
export * from './lib/feature-info/feature-info.service'
|
|
10
|
-
export * from './lib/map-context/map-context.model'
|
|
11
|
-
export * from './lib/map-context/map-context.service'
|
|
12
|
-
export * from './lib/map-context/component/map-context.component'
|
|
6
|
+
export * from './lib/map-state-container/map-state-container.component'
|
|
13
7
|
export * from './lib/constant'
|
|
14
8
|
export * from './lib/utils'
|
|
15
9
|
export * from './lib/style'
|
|
16
10
|
export * from './lib/layers-panel/layers-panel.component'
|
|
17
11
|
export * from './lib/add-layer-from-catalog/add-layer-from-catalog.component'
|
|
18
12
|
export * from './lib/add-layer-from-catalog/add-layer-record-preview/add-layer-record-preview.component'
|
|
19
|
-
export * from './lib/map-container/map-container.component'
|
|
20
13
|
export * from './lib/geocoding/geocoding.component'
|
|
@@ -1,32 +1,17 @@
|
|
|
1
1
|
import { createAction, props } from '@ngrx/store'
|
|
2
|
-
import {
|
|
2
|
+
import { MapContext } from '@geospatial-sdk/core'
|
|
3
|
+
import type { Feature } from 'geojson'
|
|
3
4
|
|
|
4
|
-
export const
|
|
5
|
-
'[Map]
|
|
6
|
-
props<{
|
|
5
|
+
export const setContext = createAction(
|
|
6
|
+
'[Map] Set Context',
|
|
7
|
+
props<{ context: MapContext }>()
|
|
7
8
|
)
|
|
8
9
|
|
|
9
|
-
export const
|
|
10
|
-
'[Map]
|
|
11
|
-
props<{
|
|
10
|
+
export const setSelectedFeatures = createAction(
|
|
11
|
+
'[Map] Set Selected Features',
|
|
12
|
+
props<{ selectedFeatures: Feature[] }>()
|
|
12
13
|
)
|
|
13
14
|
|
|
14
|
-
export const
|
|
15
|
-
'[Map]
|
|
16
|
-
props<{ updatedLayer: MapLayer; index: number }>()
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
export const changeLayerOrder = createAction(
|
|
20
|
-
'[Map] Change Layer Order',
|
|
21
|
-
props<{ currentIndex: number; newIndex: number }>()
|
|
22
|
-
)
|
|
23
|
-
|
|
24
|
-
export const setLayerError = createAction(
|
|
25
|
-
'[Map] Set Layer Error',
|
|
26
|
-
props<{ index: number; error: string }>()
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
export const clearLayerError = createAction(
|
|
30
|
-
'[Map] Clear Layer Error',
|
|
31
|
-
props<{ index: number }>()
|
|
15
|
+
export const clearSelectedFeatures = createAction(
|
|
16
|
+
'[Map] Clear Selected Features'
|
|
32
17
|
)
|
|
@@ -1,30 +1,26 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core'
|
|
2
2
|
import { select, Store } from '@ngrx/store'
|
|
3
3
|
import * as MapSelectors from './map.selectors'
|
|
4
|
-
import { MapLayer } from './map.models'
|
|
5
4
|
import * as MapActions from './map.actions'
|
|
5
|
+
import { MapContext } from '@geospatial-sdk/core'
|
|
6
|
+
import { Feature } from 'geojson'
|
|
6
7
|
|
|
7
8
|
@Injectable()
|
|
8
9
|
export class MapFacade {
|
|
9
|
-
|
|
10
|
+
context$ = this.store.pipe(select(MapSelectors.getMapContext))
|
|
11
|
+
selectedFeatures$ = this.store.pipe(select(MapSelectors.getSelectedFeatures))
|
|
10
12
|
|
|
11
13
|
constructor(private readonly store: Store) {}
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* or more tasks in your Effects.
|
|
16
|
-
*/
|
|
17
|
-
init() {
|
|
18
|
-
// placeholder
|
|
15
|
+
applyContext(context: MapContext) {
|
|
16
|
+
this.store.dispatch(MapActions.setContext({ context }))
|
|
19
17
|
}
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
this.store.dispatch(MapActions.
|
|
19
|
+
selectFeatures(selectedFeatures: Feature[]) {
|
|
20
|
+
this.store.dispatch(MapActions.setSelectedFeatures({ selectedFeatures }))
|
|
23
21
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
removeLayer(index: number) {
|
|
28
|
-
this.store.dispatch(MapActions.removeLayer({ index }))
|
|
22
|
+
|
|
23
|
+
clearFeatureSelection() {
|
|
24
|
+
this.store.dispatch(MapActions.clearSelectedFeatures())
|
|
29
25
|
}
|
|
30
26
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Action, createReducer, on } from '@ngrx/store'
|
|
2
|
-
|
|
3
2
|
import * as MapActions from './map.actions'
|
|
4
|
-
import {
|
|
3
|
+
import { MapContext } from '@geospatial-sdk/core'
|
|
4
|
+
import { Feature } from 'geojson'
|
|
5
5
|
|
|
6
6
|
export const MAP_FEATURE_KEY = 'map'
|
|
7
7
|
|
|
8
8
|
export interface MapState {
|
|
9
|
-
|
|
9
|
+
context: MapContext
|
|
10
|
+
selectedFeatures: Feature[]
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export interface MapPartialState {
|
|
@@ -14,68 +15,30 @@ export interface MapPartialState {
|
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export const initialMapState: MapState = {
|
|
17
|
-
layers: [],
|
|
18
|
+
context: { layers: [], view: null },
|
|
19
|
+
selectedFeatures: [],
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
const reducer = createReducer(
|
|
21
23
|
initialMapState,
|
|
22
|
-
on(MapActions.
|
|
23
|
-
const layers: MapLayerWithInfo[] = [...state.layers]
|
|
24
|
-
const layerWithInfo = { ...action.layer, loading: false, error: null }
|
|
25
|
-
if (!('atIndex' in action)) layers.push(layerWithInfo)
|
|
26
|
-
else layers.splice(action.atIndex, 0, layerWithInfo)
|
|
24
|
+
on(MapActions.setContext, (state, { context }) => {
|
|
27
25
|
return {
|
|
28
26
|
...state,
|
|
29
|
-
|
|
27
|
+
context,
|
|
30
28
|
}
|
|
31
29
|
}),
|
|
32
|
-
on(MapActions.
|
|
33
|
-
...state,
|
|
34
|
-
layers: state.layers.map((layer, index) =>
|
|
35
|
-
index === action.index
|
|
36
|
-
? {
|
|
37
|
-
...action.updatedLayer,
|
|
38
|
-
loading: false,
|
|
39
|
-
error: null,
|
|
40
|
-
}
|
|
41
|
-
: layer
|
|
42
|
-
),
|
|
43
|
-
})),
|
|
44
|
-
on(MapActions.removeLayer, (state, action) => ({
|
|
45
|
-
...state,
|
|
46
|
-
layers: state.layers.filter((layer, index) => index !== action.index),
|
|
47
|
-
})),
|
|
48
|
-
on(MapActions.changeLayerOrder, (state, action) => {
|
|
49
|
-
const layers: MapLayerWithInfo[] = [...state.layers]
|
|
50
|
-
const moved = layers.splice(action.currentIndex, 1)[0]
|
|
51
|
-
layers.splice(action.newIndex, 0, moved)
|
|
30
|
+
on(MapActions.setSelectedFeatures, (state, { selectedFeatures }) => {
|
|
52
31
|
return {
|
|
53
32
|
...state,
|
|
54
|
-
|
|
33
|
+
selectedFeatures,
|
|
55
34
|
}
|
|
56
35
|
}),
|
|
57
|
-
on(MapActions.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
error: action.error,
|
|
64
|
-
}
|
|
65
|
-
: layer
|
|
66
|
-
),
|
|
67
|
-
})),
|
|
68
|
-
on(MapActions.clearLayerError, (state, action) => ({
|
|
69
|
-
...state,
|
|
70
|
-
layers: state.layers.map((layer, index) =>
|
|
71
|
-
index === action.index
|
|
72
|
-
? {
|
|
73
|
-
...layer,
|
|
74
|
-
error: null,
|
|
75
|
-
}
|
|
76
|
-
: layer
|
|
77
|
-
),
|
|
78
|
-
}))
|
|
36
|
+
on(MapActions.clearSelectedFeatures, (state) => {
|
|
37
|
+
return {
|
|
38
|
+
...state,
|
|
39
|
+
selectedFeatures: [],
|
|
40
|
+
}
|
|
41
|
+
})
|
|
79
42
|
)
|
|
80
43
|
|
|
81
44
|
export function mapReducer(state: MapState | undefined, action: Action) {
|
|
@@ -4,7 +4,12 @@ import { MAP_FEATURE_KEY, MapState } from './map.reducer'
|
|
|
4
4
|
// Lookup the 'Map' feature state managed by NgRx
|
|
5
5
|
export const getMapState = createFeatureSelector<MapState>(MAP_FEATURE_KEY)
|
|
6
6
|
|
|
7
|
-
export const
|
|
7
|
+
export const getMapContext = createSelector(
|
|
8
8
|
getMapState,
|
|
9
|
-
(state: MapState) => state.
|
|
9
|
+
(state: MapState) => state.context
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
export const getSelectedFeatures = createSelector(
|
|
13
|
+
getMapState,
|
|
14
|
+
(state: MapState) => state.selectedFeatures
|
|
10
15
|
)
|