geonetwork-ui 2.4.0-dev.5cc37149 → 2.4.0-dev.613f7319
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/index.mjs +2 -1
- package/esm2022/libs/api/repository/src/lib/gn4/gn4-repository.mjs +12 -1
- package/esm2022/libs/common/domain/src/lib/repository/records-repository.interface.mjs +1 -1
- 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/record-form/form-field/form-field.component.mjs +3 -3
- 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 +143 -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/search/src/lib/results-table/results-table-container.component.mjs +9 -3
- package/esm2022/libs/ui/elements/src/lib/user-preview/user-preview.component.mjs +3 -3
- package/esm2022/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.mjs +29 -0
- package/esm2022/libs/ui/search/src/lib/results-table/results-table.component.mjs +15 -7
- package/esm2022/translations/de.json +30 -0
- package/esm2022/translations/en.json +30 -0
- package/esm2022/translations/es.json +30 -0
- package/esm2022/translations/fr.json +30 -0
- package/esm2022/translations/it.json +30 -0
- package/esm2022/translations/nl.json +30 -0
- package/esm2022/translations/pt.json +30 -0
- package/fesm2022/geonetwork-ui.mjs +451 -89
- package/fesm2022/geonetwork-ui.mjs.map +1 -1
- package/libs/api/metadata-converter/src/index.d.ts +1 -0
- package/libs/api/metadata-converter/src/index.d.ts.map +1 -1
- package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts +1 -0
- package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts.map +1 -1
- package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts +9 -0
- package/libs/common/domain/src/lib/repository/records-repository.interface.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/record-form/form-field/form-field.component.d.ts +1 -1
- 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 +38 -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/search/src/lib/results-table/results-table-container.component.d.ts +3 -1
- package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts.map +1 -1
- package/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.d.ts +11 -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 +4 -2
- package/libs/ui/search/src/lib/results-table/results-table.component.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/libs/api/metadata-converter/src/index.ts +1 -0
- package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +20 -0
- package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +12 -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/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/record-form/form-field/form-field.component.html +9 -9
- package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +2 -1
- 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 +175 -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/search/src/lib/results-table/results-table-container.component.html +1 -0
- package/src/libs/feature/search/src/lib/results-table/results-table-container.component.ts +5 -0
- package/src/libs/ui/elements/src/lib/user-preview/user-preview.component.html +1 -1
- 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 +17 -0
- package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.ts +22 -0
- package/src/libs/ui/search/src/lib/results-table/results-table.component.html +9 -0
- package/src/libs/ui/search/src/lib/results-table/results-table.component.ts +26 -12
- package/translations/de.json +30 -0
- package/translations/en.json +30 -0
- package/translations/es.json +30 -0
- package/translations/fr.json +30 -0
- package/translations/it.json +30 -0
- package/translations/nl.json +30 -0
- package/translations/pt.json +30 -0
- package/translations/sk.json +30 -0
- 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
|
@@ -1,71 +1,185 @@
|
|
|
1
1
|
import { marker } from '@biesbjerg/ngx-translate-extract-marker'
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
import {
|
|
3
|
+
EditorConfig,
|
|
4
|
+
EditorField,
|
|
5
|
+
EditorSection,
|
|
6
|
+
} from './models/editor-config.model'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* This file contains the configuration of the fields that will be displayed in the editor.
|
|
10
|
+
* To add a new field, you need to create a new EditorField object in the fields part of this file.
|
|
11
|
+
* Then add it to the corresponding section in the sections part of this file.
|
|
12
|
+
* Finally, add the section to the corresponding page in the pages part of this file.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/************************************************************
|
|
16
|
+
*************** FIELDS *****************
|
|
17
|
+
************************************************************
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
export const RECORD_LICENSE_FIELD: EditorField = {
|
|
21
|
+
model: 'licenses',
|
|
22
|
+
formFieldConfig: {
|
|
23
|
+
labelKey: marker('editor.record.form.field.license'),
|
|
11
24
|
},
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const RECORD_KEYWORDS_FIELD: EditorField = {
|
|
28
|
+
model: 'keywords',
|
|
29
|
+
formFieldConfig: {
|
|
30
|
+
labelKey: marker('editor.record.form.field.keywords'),
|
|
18
31
|
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const RECORD_UNIQUE_IDENTIFIER_FIELD: EditorField = {
|
|
35
|
+
model: 'uniqueIdentifier',
|
|
36
|
+
formFieldConfig: {
|
|
37
|
+
labelKey: marker('editor.record.form.field.uniqueIdentifier'),
|
|
38
|
+
locked: true,
|
|
26
39
|
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
onSaveProcess: '${dateNow()}',
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const RECORD_RESOURCE_UPDATED_FIELD: EditorField = {
|
|
43
|
+
model: 'resourceUpdated',
|
|
44
|
+
formFieldConfig: {
|
|
45
|
+
labelKey: marker('editor.record.form.field.resourceUpdated'),
|
|
35
46
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const RECORD_UPDATED_FIELD: EditorField = {
|
|
50
|
+
model: 'recordUpdated',
|
|
51
|
+
formFieldConfig: {
|
|
52
|
+
labelKey: marker('editor.record.form.field.recordUpdated'),
|
|
53
|
+
locked: true,
|
|
42
54
|
},
|
|
43
|
-
{
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
55
|
+
onSaveProcess: '${dateNow()}',
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export const RECORD_UPDATE_FREQUENCY_FIELD: EditorField = {
|
|
59
|
+
model: 'updateFrequency',
|
|
60
|
+
formFieldConfig: {
|
|
61
|
+
labelKey: marker('editor.record.form.field.updateFrequency'),
|
|
49
62
|
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export const RECORD_TEMPORAL_EXTENTS_FIELD: EditorField = {
|
|
66
|
+
model: 'temporalExtents',
|
|
67
|
+
formFieldConfig: {
|
|
68
|
+
labelKey: marker('editor.record.form.field.temporalExtents'),
|
|
56
69
|
},
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export const RECORD_TITLE_FIELD: EditorField = {
|
|
73
|
+
model: 'title',
|
|
74
|
+
formFieldConfig: {
|
|
75
|
+
labelKey: marker('editor.record.form.field.title'),
|
|
63
76
|
},
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export const RECORD_ABSTRACT_FIELD: EditorField = {
|
|
80
|
+
model: 'abstract',
|
|
81
|
+
formFieldConfig: {
|
|
82
|
+
labelKey: marker('editor.record.form.field.abstract'),
|
|
70
83
|
},
|
|
71
|
-
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/************************************************************
|
|
87
|
+
*************** SECTIONS *****************
|
|
88
|
+
************************************************************
|
|
89
|
+
*/
|
|
90
|
+
|
|
91
|
+
export const TITLE_SECTION: EditorSection = {
|
|
92
|
+
hidden: false,
|
|
93
|
+
fields: [RECORD_TITLE_FIELD, RECORD_ABSTRACT_FIELD],
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export const ABOUT_SECTION: EditorSection = {
|
|
97
|
+
labelKey: marker('editor.record.form.section.about.label'),
|
|
98
|
+
descriptionKey: marker('editor.record.form.section.about.description'),
|
|
99
|
+
hidden: false,
|
|
100
|
+
fields: [
|
|
101
|
+
RECORD_UNIQUE_IDENTIFIER_FIELD,
|
|
102
|
+
RECORD_RESOURCE_UPDATED_FIELD,
|
|
103
|
+
RECORD_UPDATED_FIELD,
|
|
104
|
+
RECORD_UPDATE_FREQUENCY_FIELD,
|
|
105
|
+
RECORD_TEMPORAL_EXTENTS_FIELD,
|
|
106
|
+
],
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export const GEOGRAPHICAL_COVERAGE_SECTION: EditorSection = {
|
|
110
|
+
labelKey: marker('editor.record.form.section.geographicalCoverage.label'),
|
|
111
|
+
hidden: false,
|
|
112
|
+
fields: [],
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export const ASSOCIATED_RESOURCES_SECTION: EditorSection = {
|
|
116
|
+
labelKey: marker('editor.record.form.section.associatedResources.label'),
|
|
117
|
+
descriptionKey: marker(
|
|
118
|
+
'editor.record.form.section.associatedResources.description'
|
|
119
|
+
),
|
|
120
|
+
hidden: false,
|
|
121
|
+
fields: [],
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export const ANNEXES_SECTION: EditorSection = {
|
|
125
|
+
labelKey: marker('editor.record.form.section.annexes.label'),
|
|
126
|
+
hidden: false,
|
|
127
|
+
fields: [],
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export const CLASSIFICATION_SECTION: EditorSection = {
|
|
131
|
+
labelKey: marker('editor.record.form.section.classification.label'),
|
|
132
|
+
descriptionKey: marker(
|
|
133
|
+
'editor.record.form.section.classification.description'
|
|
134
|
+
),
|
|
135
|
+
hidden: false,
|
|
136
|
+
fields: [RECORD_KEYWORDS_FIELD],
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export const USE_AND_ACCESS_CONDITIONS_SECTION: EditorSection = {
|
|
140
|
+
labelKey: marker('editor.record.form.section.useAndAccessConditions.label'),
|
|
141
|
+
hidden: false,
|
|
142
|
+
fields: [RECORD_LICENSE_FIELD],
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export const DATA_MANAGERS_SECTION: EditorSection = {
|
|
146
|
+
labelKey: marker('editor.record.form.section.dataManagers.label'),
|
|
147
|
+
descriptionKey: marker('editor.record.form.section.dataManagers.description'),
|
|
148
|
+
hidden: false,
|
|
149
|
+
fields: [],
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export const DATA_POINT_OF_CONTACT_SECTION: EditorSection = {
|
|
153
|
+
labelKey: marker('editor.record.form.section.dataPointOfContact.label'),
|
|
154
|
+
descriptionKey: marker(
|
|
155
|
+
'editor.record.form.section.dataPointOfContact.description'
|
|
156
|
+
),
|
|
157
|
+
hidden: false,
|
|
158
|
+
fields: [],
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/************************************************************
|
|
162
|
+
*************** PAGES *****************
|
|
163
|
+
************************************************************
|
|
164
|
+
*/
|
|
165
|
+
export const DEFAULT_CONFIGURATION: EditorConfig = {
|
|
166
|
+
pages: [
|
|
167
|
+
{
|
|
168
|
+
labelKey: marker('editor.record.form.page.description'),
|
|
169
|
+
sections: [TITLE_SECTION, ABOUT_SECTION, GEOGRAPHICAL_COVERAGE_SECTION],
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
labelKey: marker('editor.record.form.page.ressources'),
|
|
173
|
+
sections: [ASSOCIATED_RESOURCES_SECTION, ANNEXES_SECTION],
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
labelKey: marker('editor.record.form.page.accessAndContact'),
|
|
177
|
+
sections: [
|
|
178
|
+
CLASSIFICATION_SECTION,
|
|
179
|
+
USE_AND_ACCESS_CONDITIONS_SECTION,
|
|
180
|
+
DATA_MANAGERS_SECTION,
|
|
181
|
+
DATA_POINT_OF_CONTACT_SECTION,
|
|
182
|
+
],
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { CatalogRecordKeys } from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
2
|
+
|
|
3
|
+
// Expressions should be enclosed in `${}` to be recognized as such
|
|
4
|
+
// eg. ${dateNow()}
|
|
5
|
+
export type EditorFieldExpression = `$\{${string}}`
|
|
6
|
+
|
|
7
|
+
export type EditorFieldValue = string | number | boolean | unknown
|
|
8
|
+
|
|
9
|
+
export interface FormFieldConfig {
|
|
10
|
+
labelKey?: string
|
|
11
|
+
hintKey?: string
|
|
12
|
+
tooltipKey?: string
|
|
13
|
+
required?: boolean
|
|
14
|
+
locked?: boolean
|
|
15
|
+
invalid?: boolean
|
|
16
|
+
invalidHintKey?: string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface EditorField {
|
|
20
|
+
// configuration of the form field used as presentation
|
|
21
|
+
formFieldConfig: FormFieldConfig
|
|
22
|
+
|
|
23
|
+
// name of the target field in the record; will not change the record directly if not defined
|
|
24
|
+
model?: CatalogRecordKeys
|
|
25
|
+
|
|
26
|
+
// a hidden field won't show but can still be used to modify the record
|
|
27
|
+
// FIXME: currently this is redundant with an absence of formFieldConfig but necessary for clarity
|
|
28
|
+
hidden?: boolean
|
|
29
|
+
|
|
30
|
+
// the result of this expression will replace the field value on save
|
|
31
|
+
onSaveProcess?: EditorFieldExpression
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface EditorSection {
|
|
35
|
+
labelKey?: string
|
|
36
|
+
descriptionKey?: string
|
|
37
|
+
hidden: boolean
|
|
38
|
+
fields: EditorField[]
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface EditorFieldPage {
|
|
42
|
+
labelKey?: string
|
|
43
|
+
sections: EditorSection[]
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface EditorConfig {
|
|
47
|
+
pages: EditorFieldPage[]
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface EditorFieldState {
|
|
51
|
+
model: string
|
|
52
|
+
value: EditorFieldValue
|
|
53
|
+
}
|
|
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'
|
|
|
2
2
|
import { Observable, switchMap } from 'rxjs'
|
|
3
3
|
import { map, tap } from 'rxjs/operators'
|
|
4
4
|
import { CatalogRecord } from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
5
|
-
import {
|
|
5
|
+
import { EditorConfig } from '../models/'
|
|
6
6
|
import { evaluate } from '../expressions'
|
|
7
7
|
import { RecordsRepositoryInterface } from '../../../../../../libs/common/domain/src/lib/repository/records-repository.interface'
|
|
8
8
|
|
|
@@ -15,17 +15,21 @@ export class EditorService {
|
|
|
15
15
|
// returns the record as it was when saved, alongside its source
|
|
16
16
|
saveRecord(
|
|
17
17
|
record: CatalogRecord,
|
|
18
|
-
fieldsConfig:
|
|
18
|
+
fieldsConfig: EditorConfig,
|
|
19
19
|
generateNewUniqueIdentifier = false
|
|
20
20
|
): Observable<[CatalogRecord, string]> {
|
|
21
21
|
const savedRecord = { ...record }
|
|
22
22
|
|
|
23
|
+
const fields = fieldsConfig.pages.flatMap((page) =>
|
|
24
|
+
page.sections.flatMap((section) => section.fields)
|
|
25
|
+
)
|
|
26
|
+
|
|
23
27
|
// run onSave processes
|
|
24
|
-
for (const field of
|
|
28
|
+
for (const field of fields) {
|
|
25
29
|
if (field.onSaveProcess && field.model) {
|
|
26
30
|
const evaluator = evaluate(field.onSaveProcess)
|
|
27
31
|
savedRecord[field.model] = evaluator({
|
|
28
|
-
|
|
32
|
+
model: field.model,
|
|
29
33
|
value: record[field.model],
|
|
30
34
|
})
|
|
31
35
|
}
|
package/src/libs/feature/search/src/lib/results-table/results-table-container.component.html
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
[selectedRecordsIdentifiers]="selectedRecords$ | async"
|
|
5
5
|
[sortOrder]="sortBy$ | async"
|
|
6
6
|
(recordClick)="handleRecordClick($event)"
|
|
7
|
+
(duplicateRecord)="handleDuplicateRecord($event)"
|
|
7
8
|
(recordsSelectedChange)="handleRecordsSelectedChange($event[0], $event[1])"
|
|
8
9
|
(sortByChange)="handleSortByChange($event[0], $event[1])"
|
|
9
10
|
></gn-ui-results-table>
|
|
@@ -16,6 +16,7 @@ import { CommonModule } from '@angular/common'
|
|
|
16
16
|
})
|
|
17
17
|
export class ResultsTableContainerComponent {
|
|
18
18
|
@Output() recordClick = new EventEmitter<CatalogRecord>()
|
|
19
|
+
@Output() duplicateRecord = new EventEmitter<CatalogRecord>()
|
|
19
20
|
|
|
20
21
|
records$ = this.searchFacade.results$
|
|
21
22
|
selectedRecords$ = this.selectionService.selectedRecordsIdentifiers$
|
|
@@ -35,6 +36,10 @@ export class ResultsTableContainerComponent {
|
|
|
35
36
|
this.recordClick.emit(item as CatalogRecord)
|
|
36
37
|
}
|
|
37
38
|
|
|
39
|
+
handleDuplicateRecord(item: unknown) {
|
|
40
|
+
this.duplicateRecord.emit(item as CatalogRecord)
|
|
41
|
+
}
|
|
42
|
+
|
|
38
43
|
handleSortByChange(col: string, order: 'asc' | 'desc') {
|
|
39
44
|
this.searchService.setSortBy([order, col])
|
|
40
45
|
}
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<gn-ui-button
|
|
2
|
+
type="outline"
|
|
3
|
+
[matMenuTriggerFor]="menu"
|
|
4
|
+
(buttonClick)="openMenu()"
|
|
5
|
+
data-test="record-menu-button"
|
|
6
|
+
>
|
|
7
|
+
<mat-icon class="material-symbols-outlined">more_vert</mat-icon>
|
|
8
|
+
</gn-ui-button>
|
|
9
|
+
<mat-menu #menu="matMenu">
|
|
10
|
+
<button
|
|
11
|
+
mat-menu-item
|
|
12
|
+
(click)="duplicate.emit()"
|
|
13
|
+
data-test="record-menu-duplicate-button"
|
|
14
|
+
>
|
|
15
|
+
<span translate>record.action.duplicate</span>
|
|
16
|
+
</button>
|
|
17
|
+
</mat-menu>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Component, EventEmitter, Output, ViewChild } from '@angular/core'
|
|
2
|
+
import { MatIconModule } from '@angular/material/icon'
|
|
3
|
+
import { MatMenuModule, MatMenuTrigger } from '@angular/material/menu'
|
|
4
|
+
import { ButtonComponent } from '../../../../../../../libs/ui/inputs/src'
|
|
5
|
+
import { TranslateModule } from '@ngx-translate/core'
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
selector: 'gn-ui-action-menu',
|
|
9
|
+
templateUrl: './action-menu.component.html',
|
|
10
|
+
styleUrls: ['./action-menu.component.css'],
|
|
11
|
+
standalone: true,
|
|
12
|
+
imports: [MatIconModule, ButtonComponent, MatMenuModule, TranslateModule],
|
|
13
|
+
})
|
|
14
|
+
export class ActionMenuComponent {
|
|
15
|
+
@Output() duplicate = new EventEmitter<void>()
|
|
16
|
+
|
|
17
|
+
@ViewChild(MatMenuTrigger) trigger: MatMenuTrigger
|
|
18
|
+
|
|
19
|
+
openMenu() {
|
|
20
|
+
this.trigger.openMenu()
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -120,4 +120,13 @@
|
|
|
120
120
|
{{ dateToString(item.recordUpdated) }}
|
|
121
121
|
</ng-template>
|
|
122
122
|
</gn-ui-interactive-table-column>
|
|
123
|
+
|
|
124
|
+
<!-- ACTION MENU COLUMN -->
|
|
125
|
+
<gn-ui-interactive-table-column>
|
|
126
|
+
<ng-template #header> </ng-template>
|
|
127
|
+
<ng-template #cell let-item>
|
|
128
|
+
<gn-ui-action-menu (duplicate)="handleDuplicate(item)">
|
|
129
|
+
</gn-ui-action-menu>
|
|
130
|
+
</ng-template>
|
|
131
|
+
</gn-ui-interactive-table-column>
|
|
123
132
|
</gn-ui-interactive-table>
|
|
@@ -1,23 +1,31 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CommonModule } from '@angular/common'
|
|
2
|
+
import {
|
|
3
|
+
Component,
|
|
4
|
+
EventEmitter,
|
|
5
|
+
Input,
|
|
6
|
+
Output,
|
|
7
|
+
ViewChild,
|
|
8
|
+
} from '@angular/core'
|
|
9
|
+
import { MatIconModule } from '@angular/material/icon'
|
|
10
|
+
import { MatMenuModule, MatMenuTrigger } from '@angular/material/menu'
|
|
2
11
|
import { CatalogRecord } from '../../../../../../libs/common/domain/src/lib/model/record'
|
|
3
12
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
getFormatPriority,
|
|
8
|
-
} from '../../../../../../libs/util/shared/src'
|
|
13
|
+
FieldSort,
|
|
14
|
+
SortByField,
|
|
15
|
+
} from '../../../../../../libs/common/domain/src/lib/model/search'
|
|
9
16
|
import { BadgeComponent, UiInputsModule } from '../../../../../../libs/ui/inputs/src'
|
|
10
17
|
import {
|
|
11
18
|
InteractiveTableColumnComponent,
|
|
12
19
|
InteractiveTableComponent,
|
|
13
20
|
} from '../../../../../../libs/ui/layout/src'
|
|
14
|
-
import { MatIconModule } from '@angular/material/icon'
|
|
15
|
-
import { TranslateModule } from '@ngx-translate/core'
|
|
16
|
-
import { CommonModule } from '@angular/common'
|
|
17
21
|
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
FileFormat,
|
|
23
|
+
getBadgeColor,
|
|
24
|
+
getFileFormat,
|
|
25
|
+
getFormatPriority,
|
|
26
|
+
} from '../../../../../../libs/util/shared/src'
|
|
27
|
+
import { TranslateModule } from '@ngx-translate/core'
|
|
28
|
+
import { ActionMenuComponent } from './action-menu/action-menu.component'
|
|
21
29
|
|
|
22
30
|
@Component({
|
|
23
31
|
selector: 'gn-ui-results-table',
|
|
@@ -32,6 +40,7 @@ import {
|
|
|
32
40
|
MatIconModule,
|
|
33
41
|
TranslateModule,
|
|
34
42
|
BadgeComponent,
|
|
43
|
+
ActionMenuComponent,
|
|
35
44
|
],
|
|
36
45
|
})
|
|
37
46
|
export class ResultsTableComponent {
|
|
@@ -43,6 +52,7 @@ export class ResultsTableComponent {
|
|
|
43
52
|
// emits the column (field) as well as the order
|
|
44
53
|
@Output() sortByChange = new EventEmitter<[string, 'asc' | 'desc']>()
|
|
45
54
|
@Output() recordClick = new EventEmitter<CatalogRecord>()
|
|
55
|
+
@Output() duplicateRecord = new EventEmitter<CatalogRecord>()
|
|
46
56
|
@Output() recordsSelectedChange = new EventEmitter<
|
|
47
57
|
[CatalogRecord[], boolean]
|
|
48
58
|
>()
|
|
@@ -89,6 +99,10 @@ export class ResultsTableComponent {
|
|
|
89
99
|
this.recordClick.emit(item as CatalogRecord)
|
|
90
100
|
}
|
|
91
101
|
|
|
102
|
+
handleDuplicate(item: unknown) {
|
|
103
|
+
this.duplicateRecord.emit(item as CatalogRecord)
|
|
104
|
+
}
|
|
105
|
+
|
|
92
106
|
setSortBy(col: string, order: 'asc' | 'desc') {
|
|
93
107
|
this.sortByChange.emit([col, order])
|
|
94
108
|
}
|
package/translations/de.json
CHANGED
|
@@ -165,6 +165,18 @@
|
|
|
165
165
|
"downloads.format.unknown": "unbekannt",
|
|
166
166
|
"downloads.wfs.featuretype.not.found": "Der Layer wurde nicht gefunden",
|
|
167
167
|
"dropFile": "Datei ablegen",
|
|
168
|
+
"editor.record.form.bottomButtons.comeBackLater": "",
|
|
169
|
+
"editor.record.form.bottomButtons.next": "",
|
|
170
|
+
"editor.record.form.bottomButtons.previous": "",
|
|
171
|
+
"editor.record.form.field.abstract": "",
|
|
172
|
+
"editor.record.form.field.keywords": "Schlagwörter",
|
|
173
|
+
"editor.record.form.field.license": "Lizenz",
|
|
174
|
+
"editor.record.form.field.recordUpdated": "",
|
|
175
|
+
"editor.record.form.field.resourceUpdated": "",
|
|
176
|
+
"editor.record.form.field.temporalExtents": "",
|
|
177
|
+
"editor.record.form.field.title": "",
|
|
178
|
+
"editor.record.form.field.uniqueIdentifier": "",
|
|
179
|
+
"editor.record.form.field.updateFrequency": "",
|
|
168
180
|
"editor.record.form.abstract": "Kurzbeschreibung",
|
|
169
181
|
"editor.record.form.keywords": "Schlüsselwörter",
|
|
170
182
|
"editor.record.form.license": "Lizenz",
|
|
@@ -177,6 +189,22 @@
|
|
|
177
189
|
"editor.record.form.license.odc-by": "Open Data Commons ODC-By",
|
|
178
190
|
"editor.record.form.license.pddl": "Open Data Commons PDDL",
|
|
179
191
|
"editor.record.form.license.unknown": "Unbekannt oder nicht vorhanden",
|
|
192
|
+
"editor.record.form.page.accessAndContact": "",
|
|
193
|
+
"editor.record.form.page.description": "",
|
|
194
|
+
"editor.record.form.page.ressources": "",
|
|
195
|
+
"editor.record.form.section.about.description": "",
|
|
196
|
+
"editor.record.form.section.about.label": "",
|
|
197
|
+
"editor.record.form.section.annexes.label": "",
|
|
198
|
+
"editor.record.form.section.associatedResources.description": "",
|
|
199
|
+
"editor.record.form.section.associatedResources.label": "",
|
|
200
|
+
"editor.record.form.section.classification.description": "",
|
|
201
|
+
"editor.record.form.section.classification.label": "",
|
|
202
|
+
"editor.record.form.section.dataManagers.description": "",
|
|
203
|
+
"editor.record.form.section.dataManagers.label": "",
|
|
204
|
+
"editor.record.form.section.dataPointOfContact.description": "",
|
|
205
|
+
"editor.record.form.section.dataPointOfContact.label": "",
|
|
206
|
+
"editor.record.form.section.geographicalCoverage.label": "",
|
|
207
|
+
"editor.record.form.section.useAndAccessConditions.label": "",
|
|
180
208
|
"editor.record.form.metadata.title": "Metadaten-Titel",
|
|
181
209
|
"editor.record.form.record.updated": "Datensatz zuletzt aktualisiert",
|
|
182
210
|
"editor.record.form.resourceUpdated": "Letztes Aktualisierungsdatum",
|
|
@@ -201,6 +229,7 @@
|
|
|
201
229
|
"editor.record.saveStatus.draftWithChangesPending": "Als Entwurf gespeichert - Änderungen stehen aus",
|
|
202
230
|
"editor.record.saveStatus.recordUpToDate": "Datensatz ist auf dem neuesten Stand",
|
|
203
231
|
"editor.record.upToDate": "Dieser Datensatz ist auf dem neuesten Stand",
|
|
232
|
+
"editor.sidebar.menu.editor": "",
|
|
204
233
|
"externalviewer.dataset.unnamed": "Datensatz aus dem Datahub",
|
|
205
234
|
"facets.block.title.OrgForResource": "Organisation",
|
|
206
235
|
"facets.block.title.availableInServices": "Verfügbar für",
|
|
@@ -278,6 +307,7 @@
|
|
|
278
307
|
"pagination.pageOf": "von",
|
|
279
308
|
"previous": "zurück",
|
|
280
309
|
"record.action.download": "Herunterladen",
|
|
310
|
+
"record.action.duplicate": "",
|
|
281
311
|
"record.action.view": "Anzeigen",
|
|
282
312
|
"record.externalViewer.open": "In externem Kartenviewer öffnen",
|
|
283
313
|
"record.metadata.about": "Beschreibung",
|
package/translations/en.json
CHANGED
|
@@ -165,6 +165,18 @@
|
|
|
165
165
|
"downloads.format.unknown": "unknown",
|
|
166
166
|
"downloads.wfs.featuretype.not.found": "The layer was not found",
|
|
167
167
|
"dropFile": "drop file",
|
|
168
|
+
"editor.record.form.bottomButtons.comeBackLater": "Come back later",
|
|
169
|
+
"editor.record.form.bottomButtons.next": "Next",
|
|
170
|
+
"editor.record.form.bottomButtons.previous": "Previous",
|
|
171
|
+
"editor.record.form.field.abstract": "Abstract",
|
|
172
|
+
"editor.record.form.field.keywords": "Keywords",
|
|
173
|
+
"editor.record.form.field.license": "License",
|
|
174
|
+
"editor.record.form.field.recordUpdated": "Record Updated",
|
|
175
|
+
"editor.record.form.field.resourceUpdated": "Resource Updated",
|
|
176
|
+
"editor.record.form.field.temporalExtents": "Temporal extents",
|
|
177
|
+
"editor.record.form.field.title": "Metadata title",
|
|
178
|
+
"editor.record.form.field.uniqueIdentifier": "Unique identifier",
|
|
179
|
+
"editor.record.form.field.updateFrequency": "Update frequency",
|
|
168
180
|
"editor.record.form.abstract": "Abstract",
|
|
169
181
|
"editor.record.form.keywords": "Keywords",
|
|
170
182
|
"editor.record.form.license": "License",
|
|
@@ -177,6 +189,22 @@
|
|
|
177
189
|
"editor.record.form.license.odc-by": "Open Data Commons ODC-By",
|
|
178
190
|
"editor.record.form.license.pddl": "Open Data Commons PDDL",
|
|
179
191
|
"editor.record.form.license.unknown": "Unknown or absent",
|
|
192
|
+
"editor.record.form.page.accessAndContact": "Access and contact",
|
|
193
|
+
"editor.record.form.page.description": "Resource description",
|
|
194
|
+
"editor.record.form.page.ressources": "Resources",
|
|
195
|
+
"editor.record.form.section.about.description": "This section describes the resource.",
|
|
196
|
+
"editor.record.form.section.about.label": "About the resource",
|
|
197
|
+
"editor.record.form.section.annexes.label": "Annexes",
|
|
198
|
+
"editor.record.form.section.associatedResources.description": "Drop files here to associate them with the resource.",
|
|
199
|
+
"editor.record.form.section.associatedResources.label": "Associated resources",
|
|
200
|
+
"editor.record.form.section.classification.description": "The classification has an impact on the access to the data.",
|
|
201
|
+
"editor.record.form.section.classification.label": "Classification",
|
|
202
|
+
"editor.record.form.section.dataManagers.description": "The data managers are responsible for the data.",
|
|
203
|
+
"editor.record.form.section.dataManagers.label": "Data managers",
|
|
204
|
+
"editor.record.form.section.dataPointOfContact.description": "This information concerns the metadata.",
|
|
205
|
+
"editor.record.form.section.dataPointOfContact.label": "Data point of contact",
|
|
206
|
+
"editor.record.form.section.geographicalCoverage.label": "Geographical coverage",
|
|
207
|
+
"editor.record.form.section.useAndAccessConditions.label": "Use and access conditions",
|
|
180
208
|
"editor.record.form.metadata.title": "Metadata title",
|
|
181
209
|
"editor.record.form.record.updated": "Record updated",
|
|
182
210
|
"editor.record.form.resourceUpdated": "Last update date",
|
|
@@ -201,6 +229,7 @@
|
|
|
201
229
|
"editor.record.saveStatus.draftWithChangesPending": "Saved as draft - changes are pending",
|
|
202
230
|
"editor.record.saveStatus.recordUpToDate": "Record is up to date",
|
|
203
231
|
"editor.record.upToDate": "This record is up to date",
|
|
232
|
+
"editor.sidebar.menu.editor": "Editor",
|
|
204
233
|
"externalviewer.dataset.unnamed": "Datahub layer",
|
|
205
234
|
"facets.block.title.OrgForResource": "Organisation",
|
|
206
235
|
"facets.block.title.availableInServices": "Available for",
|
|
@@ -278,6 +307,7 @@
|
|
|
278
307
|
"pagination.pageOf": "of",
|
|
279
308
|
"previous": "previous",
|
|
280
309
|
"record.action.download": "Download",
|
|
310
|
+
"record.action.duplicate": "Duplicate",
|
|
281
311
|
"record.action.view": "View",
|
|
282
312
|
"record.externalViewer.open": "Open in the external map viewer",
|
|
283
313
|
"record.metadata.about": "Description",
|