mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-18 15:33:04 +00:00
added tests, aot fixes, lint fixes
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { MetadataRepresentationType } from '../../core/shared/metadata-representation/metadata-representation.model';
|
||||
import { hasNoValue, hasValue } from '../empty.util';
|
||||
import { Context } from '../../core/shared/context.model';
|
||||
import { Item } from '../../core/shared/item.model';
|
||||
|
||||
const map = new Map();
|
||||
export const map = new Map();
|
||||
|
||||
export const DEFAULT_ENTITY_TYPE = 'Publication';
|
||||
export const DEFAULT_REPRESENTATION_TYPE = MetadataRepresentationType.PlainText;
|
||||
export const DEFAULT_CONTEXT = Context.Undefined;
|
||||
|
||||
@@ -13,7 +13,6 @@ export function metadataRepresentationComponent(entityType: string, mdRepresenta
|
||||
if (hasNoValue(map.get(entityType))) {
|
||||
map.set(entityType, new Map());
|
||||
}
|
||||
|
||||
if (hasNoValue(map.get(entityType).get(mdRepresentationType))) {
|
||||
map.get(entityType).set(mdRepresentationType, new Map());
|
||||
}
|
||||
@@ -37,7 +36,9 @@ export function getMetadataRepresentationComponent(entityType: string, mdReprese
|
||||
return entityAndMDRepMap.get(DEFAULT_CONTEXT);
|
||||
}
|
||||
}
|
||||
return mapForEntity.get(DEFAULT_REPRESENTATION_TYPE).get(DEFAULT_CONTEXT);
|
||||
if (hasValue(mapForEntity.get(DEFAULT_REPRESENTATION_TYPE))) {
|
||||
return mapForEntity.get(DEFAULT_REPRESENTATION_TYPE).get(DEFAULT_CONTEXT);
|
||||
}
|
||||
}
|
||||
return map.get(Item.name).get(DEFAULT_REPRESENTATION_TYPE).get(DEFAULT_CONTEXT);
|
||||
}
|
||||
return map.get(DEFAULT_ENTITY_TYPE).get(DEFAULT_REPRESENTATION_TYPE).get(DEFAULT_CONTEXT);
|
||||
}
|
||||
|
Reference in New Issue
Block a user