geonetwork-ui 2.10.0-dev.69145ed6a → 2.10.0-dev.7e58935b2

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 (39) hide show
  1. package/fesm2022/geonetwork-ui.mjs +240 -55
  2. package/fesm2022/geonetwork-ui.mjs.map +1 -1
  3. package/index.d.ts +34 -6
  4. package/index.d.ts.map +1 -1
  5. package/package.json +1 -1
  6. package/src/libs/api/repository/src/lib/gn4/auth/auth.service.ts +4 -0
  7. package/src/libs/feature/editor/src/lib/components/contact-details/contact-details-form.component.css +0 -0
  8. package/src/libs/feature/editor/src/lib/components/contact-details/contact-details-form.component.html +67 -0
  9. package/src/libs/feature/editor/src/lib/components/contact-details/contact-details-form.component.ts +39 -0
  10. package/src/libs/feature/editor/src/lib/components/record-form/form-field/field-focus.directive.ts +38 -0
  11. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-constraints-shortcuts/form-field-constraints-shortcuts.component.ts +0 -1
  12. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts/form-field-contacts.component.html +9 -2
  13. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field-contacts/form-field-contacts.component.ts +12 -0
  14. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.css +37 -0
  15. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.html +1 -0
  16. package/src/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts +5 -0
  17. package/src/libs/feature/editor/src/lib/components/record-form/form-field/index.ts +1 -0
  18. package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.css +0 -3
  19. package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.html +0 -1
  20. package/src/libs/feature/editor/src/lib/components/record-form/record-form.component.ts +27 -25
  21. package/src/libs/feature/editor/src/lib/models/editor-config.model.ts +4 -0
  22. package/src/libs/ui/elements/src/index.ts +1 -0
  23. package/src/libs/ui/elements/src/lib/contact-details/contact-details.component.html +96 -0
  24. package/src/libs/ui/elements/src/lib/contact-details/contact-details.component.ts +45 -0
  25. package/src/libs/ui/elements/src/lib/contact-pill/contact-pill.component.html +23 -2
  26. package/src/libs/ui/elements/src/lib/contact-pill/contact-pill.component.ts +51 -7
  27. package/src/libs/ui/elements/src/lib/metadata-contact/metadata-contact.component.ts +2 -5
  28. package/src/libs/ui/elements/src/lib/metadata-info/metadata-info.component.html +2 -2
  29. package/src/libs/ui/inputs/src/lib/url-input/url-input.component.html +2 -2
  30. package/src/libs/ui/inputs/src/lib/url-input/url-input.component.ts +2 -1
  31. package/src/libs/util/shared/src/lib/utils/user-display.ts +9 -0
  32. package/translations/de.json +8 -1
  33. package/translations/en.json +8 -1
  34. package/translations/es.json +8 -1
  35. package/translations/fr.json +8 -1
  36. package/translations/it.json +8 -1
  37. package/translations/nl.json +8 -1
  38. package/translations/pt.json +8 -1
  39. package/translations/sk.json +8 -1
@@ -1,26 +1,70 @@
1
- import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
1
+ import { ConnectedPosition, OverlayModule } from '@angular/cdk/overlay'
2
+ import {
3
+ ChangeDetectionStrategy,
4
+ Component,
5
+ ElementRef,
6
+ inject,
7
+ Input,
8
+ } from '@angular/core'
2
9
  import { Individual } from '../../../../../../libs/common/domain/src/lib/model/record'
3
10
  import { NgIcon, provideIcons } from '@ng-icons/core'
11
+ import { matClose } from '@ng-icons/material-icons/baseline'
4
12
  import { matInfoOutline } from '@ng-icons/material-icons/outline'
5
13
  import { ButtonComponent } from '../../../../../../libs/ui/inputs/src'
6
14
  import { getIndividualDisplayName } from '../../../../../../libs/util/shared/src'
15
+ import { ContactDetailsComponent } from '../contact-details/contact-details.component'
7
16
 
