geonetwork-ui 2.9.0 → 2.10.0-dev.0d752aeb4

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 (60) hide show
  1. package/fesm2022/geonetwork-ui.mjs +1091 -918
  2. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  3. package/index.d.ts +137 -28
  4. package/index.d.ts.map +1 -1
  5. package/package.json +2 -2
  6. package/src/libs/api/repository/src/lib/gn4/gn4-repository.ts +14 -2
  7. package/src/libs/api/repository/src/lib/gn4/gn4.provider.ts +6 -1
  8. package/src/libs/common/domain/src/index.ts +1 -0
  9. package/src/libs/feature/editor/src/index.ts +2 -0
  10. package/src/libs/feature/editor/src/lib/+state/editor.actions.ts +6 -0
  11. package/src/libs/feature/editor/src/lib/+state/editor.effects.ts +0 -1
  12. package/src/libs/feature/editor/src/lib/+state/editor.facade.ts +10 -1
  13. package/src/libs/feature/editor/src/lib/components/metadata-quality-panel/metadata-quality-panel.component.html +18 -3
  14. package/src/libs/feature/editor/src/lib/components/metadata-quality-panel/metadata-quality-panel.component.ts +33 -40
  15. package/src/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.html +6 -1
  16. package/src/libs/feature/editor/src/lib/components/online-service-resource-input/online-service-resource-input.component.ts +16 -1
  17. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-constraints-shortcuts/form-field-constraints-shortcuts.component.ts +34 -34
  18. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts/form-field-contacts.component.html +8 -15
  19. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts/form-field-contacts.component.ts +6 -4
  20. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.html +8 -7
  21. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts-for-resource/form-field-contacts-for-resource.component.ts +6 -6
  22. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-single-link-resource/form-field-online-single-link-resource.component.css +0 -0
  23. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-single-link-resource/form-field-online-single-link-resource.component.html +5 -0
  24. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-online-single-link-resource/form-field-online-single-link-resource.component.ts +89 -0
  25. package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.css +3 -0
  26. package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.html +1 -0
  27. package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.ts +57 -3
  28. package/src/libs/feature/notify-reuse/src/index.ts +1 -0
  29. package/src/libs/feature/notify-reuse/src/lib/notify-reuse-form/notify-reuse-form.component.css +0 -0
  30. package/src/libs/feature/notify-reuse/src/lib/notify-reuse-form/notify-reuse-form.component.html +1 -0
  31. package/src/libs/feature/notify-reuse/src/lib/notify-reuse-form/notify-reuse-form.component.ts +21 -0
  32. package/src/libs/ui/elements/src/index.ts +1 -0
  33. package/src/libs/ui/elements/src/lib/contact-pill/contact-pill.component.html +16 -0
  34. package/src/libs/ui/elements/src/lib/contact-pill/contact-pill.component.ts +26 -0
  35. package/src/libs/ui/elements/src/lib/internal-link-card/internal-link-card.component.html +1 -1
  36. package/src/libs/ui/elements/src/lib/internal-link-card/internal-link-card.component.ts +0 -1
  37. package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.css +0 -4
  38. package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html +27 -66
  39. package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.ts +30 -10
  40. package/src/libs/ui/inputs/src/lib/button/button.component.ts +4 -0
  41. package/src/libs/ui/inputs/src/lib/url-input/url-input.component.html +2 -2
  42. package/src/libs/ui/inputs/src/lib/url-input/url-input.component.ts +6 -2
  43. package/src/libs/ui/map/src/lib/components/map-container/map-container.component.ts +2 -1
  44. package/src/libs/ui/map/src/lib/components/spatial-extent/spatial-extent.component.ts +11 -10
  45. package/src/libs/ui/search/src/lib/record-preview-row/record-preview-row.component.html +0 -1
  46. package/src/libs/util/app-config/src/lib/app-config.ts +36 -0
  47. package/src/libs/util/app-config/src/lib/model.ts +4 -0
  48. package/src/libs/util/app-config/src/lib/parse-utils.ts +23 -1
  49. package/src/libs/util/shared/src/lib/record/quality-score.util.ts +33 -18
  50. package/src/libs/util/shared/src/lib/utils/index.ts +1 -0
  51. package/src/libs/util/shared/src/lib/utils/user-display.ts +23 -0
  52. package/tailwind.base.css +11 -2
  53. package/translations/de.json +2 -0
  54. package/translations/en.json +2 -0
  55. package/translations/es.json +2 -0
  56. package/translations/fr.json +2 -0
  57. package/translations/it.json +2 -0
  58. package/translations/nl.json +2 -0
  59. package/translations/pt.json +2 -0
  60. package/translations/sk.json +2 -0
