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
package/src/libs/ui/layout/src/lib/previous-next-buttons/previous-next-buttons.component.html
CHANGED
|
@@ -3,28 +3,34 @@
|
|
|
3
3
|
data-test="previousButton"
|
|
4
4
|
type="light"
|
|
5
5
|
[extraClass]="
|
|
6
|
-
'w-10 h-8 px-2 py-1 rounded-lg ' +
|
|
6
|
+
'w-auto min-w-10 h-8 px-2 py-1 rounded-lg ' +
|
|
7
7
|
(!listComponent.isFirstPage
|
|
8
|
-
? 'border border-gray-300'
|
|
9
|
-
: 'border border-gray-100')
|
|
8
|
+
? 'border border-gray-300 text-main'
|
|
9
|
+
: 'border border-gray-100 text-gray-300')
|
|
10
10
|
"
|
|
11
11
|
[disabled]="listComponent.isFirstPage"
|
|
12
12
|
(buttonClick)="listComponent.goToPrevPage()"
|
|
13
13
|
>
|
|
14
14
|
<ng-icon name="matArrowBackIos"></ng-icon>
|
|
15
|
+
<span *ngIf="displayLabels" class="ml-2" translate
|
|
16
|
+
>pagination.previousPage</span
|
|
17
|
+
>
|
|
15
18
|
</gn-ui-button>
|
|
16
19
|
<gn-ui-button
|
|
17
20
|
data-test="nextButton"
|
|
18
21
|
type="light"
|
|
19
22
|
[extraClass]="
|
|
20
|
-
'w-10 h-8 px-2 py-1 rounded-lg ' +
|
|
23
|
+
'w-auto min-w-10 h-8 px-2 py-1 rounded-lg ' +
|
|
21
24
|
(!listComponent.isLastPage
|
|
22
|
-
? 'border border-gray-300'
|
|
23
|
-
: 'border border-gray-100')
|
|
25
|
+
? 'border border-gray-300 text-main'
|
|
26
|
+
: 'border border-gray-100 text-gray-300')
|
|
24
27
|
"
|
|
25
28
|
[disabled]="listComponent.isLastPage"
|
|
26
29
|
(buttonClick)="listComponent.goToNextPage()"
|
|
27
30
|
>
|
|
31
|
+
<span *ngIf="displayLabels" class="mr-2" translate
|
|
32
|
+
>pagination.nextPage</span
|
|
33
|
+
>
|
|
28
34
|
<ng-icon name="matArrowForwardIos"></ng-icon>
|
|
29
35
|
</gn-ui-button>
|
|
30
36
|
</div>
|
|
@@ -10,13 +10,15 @@ import {
|
|
|
10
10
|
} from '@ng-icons/material-icons/baseline'
|
|
11
11
|
import { Paginable } from '../paginable.interface'
|
|
12
12
|
import { ButtonComponent } from '../../../../../../libs/ui/inputs/src'
|
|
13
|
+
import { CommonModule } from '@angular/common'
|
|
14
|
+
import { TranslateDirective } from '@ngx-translate/core'
|
|
13
15
|
|
|
14
16
|
@Component({
|
|
15
17
|
selector: 'gn-ui-previous-next-buttons',
|
|
16
18
|
templateUrl: './previous-next-buttons.component.html',
|
|
17
19
|
styleUrls: ['./previous-next-buttons.component.css'],
|
|
18
20
|
standalone: true,
|
|
19
|
-
imports: [ButtonComponent, NgIconComponent],
|
|
21
|
+
imports: [CommonModule, ButtonComponent, NgIconComponent, TranslateDirective],
|
|
20
22
|
providers: [
|
|
21
23
|
provideIcons({ matArrowBackIos, matArrowForwardIos }),
|
|
22
24
|
provideNgIconsConfig({
|
|
@@ -26,4 +28,5 @@ import { ButtonComponent } from '../../../../../../libs/ui/inputs/src'
|
|
|
26
28
|
})
|
|
27
29
|
export class PreviousNextButtonsComponent {
|
|
28
30
|
@Input() listComponent: Paginable
|
|
31
|
+
@Input() displayLabels = false
|
|
29
32
|
}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
<div class="h-full w-full" #map
|
|
2
|
-
<
|
|
3
|
-
class="absolute inset-0 p-2 rounded z-40 transition-all flex flex-col justify-center items-center text-primary font-sans pointer-events-none"
|
|
4
|
-
[ngClass]="
|
|
5
|
-
(displayMessage$ | async) ? 'visible opacity-100' : 'invisible opacity-0'
|
|
6
|
-
"
|
|
7
|
-
>
|
|
1
|
+
<div class="relative h-full w-full" #map>
|
|
2
|
+
<ng-content></ng-content>
|
|
8
3
|
<div
|
|
9
|
-
class="absolute
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
class="absolute inset-0 p-2 rounded z-40 transition-all flex flex-col justify-center items-center text-primary font-sans pointer-events-none"
|
|
5
|
+
[ngClass]="
|
|
6
|
+
(displayMessage$ | async) ? 'visible opacity-100' : 'invisible opacity-0'
|
|
7
|
+
"
|
|
8
|
+
>
|
|
9
|
+
<div
|
|
10
|
+
class="absolute z-[-1] inset-0 bg-gradient-to-b from-white to-primary-lightest opacity-60"
|
|
11
|
+
></div>
|
|
12
|
+
<ng-icon
|
|
13
|
+
class="!w-16 !h-16 text-[64px] mb-4"
|
|
14
|
+
name="matSwipeOutline"
|
|
15
|
+
></ng-icon>
|
|
16
|
+
<p translate>map.navigation.message</p>
|
|
17
|
+
</div>
|
|
16
18
|
</div>
|
|
@@ -2,9 +2,11 @@ import {
|
|
|
2
2
|
AfterViewInit,
|
|
3
3
|
ChangeDetectionStrategy,
|
|
4
4
|
Component,
|
|
5
|
+
DestroyRef,
|
|
5
6
|
ElementRef,
|
|
6
7
|
EventEmitter,
|
|
7
8
|
Inject,
|
|
9
|
+
inject,
|
|
8
10
|
Input,
|
|
9
11
|
OnChanges,
|
|
10
12
|
Output,
|
|
@@ -13,6 +15,7 @@ import {
|
|
|
13
15
|
} from '@angular/core'
|
|
14
16
|
import { fromEvent, merge, Observable, of, timer } from 'rxjs'
|
|
15
17
|
import { delay, map, startWith, switchMap } from 'rxjs/operators'
|
|
18
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop'
|
|
16
19
|
import { CommonModule } from '@angular/common'
|
|
17
20
|
import { TranslateDirective } from '@ngx-translate/core'
|
|
18
21
|
import {
|
|
@@ -24,10 +27,13 @@ import {
|
|
|
24
27
|
FeaturesHoverEventType,
|
|
25
28
|
MapClickEvent,
|
|
26
29
|
MapClickEventType,
|
|
30
|
+
MapExtentChangeEvent,
|
|
31
|
+
MapExtentChangeEventType,
|
|
27
32
|
MapContext,
|
|
28
33
|
MapContextLayer,
|
|
29
34
|
MapContextLayerXyz,
|
|
30
35
|
MapContextView,
|
|
36
|
+
MapEventsByType,
|
|
31
37
|
SourceLoadErrorEvent,
|
|
32
38
|
SourceLoadErrorType,
|
|
33
39
|
} from '@geospatial-sdk/core'
|
|
@@ -49,6 +55,7 @@ import {
|
|
|
49
55
|
provideNgIconsConfig,
|
|
50
56
|
} from '@ng-icons/core'
|
|
51
57
|
import { matSwipeOutline } from '@ng-icons/material-icons/outline'
|
|
58
|
+
import { transformExtent } from 'ol/proj'
|
|
52
59
|
|
|
53
60
|
const DEFAULT_BASEMAP_LAYER: MapContextLayerXyz = {
|
|
54
61
|
type: 'xyz',
|
|
@@ -61,6 +68,11 @@ const DEFAULT_VIEW: MapContextView = {
|
|
|
61
68
|
zoom: 2,
|
|
62
69
|
}
|
|
63
70
|
|
|
71
|
+
interface MapViewConstraints {
|
|
72
|
+
maxZoom?: number
|
|
73
|
+
maxExtent?: Extent
|
|
74
|
+
}
|
|
75
|
+
|
|
64
76
|
@Component({
|
|
65
77
|
selector: 'gn-ui-map-container',
|
|
66
78
|
templateUrl: './map-container.component.html',
|
|
@@ -78,86 +90,151 @@ const DEFAULT_VIEW: MapContextView = {
|
|
|
78
90
|
export class MapContainerComponent implements AfterViewInit, OnChanges {
|
|
79
91
|
@Input() context: MapContext | null
|
|
80
92
|
|
|
81
|
-
|
|
82
|
-
|
|
93
|
+
@ViewChild('map') container: ElementRef
|
|
94
|
+
|
|
95
|
+
private olMap: OlMap
|
|
96
|
+
private olMapResolver: (value: OlMap) => void
|
|
97
|
+
private destroyRef: DestroyRef
|
|
98
|
+
|
|
99
|
+
displayMessage$: Observable<boolean>
|
|
100
|
+
openlayersMap = new Promise<OlMap>((resolve) => {
|
|
101
|
+
this.olMapResolver = resolve
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
// These events only get registered on the map if they are used
|
|
105
|
+
_featuresClick: EventEmitter<Feature[]> = null
|
|
106
|
+
_featuresHover: EventEmitter<Feature[]> = null
|
|
107
|
+
_mapClick: EventEmitter<[number, number]> = null
|
|
108
|
+
_extentChange: EventEmitter<Extent> = null
|
|
109
|
+
_sourceLoadError: EventEmitter<SourceLoadErrorEvent> = null
|
|
110
|
+
_resolvedExtentChange: EventEmitter<Extent> = null
|
|
111
|
+
|
|
83
112
|
@Output() get featuresClick() {
|
|
84
113
|
if (!this._featuresClick) {
|
|
85
|
-
this.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
)
|
|
92
|
-
})
|
|
114
|
+
this.setupEventListener(
|
|
115
|
+
FeaturesClickEventType,
|
|
116
|
+
(event: FeaturesClickEvent) => {
|
|
117
|
+
this._featuresClick.emit(event.features)
|
|
118
|
+
}
|
|
119
|
+
)
|
|
93
120
|
this._featuresClick = new EventEmitter<Feature[]>()
|
|
94
121
|
}
|
|
95
122
|
return this._featuresClick
|
|
96
123
|
}
|
|
97
|
-
|
|
124
|
+
|
|
98
125
|
@Output() get featuresHover() {
|
|
99
126
|
if (!this._featuresHover) {
|
|
100
|
-
this.
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
)
|
|
107
|
-
})
|
|
127
|
+
this.setupEventListener(
|
|
128
|
+
FeaturesHoverEventType,
|
|
129
|
+
(event: FeaturesHoverEvent) => {
|
|
130
|
+
this._featuresHover.emit(event.features)
|
|
131
|
+
}
|
|
132
|
+
)
|
|
108
133
|
this._featuresHover = new EventEmitter<Feature[]>()
|
|
109
134
|
}
|
|
110
135
|
return this._featuresHover
|
|
111
136
|
}
|
|
112
|
-
|
|
137
|
+
|
|
113
138
|
@Output() get mapClick() {
|
|
114
139
|
if (!this._mapClick) {
|
|
115
|
-
this.
|
|
116
|
-
|
|
117
|
-
this._mapClick.emit(coordinate)
|
|
118
|
-
)
|
|
140
|
+
this.setupEventListener(MapClickEventType, (event: MapClickEvent) => {
|
|
141
|
+
this._mapClick.emit(event.coordinate)
|
|
119
142
|
})
|
|
120
143
|
this._mapClick = new EventEmitter<[number, number]>()
|
|
121
144
|
}
|
|
122
145
|
return this._mapClick
|
|
123
146
|
}
|
|
124
|
-
|
|
147
|
+
|
|
148
|
+
@Output() get extentChange() {
|
|
149
|
+
if (!this._extentChange) {
|
|
150
|
+
this.setupEventListener(
|
|
151
|
+
MapExtentChangeEventType,
|
|
152
|
+
(event: MapExtentChangeEvent) => {
|
|
153
|
+
this._extentChange.emit(event.extent as Extent)
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
this._extentChange = new EventEmitter<Extent>()
|
|
157
|
+
}
|
|
158
|
+
return this._extentChange
|
|
159
|
+
}
|
|
160
|
+
|
|
125
161
|
@Output() get sourceLoadError() {
|
|
126
162
|
if (!this._sourceLoadError) {
|
|
127
|
-
this.
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
163
|
+
this.setupEventListener(
|
|
164
|
+
SourceLoadErrorType,
|
|
165
|
+
(event: SourceLoadErrorEvent) => {
|
|
166
|
+
this._sourceLoadError.emit(event)
|
|
167
|
+
}
|
|
168
|
+
)
|
|
132
169
|
this._sourceLoadError = new EventEmitter<SourceLoadErrorEvent>()
|
|
133
170
|
}
|
|
134
171
|
return this._sourceLoadError
|
|
135
172
|
}
|
|
136
173
|
|
|
137
|
-
@
|
|
138
|
-
|
|
139
|
-
|
|
174
|
+
@Output() get resolvedExtentChange() {
|
|
175
|
+
if (!this._resolvedExtentChange) {
|
|
176
|
+
this._resolvedExtentChange = new EventEmitter<Extent>()
|
|
177
|
+
}
|
|
178
|
+
return this._resolvedExtentChange
|
|
179
|
+
}
|
|
140
180
|
|
|
141
181
|
constructor(
|
|
142
182
|
@Inject(DO_NOT_USE_DEFAULT_BASEMAP) private doNotUseDefaultBasemap: boolean,
|
|
143
183
|
@Inject(BASEMAP_LAYERS) private basemapLayers: MapContextLayer[],
|
|
144
184
|
@Inject(MAP_VIEW_CONSTRAINTS)
|
|
145
|
-
private mapViewConstraints:
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
) {}
|
|
185
|
+
private mapViewConstraints: MapViewConstraints
|
|
186
|
+
) {
|
|
187
|
+
this.destroyRef = inject(DestroyRef)
|
|
188
|
+
}
|
|
150
189
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
190
|
+
calculateCurrentMapExtent(): Extent {
|
|
191
|
+
const extent = this.olMap.getView().calculateExtent(this.olMap.getSize())
|
|
192
|
+
const reprojectedExtent = transformExtent(
|
|
193
|
+
extent,
|
|
194
|
+
this.olMap.getView().getProjection(),
|
|
195
|
+
'EPSG:4326'
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
return reprojectedExtent as Extent
|
|
199
|
+
}
|
|
155
200
|
|
|
156
201
|
async ngAfterViewInit() {
|
|
157
202
|
this.olMap = await createMapFromContext(
|
|
158
203
|
this.processContext(this.context),
|
|
159
204
|
this.container.nativeElement
|
|
160
205
|
)
|
|
206
|
+
if (this._resolvedExtentChange) {
|
|
207
|
+
this._resolvedExtentChange.emit(this.calculateCurrentMapExtent())
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
this.setupDisplayMessageObservable()
|
|
211
|
+
this.olMapResolver(this.olMap)
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
async ngOnChanges(changes: SimpleChanges) {
|
|
215
|
+
if ('context' in changes && !changes['context'].isFirstChange()) {
|
|
216
|
+
const diff = computeMapContextDiff(
|
|
217
|
+
this.processContext(changes['context'].currentValue),
|
|
218
|
+
this.processContext(changes['context'].previousValue)
|
|
219
|
+
)
|
|
220
|
+
await applyContextDiffToMap(this.olMap, diff)
|
|
221
|
+
|
|
222
|
+
if (this._resolvedExtentChange && diff.viewChanges) {
|
|
223
|
+
this._resolvedExtentChange.emit(this.calculateCurrentMapExtent())
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
private setupEventListener(
|
|
229
|
+
eventType: keyof MapEventsByType,
|
|
230
|
+
handler: (event: MapEventsByType[typeof eventType]) => void
|
|
231
|
+
) {
|
|
232
|
+
this.openlayersMap.then((olMap: OlMap) => {
|
|
233
|
+
listen(olMap, eventType, handler)
|
|
234
|
+
})
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
private setupDisplayMessageObservable() {
|
|
161
238
|
this.displayMessage$ = merge(
|
|
162
239
|
fromEvent(this.olMap, 'mapmuted').pipe(map(() => true)),
|
|
163
240
|
fromEvent(this.olMap, 'movestart').pipe(map(() => false)),
|
|
@@ -171,32 +248,25 @@ export class MapContainerComponent implements AfterViewInit, OnChanges {
|
|
|
171
248
|
delay(400)
|
|
172
249
|
)
|
|
173
250
|
: of(false)
|
|
174
|
-
)
|
|
251
|
+
),
|
|
252
|
+
takeUntilDestroyed(this.destroyRef)
|
|
175
253
|
)
|
|
176
|
-
this.olMapResolver(this.olMap)
|
|
177
254
|
}
|
|
178
255
|
|
|
179
|
-
|
|
180
|
-
if ('context' in changes && !changes['context'].isFirstChange()) {
|
|
181
|
-
const diff = computeMapContextDiff(
|
|
182
|
-
this.processContext(changes['context'].currentValue),
|
|
183
|
-
this.processContext(changes['context'].previousValue)
|
|
184
|
-
)
|
|
185
|
-
await applyContextDiffToMap(this.olMap, diff)
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// This will apply basemap layers & view constraints
|
|
190
|
-
processContext(context: MapContext): MapContext {
|
|
256
|
+
private processContext(context: MapContext): MapContext {
|
|
191
257
|
const processed = context
|
|
192
258
|
? { ...context, view: context.view ?? DEFAULT_VIEW }
|
|
193
259
|
: { layers: [], view: DEFAULT_VIEW }
|
|
260
|
+
|
|
261
|
+
// Prepend with default basemap and basemap layers
|
|
194
262
|
if (this.basemapLayers.length) {
|
|
195
263
|
processed.layers = [...this.basemapLayers, ...processed.layers]
|
|
196
264
|
}
|
|
197
265
|
if (!this.doNotUseDefaultBasemap) {
|
|
198
266
|
processed.layers = [DEFAULT_BASEMAP_LAYER, ...processed.layers]
|
|
199
267
|
}
|
|
268
|
+
|
|
269
|
+
// Apply view constraints
|
|
200
270
|
if (this.mapViewConstraints.maxZoom) {
|
|
201
271
|
processed.view = {
|
|
202
272
|
maxZoom: this.mapViewConstraints.maxZoom,
|
|
@@ -209,20 +279,29 @@ export class MapContainerComponent implements AfterViewInit, OnChanges {
|
|
|
209
279
|
...processed.view,
|
|
210
280
|
}
|
|
211
281
|
}
|
|
282
|
+
|
|
212
283
|
if (
|
|
213
284
|
processed.view &&
|
|
214
|
-
|
|
215
|
-
|
|
285
|
+
'zoom' in processed.view &&
|
|
286
|
+
'center' in processed.view
|
|
216
287
|
) {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
288
|
+
return processed
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
if (processed.view && 'extent' in processed.view) {
|
|
292
|
+
return processed
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// Ensure valid view
|
|
296
|
+
if (this.mapViewConstraints.maxExtent) {
|
|
297
|
+
processed.view = {
|
|
298
|
+
extent: this.mapViewConstraints.maxExtent,
|
|
299
|
+
...processed.view,
|
|
224
300
|
}
|
|
301
|
+
} else {
|
|
302
|
+
processed.view = { ...DEFAULT_VIEW, ...processed.view }
|
|
225
303
|
}
|
|
304
|
+
|
|
226
305
|
return processed
|
|
227
306
|
}
|
|
228
307
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { LanguageCode2 } from './language-codes'
|
|
2
|
+
import {
|
|
3
|
+
ar,
|
|
4
|
+
az,
|
|
5
|
+
ca,
|
|
6
|
+
cs,
|
|
7
|
+
cy,
|
|
8
|
+
da,
|
|
9
|
+
de,
|
|
10
|
+
enUS,
|
|
11
|
+
es,
|
|
12
|
+
fi,
|
|
13
|
+
fr,
|
|
14
|
+
hy,
|
|
15
|
+
is,
|
|
16
|
+
it,
|
|
17
|
+
ka,
|
|
18
|
+
ko,
|
|
19
|
+
Locale,
|
|
20
|
+
nl,
|
|
21
|
+
nn,
|
|
22
|
+
pl,
|
|
23
|
+
pt,
|
|
24
|
+
ru,
|
|
25
|
+
sk,
|
|
26
|
+
sv,
|
|
27
|
+
tr,
|
|
28
|
+
uk,
|
|
29
|
+
zhCN,
|
|
30
|
+
} from 'date-fns/locale'
|
|
31
|
+
|
|
32
|
+
// all 2-char language codes should be listed here
|
|
33
|
+
const locales: Record<LanguageCode2, Locale> = {
|
|
34
|
+
en: enUS,
|
|
35
|
+
nl: nl,
|
|
36
|
+
fr: fr,
|
|
37
|
+
de: de,
|
|
38
|
+
ko: ko,
|
|
39
|
+
es: es,
|
|
40
|
+
cs: cs,
|
|
41
|
+
ca: ca,
|
|
42
|
+
fi: fi,
|
|
43
|
+
is: is,
|
|
44
|
+
it: it,
|
|
45
|
+
pt: pt,
|
|
46
|
+
ru: ru,
|
|
47
|
+
zh: zhCN,
|
|
48
|
+
sk: sk,
|
|
49
|
+
ar: ar,
|
|
50
|
+
da: da,
|
|
51
|
+
no: nn,
|
|
52
|
+
pl: pl,
|
|
53
|
+
sv: sv,
|
|
54
|
+
tr: tr,
|
|
55
|
+
hy: hy,
|
|
56
|
+
az: az,
|
|
57
|
+
ka: ka,
|
|
58
|
+
uk: uk,
|
|
59
|
+
cy: cy,
|
|
60
|
+
rm: enUS, // locale is unavailable
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export default locales
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Renderer2, Directive, ElementRef, Input, OnInit } from '@angular/core'
|
|
2
|
+
import { DateService } from './services/date.service'
|
|
3
|
+
|
|
4
|
+
@Directive({
|
|
5
|
+
selector: '[gnUiHumanizeDate]',
|
|
6
|
+
standalone: true,
|
|
7
|
+
})
|
|
8
|
+
export class GnUiHumanizeDateDirective implements OnInit {
|
|
9
|
+
@Input() gnUiHumanizeDate: Date | string
|
|
10
|
+
|
|
11
|
+
constructor(
|
|
12
|
+
private dateService: DateService,
|
|
13
|
+
private el: ElementRef,
|
|
14
|
+
private renderer: Renderer2
|
|
15
|
+
) {}
|
|
16
|
+
|
|
17
|
+
async ngOnInit() {
|
|
18
|
+
await this.updateElement()
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
private async updateElement(): Promise<void> {
|
|
22
|
+
const dateValue = this.gnUiHumanizeDate
|
|
23
|
+
|
|
24
|
+
const fullDateTime = this.dateService.formatDateTime(dateValue)
|
|
25
|
+
const relativeDate =
|
|
26
|
+
await this.dateService.formatRelativeDateTime(dateValue)
|
|
27
|
+
|
|
28
|
+
this.renderer.setAttribute(this.el.nativeElement, 'title', fullDateTime)
|
|
29
|
+
this.renderer.setProperty(
|
|
30
|
+
this.el.nativeElement,
|
|
31
|
+
'textContent',
|
|
32
|
+
relativeDate
|
|
33
|
+
)
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -39,6 +39,10 @@ export class LinkClassifierService {
|
|
|
39
39
|
return [LinkUsage.API, LinkUsage.DOWNLOAD, LinkUsage.GEODATA]
|
|
40
40
|
case 'GPFDL':
|
|
41
41
|
return [LinkUsage.API]
|
|
42
|
+
case 'postgis':
|
|
43
|
+
return [LinkUsage.UNKNOWN]
|
|
44
|
+
case 'stac':
|
|
45
|
+
return [LinkUsage.API]
|
|
42
46
|
default:
|
|
43
47
|
return [LinkUsage.UNKNOWN]
|
|
44
48
|
}
|
|
@@ -150,6 +150,12 @@ export const FORMATS = {
|
|
|
150
150
|
color: '#5A9E6F',
|
|
151
151
|
mimeTypes: ['image/webp'],
|
|
152
152
|
},
|
|
153
|
+
postgis: {
|
|
154
|
+
extensions: ['postgis'],
|
|
155
|
+
priority: 18,
|
|
156
|
+
color: '#336791',
|
|
157
|
+
mimeTypes: [],
|
|
158
|
+
},
|
|
153
159
|
} as const
|
|
154
160
|
|
|
155
161
|
export type FileFormat = keyof typeof FORMATS
|
|
@@ -195,6 +201,11 @@ export function getFileFormatFromServiceOutput(
|
|
|
195
201
|
export function getFileFormat(
|
|
196
202
|
link: DatasetOnlineResource | ServiceOnlineResource
|
|
197
203
|
): FileFormat {
|
|
204
|
+
if ('accessServiceProtocol' in link) {
|
|
205
|
+
if (link.accessServiceProtocol in FORMATS) {
|
|
206
|
+
return link.accessServiceProtocol as FileFormat
|
|
207
|
+
}
|
|
208
|
+
}
|
|
198
209
|
if ('mimeType' in link) {
|
|
199
210
|
const mimeTypeFormat = mimeTypeToFormat(link.mimeType)
|
|
200
211
|
if (mimeTypeFormat !== null) {
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core'
|
|
2
2
|
import { TranslateService } from '@ngx-translate/core'
|
|
3
|
+
import { type Locale } from 'date-fns/locale'
|
|
4
|
+
import { formatDistance } from 'date-fns/formatDistance'
|
|
5
|
+
|
|
6
|
+
const DEFAULT_LANGUAGE = 'en'
|
|
3
7
|
|
|
4
8
|
@Injectable({
|
|
5
9
|
providedIn: 'root',
|
|
6
10
|
})
|
|
7
11
|
export class DateService {
|
|
12
|
+
dateLocales = import('../../../../../../libs/util/i18n/src/lib/date-locales').then(
|
|
13
|
+
(obj) => obj.default
|
|
14
|
+
)
|
|
15
|
+
|
|
8
16
|
constructor(private translateService: TranslateService) {}
|
|
9
17
|
|
|
10
18
|
private getDateObject(date: Date | string): Date {
|
|
@@ -22,11 +30,17 @@ export class DateService {
|
|
|
22
30
|
locale: string
|
|
23
31
|
dateObj: Date
|
|
24
32
|
} {
|
|
25
|
-
const locale = this.translateService.currentLang ||
|
|
33
|
+
const locale = this.translateService.currentLang || DEFAULT_LANGUAGE
|
|
26
34
|
const dateObj = this.getDateObject(date)
|
|
27
35
|
return { locale, dateObj }
|
|
28
36
|
}
|
|
29
37
|
|
|
38
|
+
private async getDateLocale(): Promise<Locale> {
|
|
39
|
+
const lang = this.translateService.currentLang || DEFAULT_LANGUAGE
|
|
40
|
+
const locales = await this.dateLocales
|
|
41
|
+
return locales[lang]
|
|
42
|
+
}
|
|
43
|
+
|
|
30
44
|
formatDate(
|
|
31
45
|
date: Date | string,
|
|
32
46
|
options?: Intl.DateTimeFormatOptions
|
|
@@ -42,4 +56,16 @@ export class DateService {
|
|
|
42
56
|
const { locale, dateObj } = this.getLocaleAndDate(date)
|
|
43
57
|
return dateObj.toLocaleString(locale, options)
|
|
44
58
|
}
|
|
59
|
+
|
|
60
|
+
async formatRelativeDateTime(date: Date | string): Promise<string> {
|
|
61
|
+
const dateObj = this.getDateObject(date)
|
|
62
|
+
|
|
63
|
+
const now = new Date()
|
|
64
|
+
const locale = await this.getDateLocale()
|
|
65
|
+
|
|
66
|
+
return formatDistance(dateObj, now, {
|
|
67
|
+
addSuffix: true,
|
|
68
|
+
locale: locale,
|
|
69
|
+
})
|
|
70
|
+
}
|
|
45
71
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Injectable, InjectionToken, Injector } from '@angular/core'
|
|
2
2
|
import { Location } from '@angular/common'
|
|
3
3
|
|
|
4
4
|
export const PROXY_PATH = new InjectionToken<string>('proxyPath')
|
|
@@ -7,8 +7,12 @@ export const PROXY_PATH = new InjectionToken<string>('proxyPath')
|
|
|
7
7
|
providedIn: 'root',
|
|
8
8
|
})
|
|
9
9
|
export class ProxyService {
|
|
10
|
+
private get proxyPath(): string | null {
|
|
11
|
+
return this.injector.get(PROXY_PATH, null)
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
constructor(
|
|
11
|
-
|
|
15
|
+
private injector: Injector,
|
|
12
16
|
private location: Location
|
|
13
17
|
) {}
|
|
14
18
|
|
|
@@ -6,12 +6,15 @@ export function sortByToStrings(sortBy: SortByField): string[] {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
export function sortByToString(sortBy: SortByField): string {
|
|
9
|
-
return sortByToStrings(sortBy)
|
|
9
|
+
return sortByToStrings(sortBy).join(',')
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export function sortByFromString(sortByString: string): SortByField {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
const fields = sortByString
|
|
14
|
+
.split(',')
|
|
15
|
+
.map((field) => [
|
|
16
|
+
field.startsWith('-') ? 'desc' : 'asc',
|
|
17
|
+
field.startsWith('-') ? field.substring(1) : field,
|
|
18
|
+
]) as SortByField
|
|
19
|
+
return fields.length > 1 ? fields : (fields[0] as SortByField)
|
|
17
20
|
}
|