8
17
  @Component({
9
18
  selector: 'gn-ui-contact-pill',
10
19
  templateUrl: './contact-pill.component.html',
11
20
  changeDetection: ChangeDetectionStrategy.OnPush,
12
21
  standalone: true,
13
- imports: [NgIcon, ButtonComponent],
14
- viewProviders: [
15
- provideIcons({
16
- matInfoOutline,
17
- }),
18
- ],
22
+ imports: [NgIcon, ButtonComponent, OverlayModule, ContactDetailsComponent],
23
+ viewProviders: [provideIcons({ matClose, matInfoOutline })],
19
24
  })
20
25
  export class ContactPillComponent {
21
26
  @Input() contact: Individual
22
27
 
28
+ private host = inject(ElementRef<HTMLElement>)
29
+
30
+ overlayOpen = false
31
+ overlayWidth = 0
32
+ overlayOffsetX = 0
33
+ overlayPositions: ConnectedPosition[] = [
34
+ {
35
+ originX: 'start',
36
+ originY: 'bottom',
37
+ overlayX: 'start',
38
+ overlayY: 'top',
39
+ offsetY: 4,
40
+ },
41
+ {
42
+ originX: 'start',
43
+ originY: 'top',
44
+ overlayX: 'start',
45
+ overlayY: 'bottom',
46
+ offsetY: -4,
47
+ },
48
+ ]
49
+
23
50
  get displayName(): string {
24
51
  return getIndividualDisplayName(this.contact)
25
52
  }
53
+
54
+ toggleOverlay() {
55
+ if (!this.overlayOpen) {
56
+ // Calculate the width and horizontal offset of the overlay to align it with the parent element
57
+ const parent =
58
+ this.host.nativeElement.parentElement.getBoundingClientRect()
59
+ const pill = this.host.nativeElement.getBoundingClientRect()
60
+ this.overlayWidth = parent.width
61
+ this.overlayOffsetX = parent.left - pill.left
62
+ }
63
+
64
+ this.overlayOpen = !this.overlayOpen
65
+ }
66
+
67
+ closeOverlay() {
68
+ this.overlayOpen = false
69
+ }
26
70
  }
@@ -21,7 +21,7 @@ import {
21
21
  matCallOutline,
22
22
  matLocationOnOutline,
23
23
  } from '@ng-icons/material-icons/outline'
24
-
24
+ import { getAddressLines } from '../../../../../../libs/util/shared/src'
25
25
  import { TranslateDirective } from '@ngx-translate/core'
26
26
 
