geonetwork-ui 2.4.0-dev.27089d81 → 2.4.0-dev.4e4ab1af

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 (174) 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/api/repository/src/lib/gn4/platform/gn4-platform.service.mjs +9 -5
  6. package/esm2022/libs/common/domain/src/lib/platform.service.interface.mjs +1 -1
  7. package/esm2022/libs/common/domain/src/lib/repository/records-repository.interface.mjs +1 -1
  8. package/esm2022/libs/data-access/gn4/src/openapi/api/records.api.service.mjs +2 -6
  9. package/esm2022/libs/feature/catalog/src/lib/records/records.service.mjs +4 -6
  10. package/esm2022/libs/feature/editor/src/lib/+state/editor.actions.mjs +2 -1
  11. package/esm2022/libs/feature/editor/src/lib/+state/editor.effects.mjs +3 -3
  12. package/esm2022/libs/feature/editor/src/lib/+state/editor.facade.mjs +7 -2
  13. package/esm2022/libs/feature/editor/src/lib/+state/editor.models.mjs +1 -1
  14. package/esm2022/libs/feature/editor/src/lib/+state/editor.reducer.mjs +7 -3
  15. package/esm2022/libs/feature/editor/src/lib/+state/editor.selectors.mjs +16 -6
  16. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.mjs +4 -2
  17. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.mjs +3 -3
  18. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/index.mjs +1 -2
  19. package/esm2022/libs/feature/editor/src/lib/components/record-form/record-form.component.mjs +11 -7
  20. package/esm2022/libs/feature/editor/src/lib/expressions.mjs +1 -1
  21. package/esm2022/libs/feature/editor/src/lib/fields.config.mjs +143 -60
  22. package/esm2022/libs/feature/editor/src/lib/models/editor-config.model.mjs +2 -0
  23. package/esm2022/libs/feature/editor/src/lib/models/index.mjs +2 -1
  24. package/esm2022/libs/feature/editor/src/lib/services/editor.service.mjs +4 -3
  25. package/esm2022/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.mjs +42 -23
  26. package/esm2022/libs/feature/record/src/lib/data-view-share/data-view-share.component.mjs +13 -5
  27. package/esm2022/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.mjs +49 -15
  28. package/esm2022/libs/feature/record/src/lib/state/mdview.facade.mjs +6 -3
  29. package/esm2022/libs/feature/search/src/lib/results-table/results-table-container.component.mjs +9 -3
  30. package/esm2022/libs/feature/search/src/lib/utils/service/fields.service.mjs +7 -3
  31. package/esm2022/libs/ui/elements/src/lib/api-card/api-card.component.mjs +3 -3
  32. package/esm2022/libs/ui/elements/src/lib/metadata-info/metadata-info.component.mjs +5 -4
  33. package/esm2022/libs/ui/elements/src/lib/ui-elements.module.mjs +7 -4
  34. package/esm2022/libs/ui/elements/src/lib/user-preview/user-preview.component.mjs +3 -3
  35. package/esm2022/libs/ui/layout/src/lib/max-lines/max-lines.component.mjs +3 -3
  36. package/esm2022/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.mjs +29 -0
  37. package/esm2022/libs/ui/search/src/lib/results-table/results-table.component.mjs +15 -7
  38. package/esm2022/translations/de.json +85 -38
  39. package/esm2022/translations/en.json +57 -10
  40. package/esm2022/translations/es.json +56 -9
  41. package/esm2022/translations/fr.json +57 -10
  42. package/esm2022/translations/it.json +56 -9
  43. package/esm2022/translations/nl.json +56 -9
  44. package/esm2022/translations/pt.json +56 -9
  45. package/fesm2022/geonetwork-ui.mjs +856 -303
  46. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  47. package/libs/api/metadata-converter/src/index.d.ts +1 -0
  48. package/libs/api/metadata-converter/src/index.d.ts.map +1 -1
  49. package/libs/api/metadata-converter/src/lib/gn4/atomic-operations.d.ts.map +1 -1
  50. package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts +1 -0
  51. package/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.d.ts.map +1 -1
  52. package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts +1 -0
  53. package/libs/api/repository/src/lib/gn4/gn4-repository.d.ts.map +1 -1
  54. package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts +2 -1
  55. package/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.d.ts.map +1 -1
  56. package/libs/common/domain/src/lib/platform.service.interface.d.ts +2 -1
  57. package/libs/common/domain/src/lib/platform.service.interface.d.ts.map +1 -1
  58. package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts +9 -0
  59. package/libs/common/domain/src/lib/repository/records-repository.interface.d.ts.map +1 -1
  60. package/libs/data-access/gn4/src/openapi/api/records.api.service.d.ts.map +1 -1
  61. package/libs/feature/catalog/src/lib/records/records.service.d.ts.map +1 -1
  62. package/libs/feature/editor/src/lib/+state/editor.actions.d.ts +5 -0
  63. package/libs/feature/editor/src/lib/+state/editor.actions.d.ts.map +1 -1
  64. package/libs/feature/editor/src/lib/+state/editor.facade.d.ts +4 -4
  65. package/libs/feature/editor/src/lib/+state/editor.facade.d.ts.map +1 -1
  66. package/libs/feature/editor/src/lib/+state/editor.models.d.ts +8 -0
  67. package/libs/feature/editor/src/lib/+state/editor.models.d.ts.map +1 -1
  68. package/libs/feature/editor/src/lib/+state/editor.reducer.d.ts +4 -3
  69. package/libs/feature/editor/src/lib/+state/editor.reducer.d.ts.map +1 -1
  70. package/libs/feature/editor/src/lib/+state/editor.selectors.d.ts +4 -8
  71. package/libs/feature/editor/src/lib/+state/editor.selectors.d.ts.map +1 -1
  72. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.d.ts.map +1 -1
  73. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts +1 -1
  74. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.d.ts.map +1 -1
  75. package/libs/feature/editor/src/lib/components/record-form/form-field/index.d.ts +0 -1
  76. package/libs/feature/editor/src/lib/components/record-form/form-field/index.d.ts.map +1 -1
  77. package/libs/feature/editor/src/lib/components/record-form/record-form.component.d.ts +5 -7
  78. package/libs/feature/editor/src/lib/components/record-form/record-form.component.d.ts.map +1 -1
  79. package/libs/feature/editor/src/lib/expressions.d.ts +1 -1
  80. package/libs/feature/editor/src/lib/expressions.d.ts.map +1 -1
  81. package/libs/feature/editor/src/lib/fields.config.d.ts +38 -2
  82. package/libs/feature/editor/src/lib/fields.config.d.ts.map +1 -1
  83. package/libs/feature/editor/src/lib/models/editor-config.model.d.ts +36 -0
  84. package/libs/feature/editor/src/lib/models/editor-config.model.d.ts.map +1 -0
  85. package/libs/feature/editor/src/lib/models/index.d.ts +1 -0
  86. package/libs/feature/editor/src/lib/models/index.d.ts.map +1 -1
  87. package/libs/feature/editor/src/lib/services/editor.service.d.ts +2 -2
  88. package/libs/feature/editor/src/lib/services/editor.service.d.ts.map +1 -1
  89. package/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.d.ts +4 -1
  90. package/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.d.ts.map +1 -1
  91. package/libs/feature/record/src/lib/data-view-share/data-view-share.component.d.ts +4 -1
  92. package/libs/feature/record/src/lib/data-view-share/data-view-share.component.d.ts.map +1 -1
  93. package/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.d.ts +4 -1
  94. package/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.d.ts.map +1 -1
  95. package/libs/feature/record/src/lib/state/mdview.facade.d.ts.map +1 -1
  96. package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts +3 -1
  97. package/libs/feature/search/src/lib/results-table/results-table-container.component.d.ts.map +1 -1
  98. package/libs/feature/search/src/lib/utils/service/fields.service.d.ts.map +1 -1
  99. package/libs/ui/elements/src/lib/ui-elements.module.d.ts +2 -1
  100. package/libs/ui/elements/src/lib/ui-elements.module.d.ts.map +1 -1
  101. package/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.d.ts +11 -0
  102. package/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.d.ts.map +1 -0
  103. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts +4 -2
  104. package/libs/ui/search/src/lib/results-table/results-table.component.d.ts.map +1 -1
  105. package/package.json +1 -1
  106. package/src/libs/api/metadata-converter/src/index.ts +1 -0
  107. package/src/libs/api/metadata-converter/src/lib/gn4/atomic-operations.ts +1 -0
  108. package/src/libs/api/metadata-converter/src/lib/gn4/types/metadata.model.ts +1 -0
  109. package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +20 -0
  110. package/src/libs/api/repository/src/lib/gn4/platform/gn4-platform.service.ts +26 -15
  111. package/src/libs/common/domain/src/lib/platform.service.interface.ts +5 -1
  112. package/src/libs/common/domain/src/lib/repository/records-repository.interface.ts +12 -0
  113. package/src/libs/common/fixtures/src/index.ts +2 -0
  114. package/src/libs/common/fixtures/src/lib/editor/editor.fixtures.ts +156 -0
  115. package/src/libs/common/fixtures/src/lib/editor/index.ts +1 -0
  116. package/src/libs/data-access/datafeeder/src/openapi/model/datasetMetadata.api.model.ts +4 -0
  117. package/src/libs/data-access/datafeeder/src/openapi/model/datasetUploadStatus.api.model.ts +2 -0
  118. package/src/libs/data-access/gn4/src/openapi/api/records.api.service.ts +1 -5
  119. package/src/libs/data-access/gn4/src/spec.yaml +0 -8
  120. package/src/libs/feature/catalog/src/lib/records/records.service.ts +6 -8
  121. package/src/libs/feature/editor/src/lib/+state/editor.actions.ts +5 -0
  122. package/src/libs/feature/editor/src/lib/+state/editor.effects.ts +2 -2
  123. package/src/libs/feature/editor/src/lib/+state/editor.facade.ts +9 -1
  124. package/src/libs/feature/editor/src/lib/+state/editor.models.ts +11 -0
  125. package/src/libs/feature/editor/src/lib/+state/editor.reducer.ts +11 -5
  126. package/src/libs/feature/editor/src/lib/+state/editor.selectors.ts +22 -8
  127. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-keywords/form-field-keywords.component.ts +8 -6
  128. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +9 -9
  129. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +2 -1
  130. package/src/libs/feature/editor/src/lib/components/record-form/form-field/index.ts +0 -1
  131. package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.html +51 -11
  132. package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.ts +15 -8
  133. package/src/libs/feature/editor/src/lib/expressions.ts +1 -1
  134. package/src/libs/feature/editor/src/lib/fields.config.ts +175 -61
  135. package/src/libs/feature/editor/src/lib/models/editor-config.model.ts +53 -0
  136. package/src/libs/feature/editor/src/lib/models/index.ts +1 -0
  137. package/src/libs/feature/editor/src/lib/services/editor.service.ts +8 -4
  138. package/src/libs/feature/record/src/lib/data-view-permalink/data-view-permalink.component.ts +36 -19
  139. package/src/libs/feature/record/src/lib/data-view-share/data-view-share.component.html +6 -2
  140. package/src/libs/feature/record/src/lib/data-view-share/data-view-share.component.ts +11 -0
  141. package/src/libs/feature/record/src/lib/data-view-web-component/data-view-web-component.component.ts +59 -12
  142. package/src/libs/feature/record/src/lib/state/mdview.facade.ts +6 -2
  143. package/src/libs/feature/search/src/lib/results-table/results-table-container.component.html +1 -0
  144. package/src/libs/feature/search/src/lib/results-table/results-table-container.component.ts +5 -0
  145. package/src/libs/feature/search/src/lib/utils/service/fields.service.ts +16 -2
  146. package/src/libs/ui/elements/src/lib/api-card/api-card.component.html +29 -29
  147. package/src/libs/ui/elements/src/lib/ui-elements.module.ts +2 -1
  148. package/src/libs/ui/elements/src/lib/user-preview/user-preview.component.html +1 -1
  149. package/src/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.css +31 -0
  150. package/src/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.html +15 -0
  151. package/src/libs/ui/inputs/src/lib/switch-toggle/switch-toggle.component.ts +38 -0
  152. package/src/libs/ui/layout/src/lib/max-lines/max-lines.component.html +1 -0
  153. package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.css +0 -0
  154. package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.html +17 -0
  155. package/src/libs/ui/search/src/lib/results-table/action-menu/action-menu.component.ts +22 -0
  156. package/src/libs/ui/search/src/lib/results-table/results-table.component.html +9 -0
  157. package/src/libs/ui/search/src/lib/results-table/results-table.component.ts +26 -12
  158. package/tailwind.base.css +2 -1
  159. package/translations/de.json +85 -38
  160. package/translations/en.json +57 -10
  161. package/translations/es.json +56 -9
  162. package/translations/fr.json +57 -10
  163. package/translations/it.json +56 -9
  164. package/translations/nl.json +56 -9
  165. package/translations/pt.json +56 -9
  166. package/translations/sk.json +56 -9
  167. package/esm2022/libs/feature/editor/src/lib/components/record-form/form-field/form-field.model.mjs +0 -2
  168. package/esm2022/libs/feature/editor/src/lib/models/fields.model.mjs +0 -2
  169. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.model.d.ts +0 -26
  170. package/libs/feature/editor/src/lib/components/record-form/form-field/form-field.model.d.ts.map +0 -1
  171. package/libs/feature/editor/src/lib/models/fields.model.d.ts +0 -15
  172. package/libs/feature/editor/src/lib/models/fields.model.d.ts.map +0 -1
  173. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.model.ts +0 -43
  174. package/src/libs/feature/editor/src/lib/models/fields.model.ts +0 -29
