geonetwork-ui 2.4.0-dev.cec60ff1 → 2.4.0-dev.d5b28b1e
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/gn4/atomic-operations.mjs +2 -1
- package/esm2022/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.mjs +1 -1
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.mjs +5 -5
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/read-parts.mjs +30 -2
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/utils/geometry.mjs +31 -0
- package/esm2022/libs/api/metadata-converter/src/lib/iso19139/write-parts.mjs +23 -1
- package/esm2022/libs/api/metadata-converter/src/lib/xml-utils.mjs +6 -1
- package/esm2022/libs/api/repository/src/lib/gn4/gn4-repository.mjs +31 -3
- package/esm2022/libs/common/domain/src/lib/model/record/metadata.model.mjs +1 -1
- package/esm2022/libs/common/domain/src/lib/repository/records-repository.interface.mjs +1 -1
- package/esm2022/libs/data-access/gn4/src/openapi/api/records.api.service.mjs +2 -6
- package/esm2022/libs/feature/editor/src/lib/+state/editor.actions.mjs +2 -1
- package/esm2022/libs/feature/editor/src/lib/+state/editor.effects.mjs +3 -3
- package/esm2022/libs/feature/editor/src/lib/+state/editor.facade.mjs +7 -2
- package/esm2022/libs/feature/editor/src/lib/+state/editor.models.mjs +1 -1
- package/esm2022/libs/feature/editor/src/lib/+state/editor.reducer.mjs +7 -3
- package/esm2022/libs/feature/editor/src/lib/+state/editor.selectors.mjs +16 -6
- package/esm2022/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.mjs +131 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.mjs +21 -0
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.mjs +7 -6
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.mjs +19 -9
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/index.mjs +1 -2
- package/esm2022/libs/feature/editor/src/lib/components/record-form/record-form.component.mjs +11 -7
- package/esm2022/libs/feature/editor/src/lib/expressions.mjs +1 -1
- package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +153 -60
- package/esm2022/libs/feature/editor/src/lib/models/editor-config.model.mjs +2 -0
- package/esm2022/libs/feature/editor/src/lib/models/index.mjs +2 -1
- package/esm2022/libs/feature/editor/src/lib/services/editor.service.mjs +4 -3
- package/esm2022/libs/feature/map/src/lib/utils/map-utils.service.mjs +10 -5
- package/esm2022/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.mjs +42 -23
- package/esm2022/libs/feature/record/src/lib/data-view-share/data-view-share.component.mjs +13 -5
- package/esm2022/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.mjs +49 -15
- package/esm2022/libs/feature/search/src/lib/results-table/results-table-container.component.mjs +46 -7
- package/esm2022/libs/feature/search/src/lib/state/search.facade.mjs +6 -2
- package/esm2022/libs/ui/elements/src/index.mjs +2 -1
- package/esm2022/libs/ui/elements/src/lib/api-card/api-card.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/confirmation-dialog/confirmation-dialog.component.mjs +27 -0
- package/esm2022/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.mjs +4 -3
- package/esm2022/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.mjs +2 -2
- package/esm2022/libs/ui/elements/src/lib/metadata-info/metadata-info.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.mjs +5 -11
- package/esm2022/libs/ui/elements/src/lib/metadata-quality-item/metadata-quality-item.component.mjs +3 -3
- package/esm2022/libs/ui/elements/src/lib/sortable-list/sortable-list.component.mjs +6 -3
- package/esm2022/libs/ui/elements/src/lib/ui-elements.module.mjs +5 -2
- package/esm2022/libs/ui/elements/src/lib/user-preview/user-preview.component.mjs +3 -3
- package/esm2022/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.mjs +3 -3
- package/esm2022/libs/ui/layout/src/lib/interactive-table/interactive-table.component.mjs +3 -3
- package/esm2022/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.mjs +67 -0
- package/esm2022/libs/ui/search/src/lib/results-table/results-table.component.mjs +28 -8
- package/esm2022/libs/ui/widgets/src/index.mjs +2 -1
- package/esm2022/libs/ui/widgets/src/lib/popover/popover.component.mjs +68 -0
- package/esm2022/translations/de.json +68 -32
- package/esm2022/translations/en.json +44 -8
- package/esm2022/translations/es.json +41 -5
- package/esm2022/translations/fr.json +53 -17
- package/esm2022/translations/it.json +42 -6
- package/esm2022/translations/nl.json +41 -5
- package/esm2022/translations/pt.json +41 -5
- package/fesm2022/geonetwork-ui.mjs +1257 -369
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/atomic-operations.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts +1 -0
- package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts +8 -1
- package/libs/api/metadata-converter/src/lib/iso19139/read-parts.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/iso19139/utils/geometry.d.ts +5 -0
- package/libs/api/metadata-converter/src/lib/iso19139/utils/geometry.d.ts.map +1 -0
- package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts +3 -1
- package/libs/api/metadata-converter/src/lib/iso19139/write-parts.d.ts.map +1 -1
- package/libs/api/metadata-converter/src/lib/xml-utils.d.ts +1 -0
- package/libs/api/metadata-converter/src/lib/xml-utils.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts +7 -1
- package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts.map +1 -1
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts +2 -1
- package/libs/common/domain/src/lib/model/record/metadata.model.d.ts.map +1 -1
- package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts +17 -0
- package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts.map +1 -1
- package/libs/data-access/gn4/src/openapi/api/records.api.service.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/+state/editor.actions.d.ts +5 -0
- package/libs/feature/editor/src/lib/+state/editor.actions.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/+state/editor.facade.d.ts +4 -4
- package/libs/feature/editor/src/lib/+state/editor.facade.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/+state/editor.models.d.ts +8 -0
- package/libs/feature/editor/src/lib/+state/editor.models.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/+state/editor.reducer.d.ts +4 -3
- package/libs/feature/editor/src/lib/+state/editor.reducer.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/+state/editor.selectors.d.ts +4 -8
- package/libs/feature/editor/src/lib/+state/editor.selectors.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.d.ts +27 -0
- package/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.d.ts +11 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.d.ts +3 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts +6 -2
- 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 +0 -1
- package/libs/feature/editor/src/lib/components/record-form/form-field/index.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/components/record-form/record-form.component.d.ts +5 -7
- package/libs/feature/editor/src/lib/components/record-form/record-form.component.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/expressions.d.ts +1 -1
- package/libs/feature/editor/src/lib/expressions.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/fields.config.d.ts +39 -2
- package/libs/feature/editor/src/lib/fields.config.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/models/editor-config.model.d.ts +36 -0
- package/libs/feature/editor/src/lib/models/editor-config.model.d.ts.map +1 -0
- package/libs/feature/editor/src/lib/models/index.d.ts +1 -0
- package/libs/feature/editor/src/lib/models/index.d.ts.map +1 -1
- package/libs/feature/editor/src/lib/services/editor.service.d.ts +2 -2
- package/libs/feature/editor/src/lib/services/editor.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/data-view-permalink/data-view-permalink.component.d.ts +4 -1
- package/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/data-view-share/data-view-share.component.d.ts +4 -1
- package/libs/feature/record/src/lib/data-view-share/data-view-share.component.d.ts.map +1 -1
- package/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.d.ts +4 -1
- package/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.d.ts.map +1 -1
- package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts +14 -4
- package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts.map +1 -1
- package/libs/feature/search/src/lib/state/search.facade.d.ts +1 -0
- package/libs/feature/search/src/lib/state/search.facade.d.ts.map +1 -1
- package/libs/ui/elements/src/index.d.ts +1 -0
- package/libs/ui/elements/src/index.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/confirmation-dialog/confirmation-dialog.component.d.ts +18 -0
- package/libs/ui/elements/src/lib/confirmation-dialog/confirmation-dialog.component.d.ts.map +1 -0
- package/libs/ui/elements/src/lib/downloads-list/downloads-list.component.d.ts +1 -1
- package/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.d.ts +0 -3
- package/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/record-api-form/record-api-form.component.d.ts +1 -1
- package/libs/ui/elements/src/lib/sortable-list/sortable-list.component.d.ts +3 -2
- package/libs/ui/elements/src/lib/sortable-list/sortable-list.component.d.ts.map +1 -1
- package/libs/ui/elements/src/lib/ui-elements.module.d.ts +7 -6
- package/libs/ui/elements/src/lib/ui-elements.module.d.ts.map +1 -1
- package/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.d.ts +20 -0
- package/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.d.ts.map +1 -0
- package/libs/ui/search/src/lib/results-table/results-table.component.d.ts +9 -3
- package/libs/ui/search/src/lib/results-table/results-table.component.d.ts.map +1 -1
- package/libs/ui/widgets/src/index.d.ts +1 -0
- package/libs/ui/widgets/src/index.d.ts.map +1 -1
- package/libs/ui/widgets/src/lib/popover/popover.component.d.ts +19 -0
- package/libs/ui/widgets/src/lib/popover/popover.component.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/libs/api/metadata-converter/src/lib/fixtures/geo2france.records.ts +5 -1
- package/src/libs/api/metadata-converter/src/lib/fixtures/geocat-ch.records.ts +37 -12
- package/src/libs/api/metadata-converter/src/lib/fixtures/metawal.records.ts +5 -1
- package/src/libs/api/metadata-converter/src/lib/gn4/atomic-operations.ts +1 -0
- package/src/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.ts +1 -0
- package/src/libs/api/metadata-converter/src/lib/iso19139/iso19139.converter.ts +4 -2
- package/src/libs/api/metadata-converter/src/lib/iso19139/read-parts.ts +72 -2
- package/src/libs/api/metadata-converter/src/lib/iso19139/utils/geometry.ts +39 -0
- package/src/libs/api/metadata-converter/src/lib/iso19139/write-parts.ts +70 -1
- package/src/libs/api/metadata-converter/src/lib/xml-utils.ts +8 -0
- package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +42 -2
- package/src/libs/common/domain/src/lib/model/record/metadata.model.ts +2 -1
- package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +22 -0
- package/src/libs/common/fixtures/src/index.ts +2 -0
- package/src/libs/common/fixtures/src/lib/editor/editor.fixtures.ts +156 -0
- package/src/libs/common/fixtures/src/lib/editor/index.ts +1 -0
- package/src/libs/data-access/gn4/src/openapi/api/records.api.service.ts +1 -5
- package/src/libs/data-access/gn4/src/spec.yaml +0 -8
- package/src/libs/feature/editor/src/lib/+state/editor.actions.ts +5 -0
- package/src/libs/feature/editor/src/lib/+state/editor.effects.ts +2 -2
- package/src/libs/feature/editor/src/lib/+state/editor.facade.ts +9 -1
- package/src/libs/feature/editor/src/lib/+state/editor.models.ts +11 -0
- package/src/libs/feature/editor/src/lib/+state/editor.reducer.ts +11 -5
- package/src/libs/feature/editor/src/lib/+state/editor.selectors.ts +22 -8
- package/src/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.html +2 -1
- package/src/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.ts +110 -19
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.css +0 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.html +5 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-overviews/form-field-overviews.component.ts +22 -0
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-temporal-extents/form-field-temporal-extents.component.ts +8 -7
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +15 -9
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +15 -2
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/index.ts +0 -1
- package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.html +51 -11
- package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.ts +15 -8
- package/src/libs/feature/editor/src/lib/expressions.ts +1 -1
- package/src/libs/feature/editor/src/lib/fields.config.ts +186 -61
- package/src/libs/feature/editor/src/lib/models/editor-config.model.ts +53 -0
- package/src/libs/feature/editor/src/lib/models/index.ts +1 -0
- package/src/libs/feature/editor/src/lib/services/editor.service.ts +8 -4
- package/src/libs/feature/map/src/lib/utils/map-utils.service.ts +8 -4
- package/src/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.ts +36 -19
- package/src/libs/feature/record/src/lib/data-view-share/data-view-share.component.html +6 -2
- package/src/libs/feature/record/src/lib/data-view-share/data-view-share.component.ts +11 -0
- package/src/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.ts +59 -12
- package/src/libs/feature/search/src/lib/results-table/results-table-container.component.html +3 -1
- package/src/libs/feature/search/src/lib/results-table/results-table-container.component.ts +57 -3
- package/src/libs/feature/search/src/lib/state/search.facade.ts +6 -0
- package/src/libs/ui/elements/src/index.ts +1 -0
- package/src/libs/ui/elements/src/lib/api-card/api-card.component.html +29 -29
- package/src/libs/ui/elements/src/lib/confirmation-dialog/confirmation-dialog.component.css +0 -0
- package/src/libs/ui/elements/src/lib/confirmation-dialog/confirmation-dialog.component.html +12 -0
- package/src/libs/ui/elements/src/lib/confirmation-dialog/confirmation-dialog.component.ts +37 -0
- package/src/libs/ui/elements/src/lib/markdown-editor/markdown-editor.component.html +4 -1
- package/src/libs/ui/elements/src/lib/markdown-parser/markdown-parser.component.css +2 -1
- package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html +12 -8
- package/src/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.html +14 -20
- package/src/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.ts +0 -10
- package/src/libs/ui/elements/src/lib/metadata-quality-item/metadata-quality-item.component.html +1 -1
- package/src/libs/ui/elements/src/lib/sortable-list/sortable-list.component.html +3 -1
- package/src/libs/ui/elements/src/lib/sortable-list/sortable-list.component.ts +6 -2
- package/src/libs/ui/elements/src/lib/ui-elements.module.ts +2 -1
- package/src/libs/ui/elements/src/lib/user-preview/user-preview.component.html +1 -1
- package/src/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.css +31 -0
- package/src/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.html +15 -0
- package/src/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.ts +38 -0
- package/src/libs/ui/layout/src/lib/form-field-wrapper/form-field-wrapper.component.html +1 -1
- package/src/libs/ui/layout/src/lib/interactive-table/interactive-table.component.html +1 -0
- package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.css +0 -0
- package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.html +26 -0
- package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.ts +74 -0
- package/src/libs/ui/search/src/lib/results-table/results-table.component.html +15 -1
- package/src/libs/ui/search/src/lib/results-table/results-table.component.ts +26 -12
- package/src/libs/ui/widgets/src/index.ts +1 -0
- package/src/libs/ui/widgets/src/lib/popover/popover.component.css +0 -0
- package/src/libs/ui/widgets/src/lib/popover/popover.component.html +3 -0
- package/src/libs/ui/widgets/src/lib/popover/popover.component.ts +85 -0
- package/tailwind.base.css +2 -1
- package/translations/de.json +68 -32
- package/translations/en.json +44 -8
- package/translations/es.json +41 -5
- package/translations/fr.json +53 -17
- package/translations/it.json +42 -6
- package/translations/nl.json +41 -5
- package/translations/pt.json +41 -5
- package/translations/sk.json +42 -6
- package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.model.mjs +0 -2
- package/esm2022/libs/feature/editor/src/lib/models/fields.model.mjs +0 -2
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.model.d.ts +0 -26
- package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.model.d.ts.map +0 -1
- package/libs/feature/editor/src/lib/models/fields.model.d.ts +0 -15
- package/libs/feature/editor/src/lib/models/fields.model.d.ts.map +0 -1
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.model.ts +0 -43
- package/src/libs/feature/editor/src/lib/models/fields.model.ts +0 -29
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
from,
|
|
10
10
|
Observable,
|
|
11
11
|
of,
|
|
12
|
+
Subject,
|
|
12
13
|
switchMap,
|
|
13
14
|
throwError,
|
|
14
15
|
} from 'rxjs'
|
|
@@ -32,8 +33,13 @@ import {
|
|
|
32
33
|
import { CatalogRecord } from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
33
34
|
import { HttpErrorResponse } from '@angular/common/http'
|
|
34
35
|
|
|
36
|
+
const TEMPORARY_ID_PREFIX = 'TEMP-ID-'
|
|
37
|
+
|
|
35
38
|
@Injectable()
|
|
36
39
|
export class Gn4Repository implements RecordsRepositoryInterface {
|
|
40
|
+
_draftsChanged = new Subject<void>()
|
|
41
|
+
draftsChanged$ = this._draftsChanged.asObservable()
|
|
42
|
+
|
|
37
43
|
constructor(
|
|
38
44
|
private gn4SearchApi: SearchApiService,
|
|
39
45
|
private gn4SearchHelper: ElasticsearchService,
|
|
@@ -230,6 +236,26 @@ export class Gn4Repository implements RecordsRepositoryInterface {
|
|
|
230
236
|
)
|
|
231
237
|
}
|
|
232
238
|
|
|
239
|
+
openRecordForDuplication(
|
|
240
|
+
uniqueIdentifier: string
|
|
241
|
+
): Observable<[CatalogRecord, string, false] | null> {
|
|
242
|
+
return this.loadRecordAsXml(uniqueIdentifier).pipe(
|
|
243
|
+
switchMap(async (recordAsXml) => {
|
|
244
|
+
const converter = findConverterForDocument(recordAsXml)
|
|
245
|
+
const record = await converter.readRecord(recordAsXml)
|
|
246
|
+
record.uniqueIdentifier = `${TEMPORARY_ID_PREFIX}${Date.now()}`
|
|
247
|
+
record.title = `${record.title} (Copy)`
|
|
248
|
+
const xml = await converter.writeRecord(record, recordAsXml)
|
|
249
|
+
window.localStorage.setItem(
|
|
250
|
+
this.getLocalStorageKeyForRecord(record.uniqueIdentifier),
|
|
251
|
+
xml
|
|
252
|
+
)
|
|
253
|
+
this._draftsChanged.next()
|
|
254
|
+
return [record, xml, false] as [CatalogRecord, string, false]
|
|
255
|
+
})
|
|
256
|
+
)
|
|
257
|
+
}
|
|
258
|
+
|
|
233
259
|
private serializeRecordToXml(
|
|
234
260
|
record: CatalogRecord,
|
|
235
261
|
referenceRecordSource?: string
|
|
@@ -275,17 +301,26 @@ export class Gn4Repository implements RecordsRepositoryInterface {
|
|
|
275
301
|
)
|
|
276
302
|
}
|
|
277
303
|
|
|
304
|
+
deleteRecord(uniqueIdentifier: string): Observable<void> {
|
|
305
|
+
return this.gn4RecordsApi.deleteRecord(uniqueIdentifier)
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
generateTemporaryId(): string {
|
|
309
|
+
return `${TEMPORARY_ID_PREFIX}${Date.now()}`
|
|
310
|
+
}
|
|
311
|
+
|
|
278
312
|
saveRecordAsDraft(
|
|
279
313
|
record: CatalogRecord,
|
|
280
314
|
referenceRecordSource?: string
|
|
281
315
|
): Observable<string> {
|
|
282
316
|
return this.serializeRecordToXml(record, referenceRecordSource).pipe(
|
|
283
|
-
tap((recordXml) =>
|
|
317
|
+
tap((recordXml) => {
|
|
284
318
|
window.localStorage.setItem(
|
|
285
319
|
this.getLocalStorageKeyForRecord(record.uniqueIdentifier),
|
|
286
320
|
recordXml
|
|
287
321
|
)
|
|
288
|
-
|
|
322
|
+
this._draftsChanged.next()
|
|
323
|
+
})
|
|
289
324
|
)
|
|
290
325
|
}
|
|
291
326
|
|
|
@@ -293,6 +328,7 @@ export class Gn4Repository implements RecordsRepositoryInterface {
|
|
|
293
328
|
window.localStorage.removeItem(
|
|
294
329
|
this.getLocalStorageKeyForRecord(uniqueIdentifier)
|
|
295
330
|
)
|
|
331
|
+
this._draftsChanged.next()
|
|
296
332
|
}
|
|
297
333
|
|
|
298
334
|
recordHasDraft(uniqueIdentifier: string): boolean {
|
|
@@ -303,6 +339,10 @@ export class Gn4Repository implements RecordsRepositoryInterface {
|
|
|
303
339
|
)
|
|
304
340
|
}
|
|
305
341
|
|
|
342
|
+
isRecordNotYetSaved(uniqueIdentifier: string): boolean {
|
|
343
|
+
return uniqueIdentifier.startsWith(TEMPORARY_ID_PREFIX)
|
|
344
|
+
}
|
|
345
|
+
|
|
306
346
|
// generated by copilot
|
|
307
347
|
getAllDrafts(): Observable<CatalogRecord[]> {
|
|
308
348
|
const items = { ...window.localStorage }
|
|
@@ -30,6 +30,18 @@ export abstract class RecordsRepositoryInterface {
|
|
|
30
30
|
uniqueIdentifier: string
|
|
31
31
|
): Observable<[CatalogRecord, string, boolean] | null>
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* This emits once:
|
|
35
|
+
* - record object with a new unique identifier and suffixed title
|
|
36
|
+
* - serialized representation of the record as text
|
|
37
|
+
* - false, as the duplicated record is always a draft
|
|
38
|
+
* @param uniqueIdentifier
|
|
39
|
+
* @returns Observable<[CatalogRecord, string, false] | null>
|
|
40
|
+
*/
|
|
41
|
+
abstract openRecordForDuplication(
|
|
42
|
+
uniqueIdentifier: string
|
|
43
|
+
): Observable<[CatalogRecord, string, false] | null>
|
|
44
|
+
|
|
33
45
|
/**
|
|
34
46
|
* @param record
|
|
35
47
|
* @param referenceRecordSource
|
|
@@ -40,6 +52,14 @@ export abstract class RecordsRepositoryInterface {
|
|
|
40
52
|
referenceRecordSource?: string
|
|
41
53
|
): Observable<string>
|
|
42
54
|
|
|
55
|
+
/**
|
|
56
|
+
* @param uniqueIdentifier
|
|
57
|
+
* @returns Observable<void> Returns when record is deleted
|
|
58
|
+
*/
|
|
59
|
+
abstract deleteRecord(uniqueIdentifier: string): Observable<void>
|
|
60
|
+
|
|
61
|
+
abstract generateTemporaryId(): string
|
|
62
|
+
|
|
43
63
|
/**
|
|
44
64
|
* @param record
|
|
45
65
|
* @param referenceRecordSource
|
|
@@ -52,7 +72,9 @@ export abstract class RecordsRepositoryInterface {
|
|
|
52
72
|
|
|
53
73
|
abstract clearRecordDraft(uniqueIdentifier: string): void
|
|
54
74
|
abstract recordHasDraft(uniqueIdentifier: string): boolean
|
|
75
|
+
abstract isRecordNotYetSaved(uniqueIdentifier: string): boolean
|
|
55
76
|
|
|
56
77
|
/** will return all pending drafts, both published and not published */
|
|
57
78
|
abstract getAllDrafts(): Observable<CatalogRecord[]>
|
|
79
|
+
abstract draftsChanged$: Observable<void>
|
|
58
80
|
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
export const EDITOR_CONFIG = () => ({
|
|
2
|
+
pages: [
|
|
3
|
+
{
|
|
4
|
+
labelKey: 'Resource description',
|
|
5
|
+
sections: [EDITOR_SECTION_ABOUT()],
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
labelKey: 'Resources',
|
|
9
|
+
sections: [EDITOR_SECTION_CLASSIFICATION()],
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
labelKey: 'Access and contact',
|
|
13
|
+
sections: [
|
|
14
|
+
EDITOR_SECTION_USE_AND_ACCESS_CONDITIONS(),
|
|
15
|
+
EDITOR_SECTION_DATA_MANAGER(),
|
|
16
|
+
],
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
export const EDITOR_SECTION_ABOUT = () => ({
|
|
22
|
+
labelKey: 'About the resource',
|
|
23
|
+
descriptionKey: 'This section describes the resource.',
|
|
24
|
+
hidden: false,
|
|
25
|
+
fields: [
|
|
26
|
+
EDITOR_FIELD_TITLE(),
|
|
27
|
+
EDITOR_FIELD_ABSTRACT(),
|
|
28
|
+
EDITOR_FIELD_RESOURCE_UPDATED(),
|
|
29
|
+
EDITOR_FIELD_RECORD_UPDATED(),
|
|
30
|
+
EDITOR_FIELD_UPDATE_FREQUENCY(),
|
|
31
|
+
EDITOR_FIELD_TEMPORAL_EXTENTS(),
|
|
32
|
+
],
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
export const EDITOR_SECTION_DATA_MANAGER = () => ({
|
|
36
|
+
labelKey: 'Data manager',
|
|
37
|
+
descriptionKey: '',
|
|
38
|
+
hidden: false,
|
|
39
|
+
fields: [],
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
export const EDITOR_SECTION_USE_AND_ACCESS_CONDITIONS = () => ({
|
|
43
|
+
labelKey: 'Data manager',
|
|
44
|
+
descriptionKey: '',
|
|
45
|
+
hidden: false,
|
|
46
|
+
fields: [EDITOR_FIELD_LICENSE()],
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
export const EDITOR_SECTION_CLASSIFICATION = () => ({
|
|
50
|
+
labelKey: 'Classification',
|
|
51
|
+
descriptionKey: 'The classification has an impact on the access to the data.',
|
|
52
|
+
hidden: false,
|
|
53
|
+
fields: [EDITOR_FIELD_KEYWORDS(), EDITOR_FIELD_UNIQUE_IDENTIFIER()],
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
export const EDITOR_FIELD_TITLE = () => ({
|
|
57
|
+
model: 'title',
|
|
58
|
+
hidden: false,
|
|
59
|
+
value: 'Accroches vélos MEL',
|
|
60
|
+
formFieldConfig: {
|
|
61
|
+
labelKey: 'editor.record.form.field.title',
|
|
62
|
+
},
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
export const EDITOR_FIELD_ABSTRACT = () => ({
|
|
66
|
+
model: 'abstract',
|
|
67
|
+
hidden: false,
|
|
68
|
+
value: 'Abstract',
|
|
69
|
+
formFieldConfig: {
|
|
70
|
+
labelKey: 'editor.record.form.field.abstract',
|
|
71
|
+
},
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
export const EDITOR_FIELD_RESOURCE_UPDATED = () => ({
|
|
75
|
+
model: 'resourceUpdated',
|
|
76
|
+
hidden: false,
|
|
77
|
+
formFieldConfig: {
|
|
78
|
+
labelKey: 'editor.record.form.field.resourceUpdated',
|
|
79
|
+
},
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
export const EDITOR_FIELD_RECORD_UPDATED = () => ({
|
|
83
|
+
model: 'recordUpdated',
|
|
84
|
+
hidden: false,
|
|
85
|
+
formFieldConfig: {
|
|
86
|
+
labelKey: 'editor.record.form.field.recordUpdated',
|
|
87
|
+
locked: true,
|
|
88
|
+
},
|
|
89
|
+
value: '2024-07-16T05:18:53.000Z',
|
|
90
|
+
onSaveProcess: '${dateNow()}',
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
export const EDITOR_FIELD_UPDATE_FREQUENCY = () => ({
|
|
94
|
+
model: 'updateFrequency',
|
|
95
|
+
hidden: false,
|
|
96
|
+
formFieldConfig: {
|
|
97
|
+
labelKey: 'editor.record.form.field.updateFrequency',
|
|
98
|
+
},
|
|
99
|
+
value: 'unknown',
|
|
100
|
+
})
|
|
101
|
+
|
|
102
|
+
export const EDITOR_FIELD_TEMPORAL_EXTENTS = () => ({
|
|
103
|
+
model: 'temporalExtents',
|
|
104
|
+
hidden: false,
|
|
105
|
+
formFieldConfig: {
|
|
106
|
+
labelKey: 'editor.record.form.field.temporalExtents',
|
|
107
|
+
},
|
|
108
|
+
value: [],
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
export const EDITOR_FIELD_SPATIAL_EXTENTS = () => ({
|
|
112
|
+
model: 'spatialExtents',
|
|
113
|
+
hidden: false,
|
|
114
|
+
formFieldConfig: {
|
|
115
|
+
labelKey: 'editor.record.form.field.spatialExtents',
|
|
116
|
+
},
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
export const EDITOR_FIELD_KEYWORDS = () => ({
|
|
120
|
+
model: 'keywords',
|
|
121
|
+
hidden: false,
|
|
122
|
+
formFieldConfig: {
|
|
123
|
+
labelKey: 'editor.record.form.field.keywords',
|
|
124
|
+
},
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
export const EDITOR_FIELD_UNIQUE_IDENTIFIER = () => ({
|
|
128
|
+
model: 'uniqueIdentifier',
|
|
129
|
+
hidden: false,
|
|
130
|
+
formFieldConfig: {
|
|
131
|
+
labelKey: 'editor.record.form.field.uniqueIdentifier',
|
|
132
|
+
locked: true,
|
|
133
|
+
},
|
|
134
|
+
value: 'accroche_velos',
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
export const EDITOR_FIELD_LICENSE = () => ({
|
|
138
|
+
model: 'licenses',
|
|
139
|
+
hidden: false,
|
|
140
|
+
formFieldConfig: {
|
|
141
|
+
labelKey: 'editor.record.form.field.license',
|
|
142
|
+
locked: true,
|
|
143
|
+
},
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
export const EDITOR_FIELDS = () => [
|
|
147
|
+
EDITOR_FIELD_TITLE(),
|
|
148
|
+
EDITOR_FIELD_ABSTRACT(),
|
|
149
|
+
EDITOR_FIELD_RESOURCE_UPDATED(),
|
|
150
|
+
EDITOR_FIELD_RECORD_UPDATED(),
|
|
151
|
+
EDITOR_FIELD_UPDATE_FREQUENCY(),
|
|
152
|
+
EDITOR_FIELD_TEMPORAL_EXTENTS(),
|
|
153
|
+
EDITOR_FIELD_SPATIAL_EXTENTS(),
|
|
154
|
+
EDITOR_FIELD_KEYWORDS(),
|
|
155
|
+
EDITOR_FIELD_UNIQUE_IDENTIFIER(),
|
|
156
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './editor.fixtures'
|
|
@@ -7201,11 +7201,7 @@ export class RecordsApiService {
|
|
|
7201
7201
|
}
|
|
7202
7202
|
|
|
7203
7203
|
// to determine the Content-Type header
|
|
7204
|
-
const consumes: string[] = [
|
|
7205
|
-
'application/xml',
|
|
7206
|
-
'application/json',
|
|
7207
|
-
'application/x-www-form-urlencoded',
|
|
7208
|
-
]
|
|
7204
|
+
const consumes: string[] = ['application/xml']
|
|
7209
7205
|
const httpContentTypeSelected: string | undefined =
|
|
7210
7206
|
this.configuration.selectHeaderContentType(consumes)
|
|
7211
7207
|
if (httpContentTypeSelected !== undefined) {
|
|
@@ -1832,14 +1832,6 @@ paths:
|
|
|
1832
1832
|
schema:
|
|
1833
1833
|
type: string
|
|
1834
1834
|
description: XML fragment.
|
|
1835
|
-
application/json:
|
|
1836
|
-
schema:
|
|
1837
|
-
type: string
|
|
1838
|
-
description: XML fragment.
|
|
1839
|
-
application/x-www-form-urlencoded:
|
|
1840
|
-
schema:
|
|
1841
|
-
type: string
|
|
1842
|
-
description: XML fragment.
|
|
1843
1835
|
responses:
|
|
1844
1836
|
default:
|
|
1845
1837
|
description: default response
|
|
@@ -6,9 +6,9 @@ import * as EditorActions from './editor.actions'
|
|
|
6
6
|
import { EditorService } from '../services/editor.service'
|
|
7
7
|
import { Store } from '@ngrx/store'
|
|
8
8
|
import {
|
|
9
|
+
selectEditorConfig,
|
|
9
10
|
selectRecord,
|
|
10
11
|
selectRecordAlreadySavedOnce,
|
|
11
|
-
selectRecordFieldsConfig,
|
|
12
12
|
} from './editor.selectors'
|
|
13
13
|
import { RecordsRepositoryInterface } from '../../../../../../libs/common/domain/src/lib/repository/records-repository.interface'
|
|
14
14
|
|
|
@@ -24,7 +24,7 @@ export class EditorEffects {
|
|
|
24
24
|
ofType(EditorActions.saveRecord),
|
|
25
25
|
withLatestFrom(
|
|
26
26
|
this.store.select(selectRecord),
|
|
27
|
-
this.store.select(
|
|
27
|
+
this.store.select(selectEditorConfig),
|
|
28
28
|
this.store.select(selectRecordAlreadySavedOnce)
|
|
29
29
|
),
|
|
30
30
|
switchMap(([, record, fieldsConfig, alreadySavedOnce]) =>
|
|
@@ -25,8 +25,12 @@ export class EditorFacade {
|
|
|
25
25
|
changedSinceSave$ = this.store.pipe(
|
|
26
26
|
select(EditorSelectors.selectRecordChangedSinceSave)
|
|
27
27
|
)
|
|
28
|
-
|
|
28
|
+
currentSections$ = this.store.pipe(
|
|
29
|
+
select(EditorSelectors.selectRecordSections)
|
|
30
|
+
)
|
|
29
31
|
draftSaveSuccess$ = this.actions$.pipe(ofType(EditorActions.draftSaveSuccess))
|
|
32
|
+
currentPage$ = this.store.pipe(select(EditorSelectors.selectCurrentPage))
|
|
33
|
+
editorConfig$ = this.store.pipe(select(EditorSelectors.selectEditorConfig))
|
|
30
34
|
|
|
31
35
|
openRecord(
|
|
32
36
|
record: CatalogRecord,
|
|
@@ -45,4 +49,8 @@ export class EditorFacade {
|
|
|
45
49
|
updateRecordField(field: string, value: unknown) {
|
|
46
50
|
this.store.dispatch(EditorActions.updateRecordField({ field, value }))
|
|
47
51
|
}
|
|
52
|
+
|
|
53
|
+
setCurrentPage(page: number) {
|
|
54
|
+
this.store.dispatch(EditorActions.setCurrentPage({ page }))
|
|
55
|
+
}
|
|
48
56
|
}
|
|
@@ -1 +1,12 @@
|
|
|
1
|
+
import { EditorField, EditorFieldValue, EditorSection } from '../models'
|
|
2
|
+
|
|
1
3
|
export type SaveRecordError = string
|
|
4
|
+
|
|
5
|
+
export interface EditorFieldWithValue {
|
|
6
|
+
config: EditorField
|
|
7
|
+
value: EditorFieldValue
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type EditorSectionWithValues = EditorSection & {
|
|
11
|
+
fieldsWithValues: EditorFieldWithValue[]
|
|
12
|
+
}
|
|
@@ -2,8 +2,8 @@ import { Action, createReducer, on } from '@ngrx/store'
|
|
|
2
2
|
import * as EditorActions from './editor.actions'
|
|
3
3
|
import { CatalogRecord } from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
4
4
|
import { SaveRecordError } from './editor.models'
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { EditorConfig } from '../models'
|
|
6
|
+
import { DEFAULT_CONFIGURATION } from '../fields.config'
|
|
7
7
|
|
|
8
8
|
export const EDITOR_FEATURE_KEY = 'editor'
|
|
9
9
|
|
|
@@ -13,7 +13,7 @@ export const EDITOR_FEATURE_KEY = 'editor'
|
|
|
13
13
|
* @property saving
|
|
14
14
|
* @property saveError
|
|
15
15
|
* @property changedSinceSave
|
|
16
|
-
* @property
|
|
16
|
+
* @property editorConfig Configuration for the fields in the editor
|
|
17
17
|
*/
|
|
18
18
|
export interface EditorState {
|
|
19
19
|
record: CatalogRecord | null
|
|
@@ -22,7 +22,8 @@ export interface EditorState {
|
|
|
22
22
|
saving: boolean
|
|
23
23
|
saveError: SaveRecordError | null
|
|
24
24
|
changedSinceSave: boolean
|
|
25
|
-
|
|
25
|
+
editorConfig: EditorConfig
|
|
26
|
+
currentPage: number
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
export interface EditorPartialState {
|
|
@@ -36,7 +37,8 @@ export const initialEditorState: EditorState = {
|
|
|
36
37
|
saving: false,
|
|
37
38
|
saveError: null,
|
|
38
39
|
changedSinceSave: false,
|
|
39
|
-
|
|
40
|
+
editorConfig: DEFAULT_CONFIGURATION,
|
|
41
|
+
currentPage: 0,
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
const reducer = createReducer(
|
|
@@ -77,6 +79,10 @@ const reducer = createReducer(
|
|
|
77
79
|
on(EditorActions.markRecordAsChanged, (state) => ({
|
|
78
80
|
...state,
|
|
79
81
|
changedSinceSave: true,
|
|
82
|
+
})),
|
|
83
|
+
on(EditorActions.setCurrentPage, (state, { page }) => ({
|
|
84
|
+
...state,
|
|
85
|
+
currentPage: page,
|
|
80
86
|
}))
|
|
81
87
|
)
|
|
82
88
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createFeatureSelector, createSelector } from '@ngrx/store'
|
|
2
2
|
import { EDITOR_FEATURE_KEY, EditorState } from './editor.reducer'
|
|
3
|
+
import { EditorSectionWithValues } from './editor.models'
|
|
3
4
|
|
|
4
5
|
export const selectEditorState =
|
|
5
6
|
createFeatureSelector<EditorState>(EDITOR_FEATURE_KEY)
|
|
@@ -34,16 +35,29 @@ export const selectRecordAlreadySavedOnce = createSelector(
|
|
|
34
35
|
(state: EditorState) => state.alreadySavedOnce
|
|
35
36
|
)
|
|
36
37
|
|
|
37
|
-
export const
|
|
38
|
+
export const selectEditorConfig = createSelector(
|
|
38
39
|
selectEditorState,
|
|
39
|
-
(state: EditorState) => state.
|
|
40
|
+
(state: EditorState) => state.editorConfig
|
|
40
41
|
)
|
|
41
42
|
|
|
42
|
-
export const
|
|
43
|
+
export const selectCurrentPage = createSelector(
|
|
43
44
|
selectEditorState,
|
|
44
|
-
(state: EditorState) =>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
(state: EditorState) => state.currentPage
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
export const selectRecordSections = createSelector(
|
|
49
|
+
selectEditorState,
|
|
50
|
+
(state: EditorState) => {
|
|
51
|
+
const currentPage = state.editorConfig.pages[state.currentPage]
|
|
52
|
+
if (!currentPage) {
|
|
53
|
+
return [] as EditorSectionWithValues[]
|
|
54
|
+
}
|
|
55
|
+
return currentPage.sections.map((section) => ({
|
|
56
|
+
...section,
|
|
57
|
+
fieldsWithValues: section.fields.map((fieldConfig) => ({
|
|
58
|
+
config: fieldConfig,
|
|
59
|
+
value: state.record?.[fieldConfig.model] ?? null,
|
|
60
|
+
})),
|
|
61
|
+
})) as EditorSectionWithValues[]
|
|
62
|
+
}
|
|
49
63
|
)
|
package/src/libs/feature/editor/src/lib/components/overview-upload/overview-upload.component.html
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<gn-ui-image-input
|
|
2
2
|
[maxSizeMB]="5"
|
|
3
3
|
[previewUrl]="resourceUrl"
|
|
4
|
-
[altText]="
|
|
4
|
+
[altText]="resourceAltText"
|
|
5
5
|
(fileChange)="handleFileChange($event)"
|
|
6
6
|
(urlChange)="handleUrlChange($event)"
|
|
7
|
+
(altTextChange)="handleAltTextChange($event)"
|
|
7
8
|
(delete)="handleDelete()"
|
|
8
9
|
></gn-ui-image-input>
|