geonetwork-ui 2.8.0-dev.93d2d87c0 → 2.8.0-dev.b7a1670bc
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/index.mjs +2 -1
- package/esm2022/libs/api/metadata-converter/src/lib/common/distribution.mapper.mjs +5 -1
- package/esm2022/libs/api/metadata-converter/src/lib/common/resource-types.mjs +6 -1
- package/esm2022/libs/api/metadata-converter/src/lib/dcat-ap/dcat-ap.converter.mjs +3 -3
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.mjs +31 -4
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.mjs +7 -7
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/read-parts.mjs +3 -2
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +4 -3
- package/esm2022/libs/api/repository/src/lib/gn4/auth/auth.service.mjs +2 -2
- package/esm2022/libs/api/repository/src/lib/gn4/elasticsearch/constant.mjs +2 -2
- package/esm2022/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.mjs +7 -3
- package/esm2022/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.mjs +10 -10
- package/esm2022/libs/api/repository/src/lib/gn4/settings/gn4-settings.service.mjs +3 -2
- package/esm2022/libs/common/domain/src/index.mjs +3 -0
- package/esm2022/libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model.mjs +1 -1
- package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +3 -1
- package/esm2022/libs/common/domain/src/lib/model/search/sort-by.model.mjs +6 -1
- package/esm2022/libs/common/domain/src/lib/platform.service.interface.mjs +1 -1
- package/esm2022/libs/data-access/gn4/src/openapi/model/user.api.model.mjs +1 -1
- package/esm2022/libs/feature/dataviz/src/lib/chart-view/chart-view.component.mjs +3 -1
- package/esm2022/libs/feature/dataviz/src/lib/geo-table-view/geo-table-view.component.mjs +2 -2
- package/esm2022/libs/feature/dataviz/src/lib/service/data.service.mjs +26 -8
- package/esm2022/libs/feature/editor/src/lib/components/multilingual-panel/multilingual-panel.component.mjs +3 -3
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.mjs +23 -3
- package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +2 -2
- package/esm2022/libs/feature/map/src/lib/map-state-container/map-state-container.component.mjs +2 -2
- package/esm2022/libs/feature/record/src/index.mjs +2 -1
- package/esm2022/libs/feature/record/src/lib/data-view/data-view.component.mjs +1 -1
- package/esm2022/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.mjs +13 -4
- package/esm2022/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.mjs +23 -8
- package/esm2022/libs/feature/record/src/lib/gpf-api-dl/gpf-api-dl.component.mjs +4 -4
- package/esm2022/libs/feature/record/src/lib/gpf-api-dl-list-item/gpf-api-dl-list-item.component.mjs +1 -1
- package/esm2022/libs/feature/record/src/lib/map-view/map-view.component.mjs +4 -3
- package/esm2022/libs/feature/record/src/lib/stac-view/stac-view.component.mjs +230 -0
- package/esm2022/libs/feature/record/src/lib/stac-view/utils.mjs +26 -0
- package/esm2022/libs/feature/record/src/lib/state/mdview.effects.mjs +2 -2
- package/esm2022/libs/feature/record/src/lib/state/mdview.facade.mjs +14 -1
- package/esm2022/libs/feature/router/src/lib/default/router.service.mjs +5 -1
- package/esm2022/libs/feature/router/src/lib/default/state/router.effects.mjs +9 -7
- package/esm2022/libs/feature/search/src/lib/constants.mjs +2 -2
- package/esm2022/libs/feature/search/src/lib/sort-by/sort-by.component.mjs +8 -12
- package/esm2022/libs/feature/search/src/lib/utils/service/fields.mjs +36 -22
- package/esm2022/libs/feature/search/src/lib/utils/service/fields.service.mjs +2 -1
- package/esm2022/libs/ui/elements/src/index.mjs +3 -1
- package/esm2022/libs/ui/elements/src/lib/downloads-list/downloads-list.component.mjs +1 -1
- package/esm2022/libs/ui/elements/src/lib/external-link-card/external-link-card.component.mjs +11 -4
- package/esm2022/libs/ui/elements/src/lib/metadata-doi/metadata-doi.component.mjs +37 -0
- package/esm2022/libs/ui/elements/src/lib/metadata-info/metadata-info.component.mjs +5 -9
- package/esm2022/libs/ui/elements/src/lib/stac-items-result-grid/stac-items-result-grid.component.mjs +18 -0
- package/esm2022/libs/ui/elements/src/lib/user-feedback-item/user-feedback-item.component.mjs +5 -5
- package/esm2022/libs/ui/inputs/src/index.mjs +2 -1
- package/esm2022/libs/ui/inputs/src/lib/check-toggle/check-toggle.component.mjs +3 -3
- package/esm2022/libs/ui/inputs/src/lib/date-picker/date-picker.component.mjs +21 -7
- package/esm2022/libs/ui/inputs/src/lib/date-range-dropdown/date-range-dropdown.component.mjs +3 -3
- package/esm2022/libs/ui/inputs/src/lib/date-range-inputs/date-range-inputs.component.mjs +35 -0
- package/esm2022/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.mjs +2 -3
- package/esm2022/libs/ui/layout/src/lib/paginable.interface.mjs +1 -1
- package/esm2022/libs/ui/layout/src/lib/previous-next-buttons/previous-next-buttons.component.mjs +13 -5
- package/esm2022/libs/ui/map/src/lib/components/map-container/map-container.component.mjs +86 -32
- package/esm2022/libs/ui/map/src/lib/components/spatial-extent/spatial-extent.component.mjs +1 -1
- package/esm2022/libs/ui/widgets/src/lib/loading-mask/loading-mask.component.mjs +3 -3
- package/esm2022/libs/util/i18n/src/lib/date-locales.mjs +33 -0
- package/esm2022/libs/util/shared/src/index.mjs +2 -1
- package/esm2022/libs/util/shared/src/lib/humanize-date.directive.mjs +33 -0
- package/esm2022/libs/util/shared/src/lib/links/link-classifier.service.mjs +5 -1
- package/esm2022/libs/util/shared/src/lib/links/link-utils.mjs +12 -1
- package/esm2022/libs/util/shared/src/lib/services/date.service.mjs +19 -2
- package/esm2022/libs/util/shared/src/lib/services/proxy.service.mjs +9 -11
- package/esm2022/libs/util/shared/src/lib/utils/sort-by.mjs +9 -6
- package/esm2022/translations/de.json +20 -3
- package/esm2022/translations/en.json +20 -4
- package/esm2022/translations/es.json +19 -2
- package/esm2022/translations/fr.json +20 -3
- package/esm2022/translations/it.json +21 -4
- package/esm2022/translations/nl.json +19 -2
- package/esm2022/translations/pt.json +19 -2
- package/esm2022/translations/sk.json +20 -3
- package/fesm2022/geonetwork-ui-date-locales-DhlIiWpT.mjs +35 -0
- package/fesm2022/geonetwork-ui-date-locales-DhlIiWpT.mjs.map +1 -0
- package/fesm2022/geonetwork-ui.mjs +946 -287
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.ts +1 -0
- package/libs/api/metadata-converter/src/lib/common/distribution.mapper.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/common/resource-types.d.ts +3 -0
- package/libs/api/metadata-converter/src/lib/common/resource-types.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts +5 -1
- package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/auth/auth.service.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts +7 -7
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/settings/gn4-settings.service.d.ts.map +1 -1
- package/libs/common/domain/src/index.d.ts +3 -0
- package/libs/common/domain/src/index.d.ts.map +1 -0
- package/libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model.d.ts +1 -1
- package/libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model.d.ts.map +1 -1
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +7 -2
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
- package/libs/common/domain/src/lib/model/search/sort-by.model.d.ts.map +1 -1
- package/libs/common/domain/src/lib/platform.service.interface.d.ts +1 -1
- package/libs/common/domain/src/lib/platform.service.interface.d.ts.map +1 -1
- package/libs/data-access/gn4/src/openapi/model/user.api.model.d.ts +1 -1
- 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 +2 -1
- package/libs/feature/dataviz/src/lib/service/data.service.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts +2 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts.map +1 -1
- package/libs/feature/record/src/index.d.ts +1 -0
- package/libs/feature/record/src/index.d.ts.map +1 -1
- package/libs/feature/record/src/lib/data-view/data-view.component.d.ts +5 -1
- package/libs/feature/record/src/lib/data-view/data-view.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.d.ts +3 -2
- package/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.d.ts +3 -2
- package/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/gpf-api-dl/gpf-api-dl.component.d.ts +12 -5
- package/libs/feature/record/src/lib/gpf-api-dl/gpf-api-dl.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/gpf-api-dl-list-item/gpf-api-dl-list-item.component.d.ts +3 -1
- package/libs/feature/record/src/lib/gpf-api-dl-list-item/gpf-api-dl-list-item.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/map-view/map-view.component.d.ts +5 -1
- package/libs/feature/record/src/lib/map-view/map-view.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/stac-view/stac-view.component.d.ts +53 -0
- package/libs/feature/record/src/lib/stac-view/stac-view.component.d.ts.map +1 -0
- package/libs/feature/record/src/lib/stac-view/utils.d.ts +7 -0
- package/libs/feature/record/src/lib/stac-view/utils.d.ts.map +1 -0
- package/libs/feature/record/src/lib/state/mdview.facade.d.ts +28 -24
- package/libs/feature/record/src/lib/state/mdview.facade.d.ts.map +1 -1
- package/libs/feature/router/src/lib/default/router.service.d.ts +2 -0
- package/libs/feature/router/src/lib/default/router.service.d.ts.map +1 -1
- package/libs/feature/router/src/lib/default/state/router.effects.d.ts +3 -1
- package/libs/feature/router/src/lib/default/state/router.effects.d.ts.map +1 -1
- package/libs/feature/search/src/lib/sort-by/sort-by.component.d.ts +4 -3
- package/libs/feature/search/src/lib/sort-by/sort-by.component.d.ts.map +1 -1
- package/libs/feature/search/src/lib/utils/service/fields.d.ts.map +1 -1
- package/libs/feature/search/src/lib/utils/service/fields.service.d.ts.map +1 -1
- package/libs/ui/elements/src/index.d.ts +2 -0
- package/libs/ui/elements/src/index.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/external-link-card/external-link-card.component.d.ts +3 -2
- package/libs/ui/elements/src/lib/external-link-card/external-link-card.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/metadata-doi/metadata-doi.component.d.ts +8 -0
- package/libs/ui/elements/src/lib/metadata-doi/metadata-doi.component.d.ts.map +1 -0
- package/libs/ui/elements/src/lib/metadata-info/metadata-info.component.d.ts +0 -2
- package/libs/ui/elements/src/lib/metadata-info/metadata-info.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/stac-items-result-grid/stac-items-result-grid.component.d.ts +8 -0
- package/libs/ui/elements/src/lib/stac-items-result-grid/stac-items-result-grid.component.d.ts.map +1 -0
- 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/date-picker/date-picker.component.d.ts +5 -0
- package/libs/ui/inputs/src/lib/date-picker/date-picker.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/date-range-inputs/date-range-inputs.component.d.ts +12 -0
- package/libs/ui/inputs/src/lib/date-range-inputs/date-range-inputs.component.d.ts.map +1 -0
- package/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.d.ts.map +1 -1
- package/libs/ui/layout/src/lib/paginable.interface.d.ts +3 -3
- package/libs/ui/layout/src/lib/paginable.interface.d.ts.map +1 -1
- package/libs/ui/layout/src/lib/previous-next-buttons/previous-next-buttons.component.d.ts +2 -1
- package/libs/ui/layout/src/lib/previous-next-buttons/previous-next-buttons.component.d.ts.map +1 -1
- package/libs/ui/map/src/lib/components/map-container/map-container.component.d.ts +24 -14
- package/libs/ui/map/src/lib/components/map-container/map-container.component.d.ts.map +1 -1
- package/libs/util/i18n/src/lib/date-locales.d.ts +5 -0
- package/libs/util/i18n/src/lib/date-locales.d.ts.map +1 -0
- package/libs/util/shared/src/index.d.ts +1 -0
- package/libs/util/shared/src/index.d.ts.map +1 -1
- package/libs/util/shared/src/lib/humanize-date.directive.d.ts +15 -0
- package/libs/util/shared/src/lib/humanize-date.directive.d.ts.map +1 -0
- 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 -0
- package/libs/util/shared/src/lib/links/link-utils.d.ts.map +1 -1
- package/libs/util/shared/src/lib/services/date.service.d.ts +4 -0
- package/libs/util/shared/src/lib/services/date.service.d.ts.map +1 -1
- package/libs/util/shared/src/lib/services/proxy.service.d.ts +5 -4
- package/libs/util/shared/src/lib/services/proxy.service.d.ts.map +1 -1
- package/libs/util/shared/src/lib/utils/sort-by.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/libs/api/metadata-converter/src/lib/common/distribution.mapper.ts +2 -0
- package/src/libs/api/metadata-converter/src/lib/common/resource-types.ts +11 -0
- package/src/libs/api/metadata-converter/src/lib/dcat-ap/dcat-ap.converter.ts +2 -2
- 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.service+eaux-usees.ts +1 -1
- package/src/libs/api/metadata-converter/src/lib/fixtures/geo2france.records.ts +5 -2
- package/src/libs/api/metadata-converter/src/lib/fixtures/geocat-ch.records.ts +1 -1
- package/src/libs/api/metadata-converter/src/lib/fixtures/georhena.records.ts +1 -1
- package/src/libs/api/metadata-converter/src/lib/fixtures/metawal.records.ts +2 -2
- package/src/libs/api/metadata-converter/src/lib/fixtures/wallonie.records.reuse.ts +1 -1
- package/src/libs/api/metadata-converter/src/lib/fixtures/wallonie.records.service+napitswallonia.ts +1 -1
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +39 -3
- package/src/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.ts +13 -6
- package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +6 -2
- package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +4 -2
- package/src/libs/api/repository/src/lib/gn4/auth/auth.service.ts +4 -1
- package/src/libs/api/repository/src/lib/gn4/elasticsearch/constant.ts +1 -1
- package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.mapper.ts +12 -4
- package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.ts +37 -36
- package/src/libs/api/repository/src/lib/gn4/settings/gn4-settings.service.ts +3 -2
- package/src/libs/common/domain/src/index.ts +2 -0
- package/src/libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model.ts +1 -1
- package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +12 -1
- package/src/libs/common/domain/src/lib/model/search/sort-by.model.ts +5 -0
- package/src/libs/common/domain/src/lib/platform.service.interface.ts +1 -1
- package/src/libs/common/fixtures/src/lib/elasticsearch/metadata-links.fixtures.ts +5 -0
- package/src/libs/common/fixtures/src/lib/link.fixtures.ts +19 -0
- package/src/libs/data-access/gn4/src/openapi/model/user.api.model.ts +1 -1
- package/src/libs/feature/dataviz/src/lib/chart-view/chart-view.component.ts +1 -0
- package/src/libs/feature/dataviz/src/lib/service/data.service.ts +30 -5
- package/src/libs/feature/editor/src/lib/components/multilingual-panel/multilingual-panel.component.html +1 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +3 -3
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +30 -0
- package/src/libs/feature/editor/src/lib/fields.config.ts +1 -1
- package/src/libs/feature/record/src/index.ts +1 -0
- package/src/libs/feature/record/src/lib/data-view/data-view.component.ts +5 -1
- package/src/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.ts +7 -1
- package/src/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.ts +23 -4
- package/src/libs/feature/record/src/lib/gpf-api-dl/gpf-api-dl.component.ts +10 -8
- package/src/libs/feature/record/src/lib/gpf-api-dl-list-item/gpf-api-dl-list-item.component.ts +1 -1
- package/src/libs/feature/record/src/lib/map-view/map-view.component.html +1 -2
- package/src/libs/feature/record/src/lib/map-view/map-view.component.ts +6 -2
- package/src/libs/feature/record/src/lib/stac-view/stac-view.component.css +8 -0
- package/src/libs/feature/record/src/lib/stac-view/stac-view.component.html +87 -0
- package/src/libs/feature/record/src/lib/stac-view/stac-view.component.ts +339 -0
- package/src/libs/feature/record/src/lib/stac-view/utils.ts +57 -0
- package/src/libs/feature/record/src/lib/state/mdview.effects.ts +1 -1
- package/src/libs/feature/record/src/lib/state/mdview.facade.ts +30 -1
- package/src/libs/feature/router/src/lib/default/router.service.ts +8 -0
- package/src/libs/feature/router/src/lib/default/state/router.effects.ts +6 -7
- package/src/libs/feature/search/src/lib/constants.ts +1 -1
- package/src/libs/feature/search/src/lib/sort-by/sort-by.component.ts +8 -12
- package/src/libs/feature/search/src/lib/utils/service/fields.service.ts +1 -0
- package/src/libs/feature/search/src/lib/utils/service/fields.ts +37 -33
- package/src/libs/ui/elements/src/index.ts +2 -0
- package/src/libs/ui/elements/src/lib/external-link-card/external-link-card.component.html +43 -22
- package/src/libs/ui/elements/src/lib/external-link-card/external-link-card.component.ts +12 -3
- package/src/libs/ui/elements/src/lib/metadata-doi/metadata-doi.component.css +0 -0
- package/src/libs/ui/elements/src/lib/metadata-doi/metadata-doi.component.html +31 -0
- package/src/libs/ui/elements/src/lib/metadata-doi/metadata-doi.component.ts +30 -0
- package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html +69 -23
- package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.ts +2 -9
- package/src/libs/ui/elements/src/lib/stac-items-result-grid/stac-items-result-grid.component.css +0 -0
- package/src/libs/ui/elements/src/lib/stac-items-result-grid/stac-items-result-grid.component.html +13 -0
- package/src/libs/ui/elements/src/lib/stac-items-result-grid/stac-items-result-grid.component.ts +15 -0
- package/src/libs/ui/elements/src/lib/user-feedback-item/user-feedback-item.component.html +1 -1
- package/src/libs/ui/elements/src/lib/user-feedback-item/user-feedback-item.component.ts +2 -2
- package/src/libs/ui/inputs/src/index.ts +1 -0
- package/src/libs/ui/inputs/src/lib/check-toggle/check-toggle.component.html +3 -3
- package/src/libs/ui/inputs/src/lib/date-picker/date-picker.component.ts +17 -1
- package/src/libs/ui/inputs/src/lib/date-range-inputs/date-range-inputs.component.css +0 -0
- package/src/libs/ui/inputs/src/lib/date-range-inputs/date-range-inputs.component.html +15 -0
- package/src/libs/ui/inputs/src/lib/date-range-inputs/date-range-inputs.component.ts +41 -0
- package/src/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.ts +4 -2
- package/src/libs/ui/layout/src/lib/paginable.interface.ts +3 -3
- package/src/libs/ui/layout/src/lib/previous-next-buttons/previous-next-buttons.component.html +12 -6
- package/src/libs/ui/layout/src/lib/previous-next-buttons/previous-next-buttons.component.ts +4 -1
- package/src/libs/ui/map/src/lib/components/map-container/map-container.component.html +16 -14
- package/src/libs/ui/map/src/lib/components/map-container/map-container.component.ts +144 -65
- package/src/libs/util/i18n/src/lib/date-locales.ts +63 -0
- package/src/libs/util/shared/src/index.ts +1 -0
- package/src/libs/util/shared/src/lib/humanize-date.directive.ts +35 -0
- package/src/libs/util/shared/src/lib/links/link-classifier.service.ts +4 -0
- package/src/libs/util/shared/src/lib/links/link-utils.ts +11 -0
- package/src/libs/util/shared/src/lib/services/date.service.ts +27 -1
- package/src/libs/util/shared/src/lib/services/proxy.service.ts +6 -2
- package/src/libs/util/shared/src/lib/utils/sort-by.ts +8 -5
- package/translations/de.json +20 -3
- package/translations/en.json +20 -4
- package/translations/es.json +19 -2
- package/translations/fr.json +20 -3
- package/translations/it.json +21 -4
- package/translations/nl.json +19 -2
- package/translations/pt.json +19 -2
- package/translations/sk.json +20 -3
- package/esm2022/libs/ui/elements/src/lib/user-feedback-item/time-since.pipe.mjs +0 -59
- package/libs/ui/elements/src/lib/user-feedback-item/time-since.pipe.d.ts +0 -11
- package/libs/ui/elements/src/lib/user-feedback-item/time-since.pipe.d.ts.map +0 -1
- package/src/libs/common/domain/src/lib/index.ts +0 -2
- package/src/libs/ui/elements/src/lib/user-feedback-item/time-since.pipe.ts +0 -54
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common'
|
|
2
|
+
import {
|
|
3
|
+
AfterViewInit,
|
|
4
|
+
ChangeDetectionStrategy,
|
|
5
|
+
Component,
|
|
6
|
+
OnInit,
|
|
7
|
+
ViewChild,
|
|
8
|
+
} from '@angular/core'
|
|
9
|
+
import {
|
|
10
|
+
DatasetRecord,
|
|
11
|
+
DatasetTemporalExtent,
|
|
12
|
+
} from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
13
|
+
import {
|
|
14
|
+
ButtonComponent,
|
|
15
|
+
DateRangeInputsComponent,
|
|
16
|
+
CheckToggleComponent,
|
|
17
|
+
} from '../../../../../../libs/ui/inputs/src'
|
|
18
|
+
import {
|
|
19
|
+
MapContainerComponent,
|
|
20
|
+
prioritizePageScroll,
|
|
21
|
+
} from '../../../../../../libs/ui/map/src'
|
|
22
|
+
import { Extent, MapContext } from '@geospatial-sdk/core/dist/model'
|
|
23
|
+
import { StacItemsResultGridComponent } from '../../../../../../libs/ui/elements/src'
|
|
24
|
+
import { NgIconComponent, provideIcons } from '@ng-icons/core'
|
|
25
|
+
import { matDeleteOutline } from '@ng-icons/material-icons/outline'
|
|
26
|
+
import {
|
|
27
|
+
TranslateDirective,
|
|
28
|
+
TranslatePipe,
|
|
29
|
+
TranslateService,
|
|
30
|
+
} from '@ngx-translate/core'
|
|
31
|
+
import { DataService } from '../../../../../../libs/feature/dataviz/src'
|
|
32
|
+
import {
|
|
33
|
+
BehaviorSubject,
|
|
34
|
+
catchError,
|
|
35
|
+
debounceTime,
|
|
36
|
+
distinctUntilChanged,
|
|
37
|
+
from,
|
|
38
|
+
map,
|
|
39
|
+
Observable,
|
|
40
|
+
of,
|
|
41
|
+
shareReplay,
|
|
42
|
+
switchMap,
|
|
43
|
+
take,
|
|
44
|
+
tap,
|
|
45
|
+
} from 'rxjs'
|
|
46
|
+
import { GetCollectionItemsOptions, StacItem } from '@camptocamp/ogc-client'
|
|
47
|
+
import { MdViewFacade } from '../state'
|
|
48
|
+
import {
|
|
49
|
+
areSpatialExtentsEqual,
|
|
50
|
+
areTemporalExtentsEqual,
|
|
51
|
+
areFilterStatesEqual,
|
|
52
|
+
} from './utils'
|
|
53
|
+
import { MapUtilsService } from '../../../../../../libs/feature/map/src'
|
|
54
|
+
import { PreviousNextButtonsComponent } from '../../../../../../libs/ui/layout/src'
|
|
55
|
+
import { FetchError } from '../../../../../../libs/util/data-fetcher/src'
|
|
56
|
+
import { PopupAlertComponent } from '../../../../../../libs/ui/widgets/src'
|
|
57
|
+
|
|
58
|
+
const STAC_ITEMS_PER_PAGE = 12
|
|
59
|
+
const DEBOUNCE_TIME_MS = 500
|
|
60
|
+
|
|
61
|
+
export interface StacFilterState {
|
|
62
|
+
temporalExtent: DatasetTemporalExtent | null
|
|
63
|
+
spatialExtent: Extent | null
|
|
64
|
+
isSpatialExtentFilterEnabled: boolean
|
|
65
|
+
pageUrl: string | null
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@Component({
|
|
69
|
+
selector: 'gn-ui-stac-view',
|
|
70
|
+
templateUrl: './stac-view.component.html',
|
|
71
|
+
styleUrls: ['./stac-view.component.css'],
|
|
72
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
73
|
+
standalone: true,
|
|
74
|
+
imports: [
|
|
75
|
+
CommonModule,
|
|
76
|
+
NgIconComponent,
|
|
77
|
+
TranslateDirective,
|
|
78
|
+
TranslatePipe,
|
|
79
|
+
StacItemsResultGridComponent,
|
|
80
|
+
DateRangeInputsComponent,
|
|
81
|
+
MapContainerComponent,
|
|
82
|
+
CheckToggleComponent,
|
|
83
|
+
PreviousNextButtonsComponent,
|
|
84
|
+
PopupAlertComponent,
|
|
85
|
+
ButtonComponent,
|
|
86
|
+
],
|
|
87
|
+
viewProviders: [provideIcons({ matDeleteOutline })],
|
|
88
|
+
})
|
|
89
|
+
export class StacViewComponent implements OnInit, AfterViewInit {
|
|
90
|
+
@ViewChild('mapContainer') mapContainer: MapContainerComponent
|
|
91
|
+
|
|
92
|
+
initialTemporalExtent: DatasetTemporalExtent | null = null
|
|
93
|
+
initialSpatialExtent: Extent | null = null
|
|
94
|
+
resolvedInitialSpatialExtent: Extent | null = null
|
|
95
|
+
initialPageUrl: string
|
|
96
|
+
previousPageUrl: string
|
|
97
|
+
nextPageUrl: string
|
|
98
|
+
|
|
99
|
+
error$ = new BehaviorSubject<string | null>(null)
|
|
100
|
+
mapContext$ = new BehaviorSubject<MapContext>({
|
|
101
|
+
layers: [],
|
|
102
|
+
view: null,
|
|
103
|
+
})
|
|
104
|
+
filterState$ = new BehaviorSubject<StacFilterState>({
|
|
105
|
+
temporalExtent: null,
|
|
106
|
+
spatialExtent: null,
|
|
107
|
+
isSpatialExtentFilterEnabled: true,
|
|
108
|
+
pageUrl: null,
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
isFilterModified$ = this.filterState$.pipe(
|
|
112
|
+
map((filterState) => {
|
|
113
|
+
const isTemporalModified = !areTemporalExtentsEqual(
|
|
114
|
+
filterState.temporalExtent,
|
|
115
|
+
this.initialTemporalExtent
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
const isSpatialModified =
|
|
119
|
+
this.resolvedInitialSpatialExtent &&
|
|
120
|
+
filterState.spatialExtent !== null &&
|
|
121
|
+
filterState.isSpatialExtentFilterEnabled &&
|
|
122
|
+
!areSpatialExtentsEqual(
|
|
123
|
+
filterState.spatialExtent,
|
|
124
|
+
this.resolvedInitialSpatialExtent
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
return isTemporalModified || isSpatialModified
|
|
128
|
+
}),
|
|
129
|
+
shareReplay({ bufferSize: 1, refCount: false })
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
items$: Observable<StacItem[]> = this.filterState$.pipe(
|
|
133
|
+
debounceTime(DEBOUNCE_TIME_MS),
|
|
134
|
+
distinctUntilChanged((prev, curr) => areFilterStatesEqual(prev, curr)),
|
|
135
|
+
switchMap((filterState) => {
|
|
136
|
+
if (filterState.pageUrl === null) {
|
|
137
|
+
return of([])
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
this.error$.next(null)
|
|
141
|
+
return from(
|
|
142
|
+
this.dataService.getItemsFromStacApi(
|
|
143
|
+
filterState.pageUrl,
|
|
144
|
+
this.buildRequestOptions(filterState)
|
|
145
|
+
)
|
|
146
|
+
).pipe(
|
|
147
|
+
tap((stacDocument) => {
|
|
148
|
+
this.previousPageUrl =
|
|
149
|
+
stacDocument.links.find((link) => link.rel === 'previous')?.href ||
|
|
150
|
+
null
|
|
151
|
+
this.nextPageUrl =
|
|
152
|
+
stacDocument.links.find((link) => link.rel === 'next')?.href || null
|
|
153
|
+
}),
|
|
154
|
+
map((stacDocument) => stacDocument.features),
|
|
155
|
+
catchError((err) => {
|
|
156
|
+
this.handleError(err)
|
|
157
|
+
return of([])
|
|
158
|
+
})
|
|
159
|
+
)
|
|
160
|
+
}),
|
|
161
|
+
shareReplay({ bufferSize: 1, refCount: false })
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
constructor(
|
|
165
|
+
private dataService: DataService,
|
|
166
|
+
private metadataViewFacade: MdViewFacade,
|
|
167
|
+
private mapUtils: MapUtilsService,
|
|
168
|
+
private translateService: TranslateService
|
|
169
|
+
) {}
|
|
170
|
+
|
|
171
|
+
ngOnInit() {
|
|
172
|
+
this.metadataViewFacade.metadata$
|
|
173
|
+
.pipe(
|
|
174
|
+
take(1),
|
|
175
|
+
map((metadata) => {
|
|
176
|
+
const temporalExtents =
|
|
177
|
+
metadata?.kind === 'dataset'
|
|
178
|
+
? (metadata as DatasetRecord).temporalExtents
|
|
179
|
+
: []
|
|
180
|
+
|
|
181
|
+
const temporalExtent =
|
|
182
|
+
temporalExtents.length > 0
|
|
183
|
+
? temporalExtents[0]
|
|
184
|
+
: ({
|
|
185
|
+
start: null,
|
|
186
|
+
end: null,
|
|
187
|
+
} as DatasetTemporalExtent)
|
|
188
|
+
|
|
189
|
+
const spatialExtent = this.mapUtils.getRecordExtent(metadata)
|
|
190
|
+
return { temporalExtent, spatialExtent }
|
|
191
|
+
})
|
|
192
|
+
)
|
|
193
|
+
.subscribe(({ temporalExtent, spatialExtent }) => {
|
|
194
|
+
this.initialTemporalExtent = temporalExtent
|
|
195
|
+
this.initialSpatialExtent = spatialExtent
|
|
196
|
+
|
|
197
|
+
this.filterState$.next({
|
|
198
|
+
...this.filterState$.value,
|
|
199
|
+
temporalExtent: this.initialTemporalExtent,
|
|
200
|
+
})
|
|
201
|
+
|
|
202
|
+
this.mapContext$.next({
|
|
203
|
+
...this.mapContext$.value,
|
|
204
|
+
view: {
|
|
205
|
+
extent: spatialExtent,
|
|
206
|
+
},
|
|
207
|
+
})
|
|
208
|
+
})
|
|
209
|
+
|
|
210
|
+
this.metadataViewFacade.stacLinks$
|
|
211
|
+
.pipe(
|
|
212
|
+
take(1),
|
|
213
|
+
map((links) => (links && links.length > 0 ? links[0] : null))
|
|
214
|
+
)
|
|
215
|
+
.subscribe((link) => {
|
|
216
|
+
if (link) {
|
|
217
|
+
this.initialPageUrl = link.url.href
|
|
218
|
+
this.filterState$.next({
|
|
219
|
+
...this.filterState$.value,
|
|
220
|
+
pageUrl: link.url.href,
|
|
221
|
+
})
|
|
222
|
+
}
|
|
223
|
+
})
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
async ngAfterViewInit() {
|
|
227
|
+
const map = await this.mapContainer.openlayersMap
|
|
228
|
+
prioritizePageScroll(map.getInteractions())
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
onTemporalExtentChange(extent: DatasetTemporalExtent | null) {
|
|
232
|
+
this.filterState$.next({
|
|
233
|
+
...this.filterState$.value,
|
|
234
|
+
temporalExtent: extent,
|
|
235
|
+
pageUrl: this.initialPageUrl,
|
|
236
|
+
})
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
onSpatialExtentChange(extent: Extent) {
|
|
240
|
+
this.filterState$.next({
|
|
241
|
+
...this.filterState$.value,
|
|
242
|
+
spatialExtent: extent,
|
|
243
|
+
pageUrl: this.initialPageUrl,
|
|
244
|
+
})
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
onResolvedMapExtentChange(extent: Extent) {
|
|
248
|
+
this.resolvedInitialSpatialExtent = extent
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
onSpatialFilterToggle(enabled: boolean) {
|
|
252
|
+
this.filterState$.next({
|
|
253
|
+
...this.filterState$.value,
|
|
254
|
+
isSpatialExtentFilterEnabled: enabled,
|
|
255
|
+
pageUrl: this.initialPageUrl,
|
|
256
|
+
})
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
onResetFilters() {
|
|
260
|
+
this.mapContext$.next({
|
|
261
|
+
...this.mapContext$.value,
|
|
262
|
+
view: {
|
|
263
|
+
extent: this.initialSpatialExtent,
|
|
264
|
+
},
|
|
265
|
+
})
|
|
266
|
+
|
|
267
|
+
this.filterState$.next({
|
|
268
|
+
temporalExtent: this.initialTemporalExtent,
|
|
269
|
+
spatialExtent: this.resolvedInitialSpatialExtent,
|
|
270
|
+
isSpatialExtentFilterEnabled: true,
|
|
271
|
+
pageUrl: this.initialPageUrl,
|
|
272
|
+
})
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
private buildRequestOptions(
|
|
276
|
+
filterState: StacFilterState
|
|
277
|
+
): GetCollectionItemsOptions {
|
|
278
|
+
const options: GetCollectionItemsOptions = {
|
|
279
|
+
limit: STAC_ITEMS_PER_PAGE,
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
if (
|
|
283
|
+
filterState.temporalExtent &&
|
|
284
|
+
(filterState.temporalExtent.start || filterState.temporalExtent.end)
|
|
285
|
+
) {
|
|
286
|
+
options.datetime = {
|
|
287
|
+
...(filterState.temporalExtent.start && {
|
|
288
|
+
start: filterState.temporalExtent.start,
|
|
289
|
+
}),
|
|
290
|
+
...(filterState.temporalExtent.end && {
|
|
291
|
+
end: filterState.temporalExtent.end,
|
|
292
|
+
}),
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
if (filterState.isSpatialExtentFilterEnabled && filterState.spatialExtent) {
|
|
297
|
+
options.bbox = filterState.spatialExtent
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
return options
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
handleError(error: FetchError | Error | string) {
|
|
304
|
+
if (error instanceof FetchError) {
|
|
305
|
+
this.error$.next(
|
|
306
|
+
this.translateService.instant(`dataset.error.${error.type}`, {
|
|
307
|
+
info: error.info,
|
|
308
|
+
})
|
|
309
|
+
)
|
|
310
|
+
console.warn(error.message)
|
|
311
|
+
} else if (error instanceof Error) {
|
|
312
|
+
this.error$.next(this.translateService.instant(error.message))
|
|
313
|
+
console.warn(error.stack || error)
|
|
314
|
+
} else {
|
|
315
|
+
this.error$.next(this.translateService.instant(error))
|
|
316
|
+
console.warn(error)
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
// Paginable API
|
|
321
|
+
get isFirstPage() {
|
|
322
|
+
return this.previousPageUrl == null
|
|
323
|
+
}
|
|
324
|
+
get isLastPage() {
|
|
325
|
+
return this.nextPageUrl == null
|
|
326
|
+
}
|
|
327
|
+
goToNextPage() {
|
|
328
|
+
this.filterState$.next({
|
|
329
|
+
...this.filterState$.value,
|
|
330
|
+
pageUrl: this.nextPageUrl,
|
|
331
|
+
})
|
|
332
|
+
}
|
|
333
|
+
goToPrevPage() {
|
|
334
|
+
this.filterState$.next({
|
|
335
|
+
...this.filterState$.value,
|
|
336
|
+
pageUrl: this.previousPageUrl,
|
|
337
|
+
})
|
|
338
|
+
}
|
|
339
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { DatasetTemporalExtent } from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
2
|
+
import { Extent } from '@geospatial-sdk/core/dist/model'
|
|
3
|
+
import { StacFilterState } from './stac-view.component'
|
|
4
|
+
|
|
5
|
+
export function areTemporalExtentsEqual(
|
|
6
|
+
previous: DatasetTemporalExtent | null,
|
|
7
|
+
current: DatasetTemporalExtent | null
|
|
8
|
+
): boolean {
|
|
9
|
+
const previousStartTime = previous?.start?.getTime() ?? null
|
|
10
|
+
const previousEndTime = previous?.end?.getTime() ?? null
|
|
11
|
+
|
|
12
|
+
const currentStartTime = current?.start?.getTime() ?? null
|
|
13
|
+
const currentEndTime = current?.end?.getTime() ?? null
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
previousStartTime === currentStartTime && previousEndTime === currentEndTime
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function areSpatialExtentsEqual(
|
|
21
|
+
previous: Extent | null,
|
|
22
|
+
current: Extent | null
|
|
23
|
+
): boolean {
|
|
24
|
+
return (
|
|
25
|
+
previous?.[0] === current?.[0] &&
|
|
26
|
+
previous?.[1] === current?.[1] &&
|
|
27
|
+
previous?.[2] === current?.[2] &&
|
|
28
|
+
previous?.[3] === current?.[3]
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function areFilterStatesEqual(
|
|
33
|
+
previous: StacFilterState,
|
|
34
|
+
current: StacFilterState
|
|
35
|
+
): boolean {
|
|
36
|
+
const sameTemporalExtents = areTemporalExtentsEqual(
|
|
37
|
+
previous.temporalExtent,
|
|
38
|
+
current.temporalExtent
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
const sameSpatialExtents =
|
|
42
|
+
!current.isSpatialExtentFilterEnabled ||
|
|
43
|
+
areSpatialExtentsEqual(previous.spatialExtent, current.spatialExtent)
|
|
44
|
+
|
|
45
|
+
const sameIsSpatialExtentFilterEnabled =
|
|
46
|
+
previous.isSpatialExtentFilterEnabled ===
|
|
47
|
+
current.isSpatialExtentFilterEnabled
|
|
48
|
+
|
|
49
|
+
const samePageUrl = previous.pageUrl === current.pageUrl
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
sameTemporalExtents &&
|
|
53
|
+
sameSpatialExtents &&
|
|
54
|
+
sameIsSpatialExtentFilterEnabled &&
|
|
55
|
+
samePageUrl
|
|
56
|
+
)
|
|
57
|
+
}
|
|
@@ -68,7 +68,7 @@ export class MdViewEffects {
|
|
|
68
68
|
map((related) => {
|
|
69
69
|
return MdViewActions.setRelated({ related })
|
|
70
70
|
}),
|
|
71
|
-
catchError((
|
|
71
|
+
catchError(() => of(MdViewActions.setRelated({ related: null })))
|
|
72
72
|
)
|
|
73
73
|
)
|
|
74
74
|
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
21
21
|
import { AvatarServiceInterface } from '../../../../../../libs/api/repository/src'
|
|
22
22
|
import { OgcApiRecord } from '@camptocamp/ogc-client'
|
|
23
|
-
import { from, of
|
|
23
|
+
import { from, of } from 'rxjs'
|
|
24
24
|
import { DataService } from '../../../../../../libs/feature/dataviz/src'
|
|
25
25
|
|
|
26
26
|
@Injectable()
|
|
@@ -89,6 +89,25 @@ export class MdViewFacade {
|
|
|
89
89
|
shareReplay(1)
|
|
90
90
|
)
|
|
91
91
|
|
|
92
|
+
resourceDoi$ = this.metadata$.pipe(
|
|
93
|
+
map((record) => {
|
|
94
|
+
if (!record?.resourceIdentifiers?.length) return null
|
|
95
|
+
const doiIdentifier = record.resourceIdentifiers.find(
|
|
96
|
+
(id) =>
|
|
97
|
+
id.codeSpace?.toLowerCase().includes('doi.org') ||
|
|
98
|
+
id.code.startsWith('10.')
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
if (!doiIdentifier) return null
|
|
102
|
+
|
|
103
|
+
return {
|
|
104
|
+
code: doiIdentifier.code,
|
|
105
|
+
url: doiIdentifier.url ? doiIdentifier.url : null,
|
|
106
|
+
}
|
|
107
|
+
}),
|
|
108
|
+
shareReplay(1)
|
|
109
|
+
)
|
|
110
|
+
|
|
92
111
|
apiLinks$ = this.allLinks$.pipe(
|
|
93
112
|
map((links) =>
|
|
94
113
|
links.filter((link) => this.linkClassifier.hasUsage(link, LinkUsage.API))
|
|
@@ -105,6 +124,16 @@ export class MdViewFacade {
|
|
|
105
124
|
shareReplay(1)
|
|
106
125
|
)
|
|
107
126
|
|
|
127
|
+
stacLinks$ = this.allLinks$.pipe(
|
|
128
|
+
map((links) =>
|
|
129
|
+
links.filter(
|
|
130
|
+
(link) =>
|
|
131
|
+
link.type === 'service' && link.accessServiceProtocol === 'stac'
|
|
132
|
+
)
|
|
133
|
+
),
|
|
134
|
+
shareReplay(1)
|
|
135
|
+
)
|
|
136
|
+
|
|
108
137
|
downloadLinks$ = this.allLinks$.pipe(
|
|
109
138
|
map((links) =>
|
|
110
139
|
links.filter((link) =>
|
|
@@ -8,6 +8,10 @@ import {
|
|
|
8
8
|
} from '.'
|
|
9
9
|
import { Router, Routes } from '@angular/router'
|
|
10
10
|
import { ROUTER_CONFIG, RouterConfigModel } from './router.config'
|
|
11
|
+
import {
|
|
12
|
+
SortByEnum,
|
|
13
|
+
SortByField,
|
|
14
|
+
} from '../../../../../../libs/common/domain/src/lib/model/search'
|
|
11
15
|
|
|
12
16
|
@Injectable({
|
|
13
17
|
providedIn: 'root',
|
|
@@ -58,4 +62,8 @@ export class RouterService {
|
|
|
58
62
|
getOrganizationPageRoute(): string {
|
|
59
63
|
return ROUTER_ROUTE_ORGANIZATION
|
|
60
64
|
}
|
|
65
|
+
|
|
66
|
+
getDefaultSort(): SortByField {
|
|
67
|
+
return SortByEnum.RESOURCE_DATES
|
|
68
|
+
}
|
|
61
69
|
}
|
|
@@ -9,10 +9,7 @@ import {
|
|
|
9
9
|
SetFilters,
|
|
10
10
|
SetSortBy,
|
|
11
11
|
} from '../../../../../../../libs/feature/search/src'
|
|
12
|
-
import {
|
|
13
|
-
FieldFilters,
|
|
14
|
-
SortByEnum,
|
|
15
|
-
} from '../../../../../../../libs/common/domain/src/lib/model/search'
|
|
12
|
+
import { FieldFilters } from '../../../../../../../libs/common/domain/src/lib/model/search'
|
|
16
13
|
import { Actions, createEffect, ofType } from '@ngrx/effects'
|
|
17
14
|
import { navigation } from '@ngrx/router-store/data-persistence'
|
|
18
15
|
import { of, pairwise, startWith } from 'rxjs'
|
|
@@ -22,6 +19,7 @@ import { RouterFacade } from './router.facade'
|
|
|
22
19
|
import { ROUTE_PARAMS } from '../constants'
|
|
23
20
|
import { sortByFromString } from '../../../../../../../libs/util/shared/src'
|
|
24
21
|
import { ROUTER_CONFIG, RouterConfigModel } from '../router.config'
|
|
22
|
+
import { RouterService } from '../router.service'
|
|
25
23
|
|
|
26
24
|
@Injectable()
|
|
27
25
|
export class RouterEffects {
|
|
@@ -31,7 +29,8 @@ export class RouterEffects {
|
|
|
31
29
|
private _location: Location,
|
|
32
30
|
private facade: RouterFacade,
|
|
33
31
|
@Inject(ROUTER_CONFIG) private routerConfig: RouterConfigModel,
|
|
34
|
-
private fieldsService: FieldsService
|
|
32
|
+
private fieldsService: FieldsService,
|
|
33
|
+
private routerService: RouterService
|
|
35
34
|
) {}
|
|
36
35
|
|
|
37
36
|
navigate$ = createEffect(
|
|
@@ -61,7 +60,7 @@ export class RouterEffects {
|
|
|
61
60
|
let sortBy =
|
|
62
61
|
ROUTE_PARAMS.SORT in newParams
|
|
63
62
|
? sortByFromString(newParams[ROUTE_PARAMS.SORT])
|
|
64
|
-
:
|
|
63
|
+
: this.routerService.getDefaultSort()
|
|
65
64
|
let pageNumber =
|
|
66
65
|
ROUTE_PARAMS.PAGE in newParams
|
|
67
66
|
? parseInt(newParams[ROUTE_PARAMS.PAGE])
|
|
@@ -70,7 +69,7 @@ export class RouterEffects {
|
|
|
70
69
|
const oldSort =
|
|
71
70
|
ROUTE_PARAMS.SORT in oldParams
|
|
72
71
|
? sortByFromString(oldParams[ROUTE_PARAMS.SORT])
|
|
73
|
-
:
|
|
72
|
+
: this.routerService.getDefaultSort()
|
|
74
73
|
if (JSON.stringify(sortBy) === JSON.stringify(oldSort)) {
|
|
75
74
|
sortBy = null
|
|
76
75
|
}
|
|
@@ -11,7 +11,6 @@ export const FIELDS_SUMMARY: FieldName[] = [
|
|
|
11
11
|
'resourceAbstractObject',
|
|
12
12
|
'overview',
|
|
13
13
|
'logo',
|
|
14
|
-
'codelist_status_text',
|
|
15
14
|
'link',
|
|
16
15
|
'linkProtocol',
|
|
17
16
|
'contactForResource*.organisation*',
|
|
@@ -20,6 +19,7 @@ export const FIELDS_SUMMARY: FieldName[] = [
|
|
|
20
19
|
'userSavedCount',
|
|
21
20
|
'cl_topic',
|
|
22
21
|
'cl_maintenanceAndUpdateFrequency',
|
|
22
|
+
'cl_presentationForm',
|
|
23
23
|
'MD_LegalConstraints*Object',
|
|
24
24
|
'qualityScore',
|
|
25
25
|
'allKeywords',
|
|
@@ -13,7 +13,7 @@ import { TranslatePipe } from '@ngx-translate/core'
|
|
|
13
13
|
|
|
14
14
|
interface SortChoice {
|
|
15
15
|
label: string
|
|
16
|
-
value:
|
|
16
|
+
value: SortByField
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
@Component({
|
|
@@ -27,24 +27,20 @@ export class SortByComponent implements OnInit {
|
|
|
27
27
|
choices: SortChoice[] = [
|
|
28
28
|
{
|
|
29
29
|
label: marker('results.sortBy.relevancy'),
|
|
30
|
-
value: SortByEnum.RELEVANCY
|
|
30
|
+
value: SortByEnum.RELEVANCY,
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
label: marker('results.sortBy.dateStamp'),
|
|
34
|
-
value: SortByEnum.
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
label: marker('results.sortBy.changeDate'),
|
|
38
|
-
value: SortByEnum.CHANGE_DATE.join(','),
|
|
34
|
+
value: SortByEnum.RESOURCE_DATES,
|
|
39
35
|
},
|
|
40
36
|
{
|
|
41
37
|
label: marker('results.sortBy.popularity'),
|
|
42
|
-
value: SortByEnum.POPULARITY
|
|
38
|
+
value: SortByEnum.POPULARITY,
|
|
43
39
|
},
|
|
44
40
|
]
|
|
45
41
|
currentSortBy$ = this.facade.sortBy$.pipe(
|
|
46
42
|
filter((sortBy) => !!sortBy),
|
|
47
|
-
map((sortBy) => sortBy
|
|
43
|
+
map((sortBy) => sortBy)
|
|
48
44
|
)
|
|
49
45
|
|
|
50
46
|
constructor(
|
|
@@ -56,12 +52,12 @@ export class SortByComponent implements OnInit {
|
|
|
56
52
|
if (this.isQualitySortable) {
|
|
57
53
|
this.choices.push({
|
|
58
54
|
label: marker('results.sortBy.qualityScore'),
|
|
59
|
-
value: SortByEnum.QUALITY_SCORE
|
|
55
|
+
value: SortByEnum.QUALITY_SCORE,
|
|
60
56
|
})
|
|
61
57
|
}
|
|
62
58
|
}
|
|
63
59
|
|
|
64
|
-
changeSortBy(
|
|
65
|
-
this.searchService.setSortBy(
|
|
60
|
+
changeSortBy(criteria: SortByField): void {
|
|
61
|
+
this.searchService.setSortBy(criteria)
|
|
66
62
|
}
|
|
67
63
|
}
|
|
@@ -34,6 +34,7 @@ marker('search.filters.publicationYear')
|
|
|
34
34
|
marker('search.filters.organization')
|
|
35
35
|
marker('search.filters.representationType')
|
|
36
36
|
marker('search.filters.resourceType')
|
|
37
|
+
marker('search.filters.recordKind')
|
|
37
38
|
marker('search.filters.standard')
|
|
38
39
|
marker('search.filters.topic')
|
|
39
40
|
marker('search.filters.contact')
|
|
@@ -505,11 +505,15 @@ export class ResourceTypeLegacyField extends TranslatedSearchField {
|
|
|
505
505
|
|
|
506
506
|
export class RecordKindField extends SimpleSearchField {
|
|
507
507
|
TYPE_MAPPING = {
|
|
508
|
-
dataset: ['dataset', 'series', 'featureCatalog'],
|
|
508
|
+
dataset: ['dataset', 'series', 'featureCatalog', 'document'],
|
|
509
509
|
service: ['service'],
|
|
510
|
-
reuse:
|
|
511
|
-
.
|
|
512
|
-
|
|
510
|
+
reuse: [
|
|
511
|
+
...Object.entries(PossibleResourceTypes)
|
|
512
|
+
.filter(([_, v]) => v === 'reuse')
|
|
513
|
+
.map(([k]) => k), // = ['application', 'map', 'staticMap', 'interactiveMap', ...]
|
|
514
|
+
'dataset', // allow datasets and documents to be filtered as 'reuse' by cl_presentationForm
|
|
515
|
+
'document',
|
|
516
|
+
],
|
|
513
517
|
}
|
|
514
518
|
|
|
515
519
|
constructor(injector: Injector) {
|
|
@@ -517,38 +521,25 @@ export class RecordKindField extends SimpleSearchField {
|
|
|
517
521
|
}
|
|
518
522
|
|
|
519
523
|
getAvailableValues(): Observable<FieldAvailableValue[]> {
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
acc[key] = (acc[key] || 0) + count
|
|
536
|
-
return acc
|
|
537
|
-
},
|
|
538
|
-
{} as Record<string, number>
|
|
539
|
-
)
|
|
540
|
-
|
|
541
|
-
return Object.keys(this.TYPE_MAPPING).map((type) => ({
|
|
542
|
-
label: type,
|
|
543
|
-
value: type,
|
|
544
|
-
count: counts[type] ?? 0,
|
|
545
|
-
}))
|
|
546
|
-
})
|
|
547
|
-
)
|
|
524
|
+
// simplified as available values now depend on 'resourceType' and 'cl_presentationForm' fields
|
|
525
|
+
return of([
|
|
526
|
+
{
|
|
527
|
+
label: 'dataset',
|
|
528
|
+
value: 'dataset',
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
label: 'service',
|
|
532
|
+
value: 'service',
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
label: 'reuse',
|
|
536
|
+
value: 'reuse',
|
|
537
|
+
},
|
|
538
|
+
])
|
|
548
539
|
}
|
|
549
540
|
|
|
550
541
|
getFiltersForValues(values: FieldValue[]): Observable<FieldFilters> {
|
|
551
|
-
const filters = {
|
|
542
|
+
const filters: FieldFilters = {
|
|
552
543
|
[this.esFieldName]: values.reduce((acc, value) => {
|
|
553
544
|
if (value === '') return { ...acc, [value]: true }
|
|
554
545
|
|
|
@@ -559,6 +550,19 @@ export class RecordKindField extends SimpleSearchField {
|
|
|
559
550
|
}, {}),
|
|
560
551
|
}
|
|
561
552
|
|
|
553
|
+
const presentationFormFilter = {}
|
|
554
|
+
if (values.includes('reuse') && !values.includes('dataset')) {
|
|
555
|
+
presentationFormFilter['mapDigital'] = true
|
|
556
|
+
presentationFormFilter['mapHardcopy'] = true
|
|
557
|
+
} else if (values.includes('dataset') && !values.includes('reuse')) {
|
|
558
|
+
presentationFormFilter['mapDigital'] = false
|
|
559
|
+
presentationFormFilter['mapHardcopy'] = false
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
if (Object.keys(presentationFormFilter).length > 0) {
|
|
563
|
+
filters['cl_presentationForm.key'] = presentationFormFilter
|
|
564
|
+
}
|
|
565
|
+
|
|
562
566
|
return of(filters)
|
|
563
567
|
}
|
|
564
568
|
|