@@ -3,27 +3,41 @@ import {
3
3
  RecordKind,
4
4
  } from '../../../../../../libs/common/domain/src/lib/model/record'
5
5
 
6
+ type TValidatorEntry = {
7
+ validator: (metadata: Partial<CatalogRecord>) => boolean
8
+ alias?: string
9
+ }
10
+
6
11
  type TValidatorMapper = {
7
- [key: string]: (metadata: Partial<CatalogRecord>) => boolean
12
+ [key: string]: TValidatorEntry
8
13
  }
9
14
 
10
15
  const ValidatorMapper: TValidatorMapper = {
11
- title: (record) => !!record?.title,
12
- abstract: (record) => !!record?.abstract,
13
- keywords: (record) => (record?.keywords?.length ?? 0) > 0,
14
- legalConstraints: (record) =>
15
- !!(
16
- record?.legalConstraints?.length &&
17
- record.legalConstraints.some((c) => c?.text?.trim().length > 0)
18
- ),
19
- contacts: (record) =>
20
- !!record?.contacts?.[0]?.email &&
21
- record.contacts[0].email !== 'missing@missing.com',
22
- updateFrequency: (record) =>
23
- !!record?.updateFrequency && record.updateFrequency !== 'unknown',
24
- topics: (record) => (record?.topics?.length ?? 0) > 0,
25
- organisation: (record) => !!record?.contacts?.[0]?.organization?.name,
26
- source: (record) => !!record?.extras?.sourcesIdentifiers,
16
+ title: { validator: (record) => !!record?.title },
17
+ abstract: { validator: (record) => !!record?.abstract },
18
+ keywords: { validator: (record) => (record?.keywords?.length ?? 0) > 0 },
19
+ legalConstraints: {
20
+ validator: (record) =>
21
+ !!(
22
+ record?.legalConstraints?.length &&
23
+ record.legalConstraints.some((c) => c?.text?.trim().length > 0)
24
+ ),
25
+ },
26
+ contacts: {
27
+ validator: (record) =>
28
+ !!record?.contacts?.[0]?.email &&
29
+ record.contacts[0].email !== 'missing@missing.com',
30
+ },
31
+ updateFrequency: {
32
+ validator: (record) =>
33
+ !!record?.updateFrequency && record.updateFrequency !== 'unknown',
34
+ },
35
+ topics: { validator: (record) => (record?.topics?.length ?? 0) > 0 },
36
+ organisation: {
37
+ validator: (record) => !!record?.contacts?.[0]?.organization?.name,
38
+ alias: 'contacts',
39
+ },
40
+ source: { validator: (record) => !!record?.extras?.sourcesIdentifiers },
27
41
  } as const
28
42
 
29
43
  export type ValidatorMapperKeys = keyof typeof ValidatorMapper & string
@@ -67,6 +81,7 @@ export function getQualityValidators(
67
81
 
68
82
  return filteredProps.map((name) => ({
69
83
  name,
70
- validator: () => ValidatorMapper[name](record),
84
+ validator: () => ValidatorMapper[name].validator(record),
85
+ alias: ValidatorMapper[name].alias,
71
86
  }))
72
87
  }
@@ -13,3 +13,4 @@ export * from './sort-by'
13
13
  export * from './strip-html'
14
14
  export * from './temporal-extent-union'
