geonetwork-ui 2.3.0-dev.e07c5606 → 2.3.0-dev.e43863db
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/libs/api/metadata-converter/src/lib/iso19115-3/iso19115-3.converter.mjs +2 -2
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.mjs +9 -7
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/read-parts.mjs +23 -8
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +15 -4
- package/esm2022/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.mjs +9 -7
- package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +1 -1
- package/esm2022/libs/feature/dataviz/src/lib/chart-view/chart-view.component.mjs +1 -1
- package/esm2022/libs/feature/dataviz/src/lib/service/data.service.mjs +47 -2
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-license/form-field-license.component.mjs +1 -1
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.mjs +15 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.mjs +104 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.mjs +14 -4
- package/esm2022/libs/feature/editor/src/lib/components/wizard-field/wizard-field.component.mjs +1 -1
- package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +15 -1
- package/esm2022/libs/feature/map/src/lib/add-layer-from-ogc-api/add-layer-from-ogc-api.component.mjs +73 -20
- package/esm2022/libs/feature/map/src/lib/add-layer-from-wfs/add-layer-from-wfs.component.mjs +1 -1
- package/esm2022/libs/feature/map/src/lib/add-layer-from-wms/add-layer-from-wms.component.mjs +1 -1
- package/esm2022/libs/feature/map/src/lib/map-context/map-context.model.mjs +1 -1
- package/esm2022/libs/feature/map/src/lib/map-context/map-context.service.mjs +58 -17
- package/esm2022/libs/feature/map/src/lib/utils/map-utils.service.mjs +7 -3
- package/esm2022/libs/feature/record/src/lib/data-view/data-view.component.mjs +1 -1
- package/esm2022/libs/feature/record/src/lib/map-view/map-view.component.mjs +17 -9
- package/esm2022/libs/feature/record/src/lib/state/mdview.facade.mjs +34 -5
- package/esm2022/libs/feature/record/src/lib/state/mdview.reducer.mjs +1 -3
- package/esm2022/libs/feature/search/src/index.mjs +2 -1
- package/esm2022/libs/feature/search/src/lib/results-layout/results-layout.component.mjs +1 -1
- package/esm2022/libs/feature/search/src/lib/results-list/results-list.container.component.mjs +4 -4
- package/esm2022/libs/feature/search/src/lib/sort-by/sort-by.component.mjs +1 -1
- package/esm2022/libs/feature/search/src/lib/utils/service/fields.service.mjs +1 -1
- package/esm2022/libs/ui/catalog/src/lib/language-switcher/language-switcher.component.mjs +1 -1
- package/esm2022/libs/ui/catalog/src/lib/organisations-filter/organisations-filter.component.mjs +1 -1
- package/esm2022/libs/ui/elements/src/index.mjs +2 -2
- package/esm2022/libs/ui/elements/src/lib/api-card/api-card.component.mjs +3 -2
- package/esm2022/libs/ui/elements/src/lib/downloads-list/downloads-list.component.mjs +2 -2
- package/esm2022/libs/ui/elements/src/lib/error/error.component.mjs +30 -0
- package/esm2022/libs/ui/elements/src/lib/link-card/link-card.component.mjs +16 -3
- package/esm2022/libs/ui/elements/src/lib/record-api-form/record-api-form.component.mjs +98 -36
- package/esm2022/libs/ui/elements/src/lib/ui-elements.module.mjs +6 -11
- package/esm2022/libs/ui/elements/src/lib/user-feedback-item/user-feedback-item.component.mjs +3 -5
- package/esm2022/libs/ui/inputs/src/index.mjs +16 -15
- package/esm2022/libs/ui/inputs/src/lib/check-toggle/check-toggle.component.mjs +4 -3
- package/esm2022/libs/ui/inputs/src/lib/date-picker/date-picker.component.mjs +22 -0
- package/esm2022/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.mjs +7 -5
- package/esm2022/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.mjs +5 -3
- package/esm2022/libs/ui/inputs/src/lib/previous-next-buttons/previous-next-buttons.component.mjs +29 -0
- package/esm2022/libs/ui/inputs/src/lib/text-input/text-input.component.mjs +5 -3
- package/esm2022/libs/ui/inputs/src/lib/ui-inputs.module.mjs +10 -8
- package/esm2022/libs/ui/layout/src/index.mjs +2 -1
- package/esm2022/libs/ui/layout/src/lib/block-list/block-list.component.mjs +76 -0
- package/esm2022/libs/ui/layout/src/lib/carousel/carousel.component.mjs +42 -18
- package/esm2022/libs/ui/layout/src/lib/ui-layout.module.mjs +3 -8
- package/esm2022/libs/util/app-config/src/lib/app-config.mjs +3 -1
- package/esm2022/libs/util/app-config/src/lib/fixtures.mjs +2 -1
- package/esm2022/libs/util/app-config/src/lib/model.mjs +1 -1
- package/esm2022/libs/util/shared/src/lib/links/link-classifier.service.mjs +2 -2
- package/esm2022/libs/util/shared/src/lib/links/link-utils.mjs +22 -1
- package/esm2022/translations/de.json +13 -14
- package/esm2022/translations/en.json +13 -14
- package/esm2022/translations/es.json +13 -14
- package/esm2022/translations/fr.json +13 -14
- package/esm2022/translations/it.json +13 -14
- package/esm2022/translations/nl.json +13 -14
- package/esm2022/translations/pt.json +13 -14
- package/fesm2022/geonetwork-ui.mjs +1742 -1190
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19115-3/iso19115-3.converter.d.ts +2 -2
- package/libs/api/metadata-converter/src/lib/iso19115-3/iso19115-3.converter.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.d.ts +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts +4 -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 +2 -1
- package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts.map +1 -1
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +3 -3
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
- package/libs/feature/dataviz/src/lib/service/data.service.d.ts +4 -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-resource-updated/form-field-resource-updated.component.d.ts +8 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.d.ts +21 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.d.ts.map +1 -0
- 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/editor/src/lib/fields.config.d.ts.map +1 -1
- package/libs/feature/map/src/lib/add-layer-from-ogc-api/add-layer-from-ogc-api.component.d.ts +10 -5
- 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/map-context/map-context.model.d.ts +7 -0
- package/libs/feature/map/src/lib/map-context/map-context.model.d.ts.map +1 -1
- package/libs/feature/map/src/lib/map-context/map-context.service.d.ts +1 -1
- package/libs/feature/map/src/lib/map-context/map-context.service.d.ts.map +1 -1
- package/libs/feature/map/src/lib/utils/map-utils.service.d.ts.map +1 -1
- package/libs/feature/record/src/lib/map-view/map-view.component.d.ts +2 -2
- package/libs/feature/record/src/lib/map-view/map-view.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/state/mdview.facade.d.ts +5 -2
- package/libs/feature/record/src/lib/state/mdview.facade.d.ts.map +1 -1
- package/libs/feature/record/src/lib/state/mdview.reducer.d.ts.map +1 -1
- package/libs/feature/search/src/index.d.ts +1 -0
- package/libs/feature/search/src/index.d.ts.map +1 -1
- package/libs/feature/search/src/lib/utils/service/fields.service.d.ts +3 -3
- package/libs/feature/search/src/lib/utils/service/fields.service.d.ts.map +1 -1
- package/libs/ui/elements/src/index.d.ts +1 -1
- package/libs/ui/elements/src/index.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/api-card/api-card.component.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/error/error.component.d.ts +16 -0
- package/libs/ui/elements/src/lib/error/error.component.d.ts.map +1 -0
- package/libs/ui/elements/src/lib/link-card/link-card.component.d.ts +3 -1
- package/libs/ui/elements/src/lib/link-card/link-card.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/record-api-form/record-api-form.component.d.ts +24 -4
- package/libs/ui/elements/src/lib/record-api-form/record-api-form.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/ui-elements.module.d.ts +29 -30
- package/libs/ui/elements/src/lib/ui-elements.module.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/user-feedback-item/user-feedback-item.component.d.ts +1 -2
- package/libs/ui/elements/src/lib/user-feedback-item/user-feedback-item.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/index.d.ts +15 -14
- package/libs/ui/inputs/src/index.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/check-toggle/check-toggle.component.d.ts +1 -1
- package/libs/ui/inputs/src/lib/check-toggle/check-toggle.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/date-picker/date-picker.component.d.ts +9 -0
- package/libs/ui/inputs/src/lib/date-picker/date-picker.component.d.ts.map +1 -0
- package/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.d.ts +1 -1
- package/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.d.ts +2 -1
- package/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/previous-next-buttons/previous-next-buttons.component.d.ts +12 -0
- package/libs/ui/inputs/src/lib/previous-next-buttons/previous-next-buttons.component.d.ts.map +1 -0
- package/libs/ui/inputs/src/lib/text-input/text-input.component.d.ts +2 -1
- package/libs/ui/inputs/src/lib/text-input/text-input.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/ui-inputs.module.d.ts +27 -27
- package/libs/ui/layout/src/index.d.ts +1 -0
- package/libs/ui/layout/src/index.d.ts.map +1 -1
- package/libs/ui/layout/src/lib/block-list/block-list.component.d.ts +25 -0
- package/libs/ui/layout/src/lib/block-list/block-list.component.d.ts.map +1 -0
- package/libs/ui/layout/src/lib/carousel/carousel.component.d.ts +13 -6
- package/libs/ui/layout/src/lib/carousel/carousel.component.d.ts.map +1 -1
- package/libs/ui/layout/src/lib/ui-layout.module.d.ts +4 -5
- package/libs/ui/layout/src/lib/ui-layout.module.d.ts.map +1 -1
- package/libs/util/app-config/src/lib/app-config.d.ts.map +1 -1
- package/libs/util/app-config/src/lib/fixtures.d.ts.map +1 -1
- package/libs/util/app-config/src/lib/model.d.ts +1 -0
- package/libs/util/app-config/src/lib/model.d.ts.map +1 -1
- package/libs/util/shared/src/lib/links/link-utils.d.ts +18 -0
- package/libs/util/shared/src/lib/links/link-utils.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/libs/api/metadata-converter/src/lib/fixtures/generic.records.ts +9 -1
- package/src/libs/api/metadata-converter/src/lib/iso19115-3/iso19115-3.converter.ts +3 -3
- package/src/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.ts +35 -31
- package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +68 -16
- package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +72 -17
- package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.ts +16 -10
- package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +3 -3
- package/src/libs/common/fixtures/src/lib/link.fixtures.ts +8 -0
- package/src/libs/common/fixtures/src/lib/records.fixtures.ts +10 -2
- package/src/libs/feature/dataviz/src/lib/service/data.service.ts +65 -1
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.css +0 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.html +4 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-resource-updated/form-field-resource-updated.component.ts +15 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.css +0 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.html +14 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-update-frequency/form-field-update-frequency.component.ts +143 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +10 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +11 -1
- package/src/libs/feature/editor/src/lib/fields.config.ts +14 -0
- package/src/libs/feature/map/src/lib/add-layer-from-ogc-api/add-layer-from-ogc-api.component.css +7 -0
- package/src/libs/feature/map/src/lib/add-layer-from-ogc-api/add-layer-from-ogc-api.component.html +32 -18
- package/src/libs/feature/map/src/lib/add-layer-from-ogc-api/add-layer-from-ogc-api.component.ts +72 -17
- package/src/libs/feature/map/src/lib/map-context/map-context.model.ts +7 -0
- package/src/libs/feature/map/src/lib/map-context/map-context.service.ts +57 -17
- package/src/libs/feature/map/src/lib/utils/map-utils.service.ts +6 -2
- package/src/libs/feature/record/src/lib/map-view/map-view.component.ts +17 -9
- package/src/libs/feature/record/src/lib/state/mdview.facade.ts +40 -4
- package/src/libs/feature/record/src/lib/state/mdview.reducer.ts +0 -2
- package/src/libs/feature/search/src/index.ts +1 -0
- package/src/libs/feature/search/src/lib/results-list/results-list.container.component.html +4 -4
- package/src/libs/feature/search/src/lib/utils/service/fields.service.ts +2 -2
- package/src/libs/ui/elements/src/index.ts +1 -1
- package/src/libs/ui/elements/src/lib/api-card/api-card.component.ts +2 -1
- package/src/libs/ui/elements/src/lib/downloads-list/downloads-list.component.ts +1 -1
- package/src/libs/ui/elements/src/lib/{search-results-error/search-results-error.component.html → error/error.component.html} +18 -3
- package/src/libs/ui/elements/src/lib/{search-results-error/search-results-error.component.ts → error/error.component.ts} +5 -4
- package/src/libs/ui/elements/src/lib/link-card/link-card.component.html +38 -20
- package/src/libs/ui/elements/src/lib/link-card/link-card.component.ts +12 -0
- package/src/libs/ui/elements/src/lib/record-api-form/record-api-form.component.html +26 -10
- package/src/libs/ui/elements/src/lib/record-api-form/record-api-form.component.ts +125 -30
- package/src/libs/ui/elements/src/lib/ui-elements.module.ts +3 -6
- 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 +0 -1
- package/src/libs/ui/inputs/src/index.ts +15 -14
- package/src/libs/ui/inputs/src/lib/check-toggle/check-toggle.component.ts +3 -0
- package/src/libs/ui/inputs/src/lib/date-picker/date-picker.component.css +3 -0
- package/src/libs/ui/inputs/src/lib/date-picker/date-picker.component.html +11 -0
- package/src/libs/ui/inputs/src/lib/date-picker/date-picker.component.ts +16 -0
- package/src/libs/ui/inputs/src/lib/date-range-picker/date-range-picker.component.ts +8 -1
- package/src/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.html +1 -0
- package/src/libs/ui/inputs/src/lib/dropdown-selector/dropdown-selector.component.ts +1 -0
- package/src/libs/ui/inputs/src/lib/previous-next-buttons/previous-next-buttons.component.css +6 -0
- package/src/libs/ui/inputs/src/lib/previous-next-buttons/previous-next-buttons.component.html +26 -0
- package/src/libs/ui/inputs/src/lib/previous-next-buttons/previous-next-buttons.component.ts +32 -0
- package/src/libs/ui/inputs/src/lib/text-input/text-input.component.html +1 -0
- package/src/libs/ui/inputs/src/lib/text-input/text-input.component.ts +1 -0
- package/src/libs/ui/inputs/src/lib/ui-inputs.module.ts +2 -2
- package/src/libs/ui/layout/src/index.ts +1 -0
- package/src/libs/ui/layout/src/lib/block-list/block-list.component.css +23 -0
- package/src/libs/ui/layout/src/lib/block-list/block-list.component.html +20 -0
- package/src/libs/ui/layout/src/lib/block-list/block-list.component.ts +84 -0
- package/src/libs/ui/layout/src/lib/carousel/carousel.component.css +8 -4
- package/src/libs/ui/layout/src/lib/carousel/carousel.component.html +4 -4
- package/src/libs/ui/layout/src/lib/carousel/carousel.component.ts +45 -15
- package/src/libs/ui/layout/src/lib/ui-layout.module.ts +0 -2
- package/src/libs/util/app-config/src/lib/app-config.ts +2 -0
- package/src/libs/util/app-config/src/lib/fixtures.ts +1 -0
- package/src/libs/util/app-config/src/lib/model.ts +1 -0
- package/src/libs/util/shared/src/lib/links/link-classifier.service.ts +1 -1
- package/src/libs/util/shared/src/lib/links/link-utils.ts +21 -0
- package/translations/de.json +13 -14
- package/translations/en.json +13 -14
- package/translations/es.json +13 -14
- package/translations/fr.json +13 -14
- package/translations/it.json +13 -14
- package/translations/nl.json +13 -14
- package/translations/pt.json +13 -14
- package/translations/sk.json +13 -14
- package/esm2022/libs/ui/elements/src/lib/search-results-error/search-results-error.component.mjs +0 -29
- package/libs/ui/elements/src/lib/search-results-error/search-results-error.component.d.ts +0 -15
- package/libs/ui/elements/src/lib/search-results-error/search-results-error.component.d.ts.map +0 -1
- /package/src/libs/ui/elements/src/lib/{search-results-error/search-results-error.component.css → error/error.component.css} +0 -0
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
MapUtilsService,
|
|
16
16
|
} from '../../../../../../libs/feature/map/src'
|
|
17
17
|
import { getOptionalMapConfig, MapConfig } from '../../../../../../libs/util/app-config/src'
|
|
18
|
-
import { getLinkLabel
|
|
18
|
+
import { getLinkLabel } from '../../../../../../libs/util/shared/src'
|
|
19
19
|
import Feature from 'ol/Feature'
|
|
20
20
|
import { Geometry } from 'ol/geom'
|
|
21
21
|
import { StyleLike } from 'ol/style/Style'
|
|
@@ -23,10 +23,8 @@ import {
|
|
|
23
23
|
BehaviorSubject,
|
|
24
24
|
combineLatest,
|
|
25
25
|
from,
|
|
26
|
-
lastValueFrom,
|
|
27
26
|
Observable,
|
|
28
27
|
of,
|
|
29
|
-
startWith,
|
|
30
28
|
Subscription,
|
|
31
29
|
throwError,
|
|
32
30
|
withLatestFrom,
|
|
@@ -36,6 +34,7 @@ import {
|
|
|
36
34
|
distinctUntilChanged,
|
|
37
35
|
finalize,
|
|
38
36
|
map,
|
|
37
|
+
startWith,
|
|
39
38
|
switchMap,
|
|
40
39
|
tap,
|
|
41
40
|
} from 'rxjs/operators'
|
|
@@ -57,9 +56,11 @@ export class MapViewComponent implements OnInit, OnDestroy {
|
|
|
57
56
|
|
|
58
57
|
compatibleMapLinks$ = combineLatest([
|
|
59
58
|
this.mdViewFacade.mapApiLinks$,
|
|
60
|
-
this.mdViewFacade.
|
|
59
|
+
this.mdViewFacade.geoDataLinksWithGeometry$,
|
|
61
60
|
]).pipe(
|
|
62
|
-
map(([mapApiLinks,
|
|
61
|
+
map(([mapApiLinks, geoDataLinksWithGeometry]) => {
|
|
62
|
+
return [...mapApiLinks, ...geoDataLinksWithGeometry]
|
|
63
|
+
})
|
|
63
64
|
)
|
|
64
65
|
|
|
65
66
|
dropdownChoices$ = this.compatibleMapLinks$.pipe(
|
|
@@ -104,8 +105,8 @@ export class MapViewComponent implements OnInit, OnDestroy {
|
|
|
104
105
|
mapContext$ = this.currentLayers$.pipe(
|
|
105
106
|
switchMap((layers) =>
|
|
106
107
|
from(this.mapUtils.getLayerExtent(layers[0])).pipe(
|
|
107
|
-
catchError((
|
|
108
|
-
|
|
108
|
+
catchError(() => {
|
|
109
|
+
this.error = 'The layer has no extent'
|
|
109
110
|
return of(undefined)
|
|
110
111
|
}),
|
|
111
112
|
map(
|
|
@@ -117,9 +118,15 @@ export class MapViewComponent implements OnInit, OnDestroy {
|
|
|
117
118
|
},
|
|
118
119
|
} as MapContextModel)
|
|
119
120
|
),
|
|
120
|
-
tap(() =>
|
|
121
|
+
tap((res) => {
|
|
122
|
+
this.resetSelection()
|
|
123
|
+
})
|
|
121
124
|
)
|
|
122
125
|
),
|
|
126
|
+
startWith({
|
|
127
|
+
layers: [],
|
|
128
|
+
view: {},
|
|
129
|
+
} as MapContextModel),
|
|
123
130
|
withLatestFrom(this.mdViewFacade.metadata$),
|
|
124
131
|
map(([context, metadata]) => {
|
|
125
132
|
if (context.view.extent) return context
|
|
@@ -196,7 +203,8 @@ export class MapViewComponent implements OnInit, OnDestroy {
|
|
|
196
203
|
} else if (
|
|
197
204
|
(link.type === 'service' &&
|
|
198
205
|
(link.accessServiceProtocol === 'wfs' ||
|
|
199
|
-
link.accessServiceProtocol === 'esriRest'
|
|
206
|
+
link.accessServiceProtocol === 'esriRest' ||
|
|
207
|
+
link.accessServiceProtocol === 'ogcFeatures')) ||
|
|
200
208
|
link.type === 'download'
|
|
201
209
|
) {
|
|
202
210
|
return this.dataService.readAsGeoJson(link).pipe(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core'
|
|
2
2
|
import { select, Store } from '@ngrx/store'
|
|
3
|
-
import { filter, map } from 'rxjs/operators'
|
|
3
|
+
import { defaultIfEmpty, filter, map, mergeMap, scan } from 'rxjs/operators'
|
|
4
4
|
import * as MdViewActions from './mdview.actions'
|
|
5
5
|
import * as MdViewSelectors from './mdview.selectors'
|
|
6
6
|
import { LinkClassifierService, LinkUsage } from '../../../../../../libs/util/shared/src'
|
|
@@ -8,9 +8,11 @@ import { DatavizConfigurationModel } from '../../../../../../libs/common/domain/
|
|
|
8
8
|
import {
|
|
9
9
|
CatalogRecord,
|
|
10
10
|
UserFeedback,
|
|
11
|
-
UserFeedbackViewModel,
|
|
12
11
|
} from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
13
12
|
import { AvatarServiceInterface } from '../../../../../../libs/api/repository/src'
|
|
13
|
+
import { OgcApiRecord } from '@camptocamp/ogc-client'
|
|
14
|
+
import { from, of } from 'rxjs'
|
|
15
|
+
import { DataService } from '../../../../../../libs/feature/dataviz/src'
|
|
14
16
|
|
|
15
17
|
@Injectable()
|
|
16
18
|
/**
|
|
@@ -22,8 +24,9 @@ import { AvatarServiceInterface } from '../../../../../../libs/api/repository/sr
|
|
|
22
24
|
export class MdViewFacade {
|
|
23
25
|
constructor(
|
|
24
26
|
private store: Store,
|
|
25
|
-
|
|
26
|
-
private avatarService: AvatarServiceInterface
|
|
27
|
+
public linkClassifier: LinkClassifierService,
|
|
28
|
+
private avatarService: AvatarServiceInterface,
|
|
29
|
+
public dataService: DataService
|
|
27
30
|
) {}
|
|
28
31
|
|
|
29
32
|
isPresent$ = this.store.pipe(
|
|
@@ -91,6 +94,39 @@ export class MdViewFacade {
|
|
|
91
94
|
)
|
|
92
95
|
)
|
|
93
96
|
|
|
97
|
+
geoDataLinksWithGeometry$ = this.allLinks$.pipe(
|
|
98
|
+
mergeMap((links) => {
|
|
99
|
+
return from(links)
|
|
100
|
+
}),
|
|
101
|
+
mergeMap((link) => {
|
|
102
|
+
if (this.linkClassifier.hasUsage(link, LinkUsage.GEODATA)) {
|
|
103
|
+
if (
|
|
104
|
+
link.type === 'service' &&
|
|
105
|
+
link.accessServiceProtocol === 'ogcFeatures'
|
|
106
|
+
) {
|
|
107
|
+
return from(this.dataService.getItemsFromOgcApi(link.url.href)).pipe(
|
|
108
|
+
map((collectionRecords: OgcApiRecord) => {
|
|
109
|
+
return collectionRecords && collectionRecords.geometry
|
|
110
|
+
? link
|
|
111
|
+
: null
|
|
112
|
+
}),
|
|
113
|
+
defaultIfEmpty(null)
|
|
114
|
+
)
|
|
115
|
+
} else {
|
|
116
|
+
return of(link)
|
|
117
|
+
}
|
|
118
|
+
} else {
|
|
119
|
+
return of(null)
|
|
120
|
+
}
|
|
121
|
+
}),
|
|
122
|
+
scan((acc, val) => {
|
|
123
|
+
if (val !== null && !acc.includes(val)) {
|
|
124
|
+
acc.push(val)
|
|
125
|
+
}
|
|
126
|
+
return acc
|
|
127
|
+
}, [])
|
|
128
|
+
)
|
|
129
|
+
|
|
94
130
|
landingPageLinks$ = this.metadata$.pipe(
|
|
95
131
|
map((record) => ('landingPage' in record ? [record.landingPage] : []))
|
|
96
132
|
)
|
|
@@ -82,7 +82,6 @@ const metadataViewReducer = createReducer(
|
|
|
82
82
|
*/
|
|
83
83
|
on(MetadataViewActions.loadUserFeedbacks, (state) => ({
|
|
84
84
|
...state,
|
|
85
|
-
error: null,
|
|
86
85
|
allUserFeedbacksLoading: true,
|
|
87
86
|
})),
|
|
88
87
|
on(MetadataViewActions.addUserFeedback, (state) => ({
|
|
@@ -93,7 +92,6 @@ const metadataViewReducer = createReducer(
|
|
|
93
92
|
MetadataViewActions.loadUserFeedbacksSuccess,
|
|
94
93
|
(state, { userFeedbacks }) => ({
|
|
95
94
|
...state,
|
|
96
|
-
error: null,
|
|
97
95
|
userFeedbacks: userFeedbacks,
|
|
98
96
|
addUserFeedbackLoading: false,
|
|
99
97
|
allUserFeedbacksLoading: false,
|
|
@@ -8,6 +8,7 @@ export * from './lib/state/effects'
|
|
|
8
8
|
export * from './lib/state/reducer'
|
|
9
9
|
export * from './lib/utils/service/search.service'
|
|
10
10
|
export * from './lib/utils/service/fields.service'
|
|
11
|
+
export * from './lib/utils/service/fields'
|
|
11
12
|
export * from './lib/results-list/results-list.container.component'
|
|
12
13
|
export * from './lib/filter-dropdown/filter-dropdown.component'
|
|
13
14
|
export * from './lib/constants'
|
|
@@ -42,16 +42,16 @@
|
|
|
42
42
|
</div>
|
|
43
43
|
|
|
44
44
|
<div class="p-4 max-w-[600px] m-auto text-[13px]">
|
|
45
|
-
<gn-ui-
|
|
45
|
+
<gn-ui-error
|
|
46
46
|
*ngIf="(errorCode$ | async) === 0"
|
|
47
47
|
[type]="errorTypes.COULD_NOT_REACH_API"
|
|
48
48
|
>
|
|
49
|
-
</gn-ui-
|
|
50
|
-
<gn-ui-
|
|
49
|
+
</gn-ui-error>
|
|
50
|
+
<gn-ui-error
|
|
51
51
|
*ngIf="(error$ | async) !== null && (errorCode$ | async) !== 0"
|
|
52
52
|
[type]="errorTypes.RECEIVED_ERROR"
|
|
53
53
|
[error]="errorMessage$ | async"
|
|
54
|
-
></gn-ui-
|
|
54
|
+
></gn-ui-error>
|
|
55
55
|
</div>
|
|
56
56
|
|
|
57
57
|
<ng-template #favoriteToggle let-record>
|
|
@@ -36,7 +36,7 @@ marker('search.filters.contact')
|
|
|
36
36
|
providedIn: 'root',
|
|
37
37
|
})
|
|
38
38
|
export class FieldsService {
|
|
39
|
-
|
|
39
|
+
protected fields = {
|
|
40
40
|
publisher: new OrganizationSearchField(this.injector),
|
|
41
41
|
format: new SimpleSearchField('format', this.injector, 'asc'),
|
|
42
42
|
resourceType: new TranslatedSearchField(
|
|
@@ -76,7 +76,7 @@ export class FieldsService {
|
|
|
76
76
|
return Object.keys(this.fields)
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
constructor(
|
|
79
|
+
constructor(protected injector: Injector) {}
|
|
80
80
|
|
|
81
81
|
getAvailableValues(fieldName: string) {
|
|
82
82
|
if (this.supportedFields.indexOf(fieldName) === -1)
|
|
@@ -17,7 +17,7 @@ export * from './lib/pagination-buttons/pagination-buttons.component'
|
|
|
17
17
|
export * from './lib/pagination/pagination.component'
|
|
18
18
|
export * from './lib/record-api-form/record-api-form.component'
|
|
19
19
|
export * from './lib/related-record-card/related-record-card.component'
|
|
20
|
-
export * from './lib/
|
|
20
|
+
export * from './lib/error/error.component'
|
|
21
21
|
export * from './lib/thumbnail/thumbnail.component'
|
|
22
22
|
export * from './lib/ui-elements.module'
|
|
23
23
|
export * from './lib/user-preview/user-preview.component'
|
|
@@ -26,7 +26,8 @@ export class ApiCardComponent implements OnInit, OnChanges {
|
|
|
26
26
|
|
|
27
27
|
ngOnInit() {
|
|
28
28
|
this.displayApiFormButton =
|
|
29
|
-
this.link.accessServiceProtocol === 'ogcFeatures'
|
|
29
|
+
this.link.accessServiceProtocol === 'ogcFeatures' ||
|
|
30
|
+
this.link.accessServiceProtocol === 'wfs'
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
ngOnChanges(changes: SimpleChanges) {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
<div
|
|
2
2
|
class="p-[1.7em] bg-red-50 text-red-800 text-[1.5em] text-center rounded-lg"
|
|
3
3
|
>
|
|
4
|
-
<div
|
|
4
|
+
<div
|
|
5
|
+
*ngIf="type === types.COULD_NOT_REACH_API"
|
|
6
|
+
data-test="could-not-reach-api-error"
|
|
7
|
+
>
|
|
5
8
|
<div class="relative opacity-40">
|
|
6
9
|
<mat-icon class="material-symbols-outlined face">face</mat-icon>
|
|
7
10
|
<mat-icon class="material-symbols-outlined question-mark1"
|
|
@@ -13,14 +16,26 @@
|
|
|
13
16
|
</div>
|
|
14
17
|
<div translate>search.error.couldNotReachApi</div>
|
|
15
18
|
</div>
|
|
16
|
-
<div
|
|
19
|
+
<div
|
|
20
|
+
*ngIf="type === types.DATASET_HAS_NO_LINK"
|
|
21
|
+
data-test="dataset-has-no-link-error"
|
|
22
|
+
>
|
|
23
|
+
<div class="relative opacity-40">
|
|
24
|
+
<mat-icon class="material-symbols-outlined face">computer</mat-icon>
|
|
25
|
+
</div>
|
|
26
|
+
<div translate>search.error.recordHasnolink</div>
|
|
27
|
+
</div>
|
|
28
|
+
<div *ngIf="type === types.RECEIVED_ERROR" data-test="received-error-error">
|
|
17
29
|
<div class="relative opacity-40">
|
|
18
30
|
<mat-icon class="material-symbols-outlined face">mood_bad</mat-icon>
|
|
19
31
|
</div>
|
|
20
32
|
<div translate>search.error.receivedError</div>
|
|
21
33
|
<div *ngIf="error">{{ error }}</div>
|
|
22
34
|
</div>
|
|
23
|
-
<div
|
|
35
|
+
<div
|
|
36
|
+
*ngIf="type === types.RECORD_NOT_FOUND"
|
|
37
|
+
data-test="record-not-found-error"
|
|
38
|
+
>
|
|
24
39
|
<div class="relative opacity-40">
|
|
25
40
|
<mat-icon class="material-symbols-outlined computer">computer</mat-icon>
|
|
26
41
|
<mat-icon class="material-symbols-outlined computer-question-mark"
|
|
@@ -4,15 +4,16 @@ export enum ErrorType {
|
|
|
4
4
|
COULD_NOT_REACH_API,
|
|
5
5
|
RECEIVED_ERROR,
|
|
6
6
|
RECORD_NOT_FOUND,
|
|
7
|
+
DATASET_HAS_NO_LINK,
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
@Component({
|
|
10
|
-
selector: 'gn-ui-
|
|
11
|
-
templateUrl: './
|
|
12
|
-
styleUrls: ['./
|
|
11
|
+
selector: 'gn-ui-error',
|
|
12
|
+
templateUrl: './error.component.html',
|
|
13
|
+
styleUrls: ['./error.component.css'],
|
|
13
14
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
14
15
|
})
|
|
15
|
-
export class
|
|
16
|
+
export class ErrorComponent {
|
|
16
17
|
@Input() type!: ErrorType
|
|
17
18
|
@Input() error?: string
|
|
18
19
|
@Input() recordId?: string
|
|
@@ -1,25 +1,43 @@
|
|
|
1
1
|
<a
|
|
2
2
|
[href]="link.url"
|
|
3
3
|
target="_blank"
|
|
4
|
-
class="flex flex-col justify-between group
|
|
4
|
+
class="flex flex-col justify-between group grow py-5 px-5 bg-white rounded border-gray-300 filter card-shadow overflow-hidden"
|
|
5
|
+
[ngClass]="{ 'h-40': !compact }"
|
|
6
|
+
[title]="title"
|
|
5
7
|
>
|
|
6
|
-
<
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<
|
|
24
|
-
|
|
8
|
+
<ng-container *ngIf="!compact; else compactTpl">
|
|
9
|
+
<div class="max-h-24 overflow-hidden text-ellipsis">
|
|
10
|
+
<p
|
|
11
|
+
class="font-title font-medium text-21 text-black break-words mb-1 line-clamp-2"
|
|
12
|
+
>
|
|
13
|
+
{{ link.name }}
|
|
14
|
+
</p>
|
|
15
|
+
<p class="font-medium text-sm break-words">
|
|
16
|
+
{{ link.description }}
|
|
17
|
+
</p>
|
|
18
|
+
<p
|
|
19
|
+
*ngIf="!link.name && !link.description"
|
|
20
|
+
class="font-medium text-sm break-words truncate"
|
|
21
|
+
>
|
|
22
|
+
{{ link.url }}
|
|
23
|
+
</p>
|
|
24
|
+
</div>
|
|
25
|
+
<div>
|
|
26
|
+
<mat-icon class="material-symbols-outlined card-icon"
|
|
27
|
+
>open_in_new</mat-icon
|
|
28
|
+
>
|
|
29
|
+
</div>
|
|
30
|
+
</ng-container>
|
|
31
|
+
<ng-template #compactTpl>
|
|
32
|
+
<div class="flex items-center justify-between gap-4">
|
|
33
|
+
<p
|
|
34
|
+
class="overflow-hidden font-title font-medium text-21 text-black text-ellipsis whitespace-nowrap"
|
|
35
|
+
>
|
|
36
|
+
{{ link.name || link.description }}
|
|
37
|
+
</p>
|
|
38
|
+
<mat-icon class="material-symbols-outlined card-icon flex-shrink-0"
|
|
39
|
+
>open_in_new</mat-icon
|
|
40
|
+
>
|
|
41
|
+
</div>
|
|
42
|
+
</ng-template>
|
|
25
43
|
</a>
|
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
import { Component, ChangeDetectionStrategy, Input } from '@angular/core'
|
|
2
2
|
import { DatasetDistribution } from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
3
|
+
import { MatIconModule } from '@angular/material/icon'
|
|
4
|
+
import { CommonModule } from '@angular/common'
|
|
3
5
|
|
|
4
6
|
@Component({
|
|
5
7
|
selector: 'gn-ui-link-card',
|
|
6
8
|
templateUrl: './link-card.component.html',
|
|
7
9
|
styleUrls: ['./link-card.component.css'],
|
|
8
10
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
11
|
+
standalone: true,
|
|
12
|
+
imports: [CommonModule, MatIconModule],
|
|
9
13
|
})
|
|
10
14
|
export class LinkCardComponent {
|
|
11
15
|
@Input() link: DatasetDistribution
|
|
16
|
+
@Input() compact = false
|
|
17
|
+
|
|
18
|
+
get title() {
|
|
19
|
+
if (this.link.name && this.link.description) {
|
|
20
|
+
return `${this.link.name} | ${this.link.description}`
|
|
21
|
+
}
|
|
22
|
+
return this.link.name || this.link.description || ''
|
|
23
|
+
}
|
|
12
24
|
}
|
|
@@ -37,15 +37,31 @@
|
|
|
37
37
|
</div>
|
|
38
38
|
</div>
|
|
39
39
|
</div>
|
|
40
|
-
<div class="flex flex-col gap-3">
|
|
41
|
-
<p class="text-sm" translate>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
<div class="flex flex-col gap-3 relative">
|
|
41
|
+
<p class="text-sm" [class.text-gray-600]="!supportOffset" translate>
|
|
42
|
+
record.metadata.api.form.offset
|
|
43
|
+
</p>
|
|
44
|
+
<div class="flex items-center">
|
|
45
|
+
<gn-ui-text-input
|
|
46
|
+
class="w-20"
|
|
47
|
+
[value]="offset$ | async"
|
|
48
|
+
[disabled]="!supportOffset"
|
|
49
|
+
(valueChange)="supportOffset ? setOffset($event) : null"
|
|
50
|
+
hint=""
|
|
51
|
+
>
|
|
52
|
+
</gn-ui-text-input>
|
|
53
|
+
<div
|
|
54
|
+
*ngIf="!supportOffset"
|
|
55
|
+
class="flex items-center gap-2 text-orange-500 z-10 ml-3"
|
|
56
|
+
>
|
|
57
|
+
<span
|
|
58
|
+
class="material-symbols-outlined"
|
|
59
|
+
matTooltip="Not supported on this service"
|
|
60
|
+
>
|
|
61
|
+
warning
|
|
62
|
+
</span>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
49
65
|
</div>
|
|
50
66
|
<div class="flex flex-col gap-3">
|
|
51
67
|
<p class="text-sm" translate>record.metadata.api.form.type</p>
|
|
@@ -55,7 +71,7 @@
|
|
|
55
71
|
extraBtnClass="secondary min-w-full !w-40 !text-black"
|
|
56
72
|
[showTitle]="false"
|
|
57
73
|
class="text-black"
|
|
58
|
-
[choices]="
|
|
74
|
+
[choices]="outputFormats"
|
|
59
75
|
(selectValue)="setFormat($event)"
|
|
60
76
|
[selected]="format$ | async"
|
|
61
77
|
></gn-ui-dropdown-selector>
|
|
@@ -1,12 +1,23 @@
|
|
|
1
1
|
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { OgcApiEndpoint, WfsEndpoint } from '@camptocamp/ogc-client'
|
|
3
|
+
import {
|
|
4
|
+
DatasetServiceDistribution,
|
|
5
|
+
ServiceProtocol,
|
|
6
|
+
} from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
7
|
+
import { mimeTypeToFormat } from '../../../../../../libs/util/shared/src'
|
|
8
|
+
import { BehaviorSubject, combineLatest, filter, map, switchMap } from 'rxjs'
|
|
4
9
|
|
|
5
10
|
const DEFAULT_PARAMS = {
|
|
6
11
|
OFFSET: '',
|
|
7
12
|
LIMIT: '-1',
|
|
8
13
|
FORMAT: 'json',
|
|
9
14
|
}
|
|
15
|
+
|
|
16
|
+
interface OutputFormats {
|
|
17
|
+
itemFormats?: any[]
|
|
18
|
+
outputFormats?: any[]
|
|
19
|
+
}
|
|
20
|
+
|
|
10
21
|
@Component({
|
|
11
22
|
selector: 'gn-ui-record-api-form',
|
|
12
23
|
templateUrl: './record-api-form.component.html',
|
|
@@ -15,39 +26,45 @@ const DEFAULT_PARAMS = {
|
|
|
15
26
|
})
|
|
16
27
|
export class RecordApiFormComponent {
|
|
17
28
|
@Input() set apiLink(value: DatasetServiceDistribution) {
|
|
18
|
-
this.
|
|
29
|
+
this.outputFormats = [{ value: 'json', label: 'JSON' }]
|
|
30
|
+
this.accessServiceProtocol = value ? value.accessServiceProtocol : undefined
|
|
31
|
+
this.apiFeatureType = value ? value.name : undefined
|
|
32
|
+
if (value) {
|
|
33
|
+
this.apiBaseUrl = value.url.href
|
|
34
|
+
this.createEndpoint().then(() => this.parseOutputFormats())
|
|
35
|
+
}
|
|
19
36
|
this.resetUrl()
|
|
20
37
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
38
|
+
|
|
39
|
+
offset$ = new BehaviorSubject(DEFAULT_PARAMS.OFFSET)
|
|
40
|
+
limit$ = new BehaviorSubject(DEFAULT_PARAMS.LIMIT)
|
|
41
|
+
format$ = new BehaviorSubject(DEFAULT_PARAMS.FORMAT)
|
|
42
|
+
endpoint$ = new BehaviorSubject<WfsEndpoint | OgcApiEndpoint | undefined>(
|
|
43
|
+
undefined
|
|
44
|
+
)
|
|
24
45
|
apiBaseUrl: string
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
]
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
outputUrl = url.toString()
|
|
43
|
-
}
|
|
44
|
-
return outputUrl
|
|
45
|
-
})
|
|
46
|
+
apiFeatureType: string
|
|
47
|
+
supportOffset = true
|
|
48
|
+
accessServiceProtocol: ServiceProtocol | undefined
|
|
49
|
+
outputFormats = [{ value: 'json', label: 'JSON' }]
|
|
50
|
+
endpoint: WfsEndpoint | OgcApiEndpoint | undefined
|
|
51
|
+
firstCollection: string | undefined
|
|
52
|
+
|
|
53
|
+
apiQueryUrl$ = combineLatest([
|
|
54
|
+
this.offset$,
|
|
55
|
+
this.limit$,
|
|
56
|
+
this.format$,
|
|
57
|
+
// only compute the url if the endpoint was created
|
|
58
|
+
this.endpoint$.pipe(filter((endpoint) => !!endpoint)),
|
|
59
|
+
]).pipe(
|
|
60
|
+
switchMap(([offset, limit, format]) =>
|
|
61
|
+
this.generateApiQueryUrl(offset, limit, format)
|
|
62
|
+
)
|
|
46
63
|
)
|
|
64
|
+
|
|
47
65
|
noLimitChecked$ = this.limit$.pipe(
|
|
48
66
|
map((limit) => limit === '-1' || limit === '')
|
|
49
67
|
)
|
|
50
|
-
|
|
51
68
|
displayLimit$ = this.limit$.pipe(
|
|
52
69
|
map((limit) => (limit !== '-1' ? limit : ''))
|
|
53
70
|
)
|
|
@@ -57,8 +74,7 @@ export class RecordApiFormComponent {
|
|
|
57
74
|
}
|
|
58
75
|
|
|
59
76
|
setLimit(value: string) {
|
|
60
|
-
|
|
61
|
-
this.limit$.next(newLimit)
|
|
77
|
+
this.limit$.next(value === '' ? '-1' : value)
|
|
62
78
|
}
|
|
63
79
|
|
|
64
80
|
setFormat(value: string | unknown) {
|
|
@@ -70,4 +86,83 @@ export class RecordApiFormComponent {
|
|
|
70
86
|
this.limit$.next(DEFAULT_PARAMS.LIMIT)
|
|
71
87
|
this.format$.next(DEFAULT_PARAMS.FORMAT)
|
|
72
88
|
}
|
|
89
|
+
|
|
90
|
+
async parseOutputFormats() {
|
|
91
|
+
if (!this.endpoint) return
|
|
92
|
+
const apiUrl = this.apiBaseUrl.endsWith('?')
|
|
93
|
+
? this.apiBaseUrl.slice(0, -1)
|
|
94
|
+
: this.apiBaseUrl
|
|
95
|
+
const outputFormats = await this.getOutputFormats(apiUrl)
|
|
96
|
+
|
|
97
|
+
const formatsList = outputFormats.itemFormats
|
|
98
|
+
? this.mapFormats(outputFormats.itemFormats)
|
|
99
|
+
: this.mapFormats(outputFormats.outputFormats || [])
|
|
100
|
+
|
|
101
|
+
this.outputFormats = this.outputFormats
|
|
102
|
+
.concat(formatsList.filter(Boolean))
|
|
103
|
+
.filter(
|
|
104
|
+
(format, index, self) =>
|
|
105
|
+
index === self.findIndex((t) => t.value === format.value)
|
|
106
|
+
)
|
|
107
|
+
.sort((a, b) => a.label.localeCompare(b.label))
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
mapFormats(formats: any[]) {
|
|
111
|
+
return formats.map((format) => {
|
|
112
|
+
const normalizedFormat = mimeTypeToFormat(format)
|
|
113
|
+
return normalizedFormat
|
|
114
|
+
? { label: normalizedFormat.toUpperCase(), value: normalizedFormat }
|
|
115
|
+
: null
|
|
116
|
+
})
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
async getOutputFormats(url: string): Promise<OutputFormats> {
|
|
120
|
+
if (!this.endpoint) return {}
|
|
121
|
+
if (this.endpoint instanceof WfsEndpoint) {
|
|
122
|
+
this.supportOffset = this.endpoint.supportsStartIndex()
|
|
123
|
+
return this.endpoint.getServiceInfo() as OutputFormats
|
|
124
|
+
} else {
|
|
125
|
+
return (await this.endpoint.getCollectionInfo(
|
|
126
|
+
this.firstCollection
|
|
127
|
+
)) as OutputFormats
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
async createEndpoint() {
|
|
132
|
+
if (!this.apiBaseUrl || !this.accessServiceProtocol) return
|
|
133
|
+
if (this.accessServiceProtocol === 'wfs') {
|
|
134
|
+
this.endpoint = new WfsEndpoint(this.apiBaseUrl)
|
|
135
|
+
await (this.endpoint as WfsEndpoint).isReady()
|
|
136
|
+
} else {
|
|
137
|
+
this.endpoint = new OgcApiEndpoint(this.apiBaseUrl)
|
|
138
|
+
this.firstCollection = (await this.endpoint.allCollections)[0].name
|
|
139
|
+
}
|
|
140
|
+
this.endpoint$.next(this.endpoint)
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
async generateApiQueryUrl(
|
|
144
|
+
offset: string,
|
|
145
|
+
limit: string,
|
|
146
|
+
format: string
|
|
147
|
+
): Promise<string> {
|
|
148
|
+
if (!this.apiBaseUrl || !this.endpoint || !this.apiFeatureType) return ''
|
|
149
|
+
|
|
150
|
+
const options = {
|
|
151
|
+
outputFormat: format,
|
|
152
|
+
startIndex: offset ? Number(offset) : undefined,
|
|
153
|
+
maxFeatures: limit !== '-1' ? Number(limit) : undefined,
|
|
154
|
+
limit: limit !== '-1' ? Number(limit) : limit === '-1' ? -1 : undefined,
|
|
155
|
+
offset: offset !== '' ? Number(offset) : undefined,
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (this.endpoint instanceof WfsEndpoint) {
|
|
159
|
+
options.maxFeatures = limit !== '-1' ? Number(limit) : undefined
|
|
160
|
+
return this.endpoint.getFeatureUrl(this.apiFeatureType, options)
|
|
161
|
+
} else {
|
|
162
|
+
return await this.endpoint.getCollectionItemsUrl(
|
|
163
|
+
this.firstCollection,
|
|
164
|
+
options
|
|
165
|
+
)
|
|
166
|
+
}
|
|
167
|
+
}
|
|
73
168
|
}
|