geonetwork-ui 2.7.0-dev.21bdf506c → 2.7.0-dev.228db3e1a
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 +8 -4
- 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 +20 -6
- package/esm2022/libs/api/repository/src/lib/metadata-language.token.mjs +3 -0
- package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +15 -1
- package/esm2022/libs/feature/catalog/src/lib/sources/sources.service.mjs +3 -3
- 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 +79 -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/map-view/map-view.component.mjs +4 -2
- 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/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 +3 -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 +4 -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 +59 -20
- package/esm2022/translations/en.json +60 -21
- package/esm2022/translations/es.json +46 -7
- package/esm2022/translations/fr.json +65 -26
- package/esm2022/translations/it.json +59 -20
- package/esm2022/translations/nl.json +46 -7
- package/esm2022/translations/pt.json +46 -7
- package/esm2022/translations/sk.json +50 -11
- package/fesm2022/geonetwork-ui.mjs +3216 -2921
- 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.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 +2 -0
- package/libs/api/repository/src/lib/gn4/platform/gn4-platform.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/record/metadata.model.d.ts +4 -0
- package/libs/common/domain/src/lib/model/record/metadata.model.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/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 +28 -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/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/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 +1 -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 +1 -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 +7 -3
- 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 +21 -8
- package/src/libs/api/repository/src/lib/metadata-language.token.ts +8 -0
- package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +20 -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/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 +20 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-inspire-field/form-field-inspire-theme.component.ts +85 -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/map-view/map-view.component.ts +3 -1
- 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/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 +2 -0
- package/src/libs/util/app-config/src/lib/fixtures.ts +1 -1
- package/src/libs/util/app-config/src/lib/model.ts +1 -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 +2 -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 +59 -20
- package/translations/en.json +60 -21
- package/translations/es.json +46 -7
- package/translations/fr.json +65 -26
- package/translations/it.json +59 -20
- package/translations/nl.json +46 -7
- package/translations/pt.json +46 -7
- package/translations/sk.json +50 -11
- 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
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
import { readKind } from './read-parts'
|
|
54
54
|
import { writeGeometry } from './utils/geometry'
|
|
55
55
|
import { namePartsToFull } from './utils/individual-name'
|
|
56
|
-
import {
|
|
56
|
+
import { toLang3 } from '../../../../../../libs/util/i18n/src/lib/language-codes'
|
|
57
57
|
import { kindToCodeListValue } from '../common/resource-types'
|
|
58
58
|
|
|
59
59
|
function writeLocalizedElement(
|
|
@@ -183,6 +183,10 @@ export function getProgressCode(status: RecordStatus): string {
|
|
|
183
183
|
return 'removed'
|
|
184
184
|
case 'under_development':
|
|
185
185
|
return 'underDevelopment'
|
|
186
|
+
case 'planned':
|
|
187
|
+
return 'planned'
|
|
188
|
+
case 'required':
|
|
189
|
+
return 'required'
|
|
186
190
|
default:
|
|
187
191
|
throw new Error(
|
|
188
192
|
`Could not determine progress code from status: ${status}`
|
|
@@ -1472,7 +1476,7 @@ export function writeLanguages(record: DatasetRecord, rootEl: XmlElement) {
|
|
|
1472
1476
|
writeAttribute('id', lang.toUpperCase()),
|
|
1473
1477
|
createNestedChild('gmd:languageCode', 'gmd:LanguageCode'),
|
|
1474
1478
|
writeAttribute('codeList', 'http://www.loc.gov/standards/iso639-2/'),
|
|
1475
|
-
writeAttribute('codeListValue',
|
|
1479
|
+
writeAttribute('codeListValue', toLang3(lang) ?? lang)
|
|
1476
1480
|
)
|
|
1477
1481
|
|
|
1478
1482
|
// add new languages (only if other than default one)
|
|
@@ -1486,7 +1490,7 @@ export function writeDefaultLanguage(
|
|
|
1486
1490
|
record: DatasetRecord,
|
|
1487
1491
|
rootEl: XmlElement
|
|
1488
1492
|
) {
|
|
1489
|
-
const lang3 =
|
|
1493
|
+
const lang3 = toLang3(record.defaultLanguage.toLowerCase())
|
|
1490
1494
|
return pipe(
|
|
1491
1495
|
findNestedChildOrCreate('gmd:language', 'gmd:LanguageCode'),
|
|
1492
1496
|
writeAttribute('codeList', 'http://www.loc.gov/standards/iso639-2/'),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Inject, Injectable, InjectionToken, Optional } from '@angular/core'
|
|
2
|
-
import {
|
|
2
|
+
import { toLang2, toLang3 } from '../../../../../../../libs/util/i18n/src'
|
|
3
3
|
import { TranslateService } from '@ngx-translate/core'
|
|
4
4
|
import { Location } from '@angular/common'
|
|
5
5
|
|
|
@@ -35,8 +35,8 @@ export class AuthService {
|
|
|
35
35
|
'${current_url}',
|
|
36
36
|
new URL(this.location.path(), window.location.href).toString()
|
|
37
37
|
)
|
|
38
|
-
.replace('${lang2}', this.translateService.currentLang)
|
|
39
|
-
.replace('${lang3}',
|
|
38
|
+
.replace('${lang2}', toLang2(this.translateService.currentLang))
|
|
39
|
+
.replace('${lang3}', toLang3(this.translateService.currentLang))
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
get logoutUrl() {
|
|
@@ -46,7 +46,7 @@ export class AuthService {
|
|
|
46
46
|
get settingsUrl() {
|
|
47
47
|
return this.baseSettingsUrl.replace(
|
|
48
48
|
'${lang3}',
|
|
49
|
-
|
|
49
|
+
toLang3(this.translateService.currentLang)
|
|
50
50
|
)
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -10,14 +10,12 @@ export const ES_SOURCE_SUMMARY = [
|
|
|
10
10
|
'codelist_status_text',
|
|
11
11
|
'link',
|
|
12
12
|
'linkProtocol',
|
|
13
|
-
'contactForResource
|
|
14
|
-
'contact
|
|
15
|
-
'contact
|
|
13
|
+
'contactForResource*.organisation*',
|
|
14
|
+
'contact*.organisation*',
|
|
15
|
+
'contact*.email',
|
|
16
16
|
'userSavedCount',
|
|
17
|
-
'updateFrequency',
|
|
18
17
|
'cl_topic',
|
|
19
18
|
'cl_maintenanceAndUpdateFrequency',
|
|
20
|
-
'tag',
|
|
21
19
|
'MD_LegalConstraints*Object',
|
|
22
20
|
'qualityScore',
|
|
23
21
|
'allKeywords',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Injectable, Injector } from '@angular/core'
|
|
2
|
-
import { Geometry } from 'geojson'
|
|
2
|
+
import type { Geometry } from 'geojson'
|
|
3
3
|
import {
|
|
4
4
|
ES_QUERY_FIELDS_PRIORITY,
|
|
5
5
|
ES_SOURCE_SUMMARY,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
FiltersAggregationParams,
|
|
16
16
|
SortByField,
|
|
17
17
|
} from '../../../../../../../libs/common/domain/src/lib/model/search'
|
|
18
|
-
import { METADATA_LANGUAGE } from '../../metadata-language'
|
|
18
|
+
import { METADATA_LANGUAGE } from '../../metadata-language.token'
|
|
19
19
|
import {
|
|
20
20
|
AggregationResult,
|
|
21
21
|
EsSearchParams,
|
|
@@ -26,10 +26,16 @@ import {
|
|
|
26
26
|
SortParams,
|
|
27
27
|
TermsAggregationResult,
|
|
28
28
|
} from '../../../../../../../libs/api/metadata-converter/src'
|
|
29
|
-
import {
|
|
29
|
+
import { toLang3 } from '../../../../../../../libs/util/i18n/src'
|
|
30
30
|
import { formatDate, isDateRange } from './date-range.utils'
|
|
31
|
-
import {
|
|
31
|
+
import {
|
|
32
|
+
CatalogRecord,
|
|
33
|
+
LanguageCode,
|
|
34
|
+
} from '../../../../../../../libs/common/domain/src/lib/model/record'
|
|
32
35
|
import { TranslateService } from '@ngx-translate/core'
|
|
36
|
+
import { getGeometryBoundingBox } from '../../../../../../../libs/util/shared/src'
|
|
37
|
+
import { getLength as getGeodesicLength } from 'ol/sphere'
|
|
38
|
+
import { LineString } from 'ol/geom'
|
|
33
39
|
|
|
34
40
|
export type DateRange = { start?: Date; end?: Date }
|
|
35
41
|
|
|
@@ -42,11 +48,9 @@ export class ElasticsearchService {
|
|
|
42
48
|
private runtimeFields: Record<string, string> = {}
|
|
43
49
|
|
|
44
50
|
// we're using getters in case the defined languages change over time
|
|
45
|
-
private get
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
private get metadataLang() {
|
|
49
|
-
return this.injector.get(METADATA_LANGUAGE, null)
|
|
51
|
+
private get metadataLang(): LanguageCode {
|
|
52
|
+
const mdLangValue = this.injector.get(METADATA_LANGUAGE, null)
|
|
53
|
+
return typeof mdLangValue === 'function' ? mdLangValue() : mdLangValue
|
|
50
54
|
}
|
|
51
55
|
|
|
52
56
|
constructor(
|
|
@@ -230,9 +234,12 @@ export class ElasticsearchService {
|
|
|
230
234
|
|
|
231
235
|
private getQueryLang(): string {
|
|
232
236
|
if (this.metadataLang) {
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
237
|
+
const lang3 = toLang3(
|
|
238
|
+
this.isCurrentSearchLang()
|
|
239
|
+
? this.translateService.currentLang
|
|
240
|
+
: this.metadataLang
|
|
241
|
+
)
|
|
242
|
+
return `lang${lang3}`
|
|
236
243
|
} else return '*'
|
|
237
244
|
}
|
|
238
245
|
private isCurrentSearchLang() {
|
|
@@ -351,6 +358,11 @@ export class ElasticsearchService {
|
|
|
351
358
|
})
|
|
352
359
|
}
|
|
353
360
|
if (geometry) {
|
|
361
|
+
// boosts applied using the filter geometry:
|
|
362
|
+
// * records completely within the geometry receive a boost of 5
|
|
363
|
+
// * records intersecting the geometry receive a boost of 2
|
|
364
|
+
// * records close to the geometry center receive a boost of 5 (based on the `location` field)
|
|
365
|
+
// * records on the outskirt of the geometry receive a boost of 2.5
|
|
354
366
|
should.push(
|
|
355
367
|
{
|
|
356
368
|
geo_shape: {
|
|
@@ -358,7 +370,7 @@ export class ElasticsearchService {
|
|
|
358
370
|
shape: geometry,
|
|
359
371
|
relation: 'within',
|
|
360
372
|
},
|
|
361
|
-
boost:
|
|
373
|
+
boost: 5.0,
|
|
362
374
|
},
|
|
363
375
|
},
|
|
364
376
|
{
|
|
@@ -367,10 +379,49 @@ export class ElasticsearchService {
|
|
|
367
379
|
shape: geometry,
|
|
368
380
|
relation: 'intersects',
|
|
369
381
|
},
|
|
370
|
-
boost:
|
|
382
|
+
boost: 2.0,
|
|
371
383
|
},
|
|
372
384
|
}
|
|
373
385
|
)
|
|
386
|
+
|
|
387
|
+
// this will boost the results variably depending on their distance from the given geometry
|
|
388
|
+
// note: this takes into account the `location` field of a record; this is generally the center of all spatial extents
|
|
389
|
+
// combined, and thus the actual size/coverage of the record spatial extent isn't relevant here
|
|
390
|
+
const bbox = getGeometryBoundingBox(geometry)
|
|
391
|
+
const center = [(bbox[0] + bbox[2]) / 2, (bbox[1] + bbox[3]) / 2]
|
|
392
|
+
const northToCenter = new LineString([
|
|
393
|
+
[center[0], bbox[3]],
|
|
394
|
+
center,
|
|
395
|
+
]).transform('EPSG:4326', 'EPSG:3857')
|
|
396
|
+
const southToCenter = new LineString([
|
|
397
|
+
[center[0], bbox[1]],
|
|
398
|
+
center,
|
|
399
|
+
]).transform('EPSG:4326', 'EPSG:3857')
|
|
400
|
+
const westToCenter = new LineString([
|
|
401
|
+
[bbox[0], center[1]],
|
|
402
|
+
center,
|
|
403
|
+
]).transform('EPSG:4326', 'EPSG:3857')
|
|
404
|
+
const eastToCenter = new LineString([
|
|
405
|
+
[bbox[2], center[1]],
|
|
406
|
+
center,
|
|
407
|
+
]).transform('EPSG:4326', 'EPSG:3857')
|
|
408
|
+
// cutoff distance is the distance from where the boost will only be half of the max value
|
|
409
|
+
// it is an average of the "size" of the bounding box in every direction, in meters
|
|
410
|
+
const cutoffDistance =
|
|
411
|
+
(getGeodesicLength(northToCenter) +
|
|
412
|
+
getGeodesicLength(southToCenter) +
|
|
413
|
+
getGeodesicLength(westToCenter) +
|
|
414
|
+
getGeodesicLength(eastToCenter)) /
|
|
415
|
+
4
|
|
416
|
+
|
|
417
|
+
should.push({
|
|
418
|
+
distance_feature: {
|
|
419
|
+
field: 'location',
|
|
420
|
+
pivot: `${Math.round(cutoffDistance).toFixed(0)}m`,
|
|
421
|
+
origin: center,
|
|
422
|
+
boost: 5.0,
|
|
423
|
+
},
|
|
424
|
+
})
|
|
374
425
|
}
|
|
375
426
|
|
|
376
427
|
return {
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
import { catchError, map, tap } from 'rxjs/operators'
|
|
49
49
|
import { lt } from 'semver'
|
|
50
50
|
import { ElasticsearchService } from './elasticsearch'
|
|
51
|
-
import {
|
|
51
|
+
import { toLang2 } from '../../../../../../libs/util/i18n/src'
|
|
52
52
|
import { Gn4SettingsService } from './settings/gn4-settings.service'
|
|
53
53
|
|
|
54
54
|
const minPublicationApiVersion = '4.2.5'
|
|
@@ -562,7 +562,7 @@ export class Gn4Repository implements RecordsRepositoryInterface {
|
|
|
562
562
|
.pipe(
|
|
563
563
|
map((languages) =>
|
|
564
564
|
languages
|
|
565
|
-
.map((lang) =>
|
|
565
|
+
.map((lang) => toLang2(lang.id))
|
|
566
566
|
.filter((code): code is string => !!code)
|
|
567
567
|
)
|
|
568
568
|
)
|
package/src/libs/api/repository/src/lib/gn4/organizations/organizations-from-groups.service.ts
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import { forkJoin, Observable, of } from 'rxjs'
|
|
8
8
|
import { map, shareReplay } from 'rxjs/operators'
|
|
9
9
|
import { TranslateService } from '@ngx-translate/core'
|
|
10
|
-
import {
|
|
10
|
+
import { toLang3 } from '../../../../../../../libs/util/i18n/src'
|
|
11
11
|
import { FieldFilters } from '../../../../../../../libs/common/domain/src/lib/model/search'
|
|
12
12
|
import {
|
|
13
13
|
CatalogRecord,
|
|
@@ -52,7 +52,7 @@ export class OrganizationsFromGroupsService
|
|
|
52
52
|
organisationsCount$ = this.organisations$.pipe(map((orgs) => orgs.length))
|
|
53
53
|
|
|
54
54
|
private get lang3() {
|
|
55
|
-
return
|
|
55
|
+
return toLang3(this.translateService.currentLang)
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
constructor(
|
package/src/libs/api/repository/src/lib/gn4/organizations/organizations-from-metadata.service.ts
CHANGED
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
tap,
|
|
34
34
|
withLatestFrom,
|
|
35
35
|
} from 'rxjs/operators'
|
|
36
|
-
import {
|
|
36
|
+
import { toLang3 } from '../../../../../../../libs/util/i18n/src'
|
|
37
37
|
import { PlatformServiceInterface } from '../../../../../../../libs/common/domain/src/lib/platform.service.interface'
|
|
38
38
|
import { coerce, satisfies, valid } from 'semver'
|
|
39
39
|
import { TranslateService } from '@ngx-translate/core'
|
|
@@ -126,7 +126,7 @@ export class OrganizationsFromMetadataService
|
|
|
126
126
|
) {}
|
|
127
127
|
|
|
128
128
|
private get langIndex() {
|
|
129
|
-
return
|
|
129
|
+
return `lang${toLang3(this.translateService.currentLang)}`
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
equalsNormalizedStrings(
|
|
@@ -45,8 +45,7 @@ import {
|
|
|
45
45
|
throwError,
|
|
46
46
|
} from 'rxjs'
|
|
47
47
|
import { TranslateService } from '@ngx-translate/core'
|
|
48
|
-
import {
|
|
49
|
-
import { DatavizConfigModel } from '../../../../../../../libs/common/domain/src/lib/model/dataviz/dataviz-configuration.model'
|
|
48
|
+
import { toLang3 } from '../../../../../../../libs/util/i18n/src'
|
|
50
49
|
|
|
51
50
|
const minApiVersion = '4.2.2'
|
|
52
51
|
|
|
@@ -56,6 +55,7 @@ export class Gn4PlatformService implements PlatformServiceInterface {
|
|
|
56
55
|
private readonly me$: Observable<UserModel>
|
|
57
56
|
private readonly users$: Observable<UserModel[]>
|
|
58
57
|
private readonly isUserAnonymous$: Observable<boolean>
|
|
58
|
+
private readonly gnParseVersion = '4.2.5'
|
|
59
59
|
|
|
60
60
|
private keyTranslations$ = this.toolsApiService
|
|
61
61
|
.getTranslationsPackage1('gnui')
|
|
@@ -98,7 +98,7 @@ export class Gn4PlatformService implements PlatformServiceInterface {
|
|
|
98
98
|
private keywordsByThesauri: Record<string, Observable<Keyword[]>> = {}
|
|
99
99
|
|
|
100
100
|
private get lang3() {
|
|
101
|
-
return
|
|
101
|
+
return toLang3(this.translateService.currentLang)
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
constructor(
|
|
@@ -390,22 +390,35 @@ export class Gn4PlatformService implements PlatformServiceInterface {
|
|
|
390
390
|
})
|
|
391
391
|
)
|
|
392
392
|
}
|
|
393
|
-
|
|
394
393
|
getFileContent(url: URL | string): Observable<any> {
|
|
395
|
-
return
|
|
396
|
-
|
|
394
|
+
return combineLatest([
|
|
395
|
+
this.httpClient.get(url.toString(), { responseType: 'text' }),
|
|
396
|
+
this.getApiVersion(),
|
|
397
|
+
]).pipe(
|
|
398
|
+
map(([text, version]) => {
|
|
397
399
|
const parsed = JSON.parse(text)
|
|
398
400
|
|
|
399
|
-
if (
|
|
401
|
+
if (version > this.gnParseVersion) {
|
|
400
402
|
return parsed
|
|
401
403
|
}
|
|
402
404
|
|
|
403
|
-
const decoded =
|
|
405
|
+
const decoded = this.decodeBase64(parsed)
|
|
404
406
|
return JSON.parse(decoded)
|
|
405
407
|
})
|
|
406
408
|
)
|
|
407
409
|
}
|
|
408
410
|
|
|
411
|
+
decodeBase64(base64) {
|
|
412
|
+
const text = atob(base64)
|
|
413
|
+
const length = text.length
|
|
414
|
+
const bytes = new Uint8Array(length)
|
|
415
|
+
for (let i = 0; i < length; i++) {
|
|
416
|
+
bytes[i] = text.charCodeAt(i)
|
|
417
|
+
}
|
|
418
|
+
const decoder = new TextDecoder()
|
|
419
|
+
return decoder.decode(bytes)
|
|
420
|
+
}
|
|
421
|
+
|
|
409
422
|
attachFileToRecord(
|
|
410
423
|
recordUuid: string,
|
|
411
424
|
file: File,
|
|
@@ -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 {
|
|
@@ -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
|
}
|
|
@@ -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,20 @@
|
|
|
1
|
+
<div class="flex flex-col gap-3">
|
|
2
|
+
<div class="flex flex-col gap-4">
|
|
3
|
+
<gn-ui-autocomplete
|
|
4
|
+
[placeholder]="'editor.record.form.inspire.placeholder' | translate"
|
|
5
|
+
[displayWithFn]="displayWithFn"
|
|
6
|
+
[action]="autoCompleteAction"
|
|
7
|
+
(itemSelected)="handleItemSelection($event)"
|
|
8
|
+
[minCharacterCount]="1"
|
|
9
|
+
[clearOnSelection]="true"
|
|
10
|
+
></gn-ui-autocomplete>
|
|
11
|
+
<div class="flex gap-2 flex-wrap">
|
|
12
|
+
<gn-ui-badge
|
|
13
|
+
*ngFor="let theme of themes"
|
|
14
|
+
[removable]="true"
|
|
15
|
+
(badgeRemoveClicked)="removeTheme(theme)"
|
|
16
|
+
>{{ getTranslatedTheme(theme) }}
|
|
17
|
+
</gn-ui-badge>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|