From b2b1782cd8505cf079782811bab4238e5cc0a359 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Fri, 30 Jun 2023 20:23:51 +0200 Subject: [PATCH 1/2] Hide entity field in collection form when entities aren't initialized --- .../collection-form/collection-form.component.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/collection-page/collection-form/collection-form.component.ts b/src/app/collection-page/collection-form/collection-form.component.ts index 23698de84e9..b52d282f634 100644 --- a/src/app/collection-page/collection-form/collection-form.component.ts +++ b/src/app/collection-page/collection-form/collection-form.component.ts @@ -79,9 +79,8 @@ export class CollectionFormComponent extends ComColFormComponent imp // retrieve all entity types to populate the dropdowns selection entities$.subscribe((entityTypes: ItemType[]) => { - entityTypes - .filter((type: ItemType) => type.label !== NONE_ENTITY_TYPE) - .forEach((type: ItemType, index: number) => { + entityTypes = entityTypes.filter((type: ItemType) => type.label !== NONE_ENTITY_TYPE); + entityTypes.forEach((type: ItemType, index: number) => { this.entityTypeSelection.add({ disabled: false, label: type.label, @@ -93,7 +92,7 @@ export class CollectionFormComponent extends ComColFormComponent imp } }); - this.formModel = [...collectionFormModels, this.entityTypeSelection]; + this.formModel = entityTypes.length === 0 ? collectionFormModels : [...collectionFormModels, this.entityTypeSelection]; super.ngOnInit(); }); From cf777268666587d5980408d7bc3872260606ae71 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Fri, 30 Jun 2023 22:41:07 +0200 Subject: [PATCH 2/2] Fix enter not submitting collection form correctly Fixed it for communities, collections, ePersons & groups --- .../eperson-form/eperson-form.component.html | 10 +++++----- .../group-form/group-form.component.html | 4 ++-- .../comcol-form/comcol-form.component.html | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.html b/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.html index e9cc48aee3d..156f2e776da 100644 --- a/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.html +++ b/src/app/access-control/epeople-registry/eperson-form/eperson-form.component.html @@ -15,23 +15,23 @@

{{messagePrefix + '.edit' | translate}}

[displayCancel]="false" (submitForm)="onSubmit()">
-
-
- -
- diff --git a/src/app/access-control/group-registry/group-form/group-form.component.html b/src/app/access-control/group-registry/group-form/group-form.component.html index 0fc5a574b7d..e50a4790904 100644 --- a/src/app/access-control/group-registry/group-form/group-form.component.html +++ b/src/app/access-control/group-registry/group-form/group-form.component.html @@ -25,12 +25,12 @@

{{messagePrefix + '.head.edit' | translate}}

[displayCancel]="false" (submitForm)="onSubmit()">
-
diff --git a/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.html b/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.html index 5d7b092f740..b7b3d344b1e 100644 --- a/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.html +++ b/src/app/shared/comcol/comcol-forms/comcol-form/comcol-form.component.html @@ -42,7 +42,7 @@ [formModel]="formModel" [displayCancel]="false" (submitForm)="onSubmit()"> -