geonetwork-ui 2.3.0-dev.e03215d1 → 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-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 +8 -3
- 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 +8 -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 +89 -54
- 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 +2 -1
- package/esm2022/libs/ui/inputs/src/lib/check-toggle/check-toggle.component.mjs +4 -3
- 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 +6 -5
- 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/translations/de.json +12 -14
- package/esm2022/translations/en.json +12 -14
- package/esm2022/translations/es.json +12 -14
- package/esm2022/translations/fr.json +12 -14
- package/esm2022/translations/it.json +12 -14
- package/esm2022/translations/nl.json +12 -14
- package/esm2022/translations/pt.json +12 -14
- package/fesm2022/geonetwork-ui.mjs +997 -536
- 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-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 +1 -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/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 +22 -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 +1 -0
- 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/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/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 +8 -0
- 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-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 +5 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +5 -0
- package/src/libs/feature/editor/src/lib/fields.config.ts +7 -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 +25 -9
- package/src/libs/ui/elements/src/lib/record-api-form/record-api-form.component.ts +116 -57
- 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 +1 -0
- package/src/libs/ui/inputs/src/lib/check-toggle/check-toggle.component.ts +3 -0
- 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 +1 -1
- 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/translations/de.json +12 -14
- package/translations/en.json +12 -14
- package/translations/es.json +12 -14
- package/translations/fr.json +12 -14
- package/translations/it.json +12 -14
- package/translations/nl.json +12 -14
- package/translations/pt.json +12 -14
- package/translations/sk.json +12 -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
package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts
CHANGED
|
@@ -24,6 +24,7 @@ import { FormFieldSimpleComponent } from './form-field-simple/form-field-simple.
|
|
|
24
24
|
import { FormFieldSpatialExtentComponent } from './form-field-spatial-extent/form-field-spatial-extent.component'
|
|
25
25
|
import { FormFieldTemporalExtentComponent } from './form-field-temporal-extent/form-field-temporal-extent.component'
|
|
26
26
|
import { FormFieldConfig } from './form-field.model'
|
|
27
|
+
import { FormFieldUpdateFrequencyComponent } from './form-field-update-frequency/form-field-update-frequency.component'
|
|
27
28
|
|
|
28
29
|
@Component({
|
|
29
30
|
selector: 'gn-ui-form-field',
|
|
@@ -40,6 +41,7 @@ import { FormFieldConfig } from './form-field.model'
|
|
|
40
41
|
FormFieldWrapperComponent,
|
|
41
42
|
FormFieldLicenseComponent,
|
|
42
43
|
FormFieldResourceUpdatedComponent,
|
|
44
|
+
FormFieldUpdateFrequencyComponent,
|
|
43
45
|
FormFieldSimpleComponent,
|
|
44
46
|
FormFieldRichComponent,
|
|
45
47
|
FormFieldObjectComponent,
|
|
@@ -130,6 +132,9 @@ export class FormFieldComponent {
|
|
|
130
132
|
get isResourceUpdated() {
|
|
131
133
|
return this.model === 'resourceUpdated'
|
|
132
134
|
}
|
|
135
|
+
get isUpdateFrequency() {
|
|
136
|
+
return this.model === 'updateFrequency'
|
|
137
|
+
}
|
|
133
138
|
|
|
134
139
|
get withoutWrapper() {
|
|
135
140
|
return this.model === 'title' || this.model === 'abstract'
|
package/src/libs/feature/map/src/lib/add-layer-from-ogc-api/add-layer-from-ogc-api.component.html
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
(valueChange)="urlChange.next($event)"
|
|
5
5
|
[hint]="'map.ogc.urlInput.hint' | translate"
|
|
6
6
|
class="w-96"
|
|
7
|
-
>
|
|
8
|
-
</gn-ui-text-input>
|
|
7
|
+
></gn-ui-text-input>
|
|
9
8
|
</div>
|
|
10
9
|
|
|
11
10
|
<div *ngIf="errorMessage" class="text-red-500 mt-2">
|
|
@@ -16,21 +15,36 @@
|
|
|
16
15
|
<p class="loading-message" translate>map.loading.service</p>
|
|
17
16
|
</div>
|
|
18
17
|
|
|
19
|
-
<
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
type="primary"
|
|
29
|
-
(buttonClick)="addLayer(layer)"
|
|
30
|
-
extraClass="text-sm !px-2 !py-1"
|
|
31
|
-
translate
|
|
32
|
-
><span translate> map.layer.add </span></gn-ui-button
|
|
18
|
+
<ng-container *ngFor="let layer of layers">
|
|
19
|
+
<div
|
|
20
|
+
*ngIf="shouldDisplayLayer(layer)"
|
|
21
|
+
class="flex items-center justify-between my-2 layer-item-tree"
|
|
22
|
+
>
|
|
23
|
+
<div class="flex flex-col items-start w-full">
|
|
24
|
+
<p
|
|
25
|
+
class="max-w-xs overflow-hidden overflow-ellipsis whitespace-nowrap"
|
|
26
|
+
[title]="layer.name"
|
|
33
27
|
>
|
|
28
|
+
{{ layer.name }}
|
|
29
|
+
</p>
|
|
30
|
+
<div class="flex justify-between items-center w-full">
|
|
31
|
+
<gn-ui-dropdown-selector
|
|
32
|
+
[title]="'Add Layer As' | translate"
|
|
33
|
+
[choices]="getLayerChoices(layer)"
|
|
34
|
+
(selectValue)="onLayerTypeSelect(layer.name, $event)"
|
|
35
|
+
[selected]="selectedLayerTypes[layer.name]"
|
|
36
|
+
extraBtnClass="w-6 h-5 !text-sm !px-2 !py-1"
|
|
37
|
+
></gn-ui-dropdown-selector>
|
|
38
|
+
<gn-ui-button
|
|
39
|
+
class="layer-add-btn"
|
|
40
|
+
type="primary"
|
|
41
|
+
(buttonClick)="addLayer(layer.name, selectedLayerTypes[layer.name])"
|
|
42
|
+
extraClass="text-sm !px-2 !py-1"
|
|
43
|
+
translate
|
|
44
|
+
>
|
|
45
|
+
<span translate>map.layer.add</span>
|
|
46
|
+
</gn-ui-button>
|
|
47
|
+
</div>
|
|
34
48
|
</div>
|
|
35
|
-
</
|
|
36
|
-
</
|
|
49
|
+
</div>
|
|
50
|
+
</ng-container>
|
package/src/libs/feature/map/src/lib/add-layer-from-ogc-api/add-layer-from-ogc-api.component.ts
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
MapContextLayerTypeEnum,
|
|
15
15
|
} from '../map-context/map-context.model'
|
|
16
16
|
import { TranslateModule } from '@ngx-translate/core'
|
|
17
|
-
import { UiInputsModule } from '../../../../../../libs/ui/inputs/src'
|
|
17
|
+
import { DropdownChoice, UiInputsModule } from '../../../../../../libs/ui/inputs/src'
|
|
18
18
|
import { CommonModule } from '@angular/common'
|
|
19
19
|
import { MapLayer } from '../+state/map.models'
|
|
20
20
|
|
|
@@ -30,18 +30,16 @@ export class AddLayerFromOgcApiComponent implements OnInit {
|
|
|
30
30
|
@Output() layerAdded = new EventEmitter<MapLayer>()
|
|
31
31
|
|
|
32
32
|
urlChange = new Subject<string>()
|
|
33
|
-
layerUrl = ''
|
|
34
33
|
loading = false
|
|
35
|
-
layers:
|
|
36
|
-
ogcEndpoint: OgcApiEndpoint = null
|
|
34
|
+
layers: any[] = []
|
|
37
35
|
errorMessage: string | null = null
|
|
36
|
+
selectedLayerTypes: { [key: string]: DropdownChoice['value'] } = {}
|
|
38
37
|
|
|
39
38
|
constructor(private changeDetectorRef: ChangeDetectorRef) {}
|
|
40
39
|
|
|
41
40
|
ngOnInit() {
|
|
42
41
|
this.urlChange.pipe(debounceTime(700)).subscribe(() => {
|
|
43
42
|
this.loadLayers()
|
|
44
|
-
this.changeDetectorRef.detectChanges() // manually trigger change detection
|
|
45
43
|
})
|
|
46
44
|
}
|
|
47
45
|
|
|
@@ -49,14 +47,13 @@ export class AddLayerFromOgcApiComponent implements OnInit {
|
|
|
49
47
|
this.errorMessage = null
|
|
50
48
|
try {
|
|
51
49
|
this.loading = true
|
|
52
|
-
if (this.ogcUrl.trim()
|
|
50
|
+
if (!this.ogcUrl.trim()) {
|
|
53
51
|
this.layers = []
|
|
54
52
|
return
|
|
55
53
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
this.layers = await this.ogcEndpoint.featureCollections
|
|
54
|
+
const ogcEndpoint = await new OgcApiEndpoint(this.ogcUrl)
|
|
55
|
+
this.layers = await ogcEndpoint.allCollections
|
|
56
|
+
this.setDefaultLayerTypes()
|
|
60
57
|
} catch (error) {
|
|
61
58
|
const err = error as Error
|
|
62
59
|
this.layers = []
|
|
@@ -67,14 +64,72 @@ export class AddLayerFromOgcApiComponent implements OnInit {
|
|
|
67
64
|
}
|
|
68
65
|
}
|
|
69
66
|
|
|
70
|
-
|
|
71
|
-
this.
|
|
67
|
+
setDefaultLayerTypes() {
|
|
68
|
+
this.layers.forEach((layer) => {
|
|
69
|
+
const choices = this.getLayerChoices(layer)
|
|
70
|
+
if (choices.length > 0) {
|
|
71
|
+
this.selectedLayerTypes[layer.name] = choices[0].value
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
}
|
|
72
75
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
getLayerChoices(layer: any) {
|
|
77
|
+
const choices = []
|
|
78
|
+
if (layer.hasRecords) {
|
|
79
|
+
choices.push({ label: 'Records', value: 'record' })
|
|
80
|
+
}
|
|
81
|
+
if (layer.hasFeatures) {
|
|
82
|
+
choices.push({ label: 'Features', value: 'features' })
|
|
83
|
+
}
|
|
84
|
+
if (layer.hasVectorTiles) {
|
|
85
|
+
choices.push({ label: 'Vector Tiles', value: 'vectorTiles' })
|
|
86
|
+
}
|
|
87
|
+
if (layer.hasMapTiles) {
|
|
88
|
+
choices.push({ label: 'Map Tiles', value: 'mapTiles' })
|
|
89
|
+
}
|
|
90
|
+
return choices
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
shouldDisplayLayer(layer: any) {
|
|
94
|
+
return (
|
|
95
|
+
layer.hasRecords ||
|
|
96
|
+
layer.hasFeatures ||
|
|
97
|
+
layer.hasVectorTiles ||
|
|
98
|
+
layer.hasMapTiles
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
onLayerTypeSelect(layerName: string, selectedType: any) {
|
|
103
|
+
this.selectedLayerTypes[layerName] = selectedType
|
|
104
|
+
? selectedType
|
|
105
|
+
: this.getLayerChoices(layerName)[0]?.value
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
async addLayer(layer: string, layerType: any) {
|
|
109
|
+
try {
|
|
110
|
+
const ogcEndpoint = await new OgcApiEndpoint(this.ogcUrl)
|
|
111
|
+
let layerUrl: string
|
|
112
|
+
|
|
113
|
+
if (layerType === 'vectorTiles') {
|
|
114
|
+
layerUrl = await ogcEndpoint.getVectorTilesetUrl(layer)
|
|
115
|
+
} else if (layerType === 'mapTiles') {
|
|
116
|
+
layerUrl = await ogcEndpoint.getMapTilesetUrl(layer)
|
|
117
|
+
} else {
|
|
118
|
+
layerUrl = await ogcEndpoint.getCollectionItemsUrl(layer, {
|
|
119
|
+
outputFormat: 'json',
|
|
120
|
+
})
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const layerToAdd: MapContextLayerModel = {
|
|
124
|
+
name: layer,
|
|
125
|
+
url: layerUrl,
|
|
126
|
+
type: MapContextLayerTypeEnum.OGCAPI,
|
|
127
|
+
layerType: layerType,
|
|
128
|
+
}
|
|
129
|
+
this.layerAdded.emit({ ...layerToAdd, title: layer })
|
|
130
|
+
} catch (error) {
|
|
131
|
+
const err = error as Error
|
|
132
|
+
console.error('Error adding layer:', err.message)
|
|
77
133
|
}
|
|
78
|
-
this.layerAdded.emit({ ...layerToAdd, title: layer })
|
|
79
134
|
}
|
|
80
135
|
}
|
|
@@ -20,29 +20,35 @@ export interface MapContextLayerWmsModel {
|
|
|
20
20
|
type: 'wms'
|
|
21
21
|
url: string
|
|
22
22
|
name: string
|
|
23
|
+
attributions?: string
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
export interface MapContextLayerWmtsModel {
|
|
26
27
|
type: 'wmts'
|
|
27
28
|
url: string
|
|
28
29
|
name: string
|
|
30
|
+
attributions?: string
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
interface MapContextLayerWfsModel {
|
|
32
34
|
type: 'wfs'
|
|
33
35
|
url: string
|
|
34
36
|
name: string
|
|
37
|
+
attributions?: string
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
export interface MapContextLayerOgcapiModel {
|
|
38
41
|
type: 'ogcapi'
|
|
39
42
|
url: string
|
|
40
43
|
name: string
|
|
44
|
+
layerType: 'feature' | 'vectorTiles' | 'mapTiles' | 'record'
|
|
45
|
+
attributions?: string
|
|
41
46
|
}
|
|
42
47
|
|
|
43
48
|
interface LayerXyzModel {
|
|
44
49
|
type: 'xyz'
|
|
45
50
|
name?: string
|
|
51
|
+
attributions?: string
|
|
46
52
|
}
|
|
47
53
|
interface LayerXyzModelWithUrl extends LayerXyzModel {
|
|
48
54
|
url: string
|
|
@@ -58,6 +64,7 @@ export type MapContextLayerXyzModel =
|
|
|
58
64
|
|
|
59
65
|
interface LayerGeojson {
|
|
60
66
|
type: 'geojson'
|
|
67
|
+
attributions?: string
|
|
61
68
|
}
|
|
62
69
|
interface LayerGeojsonWithUrl extends LayerGeojson {
|
|
63
70
|
url: string
|
|
@@ -25,6 +25,12 @@ import WMTS from 'ol/source/WMTS'
|
|
|
25
25
|
import { Geometry } from 'ol/geom'
|
|
26
26
|
import Feature from 'ol/Feature'
|
|
27
27
|
import { WfsEndpoint, WmtsEndpoint } from '@camptocamp/ogc-client'
|
|
28
|
+
import OGCVectorTile from 'ol/source/OGCVectorTile.js'
|
|
29
|
+
import { MVT } from 'ol/format'
|
|
30
|
+
import VectorTileLayer from 'ol/layer/VectorTile'
|
|
31
|
+
import OGCMapTile from 'ol/source/OGCMapTile.js'
|
|
32
|
+
import ImageLayer from 'ol/layer/Image'
|
|
33
|
+
import ImageWMS from 'ol/source/ImageWMS'
|
|
28
34
|
|
|
29
35
|
export const DEFAULT_BASELAYER_CONTEXT: MapContextLayerXyzModel = {
|
|
30
36
|
type: MapContextLayerTypeEnum.XYZ,
|
|
@@ -33,6 +39,7 @@ export const DEFAULT_BASELAYER_CONTEXT: MapContextLayerXyzModel = {
|
|
|
33
39
|
`https://b.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}.png`,
|
|
34
40
|
`https://c.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}.png`,
|
|
35
41
|
],
|
|
42
|
+
attributions: `<span>© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, © <a href="https://carto.com/">Carto</a></span>`,
|
|
36
43
|
}
|
|
37
44
|
|
|
38
45
|
export const DEFAULT_VIEW: MapContextViewModel = {
|
|
@@ -69,38 +76,69 @@ export class MapContextService {
|
|
|
69
76
|
}
|
|
70
77
|
map.setView(this.createView(mapContext.view, map))
|
|
71
78
|
map.getLayers().clear()
|
|
72
|
-
mapContext.layers.forEach((layer) =>
|
|
79
|
+
mapContext.layers.forEach((layer) =>
|
|
80
|
+
map.addLayer(this.createLayer(layer, mapConfig))
|
|
81
|
+
)
|
|
73
82
|
return map
|
|
74
83
|
}
|
|
75
84
|
|
|
76
|
-
createLayer(layerModel: MapContextLayerModel): Layer {
|
|
85
|
+
createLayer(layerModel: MapContextLayerModel, mapConfig?: MapConfig): Layer {
|
|
77
86
|
const { type } = layerModel
|
|
78
87
|
const style = this.styleService.styles.default
|
|
79
88
|
switch (type) {
|
|
80
89
|
case MapContextLayerTypeEnum.OGCAPI:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
if (layerModel.layerType === 'vectorTiles') {
|
|
91
|
+
return new VectorTileLayer({
|
|
92
|
+
source: new OGCVectorTile({
|
|
93
|
+
url: layerModel.url,
|
|
94
|
+
format: new MVT(),
|
|
95
|
+
attributions: layerModel.attributions,
|
|
96
|
+
}),
|
|
97
|
+
})
|
|
98
|
+
} else if (layerModel.layerType === 'mapTiles') {
|
|
99
|
+
return new TileLayer({
|
|
100
|
+
source: new OGCMapTile({
|
|
101
|
+
url: layerModel.url,
|
|
102
|
+
attributions: layerModel.attributions,
|
|
103
|
+
}),
|
|
104
|
+
})
|
|
105
|
+
} else {
|
|
106
|
+
return new VectorLayer({
|
|
107
|
+
source: new VectorSource({
|
|
108
|
+
format: new GeoJSON(),
|
|
109
|
+
url: layerModel.url,
|
|
110
|
+
attributions: layerModel.attributions,
|
|
111
|
+
}),
|
|
112
|
+
style,
|
|
113
|
+
})
|
|
114
|
+
}
|
|
89
115
|
case MapContextLayerTypeEnum.XYZ:
|
|
90
116
|
return new TileLayer({
|
|
91
117
|
source: new XYZ({
|
|
92
118
|
url: 'url' in layerModel ? layerModel.url : undefined,
|
|
93
119
|
urls: 'urls' in layerModel ? layerModel.urls : undefined,
|
|
120
|
+
attributions: layerModel.attributions,
|
|
94
121
|
}),
|
|
95
122
|
})
|
|
96
123
|
case MapContextLayerTypeEnum.WMS:
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
124
|
+
if (mapConfig?.DO_NOT_TILE_WMS) {
|
|
125
|
+
return new ImageLayer({
|
|
126
|
+
source: new ImageWMS({
|
|
127
|
+
url: layerModel.url,
|
|
128
|
+
params: { LAYERS: layerModel.name },
|
|
129
|
+
attributions: layerModel.attributions,
|
|
130
|
+
}),
|
|
131
|
+
})
|
|
132
|
+
} else {
|
|
133
|
+
return new TileLayer({
|
|
134
|
+
source: new TileWMS({
|
|
135
|
+
url: layerModel.url,
|
|
136
|
+
params: { LAYERS: layerModel.name, TILED: true },
|
|
137
|
+
attributions: layerModel.attributions,
|
|
138
|
+
}),
|
|
139
|
+
})
|
|
140
|
+
}
|
|
141
|
+
|
|
104
142
|
case MapContextLayerTypeEnum.WMTS: {
|
|
105
143
|
// TODO: isolate this in utils service
|
|
106
144
|
const olLayer = new TileLayer({})
|
|
@@ -123,6 +161,7 @@ export class MapContextService {
|
|
|
123
161
|
tileGrid,
|
|
124
162
|
projection: matrixSet.crs,
|
|
125
163
|
dimensions,
|
|
164
|
+
attributions: layerModel.attributions,
|
|
126
165
|
})
|
|
127
166
|
)
|
|
128
167
|
})
|
|
@@ -148,6 +187,7 @@ export class MapContextService {
|
|
|
148
187
|
})
|
|
149
188
|
},
|
|
150
189
|
strategy: bboxStrategy,
|
|
190
|
+
attributions: layerModel.attributions,
|
|
151
191
|
})
|
|
152
192
|
)
|
|
153
193
|
})
|
|
@@ -33,6 +33,7 @@ import { WmsEndpoint, WmtsEndpoint } from '@camptocamp/ogc-client'
|
|
|
33
33
|
import { LONLAT_CRS_CODES } from '../constant/projections'
|
|
34
34
|
import { fromEPSGCode, register } from 'ol/proj/proj4'
|
|
35
35
|
import proj4 from 'proj4/dist/proj4'
|
|
36
|
+
import { defaults as defaultControls } from 'ol/control/defaults'
|
|
36
37
|
|
|
37
38
|
const FEATURE_PROJECTION = 'EPSG:3857'
|
|
38
39
|
const DATA_PROJECTION = 'EPSG:4326'
|
|
@@ -47,7 +48,10 @@ export class MapUtilsService {
|
|
|
47
48
|
|
|
48
49
|
createEmptyMap(): Map {
|
|
49
50
|
return new Map({
|
|
50
|
-
controls:
|
|
51
|
+
controls: defaultControls({
|
|
52
|
+
attribution: true,
|
|
53
|
+
attributionOptions: { collapsible: false },
|
|
54
|
+
}),
|
|
51
55
|
pixelRatio: 1,
|
|
52
56
|
})
|
|
53
57
|
}
|
|
@@ -213,7 +217,7 @@ export class MapUtilsService {
|
|
|
213
217
|
}
|
|
214
218
|
|
|
215
219
|
getRecordExtent(record: Partial<CatalogRecord>): Extent {
|
|
216
|
-
if (!('spatialExtents' in record)) {
|
|
220
|
+
if (!('spatialExtents' in record) || record.spatialExtents.length === 0) {
|
|
217
221
|
return null
|
|
218
222
|
}
|
|
219
223
|
// transform an array of geojson geometries into a bbox
|
|
@@ -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) {
|