mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Hide entity field in collection form when entities aren't initialized
This commit is contained in:
@@ -79,9 +79,8 @@ export class CollectionFormComponent extends ComColFormComponent<Collection> imp
|
|||||||
// retrieve all entity types to populate the dropdowns selection
|
// retrieve all entity types to populate the dropdowns selection
|
||||||
entities$.subscribe((entityTypes: ItemType[]) => {
|
entities$.subscribe((entityTypes: ItemType[]) => {
|
||||||
|
|
||||||
entityTypes
|
entityTypes = entityTypes.filter((type: ItemType) => type.label !== NONE_ENTITY_TYPE);
|
||||||
.filter((type: ItemType) => type.label !== NONE_ENTITY_TYPE)
|
entityTypes.forEach((type: ItemType, index: number) => {
|
||||||
.forEach((type: ItemType, index: number) => {
|
|
||||||
this.entityTypeSelection.add({
|
this.entityTypeSelection.add({
|
||||||
disabled: false,
|
disabled: false,
|
||||||
label: type.label,
|
label: type.label,
|
||||||
@@ -93,7 +92,7 @@ export class CollectionFormComponent extends ComColFormComponent<Collection> imp
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.formModel = [...collectionFormModels, this.entityTypeSelection];
|
this.formModel = entityTypes.length === 0 ? collectionFormModels : [...collectionFormModels, this.entityTypeSelection];
|
||||||
|
|
||||||
super.ngOnInit();
|
super.ngOnInit();
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user