geonetwork-ui 2.4.0-dev.9121e5f4 → 2.4.0-dev.a1bcfe22

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.
Files changed (169) hide show
  1. package/esm2022/libs/api/metadata-converter/src/index.mjs +2 -1
  2. package/esm2022/libs/api/metadata-converter/src/lib/gn4/atomic-operations.mjs +2 -1
  3. package/esm2022/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.mjs +1 -1
  4. package/esm2022/libs/api/repository/src/lib/gn4/gn4-repository.mjs +12 -1
  5. package/esm2022/libs/common/domain/src/lib/repository/records-repository.interface.mjs +1 -1
  6. package/esm2022/libs/data-access/gn4/src/openapi/api/records.api.service.mjs +2 -6
  7. package/esm2022/libs/feature/editor/src/lib/+state/editor.actions.mjs +2 -1
  8. package/esm2022/libs/feature/editor/src/lib/+state/editor.effects.mjs +3 -3
  9. package/esm2022/libs/feature/editor/src/lib/+state/editor.facade.mjs +7 -2
  10. package/esm2022/libs/feature/editor/src/lib/+state/editor.models.mjs +1 -1
  11. package/esm2022/libs/feature/editor/src/lib/+state/editor.reducer.mjs +7 -3
  12. package/esm2022/libs/feature/editor/src/lib/+state/editor.selectors.mjs +16 -6
  13. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.mjs +3 -3
  14. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/index.mjs +1 -2
  15. package/esm2022/libs/feature/editor/src/lib/components/record-form/record-form.component.mjs +11 -7
  16. package/esm2022/libs/feature/editor/src/lib/expressions.mjs +1 -1
  17. package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +143 -60
  18. package/esm2022/libs/feature/editor/src/lib/models/editor-config.model.mjs +2 -0
  19. package/esm2022/libs/feature/editor/src/lib/models/index.mjs +2 -1
  20. package/esm2022/libs/feature/editor/src/lib/services/editor.service.mjs +4 -3
  21. package/esm2022/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.mjs +42 -23
  22. package/esm2022/libs/feature/record/src/lib/data-view-share/data-view-share.component.mjs +13 -5
  23. package/esm2022/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.mjs +49 -15
  24. package/esm2022/libs/feature/search/src/lib/results-table/results-table-container.component.mjs +9 -3
  25. package/esm2022/libs/feature/search/src/lib/utils/service/fields.service.mjs +7 -3
  26. package/esm2022/libs/ui/elements/src/lib/api-card/api-card.component.mjs +3 -3
  27. package/esm2022/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.mjs +5 -11
  28. package/esm2022/libs/ui/elements/src/lib/metadata-quality-item/metadata-quality-item.component.mjs +3 -3
  29. package/esm2022/libs/ui/elements/src/lib/ui-elements.module.mjs +5 -2
  30. package/esm2022/libs/ui/elements/src/lib/user-preview/user-preview.component.mjs +3 -3
  31. package/esm2022/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.mjs +29 -0
  32. package/esm2022/libs/ui/search/src/lib/results-table/results-table.component.mjs +15 -7
  33. package/esm2022/libs/ui/widgets/src/index.mjs +2 -1
  34. package/esm2022/libs/ui/widgets/src/lib/popover/popover.component.mjs +68 -0
  35. package/esm2022/translations/de.json +71 -32
  36. package/esm2022/translations/en.json +41 -5
  37. package/esm2022/translations/es.json +40 -1
  38. package/esm2022/translations/fr.json +42 -6
  39. package/esm2022/translations/it.json +40 -1
  40. package/esm2022/translations/nl.json +40 -1
  41. package/esm2022/translations/pt.json +40 -1
  42. package/fesm2022/geonetwork-ui.mjs +733 -192
  43. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  44. package/libs/api/metadata-converter/src/index.d.ts +1 -0
  45. package/libs/api/metadata-converter/src/index.d.ts.map +1 -1
  46. package/libs/api/metadata-converter/src/lib/gn4/atomic-operations.d.ts.map +1 -1
  47. package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts +1 -0
  48. package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts.map +1 -1
  49. package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts +1 -0
  50. package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts.map +1 -1
  51. package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts +9 -0
  52. package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts.map +1 -1
  53. package/libs/data-access/gn4/src/openapi/api/records.api.service.d.ts.map +1 -1
  54. package/libs/feature/editor/src/lib/+state/editor.actions.d.ts +5 -0
  55. package/libs/feature/editor/src/lib/+state/editor.actions.d.ts.map +1 -1
  56. package/libs/feature/editor/src/lib/+state/editor.facade.d.ts +4 -4
  57. package/libs/feature/editor/src/lib/+state/editor.facade.d.ts.map +1 -1
  58. package/libs/feature/editor/src/lib/+state/editor.models.d.ts +8 -0
  59. package/libs/feature/editor/src/lib/+state/editor.models.d.ts.map +1 -1
  60. package/libs/feature/editor/src/lib/+state/editor.reducer.d.ts +4 -3
  61. package/libs/feature/editor/src/lib/+state/editor.reducer.d.ts.map +1 -1
  62. package/libs/feature/editor/src/lib/+state/editor.selectors.d.ts +4 -8
  63. package/libs/feature/editor/src/lib/+state/editor.selectors.d.ts.map +1 -1
  64. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts +1 -1
  65. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts.map +1 -1
  66. package/libs/feature/editor/src/lib/components/record-form/form-field/index.d.ts +0 -1
  67. package/libs/feature/editor/src/lib/components/record-form/form-field/index.d.ts.map +1 -1
  68. package/libs/feature/editor/src/lib/components/record-form/record-form.component.d.ts +5 -7
  69. package/libs/feature/editor/src/lib/components/record-form/record-form.component.d.ts.map +1 -1
  70. package/libs/feature/editor/src/lib/expressions.d.ts +1 -1
  71. package/libs/feature/editor/src/lib/expressions.d.ts.map +1 -1
  72. package/libs/feature/editor/src/lib/fields.config.d.ts +38 -2
  73. package/libs/feature/editor/src/lib/fields.config.d.ts.map +1 -1
  74. package/libs/feature/editor/src/lib/models/editor-config.model.d.ts +36 -0
  75. package/libs/feature/editor/src/lib/models/editor-config.model.d.ts.map +1 -0
  76. package/libs/feature/editor/src/lib/models/index.d.ts +1 -0
  77. package/libs/feature/editor/src/lib/models/index.d.ts.map +1 -1
  78. package/libs/feature/editor/src/lib/services/editor.service.d.ts +2 -2
  79. package/libs/feature/editor/src/lib/services/editor.service.d.ts.map +1 -1
  80. package/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.d.ts +4 -1
  81. package/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.d.ts.map +1 -1
  82. package/libs/feature/record/src/lib/data-view-share/data-view-share.component.d.ts +4 -1
  83. package/libs/feature/record/src/lib/data-view-share/data-view-share.component.d.ts.map +1 -1
  84. package/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.d.ts +4 -1
  85. package/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.d.ts.map +1 -1
  86. package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts +3 -1
  87. package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts.map +1 -1
  88. package/libs/feature/search/src/lib/utils/service/fields.service.d.ts.map +1 -1
  89. package/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.d.ts +0 -3
  90. package/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.d.ts.map +1 -1
  91. package/libs/ui/elements/src/lib/ui-elements.module.d.ts +7 -6
  92. package/libs/ui/elements/src/lib/ui-elements.module.d.ts.map +1 -1
  93. package/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.d.ts +11 -0
  94. package/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.d.ts.map +1 -0
  95. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts +4 -2
  96. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts.map +1 -1
  97. package/libs/ui/widgets/src/index.d.ts +1 -0
  98. package/libs/ui/widgets/src/index.d.ts.map +1 -1
  99. package/libs/ui/widgets/src/lib/popover/popover.component.d.ts +19 -0
  100. package/libs/ui/widgets/src/lib/popover/popover.component.d.ts.map +1 -0
  101. package/package.json +1 -1
  102. package/src/libs/api/metadata-converter/src/index.ts +1 -0
  103. package/src/libs/api/metadata-converter/src/lib/gn4/atomic-operations.ts +1 -0
  104. package/src/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.ts +1 -0
  105. package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +20 -0
  106. package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +12 -0
  107. package/src/libs/common/fixtures/src/index.ts +2 -0
  108. package/src/libs/common/fixtures/src/lib/editor/editor.fixtures.ts +156 -0
  109. package/src/libs/common/fixtures/src/lib/editor/index.ts +1 -0
  110. package/src/libs/data-access/gn4/src/openapi/api/records.api.service.ts +1 -5
  111. package/src/libs/data-access/gn4/src/spec.yaml +0 -8
  112. package/src/libs/feature/editor/src/lib/+state/editor.actions.ts +5 -0
  113. package/src/libs/feature/editor/src/lib/+state/editor.effects.ts +2 -2
  114. package/src/libs/feature/editor/src/lib/+state/editor.facade.ts +9 -1
  115. package/src/libs/feature/editor/src/lib/+state/editor.models.ts +11 -0
  116. package/src/libs/feature/editor/src/lib/+state/editor.reducer.ts +11 -5
  117. package/src/libs/feature/editor/src/lib/+state/editor.selectors.ts +22 -8
  118. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +9 -9
  119. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +2 -1
  120. package/src/libs/feature/editor/src/lib/components/record-form/form-field/index.ts +0 -1
  121. package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.html +51 -11
  122. package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.ts +15 -8
  123. package/src/libs/feature/editor/src/lib/expressions.ts +1 -1
  124. package/src/libs/feature/editor/src/lib/fields.config.ts +175 -61
  125. package/src/libs/feature/editor/src/lib/models/editor-config.model.ts +53 -0
  126. package/src/libs/feature/editor/src/lib/models/index.ts +1 -0
  127. package/src/libs/feature/editor/src/lib/services/editor.service.ts +8 -4
  128. package/src/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.ts +36 -19
  129. package/src/libs/feature/record/src/lib/data-view-share/data-view-share.component.html +6 -2
  130. package/src/libs/feature/record/src/lib/data-view-share/data-view-share.component.ts +11 -0
  131. package/src/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.ts +59 -12
  132. package/src/libs/feature/search/src/lib/results-table/results-table-container.component.html +1 -0
  133. package/src/libs/feature/search/src/lib/results-table/results-table-container.component.ts +5 -0
  134. package/src/libs/feature/search/src/lib/utils/service/fields.service.ts +16 -2
  135. package/src/libs/ui/elements/src/lib/api-card/api-card.component.html +29 -29
  136. package/src/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.html +14 -20
  137. package/src/libs/ui/elements/src/lib/metadata-quality/metadata-quality.component.ts +0 -10
  138. package/src/libs/ui/elements/src/lib/metadata-quality-item/metadata-quality-item.component.html +1 -1
  139. package/src/libs/ui/elements/src/lib/ui-elements.module.ts +2 -1
  140. package/src/libs/ui/elements/src/lib/user-preview/user-preview.component.html +1 -1
  141. package/src/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.css +31 -0
  142. package/src/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.html +15 -0
  143. package/src/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.ts +38 -0
  144. package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.css +0 -0
  145. package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.html +17 -0
  146. package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.ts +22 -0
  147. package/src/libs/ui/search/src/lib/results-table/results-table.component.html +9 -0
  148. package/src/libs/ui/search/src/lib/results-table/results-table.component.ts +26 -12
  149. package/src/libs/ui/widgets/src/index.ts +1 -0
  150. package/src/libs/ui/widgets/src/lib/popover/popover.component.css +0 -0
  151. package/src/libs/ui/widgets/src/lib/popover/popover.component.html +3 -0
  152. package/src/libs/ui/widgets/src/lib/popover/popover.component.ts +85 -0
  153. package/tailwind.base.css +2 -1
  154. package/translations/de.json +71 -32
  155. package/translations/en.json +41 -5
  156. package/translations/es.json +40 -1
  157. package/translations/fr.json +42 -6
  158. package/translations/it.json +40 -1
  159. package/translations/nl.json +40 -1
  160. package/translations/pt.json +40 -1
  161. package/translations/sk.json +40 -1
  162. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.model.mjs +0 -2
  163. package/esm2022/libs/feature/editor/src/lib/models/fields.model.mjs +0 -2
  164. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.model.d.ts +0 -26
  165. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.model.d.ts.map +0 -1
  166. package/libs/feature/editor/src/lib/models/fields.model.d.ts +0 -15
  167. package/libs/feature/editor/src/lib/models/fields.model.d.ts.map +0 -1
  168. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.model.ts +0 -43
  169. 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 { EditorFieldsConfig } from './models/fields.model'
