geonetwork-ui 2.7.0-dev.dbe423d28 → 2.7.0-dev.ed54e0aff
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/dcat-ap/read-parts.mjs +4 -7
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.mjs +20 -20
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/metadata-url.service.mjs +3 -3
- package/esm2022/libs/api/metadata-converter/src/lib/iso19115-3/read-parts.mjs +3 -3
- package/esm2022/libs/api/metadata-converter/src/lib/iso19115-3/write-parts.mjs +3 -3
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/read-parts.mjs +4 -4
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/utils/status.mapper.mjs +4 -1
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +9 -5
- package/esm2022/libs/api/repository/src/index.mjs +2 -2
- package/esm2022/libs/api/repository/src/lib/gn4/auth/auth.service.mjs +5 -5
- package/esm2022/libs/api/repository/src/lib/gn4/elasticsearch/constant.mjs +4 -6
- package/esm2022/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.mjs +55 -12
- package/esm2022/libs/api/repository/src/lib/gn4/gn4-repository.mjs +3 -3
- package/esm2022/libs/api/repository/src/lib/gn4/organizations/organizations-from-groups.service.mjs +3 -3
- package/esm2022/libs/api/repository/src/lib/gn4/organizations/organizations-from-metadata.service.mjs +3 -3
- package/esm2022/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.mjs +52 -24
- package/esm2022/libs/api/repository/src/lib/gn4/settings/gn4-settings.service.mjs +3 -1
- package/esm2022/libs/api/repository/src/lib/metadata-language.token.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 +15 -1
- package/esm2022/libs/common/domain/src/lib/platform.service.interface.mjs +1 -1
- package/esm2022/libs/feature/catalog/src/lib/sources/sources.service.mjs +3 -3
- package/esm2022/libs/feature/dataviz/src/lib/chart-view/chart-view.component.mjs +10 -2
- package/esm2022/libs/feature/dataviz/src/lib/service/data.service.mjs +2 -2
- package/esm2022/libs/feature/editor/src/index.mjs +2 -1
- package/esm2022/libs/feature/editor/src/lib/components/metadata-quality-panel/metadata-quality-panel.component.mjs +80 -0
- 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-inspire-field/form-field-inspire-theme.component.mjs +55 -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/record-form/form-field/index.mjs +2 -1
- package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +77 -3
- package/esm2022/libs/feature/map/src/lib/utils/map-utils.service.mjs +3 -5
- package/esm2022/libs/feature/record/src/lib/data-view/data-view.component.mjs +31 -12
- package/esm2022/libs/feature/record/src/lib/map-view/map-view.component.mjs +76 -27
- package/esm2022/libs/feature/router/src/lib/default/state/query-params.utils.mjs +4 -3
- package/esm2022/libs/feature/router/src/lib/default/state/router.facade.mjs +3 -2
- package/esm2022/libs/feature/search/src/lib/state/reducer.mjs +5 -2
- package/esm2022/libs/ui/dataviz/src/lib/data-table/data-table.component.mjs +4 -3
- package/esm2022/libs/ui/elements/src/lib/api-card/api-card.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/downloads-list/downloads-list.component.mjs +5 -4
- package/esm2022/libs/ui/elements/src/lib/geo-data-badge/geo-data-badge.component.mjs +5 -4
- package/esm2022/libs/ui/elements/src/lib/internal-link-card/internal-link-card.component.mjs +4 -4
- package/esm2022/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.mjs +21 -46
- package/esm2022/libs/ui/elements/src/lib/metadata-quality-item/metadata-quality-item.component.mjs +7 -7
- package/esm2022/libs/ui/elements/src/lib/service-capabilities/service-capabilities.component.mjs +1 -6
- package/esm2022/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.mjs +5 -4
- package/esm2022/libs/util/app-config/src/lib/app-config.mjs +5 -1
- package/esm2022/libs/util/app-config/src/lib/fixtures.mjs +2 -2
- package/esm2022/libs/util/app-config/src/lib/model.mjs +1 -1
- package/esm2022/libs/util/app-config/src/lib/parse-utils.mjs +5 -4
- package/esm2022/libs/util/i18n/src/lib/language-codes.mjs +50 -9
- package/esm2022/libs/util/shared/src/index.mjs +2 -2
- package/esm2022/libs/util/shared/src/lib/links/link-utils.mjs +12 -2
- package/esm2022/libs/util/shared/src/lib/record/index.mjs +3 -0
- package/esm2022/libs/util/shared/src/lib/record/quality-score.util.mjs +46 -0
- package/esm2022/libs/util/shared/src/lib/record/record.util.mjs +56 -0
- package/esm2022/libs/util/shared/src/lib/utils/geojson.mjs +58 -1
- package/esm2022/libs/util/shared/src/lib/utils/index.mjs +2 -1
- package/esm2022/libs/util/shared/src/lib/utils/mobile-screen.mjs +9 -0
- package/esm2022/translations/de.json +60 -21
- package/esm2022/translations/en.json +61 -22
- package/esm2022/translations/es.json +47 -8
- package/esm2022/translations/fr.json +66 -27
- package/esm2022/translations/it.json +60 -21
- package/esm2022/translations/nl.json +47 -8
- package/esm2022/translations/pt.json +47 -8
- package/esm2022/translations/sk.json +51 -12
- package/fesm2022/geonetwork-ui.mjs +3337 -2966
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/api/metadata-converter/src/lib/dcat-ap/read-parts.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.d.ts +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/utils/status.mapper.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts +2 -2
- package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
- package/libs/api/repository/src/index.d.ts +1 -1
- package/libs/api/repository/src/index.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/elasticsearch/constant.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.d.ts +1 -2
- package/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts +9 -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 +2 -0
- package/libs/api/repository/src/lib/gn4/settings/gn4-settings.service.d.ts.map +1 -1
- package/libs/api/repository/src/lib/metadata-language.token.d.ts +5 -0
- package/libs/api/repository/src/lib/metadata-language.token.d.ts.map +1 -0
- package/libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model.d.ts +1 -0
- 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 +5 -1
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
- package/libs/common/domain/src/lib/platform.service.interface.d.ts +2 -0
- package/libs/common/domain/src/lib/platform.service.interface.d.ts.map +1 -1
- package/libs/feature/catalog/src/lib/sources/sources.service.d.ts.map +1 -1
- package/libs/feature/dataviz/src/lib/chart-view/chart-view.component.d.ts +3 -2
- 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.map +1 -1
- package/libs/feature/editor/src/index.d.ts +1 -0
- package/libs/feature/editor/src/index.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/metadata-quality-panel/metadata-quality-panel.component.d.ts +19 -0
- package/libs/feature/editor/src/lib/components/metadata-quality-panel/metadata-quality-panel.component.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-inspire-field/form-field-inspire-theme.component.d.ts +20 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-inspire-field/form-field-inspire-theme.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/components/record-form/form-field/index.d.ts +1 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/index.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/fields.config.d.ts +8 -1
- package/libs/feature/editor/src/lib/fields.config.d.ts.map +1 -1
- package/libs/feature/map/src/lib/utils/map-utils.service.d.ts +2 -2
- package/libs/feature/map/src/lib/utils/map-utils.service.d.ts.map +1 -1
- package/libs/feature/record/src/lib/data-view/data-view.component.d.ts +8 -4
- package/libs/feature/record/src/lib/data-view/data-view.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/map-view/map-view.component.d.ts +12 -5
- package/libs/feature/record/src/lib/map-view/map-view.component.d.ts.map +1 -1
- package/libs/feature/router/src/lib/default/state/query-params.utils.d.ts.map +1 -1
- package/libs/feature/router/src/lib/default/state/router.facade.d.ts.map +1 -1
- package/libs/feature/search/src/lib/state/reducer.d.ts.map +1 -1
- package/libs/ui/dataviz/src/lib/data-table/data-table.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/downloads-list/downloads-list.component.d.ts +1 -0
- package/libs/ui/elements/src/lib/downloads-list/downloads-list.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/geo-data-badge/geo-data-badge.component.d.ts +1 -0
- package/libs/ui/elements/src/lib/geo-data-badge/geo-data-badge.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/internal-link-card/internal-link-card.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.d.ts +7 -7
- package/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/service-capabilities/service-capabilities.component.d.ts.map +1 -1
- package/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.d.ts +1 -0
- package/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.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/model.d.ts +2 -0
- package/libs/util/app-config/src/lib/model.d.ts.map +1 -1
- package/libs/util/app-config/src/lib/parse-utils.d.ts.map +1 -1
- package/libs/util/i18n/src/lib/language-codes.d.ts +91 -31
- package/libs/util/i18n/src/lib/language-codes.d.ts.map +1 -1
- package/libs/util/shared/src/index.d.ts +1 -1
- package/libs/util/shared/src/index.d.ts.map +1 -1
- package/libs/util/shared/src/lib/links/link-utils.d.ts +2 -1
- package/libs/util/shared/src/lib/links/link-utils.d.ts.map +1 -1
- package/libs/util/shared/src/lib/record/index.d.ts +3 -0
- package/libs/util/shared/src/lib/record/index.d.ts.map +1 -0
- package/libs/util/shared/src/lib/record/quality-score.util.d.ts +13 -0
- package/libs/util/shared/src/lib/record/quality-score.util.d.ts.map +1 -0
- package/libs/util/shared/src/lib/record/record.util.d.ts +3 -0
- package/libs/util/shared/src/lib/record/record.util.d.ts.map +1 -0
- package/libs/util/shared/src/lib/utils/geojson.d.ts +7 -2
- package/libs/util/shared/src/lib/utils/geojson.d.ts.map +1 -1
- package/libs/util/shared/src/lib/utils/index.d.ts +1 -0
- package/libs/util/shared/src/lib/utils/index.d.ts.map +1 -1
- package/libs/util/shared/src/lib/utils/mobile-screen.d.ts +2 -0
- package/libs/util/shared/src/lib/utils/mobile-screen.d.ts.map +1 -0
- package/package.json +11 -10
- package/src/libs/api/metadata-converter/src/lib/dcat-ap/read-parts.ts +3 -6
- package/src/libs/api/metadata-converter/src/lib/dcat-ap/utils/status.mapper.ts +3 -0
- package/src/libs/api/metadata-converter/src/lib/gn4/gn4.field.mapper.ts +47 -22
- package/src/libs/api/metadata-converter/src/lib/gn4/metadata-url.service.ts +2 -2
- package/src/libs/api/metadata-converter/src/lib/iso19115-3/read-parts.ts +2 -2
- package/src/libs/api/metadata-converter/src/lib/iso19115-3/write-parts.ts +2 -2
- package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +3 -3
- package/src/libs/api/metadata-converter/src/lib/iso19139/utils/status.mapper.ts +3 -0
- package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +10 -6
- package/src/libs/api/repository/src/index.ts +1 -1
- package/src/libs/api/repository/src/lib/gn4/auth/auth.service.ts +4 -4
- package/src/libs/api/repository/src/lib/gn4/elasticsearch/constant.ts +3 -5
- package/src/libs/api/repository/src/lib/gn4/elasticsearch/elasticsearch.service.ts +65 -14
- package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +2 -2
- package/src/libs/api/repository/src/lib/gn4/organizations/organizations-from-groups.service.ts +2 -2
- package/src/libs/api/repository/src/lib/gn4/organizations/organizations-from-metadata.service.ts +2 -2
- package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.ts +60 -39
- package/src/libs/api/repository/src/lib/gn4/settings/gn4-settings.service.ts +8 -0
- package/src/libs/api/repository/src/lib/metadata-language.token.ts +8 -0
- package/src/libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model.ts +1 -0
- package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +21 -1
- package/src/libs/common/domain/src/lib/platform.service.interface.ts +3 -0
- package/src/libs/common/fixtures/src/lib/editor/editor.fixtures.ts +0 -3
- package/src/libs/feature/catalog/src/lib/sources/sources.service.ts +2 -5
- package/src/libs/feature/dataviz/src/lib/chart-view/chart-view.component.ts +10 -1
- package/src/libs/feature/dataviz/src/lib/service/data.service.ts +3 -1
- package/src/libs/feature/editor/src/index.ts +1 -0
- package/src/libs/feature/editor/src/lib/components/metadata-quality-panel/metadata-quality-panel.component.css +0 -0
- package/src/libs/feature/editor/src/lib/components/metadata-quality-panel/metadata-quality-panel.component.html +37 -0
- package/src/libs/feature/editor/src/lib/components/metadata-quality-panel/metadata-quality-panel.component.ts +90 -0
- package/src/libs/feature/editor/src/lib/components/multilingual-panel/multilingual-panel.component.html +2 -1
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-inspire-field/form-field-inspire-theme.component.css +0 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-inspire-field/form-field-inspire-theme.component.html +22 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-inspire-field/form-field-inspire-theme.component.ts +57 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +6 -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/components/record-form/form-field/index.ts +1 -0
- package/src/libs/feature/editor/src/lib/fields.config.ts +85 -3
- package/src/libs/feature/map/src/lib/utils/map-utils.service.ts +8 -8
- package/src/libs/feature/record/src/lib/data-view/data-view.component.html +2 -0
- package/src/libs/feature/record/src/lib/data-view/data-view.component.ts +34 -15
- package/src/libs/feature/record/src/lib/map-view/map-view.component.html +2 -0
- package/src/libs/feature/record/src/lib/map-view/map-view.component.ts +70 -23
- package/src/libs/feature/router/src/lib/default/state/query-params.utils.ts +5 -2
- package/src/libs/feature/router/src/lib/default/state/router.facade.ts +2 -1
- package/src/libs/feature/search/src/lib/state/reducer.ts +4 -1
- package/src/libs/ui/dataviz/src/lib/data-table/data-table.component.ts +6 -1
- package/src/libs/ui/elements/src/lib/api-card/api-card.component.html +4 -1
- package/src/libs/ui/elements/src/lib/downloads-list/downloads-list.component.html +12 -11
- package/src/libs/ui/elements/src/lib/downloads-list/downloads-list.component.ts +7 -1
- package/src/libs/ui/elements/src/lib/geo-data-badge/geo-data-badge.component.html +4 -1
- package/src/libs/ui/elements/src/lib/geo-data-badge/geo-data-badge.component.ts +7 -1
- package/src/libs/ui/elements/src/lib/internal-link-card/internal-link-card.component.html +1 -0
- package/src/libs/ui/elements/src/lib/internal-link-card/internal-link-card.component.ts +5 -1
- package/src/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.html +1 -0
- package/src/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.ts +21 -58
- package/src/libs/ui/elements/src/lib/metadata-quality-item/metadata-quality-item.component.ts +6 -6
- package/src/libs/ui/elements/src/lib/service-capabilities/service-capabilities.component.ts +0 -6
- package/src/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.html +7 -1
- package/src/libs/ui/inputs/src/lib/search-feature-catalog/search-feature-catalog.component.ts +3 -1
- package/src/libs/util/app-config/src/lib/app-config.ts +4 -0
- package/src/libs/util/app-config/src/lib/fixtures.ts +1 -1
- package/src/libs/util/app-config/src/lib/model.ts +2 -0
- package/src/libs/util/app-config/src/lib/parse-utils.ts +4 -7
- package/src/libs/util/i18n/src/lib/language-codes.ts +62 -11
- package/src/libs/util/shared/src/index.ts +1 -1
- package/src/libs/util/shared/src/lib/links/link-utils.ts +11 -1
- package/src/libs/util/shared/src/lib/record/index.ts +2 -0
- package/src/libs/util/shared/src/lib/record/quality-score.util.ts +72 -0
- package/src/libs/util/shared/src/lib/{record.util.ts → record/record.util.ts} +1 -1
- package/src/libs/util/shared/src/lib/utils/geojson.ts +72 -2
- package/src/libs/util/shared/src/lib/utils/index.ts +1 -0
- package/src/libs/util/shared/src/lib/utils/mobile-screen.ts +14 -0
- package/translations/de.json +60 -21
- package/translations/en.json +61 -22
- package/translations/es.json +47 -8
- package/translations/fr.json +66 -27
- package/translations/it.json +60 -21
- package/translations/nl.json +47 -8
- package/translations/pt.json +47 -8
- package/translations/sk.json +51 -12
- package/esm2022/libs/api/repository/src/lib/metadata-language.mjs +0 -3
- package/esm2022/libs/util/app-config/src/lib/constants.mjs +0 -439
- package/esm2022/libs/util/shared/src/lib/record.util.mjs +0 -56
- package/libs/api/repository/src/lib/metadata-language.d.ts +0 -3
- package/libs/api/repository/src/lib/metadata-language.d.ts.map +0 -1
- package/libs/util/app-config/src/lib/constants.d.ts +0 -2
- package/libs/util/app-config/src/lib/constants.d.ts.map +0 -1
- package/libs/util/shared/src/lib/record.util.d.ts +0 -3
- package/libs/util/shared/src/lib/record.util.d.ts.map +0 -1
- package/src/libs/api/repository/src/lib/metadata-language.ts +0 -3
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
MeApiService,
|
|
12
12
|
RecordsApiService,
|
|
13
13
|
RegistriesApiService,
|
|
14
|
-
SiteApiService,
|
|
15
14
|
ToolsApiService,
|
|
16
15
|
UserfeedbackApiService,
|
|
17
16
|
UsersApiService,
|
|
@@ -45,7 +44,8 @@ import {
|
|
|
45
44
|
throwError,
|
|
46
45
|
} from 'rxjs'
|
|
47
46
|
import { TranslateService } from '@ngx-translate/core'
|
|
48
|
-
import {
|
|
47
|
+
import { toLang3 } from '../../../../../../../libs/util/i18n/src'
|
|
48
|
+
import { Gn4SettingsService } from '../settings/gn4-settings.service'
|
|
49
49
|
|
|
50
50
|
const minApiVersion = '4.2.2'
|
|
51
51
|
|
|
@@ -55,6 +55,7 @@ export class Gn4PlatformService implements PlatformServiceInterface {
|
|
|
55
55
|
private readonly me$: Observable<UserModel>
|
|
56
56
|
private readonly users$: Observable<UserModel[]>
|
|
57
57
|
private readonly isUserAnonymous$: Observable<boolean>
|
|
58
|
+
private readonly gnParseVersion = '4.2.5'
|
|
58
59
|
|
|
59
60
|
private keyTranslations$ = this.toolsApiService
|
|
60
61
|
.getTranslationsPackage1('gnui')
|
|
@@ -65,31 +66,6 @@ export class Gn4PlatformService implements PlatformServiceInterface {
|
|
|
65
66
|
}),
|
|
66
67
|
shareReplay(1)
|
|
67
68
|
)
|
|
68
|
-
|
|
69
|
-
private settings$ = of(true).pipe(
|
|
70
|
-
switchMap(() => this.siteApiService.getSiteOrPortalDescription()),
|
|
71
|
-
shareReplay(1)
|
|
72
|
-
)
|
|
73
|
-
|
|
74
|
-
private readonly apiVersion$ = this.settings$.pipe(
|
|
75
|
-
map((info) => info['system/platform/version'] as string),
|
|
76
|
-
tap((version) => {
|
|
77
|
-
if (ltr(version, minApiVersion)) {
|
|
78
|
-
throw new Error(
|
|
79
|
-
`Gn4 API version is not compatible.\nMinimum: ${minApiVersion}\nYour version: ${version}`
|
|
80
|
-
)
|
|
81
|
-
}
|
|
82
|
-
}),
|
|
83
|
-
shareReplay(1)
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
-
private readonly allowEditHarvestedMd$ = this.settings$.pipe(
|
|
87
|
-
map((info) => {
|
|
88
|
-
return info['system/harvester/enableEditing'] as boolean
|
|
89
|
-
}),
|
|
90
|
-
shareReplay(1)
|
|
91
|
-
)
|
|
92
|
-
|
|
93
69
|
/**
|
|
94
70
|
* A map of already loaded thesauri (groups of keywords); the key is a URI
|
|
95
71
|
* @private
|
|
@@ -97,11 +73,10 @@ export class Gn4PlatformService implements PlatformServiceInterface {
|
|
|
97
73
|
private keywordsByThesauri: Record<string, Observable<Keyword[]>> = {}
|
|
98
74
|
|
|
99
75
|
private get lang3() {
|
|
100
|
-
return
|
|
76
|
+
return toLang3(this.translateService.currentLang)
|
|
101
77
|
}
|
|
102
78
|
|
|
103
79
|
constructor(
|
|
104
|
-
private siteApiService: SiteApiService,
|
|
105
80
|
private meApi: MeApiService,
|
|
106
81
|
private usersApi: UsersApiService,
|
|
107
82
|
private mapper: Gn4PlatformMapper,
|
|
@@ -110,7 +85,8 @@ export class Gn4PlatformService implements PlatformServiceInterface {
|
|
|
110
85
|
private translateService: TranslateService,
|
|
111
86
|
private userfeedbackApiService: UserfeedbackApiService,
|
|
112
87
|
private httpClient: HttpClient,
|
|
113
|
-
private recordsApiService: RecordsApiService
|
|
88
|
+
private recordsApiService: RecordsApiService,
|
|
89
|
+
private settingsService: Gn4SettingsService
|
|
114
90
|
) {
|
|
115
91
|
this.me$ = this.meApi.getMe().pipe(
|
|
116
92
|
switchMap((apiUser) => this.mapper.userFromMeApi(apiUser)),
|
|
@@ -127,16 +103,28 @@ export class Gn4PlatformService implements PlatformServiceInterface {
|
|
|
127
103
|
)
|
|
128
104
|
}
|
|
129
105
|
|
|
106
|
+
getFeedbacksAllowed(): Observable<boolean> {
|
|
107
|
+
return this.settingsService.allowFeedbacks$
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
getAllowEditHarvestedMd(): Observable<boolean> {
|
|
111
|
+
return this.settingsService.allowEditHarvested$
|
|
112
|
+
}
|
|
113
|
+
|
|
130
114
|
getType(): string {
|
|
131
115
|
return this.type
|
|
132
116
|
}
|
|
133
117
|
|
|
134
118
|
getApiVersion(): Observable<string> {
|
|
135
|
-
return this.apiVersion
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
119
|
+
return this.settingsService.apiVersion$.pipe(
|
|
120
|
+
tap((version) => {
|
|
121
|
+
if (ltr(version, minApiVersion)) {
|
|
122
|
+
throw new Error(
|
|
123
|
+
`Gn4 API version is not compatible.\nMinimum: ${minApiVersion}\nYour version: ${version}`
|
|
124
|
+
)
|
|
125
|
+
}
|
|
126
|
+
})
|
|
127
|
+
)
|
|
140
128
|
}
|
|
141
129
|
|
|
142
130
|
getMe(): Observable<UserModel> {
|
|
@@ -323,10 +311,15 @@ export class Gn4PlatformService implements PlatformServiceInterface {
|
|
|
323
311
|
...(Array.isArray(onlines) ? onlines : []),
|
|
324
312
|
...(Array.isArray(thumbnails) ? thumbnails : []),
|
|
325
313
|
].map((resource) => Object.values(resource.url)[0])
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
314
|
+
const fileToDelete = attachments.reduce<string[]>((acc, attachment) => {
|
|
315
|
+
if (
|
|
316
|
+
!urlsToKeep.includes(attachment.url) &&
|
|
317
|
+
attachment.filename !== 'datavizConfig.json'
|
|
318
|
+
) {
|
|
319
|
+
acc.push(attachment.filename)
|
|
320
|
+
}
|
|
321
|
+
return acc
|
|
322
|
+
}, [])
|
|
330
323
|
|
|
331
324
|
return fileToDelete
|
|
332
325
|
}),
|
|
@@ -384,6 +377,34 @@ export class Gn4PlatformService implements PlatformServiceInterface {
|
|
|
384
377
|
})
|
|
385
378
|
)
|
|
386
379
|
}
|
|
380
|
+
getFileContent(url: URL | string): Observable<any> {
|
|
381
|
+
return combineLatest([
|
|
382
|
+
this.httpClient.get(url.toString(), { responseType: 'text' }),
|
|
383
|
+
this.getApiVersion(),
|
|
384
|
+
]).pipe(
|
|
385
|
+
map(([text, version]) => {
|
|
386
|
+
const parsed = JSON.parse(text)
|
|
387
|
+
|
|
388
|
+
if (version > this.gnParseVersion) {
|
|
389
|
+
return parsed
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
const decoded = this.decodeBase64(parsed)
|
|
393
|
+
return JSON.parse(decoded)
|
|
394
|
+
})
|
|
395
|
+
)
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
decodeBase64(base64) {
|
|
399
|
+
const text = atob(base64)
|
|
400
|
+
const length = text.length
|
|
401
|
+
const bytes = new Uint8Array(length)
|
|
402
|
+
for (let i = 0; i < length; i++) {
|
|
403
|
+
bytes[i] = text.charCodeAt(i)
|
|
404
|
+
}
|
|
405
|
+
const decoder = new TextDecoder()
|
|
406
|
+
return decoder.decode(bytes)
|
|
407
|
+
}
|
|
387
408
|
|
|
388
409
|
attachFileToRecord(
|
|
389
410
|
recordUuid: string,
|
|
@@ -14,6 +14,14 @@ export class Gn4SettingsService {
|
|
|
14
14
|
public allowEditHarvested$: Observable<boolean> =
|
|
15
15
|
this.getSettingsSetValueByKey('system/harvester/enableEditing')
|
|
16
16
|
|
|
17
|
+
public allowFeedbacks$: Observable<boolean> = this.getSettingsSetValueByKey(
|
|
18
|
+
'system/userFeedback/enable'
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
public apiVersion$: Observable<string> = this.getSettingsSetValueByKey(
|
|
22
|
+
'system/platform/version'
|
|
23
|
+
)
|
|
24
|
+
|
|
17
25
|
constructor(private siteApiService: SiteApiService) {}
|
|
18
26
|
|
|
19
27
|
private getSettingsSetValueByKey(key: string) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core'
|
|
2
|
+
import { LanguageCode } from '../../../../../libs/common/domain/src/lib/model/record'
|
|
3
|
+
|
|
4
|
+
export type LanguageCodeFactory = () => LanguageCode
|
|
5
|
+
|
|
6
|
+
export const METADATA_LANGUAGE = new InjectionToken<
|
|
7
|
+
LanguageCode | LanguageCodeFactory
|
|
8
|
+
>('metadata-language')
|
|
@@ -69,6 +69,8 @@ marker('domain.record.status.ongoing')
|
|
|
69
69
|
marker('domain.record.status.under_development')
|
|
70
70
|
marker('domain.record.status.deprecated')
|
|
71
71
|
marker('domain.record.status.removed')
|
|
72
|
+
marker('domain.record.status.planned')
|
|
73
|
+
marker('domain.record.status.required')
|
|
72
74
|
|
|
73
75
|
export const RecordStatusValues = [
|
|
74
76
|
'completed',
|
|
@@ -76,6 +78,8 @@ export const RecordStatusValues = [
|
|
|
76
78
|
'under_development',
|
|
77
79
|
'deprecated',
|
|
78
80
|
'removed',
|
|
81
|
+
'planned',
|
|
82
|
+
'required',
|
|
79
83
|
]
|
|
80
84
|
export type RecordStatus = (typeof RecordStatusValues)[number]
|
|
81
85
|
|
|
@@ -104,6 +108,11 @@ export interface Keyword {
|
|
|
104
108
|
translations?: KeywordTranslations
|
|
105
109
|
}
|
|
106
110
|
|
|
111
|
+
export interface INSPIRE_theme {
|
|
112
|
+
value: string
|
|
113
|
+
label: string
|
|
114
|
+
}
|
|
115
|
+
|
|
107
116
|
export interface BaseRecord {
|
|
108
117
|
uniqueIdentifier: Uuid
|
|
109
118
|
ownerOrganization: Organization
|
|
@@ -156,6 +165,17 @@ export type ServiceProtocol =
|
|
|
156
165
|
| 'maplibre-style'
|
|
157
166
|
| 'other'
|
|
158
167
|
|
|
168
|
+
marker('record.metadata.api.accessServiceProtocol.wms')
|
|
169
|
+
marker('record.metadata.api.accessServiceProtocol.wfs')
|
|
170
|
+
marker('record.metadata.api.accessServiceProtocol.wps')
|
|
171
|
+
marker('record.metadata.api.accessServiceProtocol.wmts')
|
|
172
|
+
marker('record.metadata.api.accessServiceProtocol.esriRest')
|
|
173
|
+
marker('record.metadata.api.accessServiceProtocol.ogcFeatures')
|
|
174
|
+
marker('record.metadata.api.accessServiceProtocol.GPFDL')
|
|
175
|
+
marker('record.metadata.api.accessServiceProtocol.tms')
|
|
176
|
+
marker('record.metadata.api.accessServiceProtocol.maplibre-style')
|
|
177
|
+
marker('record.metadata.api.accessServiceProtocol.other')
|
|
178
|
+
|
|
159
179
|
export type OnlineResourceType = 'service' | 'download' | 'link' | 'endpoint'
|
|
160
180
|
|
|
161
181
|
export interface DatasetServiceDistribution {
|
|
@@ -254,7 +274,7 @@ export interface ServiceRecord extends BaseRecord {
|
|
|
254
274
|
export interface ReuseRecord extends BaseRecord {
|
|
255
275
|
kind: 'reuse'
|
|
256
276
|
lineage: string // Explanation of the origin of this record (e.g: how, why)"
|
|
257
|
-
onlineResources: Array<
|
|
277
|
+
onlineResources: Array<DatasetOnlineResource>
|
|
258
278
|
reuseType: ReuseType
|
|
259
279
|
spatialExtents: Array<DatasetSpatialExtent>
|
|
260
280
|
temporalExtents: Array<DatasetTemporalExtent>
|
|
@@ -3,6 +3,7 @@ import type { UserModel } from './model/user/user.model'
|
|
|
3
3
|
import type { Organization } from './model/record/organization.model'
|
|
4
4
|
import { CatalogRecord, Keyword, UserFeedback } from './model/record'
|
|
5
5
|
import { KeywordType } from './model/thesaurus'
|
|
6
|
+
import { DatavizConfigModel } from './model/dataviz/dataviz-configuration.model'
|
|
6
7
|
|
|
7
8
|
export interface RecordAttachment {
|
|
8
9
|
url: URL
|
|
@@ -55,4 +56,6 @@ export abstract class PlatformServiceInterface {
|
|
|
55
56
|
file: File,
|
|
56
57
|
removeDuplicate?: boolean
|
|
57
58
|
): Observable<UploadEvent>
|
|
59
|
+
abstract getFileContent(url: URL): Observable<any>
|
|
60
|
+
abstract getFeedbacksAllowed(): Observable<boolean>
|
|
58
61
|
}
|
|
@@ -127,9 +127,6 @@ export const editorFieldSpatialExtentsFixture = () => ({
|
|
|
127
127
|
export const editorFieldKeywordsFixture = () => ({
|
|
128
128
|
model: 'keywords',
|
|
129
129
|
hidden: false,
|
|
130
|
-
formFieldConfig: {
|
|
131
|
-
labelKey: 'editor.record.form.field.keywords',
|
|
132
|
-
},
|
|
133
130
|
})
|
|
134
131
|
|
|
135
132
|
export const editorFieldUniqueIdentifierFixture = () => ({
|
|
@@ -4,7 +4,7 @@ import { Observable } from 'rxjs'
|
|
|
4
4
|
import { filter, map, shareReplay } from 'rxjs/operators'
|
|
5
5
|
import { CatalogSource } from './sources.model'
|
|
6
6
|
import { TranslateService } from '@ngx-translate/core'
|
|
7
|
-
import {
|
|
7
|
+
import { toLang3 } from '../../../../../../libs/util/i18n/src'
|
|
8
8
|
|
|
9
9
|
@Injectable({
|
|
10
10
|
providedIn: 'root',
|
|
@@ -23,10 +23,7 @@ export class SourcesService {
|
|
|
23
23
|
return this.sources$.pipe(
|
|
24
24
|
map((sources) => sources.filter((source) => source.uuid === uuid)[0]),
|
|
25
25
|
filter((source) => !!source),
|
|
26
|
-
map(
|
|
27
|
-
(source) =>
|
|
28
|
-
source.label[getLang3FromLang2(this.translateService.currentLang)]
|
|
29
|
-
)
|
|
26
|
+
map((source) => source.label[toLang3(this.translateService.currentLang)])
|
|
30
27
|
)
|
|
31
28
|
}
|
|
32
29
|
}
|
|
@@ -28,7 +28,10 @@ import {
|
|
|
28
28
|
tap,
|
|
29
29
|
} from 'rxjs/operators'
|
|
30
30
|
import { DataService } from '../service/data.service'
|
|
31
|
-
import {
|
|
31
|
+
import {
|
|
32
|
+
DatavizChartConfigModel,
|
|
33
|
+
InputChartType,
|
|
34
|
+
} from '../../../../../../libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model'
|
|
32
35
|
import {
|
|
33
36
|
DatasetFeatureCatalog,
|
|
34
37
|
DatasetOnlineResource,
|
|
@@ -104,6 +107,12 @@ export class ChartViewComponent {
|
|
|
104
107
|
}
|
|
105
108
|
chartType$ = new BehaviorSubject<InputChartType>('bar')
|
|
106
109
|
|
|
110
|
+
@Input() set userChartConfig(config: DatavizChartConfigModel) {
|
|
111
|
+
this.aggregation$.next(config.aggregation)
|
|
112
|
+
this.xProperty$.next(config.xProperty)
|
|
113
|
+
this.yProperty$.next(config.yProperty)
|
|
114
|
+
this.chartType$.next(config.chartType)
|
|
115
|
+
}
|
|
107
116
|
@Output() chartConfig$ = combineLatest([
|
|
108
117
|
this.xProperty$.pipe(filter((value) => value !== undefined)),
|
|
109
118
|
this.yProperty$.pipe(filter((value) => value !== undefined)),
|
|
@@ -237,7 +237,9 @@ export class DataService {
|
|
|
237
237
|
tmsLink: DatasetServiceDistribution,
|
|
238
238
|
keepOriginalLink = false
|
|
239
239
|
): Promise<DatasetServiceDistribution[]> {
|
|
240
|
-
const endpoint = new TmsEndpoint(
|
|
240
|
+
const endpoint = new TmsEndpoint(
|
|
241
|
+
tmsLink.url.toString().replace(/\/?$/, `/${tmsLink.name}`)
|
|
242
|
+
)
|
|
241
243
|
const tileMaps = await endpoint.allTileMaps.catch(() => {
|
|
242
244
|
throw new Error(`ogc.unreachable.unknown`)
|
|
243
245
|
})
|
|
@@ -9,3 +9,4 @@ export * from './lib/components/import-record/import-record.component'
|
|
|
9
9
|
export * from './lib/components/record-form/record-form.component'
|
|
10
10
|
export * from './lib/components/record-form/form-field'
|
|
11
11
|
export * from './lib/components/multilingual-panel/multilingual-panel.component'
|
|
12
|
+
export * from './lib/components/metadata-quality-panel/metadata-quality-panel.component'
|
|
File without changes
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<div
|
|
2
|
+
class="flex flex-col h-full w-[302px] border-l border-gray-300 py-8 px-3 gap-3 overflow-auto"
|
|
3
|
+
style="background-color: #fafaf9"
|
|
4
|
+
>
|
|
5
|
+
<div class="flex flex-row px-2 justify-between">
|
|
6
|
+
<span class="text-3xl font-title text-black/80" translate
|
|
7
|
+
>editor.record.form.metadataQuality.title</span
|
|
8
|
+
>
|
|
9
|
+
</div>
|
|
10
|
+
<div
|
|
11
|
+
*ngFor="let properties of propertiesByPage; let i = index"
|
|
12
|
+
class="flex flex-col gap-2"
|
|
13
|
+
>
|
|
14
|
+
<gn-ui-button
|
|
15
|
+
*ngFor="let property of properties"
|
|
16
|
+
[extraClass]="getExtraClass(property.value)"
|
|
17
|
+
type="outline"
|
|
18
|
+
attr.data-cy="md-quality-btn-{{ property.label }}"
|
|
19
|
+
>
|
|
20
|
+
<span>{{ property.label | translate }}</span>
|
|
21
|
+
<div class="flex flex-row gap-2 items-center">
|
|
22
|
+
<ng-icon
|
|
23
|
+
*ngIf="property.value; else notChecked"
|
|
24
|
+
class="text-primary"
|
|
25
|
+
name="iconoirBadgeCheck"
|
|
26
|
+
></ng-icon>
|
|
27
|
+
<ng-template #notChecked>
|
|
28
|
+
<ng-icon class="text-neutral-300" name="iconoirSystemShut"></ng-icon>
|
|
29
|
+
</ng-template>
|
|
30
|
+
</div>
|
|
31
|
+
</gn-ui-button>
|
|
32
|
+
<hr
|
|
33
|
+
*ngIf="i !== propertiesByPage.length - 1"
|
|
34
|
+
class="border-gray-300 w-11/12 mx-auto"
|
|
35
|
+
/>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common'
|
|
2
|
+
import { Component, Input, OnChanges } from '@angular/core'
|
|
3
|
+
import { CatalogRecord } from '../../../../../../../libs/common/domain/src/lib/model/record'
|
|
4
|
+
import { ButtonComponent } from '../../../../../../../libs/ui/inputs/src'
|
|
5
|
+
import {
|
|
6
|
+
getAllKeysValidator,
|
|
7
|
+
getQualityValidators,
|
|
8
|
+
ValidatorMapperKeys,
|
|
9
|
+
} from '../../../../../../../libs/util/shared/src'
|
|
10
|
+
import {
|
|
11
|
+
NgIconComponent,
|
|
12
|
+
provideIcons,
|
|
13
|
+
provideNgIconsConfig,
|
|
14
|
+
} from '@ng-icons/core'
|
|
15
|
+
import { iconoirBadgeCheck, iconoirSystemShut } from '@ng-icons/iconoir'
|
|
16
|
+
import { TranslateDirective, TranslatePipe } from '@ngx-translate/core'
|
|
17
|
+
import { EditorConfig } from '../../models'
|
|
18
|
+
import { marker } from '@biesbjerg/ngx-translate-extract-marker'
|
|
19
|
+
|
|
20
|
+
//forced translations that are not available in fields.config.ts
|
|
21
|
+
marker('editor.record.form.field.keywords')
|
|
22
|
+
marker('editor.record.form.field.topics')
|
|
23
|
+
marker('editor.record.form.field.contacts')
|
|
24
|
+
marker('editor.record.form.field.organisation')
|
|
25
|
+
@Component({
|
|
26
|
+
selector: 'gn-ui-metadata-quality-panel',
|
|
27
|
+
standalone: true,
|
|
28
|
+
imports: [
|
|
29
|
+
CommonModule,
|
|
30
|
+
TranslateDirective,
|
|
31
|
+
TranslatePipe,
|
|
32
|
+
ButtonComponent,
|
|
33
|
+
NgIconComponent,
|
|
34
|
+
],
|
|
35
|
+
providers: [
|
|
36
|
+
provideIcons({
|
|
37
|
+
iconoirSystemShut,
|
|
38
|
+
iconoirBadgeCheck,
|
|
39
|
+
}),
|
|
40
|
+
provideNgIconsConfig({
|
|
41
|
+
size: '1.25em',
|
|
42
|
+
}),
|
|
43
|
+
],
|
|
44
|
+
templateUrl: './metadata-quality-panel.component.html',
|
|
45
|
+
styleUrl: './metadata-quality-panel.component.css',
|
|
46
|
+
})
|
|
47
|
+
export class MetadataQualityPanelComponent implements OnChanges {
|
|
48
|
+
propsToValidate: ValidatorMapperKeys[] = getAllKeysValidator()
|
|
49
|
+
propertiesByPage: { label: string; value: boolean }[][] = []
|
|
50
|
+
@Input() editorConfig: EditorConfig
|
|
51
|
+
@Input() record: CatalogRecord
|
|
52
|
+
|
|
53
|
+
ngOnChanges() {
|
|
54
|
+
if (this.editorConfig && this.record) {
|
|
55
|
+
const fieldsByPage = this.editorConfig.pages.map((page) =>
|
|
56
|
+
page.sections.flatMap((section) =>
|
|
57
|
+
section.fields
|
|
58
|
+
.filter((field) => this.propsToValidate.includes(field.model))
|
|
59
|
+
.map((field) => field.model as ValidatorMapperKeys)
|
|
60
|
+
)
|
|
61
|
+
)
|
|
62
|
+
// FIXME: temporarily add topics and organisation to the first and third page
|
|
63
|
+
// as long as they are not handled by the editor
|
|
64
|
+
if (fieldsByPage.length > 0) {
|
|
65
|
+
fieldsByPage[0].includes('topics') || fieldsByPage[0].push('topics')
|
|
66
|
+
fieldsByPage[2].includes('organisation') ||
|
|
67
|
+
fieldsByPage[2].push('organisation')
|
|
68
|
+
}
|
|
69
|
+
this.propertiesByPage = fieldsByPage
|
|
70
|
+
.map((fields) =>
|
|
71
|
+
getQualityValidators(
|
|
72
|
+
this.record,
|
|
73
|
+
fields as ValidatorMapperKeys[]
|
|
74
|
+
).map(({ name, validator }) => ({
|
|
75
|
+
label: `editor.record.form.field.${name}`, // use same translations as in fields.config.ts
|
|
76
|
+
value: validator(),
|
|
77
|
+
}))
|
|
78
|
+
)
|
|
79
|
+
.filter((arr) => arr.length > 0)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
getExtraClass(checked: boolean): string {
|
|
84
|
+
const baseClasses =
|
|
85
|
+
'flex flex-row justify-between rounded mb-1 h-[34px] w-full focus:ring-0 hover:border-none border-none hover:text-black text-black cursor-default'
|
|
86
|
+
return checked
|
|
87
|
+
? `${baseClasses} bg-neutral-100 hover:bg-neutral-100`
|
|
88
|
+
: `${baseClasses} bg-transparent hover:bg-transparent`
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<div
|
|
2
|
-
class="flex flex-col h-full w-[302px]
|
|
2
|
+
class="flex flex-col h-full w-[302px] border-l border-gray-300 py-8 px-3 gap-6 overflow-auto"
|
|
3
|
+
style="background-color: #fafaf9"
|
|
3
4
|
>
|
|
4
5
|
<div class="flex flex-row px-2 justify-between">
|
|
5
6
|
<span class="text-3xl font-title text-black/80" translate
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<div class="flex flex-col gap-3">
|
|
2
|
+
<div class="flex flex-col gap-4">
|
|
3
|
+
<gn-ui-dropdown-multiselect
|
|
4
|
+
class="w-full"
|
|
5
|
+
[title]="'editor.record.form.inspire.placeholder' | translate"
|
|
6
|
+
[maxRows]="6"
|
|
7
|
+
[selected]="themes"
|
|
8
|
+
[choices]="availableThemes || []"
|
|
9
|
+
[allowSearch]="true"
|
|
10
|
+
(selectValues)="handleItemSelection($event)"
|
|
11
|
+
>
|
|
12
|
+
</gn-ui-dropdown-multiselect>
|
|
13
|
+
<div class="flex gap-2 flex-wrap">
|
|
14
|
+
<gn-ui-badge
|
|
15
|
+
*ngFor="let theme of themes"
|
|
16
|
+
[removable]="true"
|
|
17
|
+
(badgeRemoveClicked)="removeTheme(theme)"
|
|
18
|
+
>{{ getTranslatedTheme(theme) }}
|
|
19
|
+
</gn-ui-badge>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, Output } from '@angular/core'
|
|
2
|
+
import { CommonModule } from '@angular/common'
|
|
3
|
+
import {
|
|
4
|
+
AutocompleteComponent,
|
|
5
|
+
BadgeComponent,
|
|
6
|
+
DropdownMultiselectComponent,
|
|
7
|
+
} from '../../../../../../../../../libs/ui/inputs/src'
|
|
8
|
+
import { NgIconComponent } from '@ng-icons/core'
|
|
9
|
+
import { INSPIRE_THEMES } from '../../../../fields.config'
|
|
10
|
+
import { TranslatePipe, TranslateService } from '@ngx-translate/core'
|
|
11
|
+
|
|
12
|
+
@Component({
|
|
13
|
+
selector: 'gn-ui-form-field-inspire-theme',
|
|
14
|
+
standalone: true,
|
|
15
|
+
imports: [
|
|
16
|
+
CommonModule,
|
|
17
|
+
AutocompleteComponent,
|
|
18
|
+
NgIconComponent,
|
|
19
|
+
BadgeComponent,
|
|
20
|
+
TranslatePipe,
|
|
21
|
+
DropdownMultiselectComponent,
|
|
22
|
+
],
|
|
23
|
+
templateUrl: './form-field-inspire-theme.component.html',
|
|
24
|
+
styleUrl: './form-field-inspire-theme.component.css',
|
|
25
|
+
})
|
|
26
|
+
export class FormFieldInspireThemeComponent {
|
|
27
|
+
themes = []
|
|
28
|
+
@Input() set value(themes: string[]) {
|
|
29
|
+
this.themes = themes
|
|
30
|
+
}
|
|
31
|
+
@Output() valueChange: EventEmitter<string[]> = new EventEmitter()
|
|
32
|
+
availableThemes = INSPIRE_THEMES.map((theme) => {
|
|
33
|
+
return {
|
|
34
|
+
label: this.translateService.instant(theme.label),
|
|
35
|
+
value: theme.value,
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
constructor(private translateService: TranslateService) {}
|
|
40
|
+
|
|
41
|
+
handleItemSelection(selectedItems: string[]) {
|
|
42
|
+
this.themes = selectedItems
|
|
43
|
+
this.valueChange.emit(this.themes)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
removeTheme(theme: string) {
|
|
47
|
+
this.themes = this.themes.filter((t) => t !== theme)
|
|
48
|
+
this.valueChange.emit(this.themes)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
getTranslatedTheme(theme: string) {
|
|
52
|
+
const themeKey = this.availableThemes.find(
|
|
53
|
+
(avail) => avail.value === theme
|
|
54
|
+
)?.label
|
|
55
|
+
return themeKey ? this.translateService.instant(themeKey) : ''
|
|
56
|
+
}
|
|
57
|
+
}
|
package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html
CHANGED
|
@@ -109,6 +109,12 @@
|
|
|
109
109
|
(valueChange)="valueChange.emit($event)"
|
|
110
110
|
></gn-ui-form-field-keywords>
|
|
111
111
|
</ng-container>
|
|
112
|
+
<ng-container *ngSwitchCase="'topics'">
|
|
113
|
+
<gn-ui-form-field-inspire-theme
|
|
114
|
+
[value]="valueAsInspireTheme"
|
|
115
|
+
(valueChange)="valueChange.emit($event)"
|
|
116
|
+
></gn-ui-form-field-inspire-theme>
|
|
117
|
+
</ng-container>
|
|
112
118
|
<ng-container *ngSwitchCase="'licenses'">
|
|
113
119
|
<gn-ui-form-field-license
|
|
114
120
|
[label]="config.labelKey! | translate"
|
package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts
CHANGED
|
@@ -45,6 +45,7 @@ import { FormFieldConstraintsShortcutsComponent } from './form-field-constraints
|
|
|
45
45
|
import { FormFieldConstraintsComponent } from './form-field-constraints/form-field-constraints.component'
|
|
46
46
|
import { TextFieldModule } from '@angular/cdk/text-field'
|
|
47
47
|
import { FormFieldSpatialToggleComponent } from './form-field-spatial-toggle/form-field-spatial-toggle.component'
|
|
48
|
+
import { FormFieldInspireThemeComponent } from './form-field-inspire-field/form-field-inspire-theme.component'
|
|
48
49
|
|
|
49
50
|
@Component({
|
|
50
51
|
selector: 'gn-ui-form-field',
|
|
@@ -73,6 +74,7 @@ import { FormFieldSpatialToggleComponent } from './form-field-spatial-toggle/for
|
|
|
73
74
|
FormFieldConstraintsComponent,
|
|
74
75
|
FormFieldConstraintsShortcutsComponent,
|
|
75
76
|
FormFieldSpatialToggleComponent,
|
|
77
|
+
FormFieldInspireThemeComponent,
|
|
76
78
|
TextFieldModule,
|
|
77
79
|
],
|
|
78
80
|
})
|
|
@@ -128,6 +130,9 @@ export class FormFieldComponent {
|
|
|
128
130
|
get valueAsKeywords() {
|
|
129
131
|
return this.value as Array<Keyword>
|
|
130
132
|
}
|
|
133
|
+
get valueAsInspireTheme() {
|
|
134
|
+
return this.value as Array<string>
|
|
135
|
+
}
|
|
131
136
|
get valueAsConstraints() {
|
|
132
137
|
return this.value as Array<Constraint>
|
|
133
138
|
}
|
|
@@ -10,3 +10,4 @@ export * from './form-field-array/form-field-array.component'
|
|
|
10
10
|
export * from './form-field-spatial-extent/form-field-spatial-extent.component'
|
|
11
11
|
export * from './form-field.component'
|
|
12
12
|
export * from './form-field-constraints-shortcuts/constraints.utils'
|
|
13
|
+
export * from './form-field-inspire-field/form-field-inspire-theme.component'
|