mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 07:23:03 +00:00
[CST-4591] Hide none item type entry from available entities in the collection form
This commit is contained in:
@@ -23,6 +23,7 @@ import { ItemType } from '../../core/shared/item-relationships/item-type.model';
|
|||||||
import { MetadataValue } from '../../core/shared/metadata.models';
|
import { MetadataValue } from '../../core/shared/metadata.models';
|
||||||
import { getFirstSucceededRemoteListPayload } from '../../core/shared/operators';
|
import { getFirstSucceededRemoteListPayload } from '../../core/shared/operators';
|
||||||
import { collectionFormEntityTypeSelectionConfig, collectionFormModels, } from './collection-form.models';
|
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
|
* 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
|
// retrieve all entity types to populate the dropdowns selection
|
||||||
entities$.subscribe((entityTypes: ItemType[]) => {
|
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({
|
this.entityTypeSelection.add({
|
||||||
disabled: false,
|
disabled: false,
|
||||||
label: type.label,
|
label: type.label,
|
||||||
|
@@ -6,5 +6,9 @@ import { ResourceType } from '../resource-type';
|
|||||||
* Needs to be in a separate file to prevent circular
|
* Needs to be in a separate file to prevent circular
|
||||||
* dependencies in webpack.
|
* dependencies in webpack.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export const ITEM_TYPE = new ResourceType('entitytype');
|
export const ITEM_TYPE = new ResourceType('entitytype');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The unset entity type
|
||||||
|
*/
|
||||||
|
export const NONE_ENTITY_TYPE = 'none';
|
||||||
|
Reference in New Issue
Block a user