3
-
4
- export const DEFAULT_FIELDS: EditorFieldsConfig = [
5
- {
6
- model: 'title',
7
- formFieldConfig: {
8
- labelKey: 'Metadata title',
9
- type: 'text',
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
- model: 'abstract',
14
- formFieldConfig: {
15
- labelKey: 'Abstract',
16
- type: 'rich',
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
- model: 'uniqueIdentifier',
21
- formFieldConfig: {
22
- labelKey: 'Unique identifier',
23
- type: 'text',
24
- locked: true,
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
- model: 'recordUpdated',
29
- formFieldConfig: {
30
- labelKey: 'Record Updated',
31
- type: 'text',
32
- locked: true,
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
- model: 'licenses',
38
- formFieldConfig: {
39
- labelKey: marker('editor.record.form.license'),
40
- type: 'list',
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
- model: 'resourceUpdated',
45
- formFieldConfig: {
46
- labelKey: marker('editor.record.form.resourceUpdated'),
47
- type: 'date',
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
- model: 'updateFrequency',
52
- formFieldConfig: {
53
- labelKey: marker('editor.record.form.updateFrequency'),
54
- type: 'text',
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
- model: 'temporalExtents',
59
- formFieldConfig: {
60
- labelKey: marker('editor.record.form.temporalExtents'),
61
- type: 'list',
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
- model: 'keywords',
66
- formFieldConfig: {
67
- labelKey: marker('editor.record.form.keywords'),
68
- type: 'list',
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
+ }
@@ -1,2 +1,3 @@
1
1
  export * from './wizard-field.model'
2
2
  export * from './wizard-field.type'
3
+ export * from './editor-config.model'
@@ -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 { EditorFieldsConfig } from '../models/fields.model'
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: EditorFieldsConfig,
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 fieldsConfig) {
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
- config: field,
32
+ model: field.model,
29
33
  value: record[field.model],
30
34
  })
31
35
  }
@@ -3,10 +3,11 @@ import {
3
3
  Component,
4
4
  Inject,
5
5
  InjectionToken,
6
+ Input,
6
7
  Optional,
7
8
  } from '@angular/core'
8
9
  import { Configuration } from '../../../../../../libs/data-access/gn4/src'
9
- import { combineLatest, map } from 'rxjs'
10
+ import { BehaviorSubject, combineLatest, map } from 'rxjs'
10
11
  import { MdViewFacade } from '../state'
11
12
  import { GN_UI_VERSION } from '../gn-ui-version.token'
12
13
 
@@ -21,29 +22,45 @@ export const WEB_COMPONENT_EMBEDDER_URL = new InjectionToken<string>(
21
22
  changeDetection: ChangeDetectionStrategy.OnPush,
22
23
  })
23
24
  export class DataViewPermalinkComponent {
25
+ viewType$ = new BehaviorSubject<string>('map')
26
+ @Input()
27
+ set viewType(value: string) {
28
+ this.viewType$.next(value)
29
+ }
30
+
24
31
  permalinkUrl$ = combineLatest([
32
+ this.viewType$,
25
33
  this.facade.chartConfig$,
26
34
  this.facade.metadata$,
27
35
  ]).pipe(
28
- map(([config, metadata]) => {
29
- if (config) {
30
- const { aggregation, xProperty, yProperty, chartType } = config
31
- const url = new URL(`${this.wcEmbedderBaseUrl}`, window.location.origin)
32
- url.searchParams.set('v', `${this.version}`)
33
- url.searchParams.append('e', `gn-dataset-view-chart`)
34
- url.searchParams.append('a', `api-url=${this.config.basePath}`)
35
- url.searchParams.append('a', `dataset-id=${metadata.uniqueIdentifier}`)
36
- url.searchParams.append('a', `primary-color=#0f4395`)
37
- url.searchParams.append('a', `secondary-color=#8bc832`)
38
- url.searchParams.append('a', `main-color=#555`)
39
- url.searchParams.append('a', `background-color=#fdfbff`)
40
- url.searchParams.append('a', `aggregation=${aggregation}`)
41
- url.searchParams.append('a', `x-property=${xProperty}`)
42
- url.searchParams.append('a', `y-property=${yProperty}`)
43
- url.searchParams.append('a', `chart-type=${chartType}`)
44
- return url.toString()
36
+ map(([viewType, config, metadata]) => {
37
+ const url = new URL(`${this.wcEmbedderBaseUrl}`, window.location.origin)
38
+ url.searchParams.set('v', `${this.version}`)
39
+ if (viewType === 'chart') {
40
+ if (config) {
41
+ const { aggregation, xProperty, yProperty, chartType } = config
42
+ url.searchParams.append('e', `gn-dataset-view-chart`)
43
+ url.searchParams.append('a', `aggregation=${aggregation}`)
44
+ url.searchParams.append('a', `x-property=${xProperty}`)
45
+ url.searchParams.append('a', `y-property=${yProperty}`)
46
+ url.searchParams.append('a', `chart-type=${chartType}`)
47
+ } else {
48
+ return ''
49
+ }
50
+ } else if (viewType === 'table') {
51
+ // table
52
+ url.searchParams.append('e', `gn-dataset-view-table`)
53
+ } else {
54
+ // map
55
+ url.searchParams.append('e', `gn-dataset-view-map`)
45
56
  }
46
- return ''
57
+ url.searchParams.append('a', `api-url=${this.config.basePath}`)
58
+ url.searchParams.append('a', `dataset-id=${metadata.uniqueIdentifier}`)
59
+ url.searchParams.append('a', `primary-color=#0f4395`)
60
+ url.searchParams.append('a', `secondary-color=#8bc832`)
61
+ url.searchParams.append('a', `main-color=#555`)
62
+ url.searchParams.append('a', `background-color=#fdfbff`)
63
+ return url.toString()
47
64
  })
48
65
  )
49
66
 
@@ -10,7 +10,9 @@
10
10
  <ng-template mat-tab-label>
11
11
  <span class="tab-header-label-gray" translate>share.tab.permalink</span>
12
12
  </ng-template>
13
- <gn-ui-data-view-permalink></gn-ui-data-view-permalink>
13
+ <gn-ui-data-view-permalink
14
+ [viewType]="viewType"
15
+ ></gn-ui-data-view-permalink>
14
16
  </mat-tab>
15
17
  <mat-tab>
16
18
  <ng-template mat-tab-label>
@@ -24,7 +26,9 @@
24
26
  >share.tab.webComponent</span
25
27
  >
26
28
  </ng-template>
27
- <gn-ui-data-view-web-component></gn-ui-data-view-web-component>
29
+ <gn-ui-data-view-web-component
30
+ [viewType]="viewType"
31
+ ></gn-ui-data-view-web-component>
28
32
  </mat-tab>
29
33
  </mat-tab-group>
30
34
  </div>
@@ -2,6 +2,7 @@ import {
2
2
  ChangeDetectionStrategy,
3
3
  Component,
4
4
  Inject,
5
+ Input,
5
6
  Optional,
6
7
  } from '@angular/core'
7
8
  import { WEB_COMPONENT_EMBEDDER_URL } from '../data-view-permalink/data-view-permalink.component'
@@ -13,6 +14,16 @@ import { WEB_COMPONENT_EMBEDDER_URL } from '../data-view-permalink/data-view-per
13
14
  changeDetection: ChangeDetectionStrategy.OnPush,
14
15
  })
15
16
  export class DataViewShareComponent {
17
+ private _viewType: string
18
+
19
+ @Input()
20
+ set viewType(value: string) {
21
+ this._viewType = value
22
+ }
23
+
24
+ get viewType(): string {
25
+ return this._viewType
26
+ }
16
27
  constructor(
17
28
  @Optional()
18
29
  @Inject(WEB_COMPONENT_EMBEDDER_URL)
@@ -1,7 +1,12 @@
1
- import { ChangeDetectionStrategy, Component, Inject } from '@angular/core'
1
+ import {
2
+ ChangeDetectionStrategy,
3
+ Component,
4
+ Inject,
5
+ Input,
6
+ } from '@angular/core'
2
7
  import { Configuration } from '../../../../../../libs/data-access/gn4/src'
3
8
  import { MdViewFacade } from '../state'
4
- import { combineLatest, map } from 'rxjs'
9
+ import { BehaviorSubject, combineLatest, map } from 'rxjs'
5
10
  import { GN_UI_VERSION } from '../gn-ui-version.token'
6
11
 
7
12
  @Component({
@@ -11,35 +16,77 @@ import { GN_UI_VERSION } from '../gn-ui-version.token'
11
16
  changeDetection: ChangeDetectionStrategy.OnPush,
12
17
  })
13
18
  export class DataViewWebComponentComponent {
19
+ viewType$ = new BehaviorSubject<string>('map')
20
+ @Input()
21
+ set viewType(value: string) {
22
+ this.viewType$.next(value)
23
+ }
14
24
  webComponentHtml$ = combineLatest(
25
+ this.viewType$,
15
26
  this.facade.chartConfig$,
16
27
  this.facade.metadata$
17
28
  ).pipe(
18
- map(([config, metadata]) => {
19
- if (config) {
20
- const { aggregation, xProperty, yProperty, chartType } = config
29
+ map(([viewType, config, metadata]) => {
30
+ if (viewType === 'chart') {
31
+ if (config) {
32
+ const { aggregation, xProperty, yProperty, chartType } = config
33
+ return `<script src="https://cdn.jsdelivr.net/gh/geonetwork/geonetwork-ui@wc-dist-${
34
+ this.version
35
+ }/gn-wc.js"></script>
36
+ <gn-dataset-view-chart
37
+ api-url="${new URL(
38
+ this.config.basePath,
39
+ window.location.origin
40
+ ).toString()}"
41
+ dataset-id="${metadata.uniqueIdentifier}"
42
+ aggregation="${aggregation}"
43
+ x-property="${xProperty}"
44
+ y-property="${yProperty}"
45
+ chart-type="${chartType}"
46
+ primary-color="#0f4395"
47
+ secondary-color="#8bc832"
48
+ main-color="#555"
49
+ background-color="#fdfbff"
50
+ main-font="'Inter', sans-serif"
51
+ title-font="'DM Serif Display', serif"
52
+ ></gn-dataset-view-chart>`
53
+ }
54
+ return ''
55
+ } else if (viewType === 'table') {
21
56
  return `<script src="https://cdn.jsdelivr.net/gh/geonetwork/geonetwork-ui@wc-dist-${
22
57
  this.version
23
58
  }/gn-wc.js"></script>
24
- <gn-dataset-view-chart
59
+ <gn-dataset-view-table
60
+ api-url="${new URL(
61
+ this.config.basePath,
62
+ window.location.origin
63
+ ).toString()}"
64
+ dataset-id="${metadata.uniqueIdentifier}"
65
+ primary-color="#0f4395"
66
+ secondary-color="#8bc832"
67
+ main-color="#555"
68
+ background-color="#fdfbff"
69
+ main-font="'Inter', sans-serif"
70
+ title-font="'DM Serif Display', serif"
71
+ ></gn-dataset-view-table>`
72
+ } else {
73
+ return `<script src="https://cdn.jsdelivr.net/gh/geonetwork/geonetwork-ui@wc-dist-${
74
+ this.version
75
+ }/gn-wc.js"></script>
76
+ <gn-dataset-view-map
25
77
  api-url="${new URL(
26
78
  this.config.basePath,
27
79
  window.location.origin
28
80
  ).toString()}"
29
81
  dataset-id="${metadata.uniqueIdentifier}"
30
- aggregation="${aggregation}"
31
- x-property="${xProperty}"
32
- y-property="${yProperty}"
33
- chart-type="${chartType}"
34
82
  primary-color="#0f4395"
35
83
  secondary-color="#8bc832"
36
84
  main-color="#555"
37
85
  background-color="#fdfbff"
38
86
  main-font="'Inter', sans-serif"
39
87
  title-font="'DM Serif Display', serif"
40
- ></gn-dataset-view-chart>`
88
+ ></gn-dataset-view-map>`
41
89
  }
42
- return ''
43
90
  })
44
91
  )
45
92
 
@@ -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
  }
@@ -25,19 +25,21 @@ marker('search.filters.keyword')
25
25
  marker('search.filters.isSpatial')
26
26
  marker('search.filters.license')
27
27
  marker('search.filters.publicationYear')
28
- marker('search.filters.publisher')
28
+ marker('search.filters.organization')
29
29
  marker('search.filters.representationType')
30
30
  marker('search.filters.resourceType')
31
31
  marker('search.filters.standard')
32
32
  marker('search.filters.topic')
33
33
  marker('search.filters.contact')
34
+ marker('search.filters.producerOrg')
35
+ marker('search.filters.publisherOrg')
34
36
 
35
37
  @Injectable({
36
38
  providedIn: 'root',
37
39
  })
38
40
  export class FieldsService {
39
41
  protected fields = {
40
- publisher: new OrganizationSearchField(this.injector),
42
+ organization: new OrganizationSearchField(this.injector),
41
43
  format: new SimpleSearchField('format', this.injector, 'asc'),
42
44
  resourceType: new TranslatedSearchField(
43
45
  'resourceType',
@@ -70,6 +72,18 @@ export class FieldsService {
70
72
  q: new FullTextSearchField(),
71
73
  license: new LicenseSearchField(this.injector),
72
74
  owner: new OwnerSearchField(this.injector),
75
+ producerOrg: new MultilingualSearchField(
76
+ 'originatorOrgForResourceObject',
77
+ this.injector,
78
+ 'asc',
79
+ 'key'
80
+ ),
81
+ publisherOrg: new MultilingualSearchField(
82
+ 'distributorOrgForResourceObject',
83
+ this.injector,
84
+ 'asc',
85
+ 'key'
86
+ ),
73
87
  } as Record<string, AbstractSearchField>
74
88
 
75
89
  get supportedFields() {