15
15
  export * from './url'
16
+ export * from './user-display'
@@ -0,0 +1,23 @@
1
+ import { UserModel } from '../../../../../../libs/common/domain/src/lib/model/user'
2
+ import { Individual } from '../../../../../../libs/common/domain/src/lib/model/record'
3
+
4
+ export function getIndividualDisplayName(individual: Individual): string {
5
+ const nameParts = [individual.firstName, individual.lastName]
6
+ .filter(Boolean)
7
+ .join(' ')
8
+ const orgPart = individual.organization?.name
9
+ ? ` (${individual.organization.name})`
10
+ : ''
11
+ if (nameParts) return `${nameParts}${orgPart}`
12
+ return individual.organization?.name ?? individual.email ?? ''
13
+ }
14
+
15
+ export function toIndividual(user: UserModel): Individual {
16
+ return {
17
+ firstName: user.name,
18
+ lastName: user.surname,
19
+ email: user.email,
20
+ role: 'unspecified',
21
+ organization: user.organisation ? { name: user.organisation } : undefined,
22
+ }
23
+ }
package/tailwind.base.css CHANGED
@@ -74,7 +74,10 @@
74
74
  --bg-hover: var(--gn-ui-button-bg-hover, var(--color-background));
75
75
  --font-size: var(--gn-ui-button-font-size, 1em);
76
76
  --color: var(--gn-ui-button-color, var(--color-main));
77
- @apply flex flex-row items-center justify-center
77
+ --disabled-opacity: var(--gn-ui-button-disabled-opacity, 0.5);
78
+ --justify: var(--gn-ui-button-justify, center);
79
+ justify-content: var(--justify);
80
+ @apply flex flex-row items-center
78
81
  text-[length:--font-size] leading-none
79
82
  text-[color:--color]
80
83
  p-[--padding] rounded-[--rounded] w-[--width] h-[--height] overflow-hidden
@@ -82,7 +85,7 @@
82
85
  hover:bg-[--bg-hover] focus:bg-[--bg-hover] active:bg-[--background]
83
86
  outline-none
84
87
  relative
85
- disabled:opacity-50 disabled:pointer-events-none
88
+ disabled:opacity-[--disabled-opacity] disabled:pointer-events-none
86
89
  focus:z-10 active:z-10 hover:z-10;
87
90
  }
88
91
  /* makes sure icons will not make the buttons grow vertically */
@@ -134,6 +137,12 @@
134
137
  bg-white border-white focus:ring-4 focus:ring-gray-300;
135
138
  }
136
139
 
140
+ .gn-ui-btn-primary-light {
141
+ @apply gn-ui-btn text-primary-darkest
142
+ bg-primary-white hover:bg-primary focus:bg-primary hover:text-white focus:text-white active:bg-primary-darker
143
+ border-transparent;
144
+ }
145
+
137
146
  .gn-ui-card-s {
138
147
  @apply min-h-[64px] w-full xs:min-w-[260px] xs:max-w-[280px] sm:min-w-[300px] sm:max-w-[500px] md:min-w-[230px];
139
148
  }
@@ -159,6 +159,7 @@
159
159
  "editor.record.form.field.legalConstraints": "Rechtliche Einschränkung",
160
160
  "editor.record.form.field.license": "Lizenz",
161
161
  "editor.record.form.field.onlineLinkResources": "Beigefügte Ressourcen",
162
+ "editor.record.form.field.onlineLinkageResource.defaultName": "Link",
162
163
  "editor.record.form.field.onlineResource.cancel": "Abbrechen",
163
164
  "editor.record.form.field.onlineResource.confirm": "Bestätigen",
164
165
  "editor.record.form.field.onlineResource.dialogTitle": "Vorschau des Datensatzes bearbeiten",
@@ -520,6 +521,7 @@
520
521
  "record.metadata.quality.updateFrequency.failed": "Aktualisierungsfrequenz nicht angegeben",
521
522
  "record.metadata.quality.updateFrequency.success": "Aktualisierungsfrequenz angegeben",
