[CST-4591] Hide none item type entry from available entities in the collection form

This commit is contained in:
Giuseppe Digilio
2021-10-12 16:23:47 +02:00
parent e9bca1b51d
commit 93e0828135
2 changed files with 9 additions and 2 deletions

View File

@@ -23,6 +23,7 @@ import { ItemType } from '../../core/shared/item-relationships/item-type.model';
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';
/**
* Form used for creating and editing collections
@@ -80,7 +81,9 @@ export class CollectionFormComponent extends ComColFormComponent<Collection> imp
// retrieve all entity types to populate the dropdowns selection
entities$.subscribe((entityTypes: ItemType[]) => {
entityTypes.forEach((type: ItemType, index: number) => {
entityTypes
.filter((type: ItemType) => type.label !== NONE_ENTITY_TYPE)
.forEach((type: ItemType, index: number) => {
this.entityTypeSelection.add({
disabled: false,
label: type.label,