27
27
  @Component({
@@ -59,10 +59,7 @@ export class MetadataContactComponent {
59
59
  }
60
60
 
61
61
  get address() {
62
- const addressParts = this.contacts[0].address
63
- .split(',')
64
- .map((part) => part.trim())
65
- return addressParts
62
+ return getAddressLines(this.contacts[0]?.address)
66
63
  }
67
64
 
68
65
  onOrganizationClick() {
@@ -53,7 +53,7 @@
53
53
  data-test="usage-panel"
54
54
  >
55
55
  <div class="flex flex-col gap-[10px] mr-4 py-[12px] rounded text-gray-900">
56
- @for (license of licenses; track license) {
56
+ @for (license of licenses; track $index) {
57
57
  @if (license.url) {
58
58
  <div class="text-primary">
59
59
  <a
@@ -117,7 +117,7 @@
117
117
  <p class="text-xs font-normal text-black">
118
118
  {{ group.roleLabel | translate }}
119
119
  </p>
120
- <div class="grid gap-0.5 grid-cols-1 md:grid-cols-2">
120
+ <div class="grid gap-1 grid-cols-1 md:grid-cols-2">
121
121
  @for (contact of group.contacts; track contact.email) {
122
122
  <gn-ui-contact-pill [contact]="contact"></gn-ui-contact-pill>
123
123
  }
@@ -6,7 +6,7 @@
6
6
  type="url"
7
7
  [value]="inputValue"
8
8
  (input)="handleInput($event)"
9
- (keydown.enter)="handleUpload(input)"
9
+ (keydown.enter)="handleUpload(input, $event)"
10
10
  [placeholder]="placeholder"
11
11
  [attr.aria-label]="placeholder"
12
12
  [disabled]="disabled"
@@ -25,7 +25,7 @@
25
25
  extraClass="absolute inset-y-[var(--side-padding)] right-[var(--side-padding)]"
26
26
  type="primary"
27
27
  [disabled]="disabled || input.value === '' || !isValidUrl(input.value)"
28
- (buttonClick)="handleUpload(input)"
28
+ (buttonClick)="handleUpload(input, $event)"
29
29
  >
30
30
  <ng-content>
31
31
  <ng-icon name="iconoirArrowUp"></ng-icon>
@@ -81,7 +81,8 @@ export class UrlInputComponent implements OnChanges {
81
81
  this.valueChange.next(value)
82
82
  }
83
83
 
84
- handleUpload(element: HTMLInputElement) {
84
+ handleUpload(element: HTMLInputElement, event: Event) {
85
+ event.stopPropagation()
85
86
  const value = element.value
86
87
  if (!value || !this.isValidUrl(value)) return
87
88
  this.uploadClick.next(value)
@@ -12,6 +12,15 @@ export function getIndividualDisplayName(individual: Individual): string {
12
12
  return individual.organization?.name ?? individual.email ?? ''
13
13
  }
14
14
 
15
+ export function getAddressLines(address: string | undefined): string[] {
16
+ return address
17
+ ? address
18
+ .split(',')
19
+ .map((part) => part.trim())
20
+ .filter(Boolean)
21
+ : []
22
+ }
23
+
15
24
  export function toIndividual(user: UserModel): Individual {
16
25
  return {
17
26
  firstName: user.name,
@@ -150,6 +150,14 @@
150
150
  "editor.record.form.draft.updateAlert": "Seit der Erstellung dieses Entwurfs wurde dieser Datensatz am { date } von { user } geändert. Durch das Veröffentlichen Ihrer Version können dessen Änderungen gelöscht werden. Um dies zu vermeiden, können Sie Ihre Änderungen rückgängig machen oder Ihre Version in voller Kenntnis der Sachlage veröffentlichen.",
151
151
  "editor.record.form.field.abstract": "Kurzbeschreibung",
152
152
  "editor.record.form.field.constraintsShortcuts": "",
153
+ "editor.record.form.field.contactDetails.email": "",
154
+ "editor.record.form.field.contactDetails.email.placeholder": "",
155
+ "editor.record.form.field.contactDetails.firstName": "",
156
+ "editor.record.form.field.contactDetails.firstName.placeholder": "",
157
+ "editor.record.form.field.contactDetails.lastName": "",
158
+ "editor.record.form.field.contactDetails.lastName.placeholder": "",
159
+ "editor.record.form.field.contactDetails.organization": "",
160
+ "editor.record.form.field.contactDetails.organization.placeholder": "",
153
161
  "editor.record.form.field.contacts": "Ansprechpartner - Email",
154
162
  "editor.record.form.field.contacts.noContact": "Bitte geben Sie mindestens einen Ansprechpartner an.",
155
163
  "editor.record.form.field.contacts.placeholder": "Kontakt auswählen",
@@ -495,7 +503,6 @@
495
503
  "record.metadata.preview.config.idle": "Standardvorschau festlegen",
496
504
  "record.metadata.preview.config.saved": "Gespeichert!",
497
505
  "record.metadata.preview.config.saving": "Speichern...",
498
- "record.metadata.producer": "Datenproduzent",
499
506
  "record.metadata.publication": "Veröffentlichungsdatum",
500
507
  "record.metadata.publications": "{count, plural, =0{Veröffentlichungsdatum} one{Veröffentlichungsdatum} other{Veröffentlichungen}}",
501
508
  "record.metadata.quality": "Metadatenqualität",
@@ -150,6 +150,14 @@
150
150
  "editor.record.form.draft.updateAlert": "Since you created this draft, the dataset has been updated on { date } by { user }. Publishing your draft might erase their edits. To avoid this, you need to either cancel your changes or knowingly publish your own version.",
151
151
  "editor.record.form.field.abstract": "Abstract",
152
152
  "editor.record.form.field.constraintsShortcuts": "",
153
+ "editor.record.form.field.contactDetails.email": "Contact email",
154
+ "editor.record.form.field.contactDetails.email.placeholder": "example@domainname.com",
155
+ "editor.record.form.field.contactDetails.firstName": "Contact first name",
156
+ "editor.record.form.field.contactDetails.firstName.placeholder": "First name",
157
+ "editor.record.form.field.contactDetails.lastName": "Contact last name",
158
+ "editor.record.form.field.contactDetails.lastName.placeholder": "Last name",
159
+ "editor.record.form.field.contactDetails.organization": "Contact organization",
160
+ "editor.record.form.field.contactDetails.organization.placeholder": "Company",
153
161
  "editor.record.form.field.contacts": "Point of contact - Email",
154
162
  "editor.record.form.field.contacts.noContact": "Please provide at least one point of contact.",
155
163
  "editor.record.form.field.contacts.placeholder": "Choose a contact",
@@ -495,7 +503,6 @@
495
503
  "record.metadata.preview.config.idle": "Set as default preview",
496
504
  "record.metadata.preview.config.saved": "Saved !",
497
505
  "record.metadata.preview.config.saving": "Saving...",
498
- "record.metadata.producer": "Data producer",
499
506
  "record.metadata.publication": "Date of publication",
500
507
  "record.metadata.publications": "{count, plural, =0{publication} one{publication} other{publications}}",
501
508
  "record.metadata.quality": "Metadata Quality",
@@ -150,6 +150,14 @@
150
150
  "editor.record.form.draft.updateAlert": "",
151
151
  "editor.record.form.field.abstract": "",
152
152
  "editor.record.form.field.constraintsShortcuts": "",
153
+ "editor.record.form.field.contactDetails.email": "",
154
+ "editor.record.form.field.contactDetails.email.placeholder": "",
155
+ "editor.record.form.field.contactDetails.firstName": "",
156
+ "editor.record.form.field.contactDetails.firstName.placeholder": "",
157
+ "editor.record.form.field.contactDetails.lastName": "",
158
+ "editor.record.form.field.contactDetails.lastName.placeholder": "",
159
+ "editor.record.form.field.contactDetails.organization": "",
160
+ "editor.record.form.field.contactDetails.organization.placeholder": "",
153
161
  "editor.record.form.field.contacts": "Punto de contacto - Correo ",
154
162
  "editor.record.form.field.contacts.noContact": "",
155
163
  "editor.record.form.field.contacts.placeholder": "",
@@ -495,7 +503,6 @@
495
503
  "record.metadata.preview.config.idle": "",
496
504
  "record.metadata.preview.config.saved": "",
497
505
  "record.metadata.preview.config.saving": "",
498
- "record.metadata.producer": "",
499
506
  "record.metadata.publication": "",
500
507
  "record.metadata.publications": "{count, plural, =0{} one{} other{}}",
501
508
  "record.metadata.quality": "",
@@ -150,6 +150,14 @@
150
150
  "editor.record.form.draft.updateAlert": "Depuis la création de ce brouillon, ce jeu de données a été modifié le { date } par { user }. Publier votre version peut supprimer ses modifications. Pour éviter cela, vous pouvez annuler vos changements, ou publier votre version en connaissance de cause.",
151
151
  "editor.record.form.field.abstract": "Description",
152
152
  "editor.record.form.field.constraintsShortcuts": "",
153
+ "editor.record.form.field.contactDetails.email": "Email du point de contact",
154
+ "editor.record.form.field.contactDetails.email.placeholder": "exemple@nomdedomaine.com",
155
+ "editor.record.form.field.contactDetails.firstName": "Prénom du point de contact",
156
+ "editor.record.form.field.contactDetails.firstName.placeholder": "Prénom",
157
+ "editor.record.form.field.contactDetails.lastName": "Nom du point de contact",
158
+ "editor.record.form.field.contactDetails.lastName.placeholder": "Nom",
159
+ "editor.record.form.field.contactDetails.organization": "Organisation du point de contact",
160
+ "editor.record.form.field.contactDetails.organization.placeholder": "Company",
153
161
  "editor.record.form.field.contacts": "Point de contact - Email",
154
162
  "editor.record.form.field.contacts.noContact": "Veuillez renseigner au moins un point de contact.",
155
163
  "editor.record.form.field.contacts.placeholder": "Choisissez un contact",
@@ -495,7 +503,6 @@
495
503
  "record.metadata.preview.config.idle": "Définir l'aperçu par défaut",
496
504
  "record.metadata.preview.config.saved": "Sauvegardé !",
497
505
  "record.metadata.preview.config.saving": "Sauvegarde...",
498
- "record.metadata.producer": "Producteur de la donnée",
499
506
  "record.metadata.publication": "Date de publication",
500
507
  "record.metadata.publications": "{count, plural, =0{ressource} one{ressource} other{ressources}}",
501
508
  "record.metadata.quality": "Description de la ressource",
@@ -150,6 +150,14 @@
150
150
  "editor.record.form.draft.updateAlert": "Da quando è stata creata questa bozza, questo dataset è stato modificato il { date } da { user }. La pubblicazione della sua versione potrebbe rimuovere le loro modifiche. Per evitarlo, puoi annullare le sue modifiche o pubblicare la sua versione consapevolmente.",
151
151
  "editor.record.form.field.abstract": "Riassunto",
152
152
  "editor.record.form.field.constraintsShortcuts": "",
153
+ "editor.record.form.field.contactDetails.email": "",
154
+ "editor.record.form.field.contactDetails.email.placeholder": "",
155
+ "editor.record.form.field.contactDetails.firstName": "",
156
+ "editor.record.form.field.contactDetails.firstName.placeholder": "",
157
+ "editor.record.form.field.contactDetails.lastName": "",
158
+ "editor.record.form.field.contactDetails.lastName.placeholder": "",
159
+ "editor.record.form.field.contactDetails.organization": "",
160
+ "editor.record.form.field.contactDetails.organization.placeholder": "",
153
161
  "editor.record.form.field.contacts": "",
154
162
  "editor.record.form.field.contacts.noContact": "Inserisci almeno un punto di contatto.",
155
163
  "editor.record.form.field.contacts.placeholder": "Scegli un contatto",
@@ -495,7 +503,6 @@
495
503
  "record.metadata.preview.config.idle": "",
496
504
  "record.metadata.preview.config.saved": "",
497
505
  "record.metadata.preview.config.saving": "",
498
- "record.metadata.producer": "Produttore dei dati",
499
506
  "record.metadata.publication": "Data di pubblicazione",
500
507
  "record.metadata.publications": "{count, plural, =0{pubblicazione} one{pubblicazione} other{pubblicazioni}}",
501
508
  "record.metadata.quality": "Qualità dei metadati",
@@ -150,6 +150,14 @@
150
150
  "editor.record.form.draft.updateAlert": "",
151
151
  "editor.record.form.field.abstract": "",
152
152
  "editor.record.form.field.constraintsShortcuts": "",
153
+ "editor.record.form.field.contactDetails.email": "",
154
+ "editor.record.form.field.contactDetails.email.placeholder": "",
155
+ "editor.record.form.field.contactDetails.firstName": "",
156
+ "editor.record.form.field.contactDetails.firstName.placeholder": "",
157
+ "editor.record.form.field.contactDetails.lastName": "",
158
+ "editor.record.form.field.contactDetails.lastName.placeholder": "",
159
+ "editor.record.form.field.contactDetails.organization": "",
160
+ "editor.record.form.field.contactDetails.organization.placeholder": "",
153
161
  "editor.record.form.field.contacts": "",
154
162
  "editor.record.form.field.contacts.noContact": "",
155
163
  "editor.record.form.field.contacts.placeholder": "",
@@ -495,7 +503,6 @@
495
503
  "record.metadata.preview.config.idle": "",
496
504
  "record.metadata.preview.config.saved": "",
497
505
  "record.metadata.preview.config.saving": "",
498
- "record.metadata.producer": "",
499
506
  "record.metadata.publication": "",
500
507
  "record.metadata.publications": "{count, plural, =0{} one{} other{}}",
501
508
  "record.metadata.quality": "",
@@ -150,6 +150,14 @@
150
150
  "editor.record.form.draft.updateAlert": "",
151
151
  "editor.record.form.field.abstract": "",
152
152
  "editor.record.form.field.constraintsShortcuts": "",
153
+ "editor.record.form.field.contactDetails.email": "",
154
+ "editor.record.form.field.contactDetails.email.placeholder": "",
155
+ "editor.record.form.field.contactDetails.firstName": "",
156
+ "editor.record.form.field.contactDetails.firstName.placeholder": "",
157
+ "editor.record.form.field.contactDetails.lastName": "",
158
+ "editor.record.form.field.contactDetails.lastName.placeholder": "",
159
+ "editor.record.form.field.contactDetails.organization": "",
160
+ "editor.record.form.field.contactDetails.organization.placeholder": "",
153
161
  "editor.record.form.field.contacts": "",
154
162
  "editor.record.form.field.contacts.noContact": "",
155
163
  "editor.record.form.field.contacts.placeholder": "",
@@ -495,7 +503,6 @@
495
503
  "record.metadata.preview.config.idle": "",
496
504
  "record.metadata.preview.config.saved": "",
497
505
  "record.metadata.preview.config.saving": "",
498
- "record.metadata.producer": "",
499
506
  "record.metadata.publication": "",
500
507
  "record.metadata.publications": "{count, plural, =0{} one{} other{}}",
501
508
  "record.metadata.quality": "",
@@ -150,6 +150,14 @@
150
150
  "editor.record.form.draft.updateAlert": "",
151
151
  "editor.record.form.field.abstract": "",
152
152
  "editor.record.form.field.constraintsShortcuts": "",
153
+ "editor.record.form.field.contactDetails.email": "",
154
+ "editor.record.form.field.contactDetails.email.placeholder": "",
155
+ "editor.record.form.field.contactDetails.firstName": "",
156
+ "editor.record.form.field.contactDetails.firstName.placeholder": "",
157
+ "editor.record.form.field.contactDetails.lastName": "",
158
+ "editor.record.form.field.contactDetails.lastName.placeholder": "",
159
+ "editor.record.form.field.contactDetails.organization": "",
160
+ "editor.record.form.field.contactDetails.organization.placeholder": "",
153
161
  "editor.record.form.field.contacts": "",
154
162
  "editor.record.form.field.contacts.noContact": "",
155
163
  "editor.record.form.field.contacts.placeholder": "",
@@ -495,7 +503,6 @@
495
503
  "record.metadata.preview.config.idle": "",
496
504
  "record.metadata.preview.config.saved": "",
497
505
  "record.metadata.preview.config.saving": "",
498
- "record.metadata.producer": "",
499
506
  "record.metadata.publication": "dátum publikácia",
500
507
  "record.metadata.publications": "{count, plural, =0{publikácia} one{publikácia} other{publikácie}}",
501
508
  "record.metadata.quality": "Kvalita metadát",