From 47e7eb1a4fc74b768961ca3b766b661809e58db8 Mon Sep 17 00:00:00 2001 From: Alisa Ismailati Date: Thu, 22 Jun 2023 12:14:15 +0200 Subject: [PATCH] [DURACOM-170] Fixed "add collection" behavior --- .../collection-form/collection-form.component.ts | 8 ++++++++ 1 file changed, 8 insertions(+) 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 84223d260a..ebb03df3b9 100644 --- a/src/app/collection-page/collection-form/collection-form.component.ts +++ b/src/app/collection-page/collection-form/collection-form.component.ts @@ -22,6 +22,8 @@ import { MetadataValue } from '../../core/shared/metadata.models'; import { getFirstSucceededRemoteListPayload } from '../../core/shared/operators'; import { collectionFormEntityTypeSelectionConfig, collectionFormModels, } from './collection-form.models'; import { NONE_ENTITY_TYPE } from '../../core/shared/item-relationships/item-type.resource-type'; +import { hasNoValue, isNotNull } from 'src/app/shared/empty.util'; + /** * Form used for creating and editing collections @@ -66,6 +68,12 @@ export class CollectionFormComponent extends ComColFormComponent imp super(formService, translate, notificationsService, authService, requestService, objectCache); } + ngOnInit(): void { + if (hasNoValue(this.formModel) && isNotNull(this.dso)) { + this.initializeForm(); + } + } + /** * Detect changes to the dso and initialize the form, * if the dso changes, exists and it is not the first change