diff --git a/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts b/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts
index db576ccb2d..68c84caca4 100644
--- a/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts
+++ b/libs/feature/editor/src/lib/components/record-form/form-field/form-field.component.ts
@@ -32,6 +32,7 @@ import { FormFieldOverviewsComponent } from './form-field-overviews/form-field-o
import { map, take } from 'rxjs/operators'
import { EditorFacade } from '../../../+state/editor.facade'
import { FormFieldConfig } from '../../../models'
+import { FormFieldContactsForResourceComponent } from './form-field-contacts-for-resource/form-field-contacts-for-resource.component'
@Component({
selector: 'gn-ui-form-field',
@@ -59,6 +60,7 @@ import { FormFieldConfig } from '../../../models'
FormFieldKeywordsComponent,
TranslateModule,
FormFieldOverviewsComponent,
+ FormFieldContactsForResourceComponent,
],
})
export class FormFieldComponent {
@@ -122,6 +124,9 @@ export class FormFieldComponent {
get isKeywords() {
return this.model === 'keywords'
}
+ get isContactsForResource() {
+ return this.model === 'contactsForResource'
+ }
get withoutWrapper() {
return this.model === 'title' || this.model === 'abstract'
diff --git a/libs/feature/editor/src/lib/components/record-form/record-form.component.html b/libs/feature/editor/src/lib/components/record-form/record-form.component.html
index 277b79d049..208206241e 100644
--- a/libs/feature/editor/src/lib/components/record-form/record-form.component.html
+++ b/libs/feature/editor/src/lib/components/record-form/record-form.component.html
@@ -14,7 +14,7 @@
>
{{ section.labelKey }}
diff --git a/libs/feature/editor/src/lib/fields.config.ts b/libs/feature/editor/src/lib/fields.config.ts
index 1614eb1e05..549506ba31 100644
--- a/libs/feature/editor/src/lib/fields.config.ts
+++ b/libs/feature/editor/src/lib/fields.config.ts
@@ -83,6 +83,13 @@ export const RECORD_ABSTRACT_FIELD: EditorField = {
},
}
+export const CONTACTS_FOR_RESOURCE_FIELD: EditorField = {
+ model: 'contactsForResource',
+ formFieldConfig: {
+ labelKey: '',
+ },
+}
+
export const RECORD_GRAPHICAL_OVERVIEW_FIELD: EditorField = {
model: 'overviews',
formFieldConfig: {
@@ -157,7 +164,7 @@ export const DATA_MANAGERS_SECTION: EditorSection = {
labelKey: marker('editor.record.form.section.dataManagers.label'),
descriptionKey: marker('editor.record.form.section.dataManagers.description'),
hidden: false,
- fields: [],
+ fields: [CONTACTS_FOR_RESOURCE_FIELD],
}
export const DATA_POINT_OF_CONTACT_SECTION: EditorSection = {
diff --git a/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.html b/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.html
index 11bf550ee3..7c11bb2881 100644
--- a/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.html
+++ b/libs/feature/search/src/lib/fuzzy-search/fuzzy-search.component.html
@@ -6,6 +6,6 @@
(inputSubmitted)="handleInputSubmission($event)"
(inputCleared)="handleInputCleared()"
[value]="searchInputValue$ | async"
- [clearOnSelection]="true"
+ [preventCompleteOnSelection]="true"
[autoFocus]="autoFocus"
>
diff --git a/libs/ui/elements/src/lib/sortable-list/sortable-list.component.ts b/libs/ui/elements/src/lib/sortable-list/sortable-list.component.ts
index 11acd5c480..fd318e1b68 100644
--- a/libs/ui/elements/src/lib/sortable-list/sortable-list.component.ts
+++ b/libs/ui/elements/src/lib/sortable-list/sortable-list.component.ts
@@ -17,7 +17,7 @@ import {
import { MatIconModule } from '@angular/material/icon'
import { ButtonComponent } from '@geonetwork-ui/ui/inputs'
-type DynamicElement = {
+export type DynamicElement = {
component: Type
inputs: Record
}
@@ -40,7 +40,7 @@ type DynamicElement = {
})
export class SortableListComponent {
@Input() elements: Array
- @Input() addOptions: Array<{ buttonLabel: string; eventName: string }>
+ @Input() addOptions: Array<{ buttonLabel: string; eventName: string }> = []
@Output() elementsChange = new EventEmitter>()
@Output() add = new EventEmitter()
diff --git a/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.spec.ts b/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.spec.ts
index 138118521c..f97d73fc49 100644
--- a/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.spec.ts
+++ b/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.spec.ts
@@ -302,7 +302,6 @@ describe('AutocompleteComponent', () => {
}
describe('when true', () => {
beforeEach(() => {
- component.clearOnSelection = true
component.itemSelected.subscribe((event) => (selectionEmitted = event))
fixture.detectChanges()
component.handleSelection(selectionEvent)
@@ -313,8 +312,11 @@ describe('AutocompleteComponent', () => {
it('emits selection event', () => {
expect(selectionEmitted).toEqual('first')
})
- describe('if clear on selection', () => {
+ describe('if preventCompleteOnSelection on selection', () => {
it('set input value to last entered text', () => {
+ component.clearOnSelection = false
+ component.preventCompleteOnSelection = true
+
component.control.setValue('second')
component.handleSelection(selectionEvent)
expect(component.inputRef.nativeElement.value).toEqual('second')
@@ -323,6 +325,16 @@ describe('AutocompleteComponent', () => {
expect(component.inputRef.nativeElement.value).toEqual('second')
})
})
+ describe('if clearOnSelection on selection', () => {
+ it('set input value to empty string', () => {
+ component.clearOnSelection = true
+ component.preventCompleteOnSelection = false
+
+ component.control.setValue('second')
+ component.handleSelection(selectionEvent)
+ expect(component.inputRef.nativeElement.value).toEqual('')
+ })
+ })
})
})
diff --git a/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts b/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts
index 02761e908d..3d6a2114c3 100644
--- a/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts
+++ b/libs/ui/inputs/src/lib/autocomplete/autocomplete.component.ts
@@ -61,6 +61,7 @@ export class AutocompleteComponent
@Input() action: (value: string) => Observable
@Input() value?: AutocompleteItem
@Input() clearOnSelection = false
+ @Input() preventCompleteOnSelection = false
@Input() autoFocus = false
@Input() minCharacterCount? = 3
@Input() allowSubmit = true
@@ -206,13 +207,24 @@ export class AutocompleteComponent
this.inputSubmitted.emit(this.inputRef.nativeElement.value)
}
+ /**
+ * This function is triggered when an item is selected in the list of displayed items.
+ * If preventCompleteOnSelection is true then the input will be left as entered by the user.
+ * If preventCompleteOnSelection is false (by default) then the input will be completed with the item selected by the user.
+ * If clearOnSelection is true then the input will be cleared upon selection.
+ * @param event
+ */
handleSelection(event: MatAutocompleteSelectedEvent) {
this.cancelEnter = true
this.itemSelected.emit(event.option.value)
- if (this.clearOnSelection) {
- this.lastInputValue$.pipe(first()).subscribe((any) => {
- this.inputRef.nativeElement.value = any
+ if (this.preventCompleteOnSelection) {
+ this.lastInputValue$.pipe(first()).subscribe((lastInputValue) => {
+ this.inputRef.nativeElement.value = lastInputValue
})
+ return
+ }
+ if (this.clearOnSelection) {
+ this.inputRef.nativeElement.value = ''
}
}
}
diff --git a/translations/de.json b/translations/de.json
index 680ebf6d45..9fbb918c90 100644
--- a/translations/de.json
+++ b/translations/de.json
@@ -147,6 +147,27 @@
"dataset.error.parse": "Die Daten wurden geladen, konnten aber nicht gelesen werden: \"{ info }\"",
"dataset.error.unknown": "Die Daten können nicht angezeigt werden: \"{ info }\"",
"dataset.error.unsupportedType": "Der folgende Inhaltstyp wird nicht unterstützt: \"{ info }\"",
+ "domain.contact.role.author": "",
+ "domain.contact.role.collaborator": "",
+ "domain.contact.role.contributor": "",
+ "domain.contact.role.custodian": "",
+ "domain.contact.role.distributor": "",
+ "domain.contact.role.editor": "",
+ "domain.contact.role.funder": "",
+ "domain.contact.role.mediator": "",
+ "domain.contact.role.originator": "",
+ "domain.contact.role.other": "",
+ "domain.contact.role.owner": "",
+ "domain.contact.role.point_of_contact": "",
+ "domain.contact.role.principal_investigator": "",
+ "domain.contact.role.processor": "",
+ "domain.contact.role.publisher": "",
+ "domain.contact.role.resource_provider": "",
+ "domain.contact.role.rights_holder": "",
+ "domain.contact.role.sponsor": "",
+ "domain.contact.role.stakeholder": "",
+ "domain.contact.role.unspecified": "",
+ "domain.contact.role.user": "",
"domain.record.status.completed": "Abgeschlossen",
"domain.record.status.deprecated": "Veraltet",
"domain.record.status.ongoing": "Kontinuierliche Aktualisierung",
@@ -178,6 +199,7 @@
"editor.record.form.bottomButtons.next": "",
"editor.record.form.bottomButtons.previous": "",
"editor.record.form.field.abstract": "Kurzbeschreibung",
+ "editor.record.form.field.contactsForResource.noContact": "",
"editor.record.form.field.keywords": "Schlagwörter",
"editor.record.form.field.license": "Lizenz",
"editor.record.form.field.overviews": "",
diff --git a/translations/en.json b/translations/en.json
index 526162dc6b..658432cba6 100644
--- a/translations/en.json
+++ b/translations/en.json
@@ -147,6 +147,27 @@
"dataset.error.parse": "The data was loaded but could not be parsed: \"{ info }\"",
"dataset.error.unknown": "The data cannot be displayed: \"{ info }\"",
"dataset.error.unsupportedType": "The following content type is unsupported: \"{ info }\"",
+ "domain.contact.role.author": "Author",
+ "domain.contact.role.collaborator": "Collaborator",
+ "domain.contact.role.contributor": "Contributor",
+ "domain.contact.role.custodian": "Custodian",
+ "domain.contact.role.distributor": "Distributor",
+ "domain.contact.role.editor": "Editor",
+ "domain.contact.role.funder": "Funder",
+ "domain.contact.role.mediator": "Mediator",
+ "domain.contact.role.originator": "Originator",
+ "domain.contact.role.other": "Other",
+ "domain.contact.role.owner": "Owner",
+ "domain.contact.role.point_of_contact": "Point of contact",
+ "domain.contact.role.principal_investigator": "Principal investigator",
+ "domain.contact.role.processor": "Processor",
+ "domain.contact.role.publisher": "Publisher",
+ "domain.contact.role.resource_provider": "Resource provider",
+ "domain.contact.role.rights_holder": "Rights holder",
+ "domain.contact.role.sponsor": "Sponsor",
+ "domain.contact.role.stakeholder": "Stakeholder",
+ "domain.contact.role.unspecified": "Unspecified",
+ "domain.contact.role.user": "User",
"domain.record.status.completed": "Completed",
"domain.record.status.deprecated": "Deprecated",
"domain.record.status.ongoing": "On going",
@@ -178,6 +199,7 @@
"editor.record.form.bottomButtons.next": "Next",
"editor.record.form.bottomButtons.previous": "Previous",
"editor.record.form.field.abstract": "Abstract",
+ "editor.record.form.field.contactsForResource.noContact": "Please provide at least one point of contact responsible for the data.",
"editor.record.form.field.keywords": "Keywords",
"editor.record.form.field.license": "License",
"editor.record.form.field.overviews": "Overviews",
diff --git a/translations/es.json b/translations/es.json
index e5ca041e48..3a20085291 100644
--- a/translations/es.json
+++ b/translations/es.json
@@ -147,6 +147,27 @@
"dataset.error.parse": "",
"dataset.error.unknown": "",
"dataset.error.unsupportedType": "",
+ "domain.contact.role.author": "",
+ "domain.contact.role.collaborator": "",
+ "domain.contact.role.contributor": "",
+ "domain.contact.role.custodian": "",
+ "domain.contact.role.distributor": "",
+ "domain.contact.role.editor": "",
+ "domain.contact.role.funder": "",
+ "domain.contact.role.mediator": "",
+ "domain.contact.role.originator": "",
+ "domain.contact.role.other": "",
+ "domain.contact.role.owner": "",
+ "domain.contact.role.point_of_contact": "",
+ "domain.contact.role.principal_investigator": "",
+ "domain.contact.role.processor": "",
+ "domain.contact.role.publisher": "",
+ "domain.contact.role.resource_provider": "",
+ "domain.contact.role.rights_holder": "",
+ "domain.contact.role.sponsor": "",
+ "domain.contact.role.stakeholder": "",
+ "domain.contact.role.unspecified": "",
+ "domain.contact.role.user": "",
"domain.record.status.completed": "",
"domain.record.status.deprecated": "",
"domain.record.status.ongoing": "",
@@ -178,6 +199,7 @@
"editor.record.form.bottomButtons.next": "",
"editor.record.form.bottomButtons.previous": "",
"editor.record.form.field.abstract": "",
+ "editor.record.form.field.contactsForResource.noContact": "",
"editor.record.form.field.keywords": "",
"editor.record.form.field.license": "",
"editor.record.form.field.overviews": "",
diff --git a/translations/fr.json b/translations/fr.json
index cf1a8552d8..bfb59572ed 100644
--- a/translations/fr.json
+++ b/translations/fr.json
@@ -147,6 +147,27 @@
"dataset.error.parse": "Les données ont été chargées mais leur décodage a échoué: \"{ info }\"",
"dataset.error.unknown": "Les données ne peuvent être affichées: \"{ info }\"",
"dataset.error.unsupportedType": "Le type de contenu suivant n'est pas pris en charge: \"{ info }\"",
+ "domain.contact.role.author": "Auteur",
+ "domain.contact.role.collaborator": "Collaborateur",
+ "domain.contact.role.contributor": "Contributeur",
+ "domain.contact.role.custodian": "Gestionnaire",
+ "domain.contact.role.distributor": "Distributeur",
+ "domain.contact.role.editor": "Éditeur",
+ "domain.contact.role.funder": "Financeur",
+ "domain.contact.role.mediator": "Médiateur",
+ "domain.contact.role.originator": "Créateur",
+ "domain.contact.role.other": "Autre",
+ "domain.contact.role.owner": "Propriétaire",
+ "domain.contact.role.point_of_contact": "Point de contact",
+ "domain.contact.role.principal_investigator": "Chercheur principal",
+ "domain.contact.role.processor": "Processeur",
+ "domain.contact.role.publisher": "Éditeur",
+ "domain.contact.role.resource_provider": "Fournisseur",
+ "domain.contact.role.rights_holder": "Détenteur des droits",
+ "domain.contact.role.sponsor": "Sponsor",
+ "domain.contact.role.stakeholder": "Partie prenante",
+ "domain.contact.role.unspecified": "Non spécifié",
+ "domain.contact.role.user": "Utilisateur",
"domain.record.status.completed": "Finalisé",
"domain.record.status.deprecated": "Obsolète",
"domain.record.status.ongoing": "Mise à jour continue",
@@ -178,13 +199,14 @@
"editor.record.form.bottomButtons.next": "Suivant",
"editor.record.form.bottomButtons.previous": "Précédent",
"editor.record.form.field.abstract": "Résumé",
+ "editor.record.form.field.contactsForResource.noContact": "Veuillez renseigner au moins un point de contact responsable de la donnée.",
"editor.record.form.field.keywords": "Mots-clés",
"editor.record.form.field.license": "Licence",
"editor.record.form.field.overviews": "Aperçus",
"editor.record.form.field.recordUpdated": "Date de dernière révision",
"editor.record.form.field.resourceUpdated": "Date de dernière révision",
"editor.record.form.field.temporalExtents": "Étendue temporelle",
- "editor.record.form.field.title": "Titre",
+ "editor.record.form.field.title": "",
"editor.record.form.field.uniqueIdentifier": "Identifiant unique",
"editor.record.form.field.updateFrequency": "Fréquence de mise à jour",
"editor.record.form.license.cc-by": "",
diff --git a/translations/it.json b/translations/it.json
index bee062e3f1..d48108d20b 100644
--- a/translations/it.json
+++ b/translations/it.json
@@ -147,6 +147,27 @@
"dataset.error.parse": "I dati sono stati caricati ma la decodifica non è riuscita: \"{info}\"",
"dataset.error.unknown": "Impossibile visualizzare i dati: \"{info}\"",
"dataset.error.unsupportedType": "Il seguente tipo di contenuto non è supportato: \"{info}\"",
+ "domain.contact.role.author": "",
+ "domain.contact.role.collaborator": "",
+ "domain.contact.role.contributor": "",
+ "domain.contact.role.custodian": "",
+ "domain.contact.role.distributor": "",
+ "domain.contact.role.editor": "",
+ "domain.contact.role.funder": "",
+ "domain.contact.role.mediator": "",
+ "domain.contact.role.originator": "",
+ "domain.contact.role.other": "",
+ "domain.contact.role.owner": "",
+ "domain.contact.role.point_of_contact": "",
+ "domain.contact.role.principal_investigator": "",
+ "domain.contact.role.processor": "",
+ "domain.contact.role.publisher": "",
+ "domain.contact.role.resource_provider": "",
+ "domain.contact.role.rights_holder": "",
+ "domain.contact.role.sponsor": "",
+ "domain.contact.role.stakeholder": "",
+ "domain.contact.role.unspecified": "",
+ "domain.contact.role.user": "",
"domain.record.status.completed": "Completato",
"domain.record.status.deprecated": "Deprecato",
"domain.record.status.ongoing": "Aggiornamento continuo",
@@ -178,6 +199,7 @@
"editor.record.form.bottomButtons.next": "",
"editor.record.form.bottomButtons.previous": "",
"editor.record.form.field.abstract": "",
+ "editor.record.form.field.contactsForResource.noContact": "",
"editor.record.form.field.keywords": "",
"editor.record.form.field.license": "Licenza",
"editor.record.form.field.overviews": "",
diff --git a/translations/nl.json b/translations/nl.json
index 77207ebb78..d17a7136c7 100644
--- a/translations/nl.json
+++ b/translations/nl.json
@@ -147,6 +147,27 @@
"dataset.error.parse": "",
"dataset.error.unknown": "",
"dataset.error.unsupportedType": "",
+ "domain.contact.role.author": "",
+ "domain.contact.role.collaborator": "",
+ "domain.contact.role.contributor": "",
+ "domain.contact.role.custodian": "",
+ "domain.contact.role.distributor": "",
+ "domain.contact.role.editor": "",
+ "domain.contact.role.funder": "",
+ "domain.contact.role.mediator": "",
+ "domain.contact.role.originator": "",
+ "domain.contact.role.other": "",
+ "domain.contact.role.owner": "",
+ "domain.contact.role.point_of_contact": "",
+ "domain.contact.role.principal_investigator": "",
+ "domain.contact.role.processor": "",
+ "domain.contact.role.publisher": "",
+ "domain.contact.role.resource_provider": "",
+ "domain.contact.role.rights_holder": "",
+ "domain.contact.role.sponsor": "",
+ "domain.contact.role.stakeholder": "",
+ "domain.contact.role.unspecified": "",
+ "domain.contact.role.user": "",
"domain.record.status.completed": "",
"domain.record.status.deprecated": "",
"domain.record.status.ongoing": "",
@@ -178,6 +199,7 @@
"editor.record.form.bottomButtons.next": "",
"editor.record.form.bottomButtons.previous": "",
"editor.record.form.field.abstract": "",
+ "editor.record.form.field.contactsForResource.noContact": "",
"editor.record.form.field.keywords": "",
"editor.record.form.field.license": "",
"editor.record.form.field.overviews": "",
diff --git a/translations/pt.json b/translations/pt.json
index d0307afc9e..652b6adacf 100644
--- a/translations/pt.json
+++ b/translations/pt.json
@@ -147,6 +147,27 @@
"dataset.error.parse": "",
"dataset.error.unknown": "",
"dataset.error.unsupportedType": "",
+ "domain.contact.role.author": "",
+ "domain.contact.role.collaborator": "",
+ "domain.contact.role.contributor": "",
+ "domain.contact.role.custodian": "",
+ "domain.contact.role.distributor": "",
+ "domain.contact.role.editor": "",
+ "domain.contact.role.funder": "",
+ "domain.contact.role.mediator": "",
+ "domain.contact.role.originator": "",
+ "domain.contact.role.other": "",
+ "domain.contact.role.owner": "",
+ "domain.contact.role.point_of_contact": "",
+ "domain.contact.role.principal_investigator": "",
+ "domain.contact.role.processor": "",
+ "domain.contact.role.publisher": "",
+ "domain.contact.role.resource_provider": "",
+ "domain.contact.role.rights_holder": "",
+ "domain.contact.role.sponsor": "",
+ "domain.contact.role.stakeholder": "",
+ "domain.contact.role.unspecified": "",
+ "domain.contact.role.user": "",
"domain.record.status.completed": "",
"domain.record.status.deprecated": "",
"domain.record.status.ongoing": "",
@@ -178,6 +199,7 @@
"editor.record.form.bottomButtons.next": "",
"editor.record.form.bottomButtons.previous": "",
"editor.record.form.field.abstract": "",
+ "editor.record.form.field.contactsForResource.noContact": "",
"editor.record.form.field.keywords": "",
"editor.record.form.field.license": "",
"editor.record.form.field.overviews": "",
diff --git a/translations/sk.json b/translations/sk.json
index 7abb992c59..60da63833e 100644
--- a/translations/sk.json
+++ b/translations/sk.json
@@ -147,6 +147,27 @@
"dataset.error.parse": "Dáta boli načítané, ale nedajú sa analyzovať: \"{ info }\"",
"dataset.error.unknown": "Dáta nie je možné zobraziť: \"{ info }\"",
"dataset.error.unsupportedType": "Nepodporovaný typ obsahu: \"{ info }\"",
+ "domain.contact.role.author": "",
+ "domain.contact.role.collaborator": "",
+ "domain.contact.role.contributor": "",
+ "domain.contact.role.custodian": "",
+ "domain.contact.role.distributor": "",
+ "domain.contact.role.editor": "",
+ "domain.contact.role.funder": "",
+ "domain.contact.role.mediator": "",
+ "domain.contact.role.originator": "",
+ "domain.contact.role.other": "",
+ "domain.contact.role.owner": "",
+ "domain.contact.role.point_of_contact": "",
+ "domain.contact.role.principal_investigator": "",
+ "domain.contact.role.processor": "",
+ "domain.contact.role.publisher": "",
+ "domain.contact.role.resource_provider": "",
+ "domain.contact.role.rights_holder": "",
+ "domain.contact.role.sponsor": "",
+ "domain.contact.role.stakeholder": "",
+ "domain.contact.role.unspecified": "",
+ "domain.contact.role.user": "",
"domain.record.status.completed": "Dokončené",
"domain.record.status.deprecated": "Zastarané",
"domain.record.status.ongoing": "Prebiehajúce",
@@ -178,6 +199,7 @@
"editor.record.form.bottomButtons.next": "",
"editor.record.form.bottomButtons.previous": "",
"editor.record.form.field.abstract": "",
+ "editor.record.form.field.contactsForResource.noContact": "",
"editor.record.form.field.keywords": "",
"editor.record.form.field.license": "Licencia",
"editor.record.form.field.overviews": "",