Merge branch 'fix-collection-form-bugs_contribute-7.4' into fix-collection-form-bugs_contribute-7.6

# Conflicts:
#	src/app/access-control/epeople-registry/eperson-form/eperson-form.component.html
This commit is contained in:
Alexandre Vryghem
2023-07-28 00:14:58 +02:00
4 changed files with 11 additions and 12 deletions

View File

@@ -98,9 +98,8 @@ export class CollectionFormComponent extends ComColFormComponent<Collection> 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,
@@ -112,7 +111,7 @@ export class CollectionFormComponent extends ComColFormComponent<Collection> imp
}
});
this.formModel = [...collectionFormModels, this.entityTypeSelection];
this.formModel = entityTypes.length === 0 ? collectionFormModels : [...collectionFormModels, this.entityTypeSelection];
super.ngOnInit();
this.chd.detectChanges();