522
523
  "record.metadata.related": "Entdecken Sie den Katalog",
524
+ "record.metadata.resource.contacts": "Kontakte zur Ressource",
523
525
  "record.metadata.resourceCreated": "Erstellt",
524
526
  "record.metadata.resourcePublished": "Veröffentlicht",
525
527
  "record.metadata.resourceUpdated": "Zuletzt aktualisiert",
@@ -159,6 +159,7 @@
159
159
  "editor.record.form.field.legalConstraints": "Legal constraint",
160
160
  "editor.record.form.field.license": "License",
161
161
  "editor.record.form.field.onlineLinkResources": "Attached resources",
162
+ "editor.record.form.field.onlineLinkageResource.defaultName": "Link",
162
163
  "editor.record.form.field.onlineResource.cancel": "Cancel",
163
164
  "editor.record.form.field.onlineResource.confirm": "Confirm",
164
165
  "editor.record.form.field.onlineResource.dialogTitle": "Modify the dataset preview",
@@ -520,6 +521,7 @@
520
521
  "record.metadata.quality.updateFrequency.failed": "Update frequency is not specified",
521
522
  "record.metadata.quality.updateFrequency.success": "Update frequency is specified",
522
523
  "record.metadata.related": "Explore the catalog",
524
+ "record.metadata.resource.contacts": "Contacts for the resource",
523
525
  "record.metadata.resourceCreated": "Created",
524
526
  "record.metadata.resourcePublished": "Published",
525
527
  "record.metadata.resourceUpdated": "Last updated",
@@ -159,6 +159,7 @@
159
159
  "editor.record.form.field.legalConstraints": "",
160
160
  "editor.record.form.field.license": "",
161
161
  "editor.record.form.field.onlineLinkResources": "",
162
+ "editor.record.form.field.onlineLinkageResource.defaultName": "",
162
163
  "editor.record.form.field.onlineResource.cancel": "",
163
164
  "editor.record.form.field.onlineResource.confirm": "",
164
165
  "editor.record.form.field.onlineResource.dialogTitle": "",
@@ -520,6 +521,7 @@
520
521
  "record.metadata.quality.updateFrequency.failed": "",
521
522
  "record.metadata.quality.updateFrequency.success": "",
522
523
  "record.metadata.related": "",
524
+ "record.metadata.resource.contacts": "",
523
525
  "record.metadata.resourceCreated": "",
524
526
  "record.metadata.resourcePublished": "",
525
527
  "record.metadata.resourceUpdated": "",
@@ -159,6 +159,7 @@
159
159
  "editor.record.form.field.legalConstraints": "Contrainte légale",
160
160
  "editor.record.form.field.license": "Licence",
161
161
  "editor.record.form.field.onlineLinkResources": "Ressources attachées",
162
+ "editor.record.form.field.onlineLinkageResource.defaultName": "Lien",
162
163
  "editor.record.form.field.onlineResource.cancel": "Annuler",
163
164
  "editor.record.form.field.onlineResource.confirm": "Valider",
164
165
  "editor.record.form.field.onlineResource.dialogTitle": "Modifier l'aperçu du jeu de données",
@@ -520,6 +521,7 @@
520
521
  "record.metadata.quality.updateFrequency.failed": "La fréquence de mise à jour n'est pas renseignée",
521
522
  "record.metadata.quality.updateFrequency.success": "La fréquence de mise à jour est renseignée",
522
523
  "record.metadata.related": "Explorez le catalogue",
524
+ "record.metadata.resource.contacts": "Contacts liés à la donnée",
523
525
  "record.metadata.resourceCreated": "Créé",
524
526
  "record.metadata.resourcePublished": "Publié",
525
527
  "record.metadata.resourceUpdated": "Mis à jour",
@@ -159,6 +159,7 @@
159
159
  "editor.record.form.field.legalConstraints": "Vincolo legale",
160
160
  "editor.record.form.field.license": "Licenza",
161
161
  "editor.record.form.field.onlineLinkResources": "Risorse allegate",