@@ -24,6 +24,7 @@ import {
24
24
  } from '../../../../../../libs/common/domain/src/lib/model/search'
25
25
  import { catchError, map, tap } from 'rxjs/operators'
26
26
  import {
27
+ BaseConverter,
27
28
  findConverterForDocument,
28
29
  Gn4Converter,
29
30
  Gn4SearchResults,
@@ -230,6 +231,25 @@ export class Gn4Repository implements RecordsRepositoryInterface {
230
231
  )
231
232
  }
232
233
 
234
+ openRecordForDuplication(
235
+ uniqueIdentifier: string
236
+ ): Observable<[CatalogRecord, string, false] | null> {
237
+ return this.loadRecordAsXml(uniqueIdentifier).pipe(
238
+ switchMap(async (recordAsXml) => {
239
+ const converter = findConverterForDocument(recordAsXml)
240
+ const record = await converter.readRecord(recordAsXml)
241
+ record.uniqueIdentifier = `TEMP-ID-${Date.now()}`
242
+ record.title = `${record.title} (Copy)`
243
+ const xml = await converter.writeRecord(record, recordAsXml)
244
+ window.localStorage.setItem(
245
+ this.getLocalStorageKeyForRecord(record.uniqueIdentifier),
246
+ xml
247
+ )
248
+ return [record, xml, false] as [CatalogRecord, string, false]
249
+ })
250
+ )
251
+ }
252
+
233
253
  private serializeRecordToXml(
234
254
  record: CatalogRecord,
235
255
  referenceRecordSource?: string
@@ -5,7 +5,6 @@ import {
5
5
  MeApiService,
6
6
  RegistriesApiService,
7
7
  SiteApiService,
8
- ThesaurusInfoApiModel,
9
8
  ToolsApiService,
10
9
  UserfeedbackApiService,
11
10
  UsersApiService,
@@ -25,6 +24,7 @@ import {
25
24
  KeywordApiResponse,
26
25
  ThesaurusApiResponse,
27
26
  } from '../../../../../../../libs/api/metadata-converter/src'
27
+ import { KeywordType } from '../../../../../../../libs/common/domain/src/lib/model/thesaurus'
28
28
 
29
29
  const minApiVersion = '4.2.2'
30
30
 
@@ -146,25 +146,36 @@ export class Gn4PlatformService implements PlatformServiceInterface {
146
146
  )
147
147
  .pipe(
148
148
  map((thesaurus) => {
149
- // FIXME: find a better way to exclude place keywords
150
- // thesaurus[0].filter((thes) => thes.dname !== 'place')
151
149
  return thesaurus[0] as ThesaurusApiResponse[]
152
150
  }),
153
151
  shareReplay(1)
154
152
  )
155
153
 
156
- searchKeywords(query: string): Observable<Keyword[]> {
157
- const keywords$: Observable<KeywordApiResponse[]> =
158
- this.registriesApiService.searchKeywords(
159
- query,
160
- this.langService.iso3,
161
- 10,
162
- 0,
163
- null,
164
- null,
165
- null,
166
- `*${query}*`
167
- ) as Observable<KeywordApiResponse[]>
154
+ searchKeywords(
155
+ query: string,
156
+ keywordTypes: KeywordType[]
157
+ ): Observable<Keyword[]> {
158
+ const keywords$: Observable<KeywordApiResponse[]> = this.allThesaurus$.pipe(
159
+ switchMap((thesaurus) => {
160
+ const selectedThesauri = []
161
+ keywordTypes.map((keywordType) => {
162
+ selectedThesauri.push(
163
+ ...thesaurus.filter((thes) => thes.dname === keywordType)
164
+ )
165
+ })
166
+
167
+ return this.registriesApiService.searchKeywords(
168
+ query,
169
+ this.langService.iso3,
170
+ 10,
171
+ 0,
172
+ null,
173
+ selectedThesauri.map((thes) => thes.key),
174
+ null,
175
+ `*${query}*`
176
+ ) as Observable<KeywordApiResponse[]>
177
+ })
178
+ )
168
179
 
169
180
  return combineLatest([keywords$, this.allThesaurus$]).pipe(
170
181
  map(([keywords, thesaurus]) => {
@@ -2,6 +2,7 @@ import type { Observable } from 'rxjs'
2
2
  import type { UserModel } from './model/user/user.model'
3
3
  import type { Organization } from './model/record/organization.model'
4
4
  import { Keyword, UserFeedback } from './model/record'
5
+ import { KeywordType } from './model/thesaurus'
5
6
 
6
7
  export abstract class PlatformServiceInterface {
7
8
  abstract getType(): string
@@ -15,7 +16,10 @@ export abstract class PlatformServiceInterface {
15
16
  ): Observable<UserModel[]>
16
17
  abstract getOrganizations(): Observable<Organization[]>
17
18
  abstract translateKey(key: string): Observable<string>
18
- abstract searchKeywords(query: string): Observable<Keyword[]>
19
+ abstract searchKeywords(
20
+ query: string,
21
+ keywordTypes: KeywordType[]
22
+ ): Observable<Keyword[]>
19
23
  abstract getKeywordsByUri(uri: string): Observable<Keyword[]>
20
24
  abstract getUserFeedbacks(recordUuid: string): Observable<UserFeedback[]>
21
25
  abstract postUserFeedbacks(recordUuid: UserFeedback): Observable<void>
@@ -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
@@ -11,3 +11,5 @@ export * from './lib/records.fixtures'
11
11
  export * from './lib/repository.fixtures'
12
12
  export * from './lib/user.fixtures'
13
13
  export * from './lib/user-feedbacks.fixtures'
14
+
15
+ export * from './lib/editor'
@@ -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'
@@ -38,4 +38,8 @@ export interface DatasetMetadataApiModel {
38
38
  * textual description of dataset lineage
39
39
  */
40
40
  creationProcessDescription?: string
41
+ /**
42
+ * Optional, additional options for the dataset
43
+ */
44
+ options: any
41
45
  }
@@ -34,4 +34,6 @@ export interface DatasetUploadStatusApiModel {
34
34
  * detected charset
35
35
  */
36
36
  encoding?: string
37
+ format?: 'CSV' | 'SHAPEFILE'
38
+ options?: any
37
39
  }
@@ -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
@@ -1,18 +1,16 @@
1
1
  import { Injectable } from '@angular/core'
2
- import { Observable, of } from 'rxjs'
3
- import { catchError, shareReplay } from 'rxjs/operators'
2
+ import { Observable, of, switchMap } from 'rxjs'
3
+ import { shareReplay } from 'rxjs/operators'
4
4
  import { RecordsRepositoryInterface } from '../../../../../../libs/common/domain/src/lib/repository/records-repository.interface'
5
5
 
6
6
  @Injectable({
7
7
  providedIn: 'root',
8
8
  })
9
9
  export class RecordsService {
10
- recordsCount$: Observable<number> = this.recordsRepository
11
- .getMatchesCount({})
12
- .pipe(
13
- shareReplay(1),
14
- catchError(() => of(0))
15
- )
10
+ recordsCount$: Observable<number> = of(true).pipe(
11
+ switchMap(() => this.recordsRepository.getMatchesCount({})),
12
+ shareReplay(1)
13
+ )
16
14
 
17
15
  constructor(private recordsRepository: RecordsRepositoryInterface) {}
18
16
  }
@@ -28,3 +28,8 @@ export const saveRecordFailure = createAction(
28
28
  )
29
29
 
30
30
  export const draftSaveSuccess = createAction('[Editor] Draft save success')
31
+
32
+ export const setCurrentPage = createAction(
33
+ '[Editor] Set current page',
34
+ props<{ page: number }>()
35
+ )
@@ -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(selectRecordFieldsConfig),
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
- recordFields$ = this.store.pipe(select(EditorSelectors.selectRecordFields))
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 { EditorFieldsConfig } from '../models/fields.model'
6
- import { DEFAULT_FIELDS } from '../fields.config'
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 fieldsConfig Configuration for the fields in the editor
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
- fieldsConfig: EditorFieldsConfig
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
- fieldsConfig: DEFAULT_FIELDS,
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 selectRecordFieldsConfig = createSelector(
38
+ export const selectEditorConfig = createSelector(
38
39
  selectEditorState,
39
- (state: EditorState) => state.fieldsConfig
40
+ (state: EditorState) => state.editorConfig
40
41
  )
41
42
 
42
- export const selectRecordFields = createSelector(
43
+ export const selectCurrentPage = createSelector(
43
44
  selectEditorState,
44
- (state: EditorState) =>
45
- state.fieldsConfig.map((fieldConfig) => ({
46
- config: fieldConfig,
47
- value: state.record?.[fieldConfig.model] ?? null,
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
  )
@@ -35,13 +35,15 @@ export class FormFieldKeywordsComponent {
35
35
  }
36
36
 
37
37
  autoCompleteAction = (query: string) => {
38
- return this.platformService.searchKeywords(query).pipe(
39
- map((keywords) =>
40
- keywords.map((keyword) => {
41
- return { title: keyword.label, value: keyword }
42
- })
38
+ return this.platformService
39
+ .searchKeywords(query, ['temporal', 'theme', 'other'])
40
+ .pipe(
41
+ map((keywords) =>
42
+ keywords.map((keyword) => {
43
+ return { title: keyword.label, value: keyword }
44
+ })
45
+ )
43
46
  )
44
- )
45
47
  }
46
48
 
47
49
  constructor(private platformService: PlatformServiceInterface) {}
@@ -4,8 +4,8 @@
4
4
  </ng-container>
5
5
  <ng-template #withGenericWrapper>
6
6
  <gn-ui-form-field-wrapper
7
- [label]="config.labelKey | translate"
8
- [hint]="config.hintKey | translate"
7
+ [label]="config.labelKey! | translate"
8
+ [hint]="config.hintKey! | translate"
9
9
  >
10
10
  <ng-container *ngTemplateOutlet="fieldContent"></ng-container>
11
11
  </gn-ui-form-field-wrapper>
@@ -15,14 +15,14 @@
15
15
  <ng-template #fieldContent>
16
16
  <ng-container *ngIf="isTitle">
17
17
  <div class="flex justify-between items-center gap-3">
18
- <h2
18
+ <span
19
19
  #titleInput
20
- class="grow text-3xl font-normal"
20
+ class="grow font-title text-3xl font-normal"
21
21
  [gnUiEditableLabel]="true"
22
22
  (editableLabelChanged)="formControl.setValue($event)"
23
23
  >
24
24
  {{ formControl.value }}
25
- </h2>
25
+ </span>
26
26
  <span
27
27
  class="material-symbols-outlined gn-ui-icon-small m-2 cursor-pointer"
28
28
  (click)="focusTitleInput()"
@@ -30,7 +30,7 @@
30
30
  >
31
31
  <span
32
32
  class="material-symbols-outlined gn-ui-icon-small m-2"
33
- [matTooltip]="config.hintKey | translate"
33
+ [matTooltip]="config.hintKey! | translate"
34
34
  matTooltipPosition="above"
35
35
  >
36
36
  help
@@ -41,14 +41,14 @@
41
41
  <gn-ui-form-field-rich
42
42
  class="h-[8rem]"
43
43
  [control]="formControl"
44
- [label]="config.labelKey | translate"
45
- [hint]="config.hintKey | translate"
44
+ [label]="config.labelKey! | translate"
45
+ [hint]="config.hintKey! | translate"
46
46
  ></gn-ui-form-field-rich>
47
47
  </ng-container>
48
48
  <ng-container *ngIf="isLicenses">
49
49
  <gn-ui-form-field-license
50
50
  [control]="formControl"
51
- [label]="config.labelKey | translate"
51
+ [label]="config.labelKey! | translate"
52
52
  ></gn-ui-form-field-license>
53
53
  </ng-container>
54
54
  <ng-container *ngIf="isResourceUpdated">
@@ -25,10 +25,10 @@ import { FormFieldObjectComponent } from './form-field-object/form-field-object.
25
25
  import { FormFieldRichComponent } from './form-field-rich/form-field-rich.component'
26
26
  import { FormFieldSimpleComponent } from './form-field-simple/form-field-simple.component'
27
27
  import { FormFieldSpatialExtentComponent } from './form-field-spatial-extent/form-field-spatial-extent.component'
28
- import { FormFieldConfig } from './form-field.model'
29
28
  import { FormFieldUpdateFrequencyComponent } from './form-field-update-frequency/form-field-update-frequency.component'
30
29
  import { CatalogRecordKeys } from '../../../../../../../../libs/common/domain/src/lib/model/record'
31
30
  import { FormFieldKeywordsComponent } from './form-field-keywords/form-field-keywords.component'
31
+ import { FormFieldConfig } from '../../../models'
32
32
 
33
33
  @Component({
34
34
  selector: 'gn-ui-form-field',
@@ -65,6 +65,7 @@ export class FormFieldComponent {
65
65
  emitEvent: false,
66
66
  })
67
67
  }
68
+
68
69
  @Output() valueChange: Observable<unknown>
69
70
 
70
71
  @ViewChild('titleInput') titleInput: ElementRef
@@ -9,4 +9,3 @@ export * from './form-field-object/form-field-object.component'
9
9
  export * from './form-field-array/form-field-array.component'
10
10
  export * from './form-field-spatial-extent/form-field-spatial-extent.component'
11
11
  export * from './form-field.component'
12
- export * from './form-field.model'