162
+ "editor.record.form.field.onlineLinkageResource.defaultName": "Link",
162
163
  "editor.record.form.field.onlineResource.cancel": "Annulla",
163
164
  "editor.record.form.field.onlineResource.confirm": "Convalida",
164
165
  "editor.record.form.field.onlineResource.dialogTitle": "Modifica anteprima dataset",
@@ -520,6 +521,7 @@
520
521
  "record.metadata.quality.updateFrequency.failed": "La frequenza di aggiornamento non è specificata",
521
522
  "record.metadata.quality.updateFrequency.success": "La frequenza di aggiornamento è specificata",
522
523
  "record.metadata.related": "Vedi anche",
524
+ "record.metadata.resource.contacts": "Contatti per la risorsa",
523
525
  "record.metadata.resourceCreated": "Creato",
524
526
  "record.metadata.resourcePublished": "Pubblicato",
525
527
  "record.metadata.resourceUpdated": "Ultimo aggiornamento",
@@ -159,6 +159,7 @@
159
159
  "editor.record.form.field.legalConstraints": "",
160
160
  "editor.record.form.field.license": "",
161
161
  "editor.record.form.field.onlineLinkResources": "",
162
+ "editor.record.form.field.onlineLinkageResource.defaultName": "",
162
163
  "editor.record.form.field.onlineResource.cancel": "",
163
164
  "editor.record.form.field.onlineResource.confirm": "",
164
165
  "editor.record.form.field.onlineResource.dialogTitle": "",
@@ -520,6 +521,7 @@
520
521
  "record.metadata.quality.updateFrequency.failed": "",
521
522
  "record.metadata.quality.updateFrequency.success": "",
522
523
  "record.metadata.related": "",
524
+ "record.metadata.resource.contacts": "",
523
525
  "record.metadata.resourceCreated": "",
524
526
  "record.metadata.resourcePublished": "",
525
527
  "record.metadata.resourceUpdated": "",
@@ -159,6 +159,7 @@
159
159
  "editor.record.form.field.legalConstraints": "",
160
160
  "editor.record.form.field.license": "",
161
161
  "editor.record.form.field.onlineLinkResources": "",
162
+ "editor.record.form.field.onlineLinkageResource.defaultName": "",
162
163
  "editor.record.form.field.onlineResource.cancel": "",
163
164
  "editor.record.form.field.onlineResource.confirm": "",
164
165
  "editor.record.form.field.onlineResource.dialogTitle": "",
@@ -520,6 +521,7 @@
520
521
  "record.metadata.quality.updateFrequency.failed": "",
521
522
  "record.metadata.quality.updateFrequency.success": "",
522
523
  "record.metadata.related": "",
524
+ "record.metadata.resource.contacts": "",
523
525
  "record.metadata.resourceCreated": "",
524
526
  "record.metadata.resourcePublished": "",
525
527
  "record.metadata.resourceUpdated": "",
@@ -159,6 +159,7 @@
159
159
  "editor.record.form.field.legalConstraints": "",
160
160
  "editor.record.form.field.license": "Licencia",
161
161
  "editor.record.form.field.onlineLinkResources": "",
162
+ "editor.record.form.field.onlineLinkageResource.defaultName": "",
162
163
  "editor.record.form.field.onlineResource.cancel": "",
163
164
  "editor.record.form.field.onlineResource.confirm": "",
164
165
  "editor.record.form.field.onlineResource.dialogTitle": "",
@@ -520,6 +521,7 @@
520
521
  "record.metadata.quality.updateFrequency.failed": "Frekvencia aktualizácie nie je určená",
521
522
  "record.metadata.quality.updateFrequency.success": "Frekvencia aktualizácie je určená",
522
523
  "record.metadata.related": "Súvisiace záznamy",
524
+ "record.metadata.resource.contacts": "Kontakty k zdroju",
523
525
  "record.metadata.resourceCreated": "",
524
526
  "record.metadata.resourcePublished": "",
525
527
  "record.metadata.resourceUpdated": "",