61561: fixed ui issue for DS-4006

This commit is contained in:
lotte
2019-04-05 09:13:42 +02:00
parent f54a3a4d6b
commit 1ceae322de
3 changed files with 7 additions and 21 deletions

View File

@@ -26,7 +26,6 @@ export abstract class BaseResponseParsingService {
} else if (Array.isArray(data)) {
return this.processArray(data, requestUUID);
} else if (isRestDataObject(data)) {
data = this.fixBadEPersonRestResponse(data);
const object = this.deserialize(data);
if (isNotEmpty(data._embedded)) {
Object
@@ -141,23 +140,4 @@ export abstract class BaseResponseParsingService {
protected retrieveObjectOrUrl(obj: any): any {
return this.toCache ? obj.self : obj;
}
// TODO Remove when https://jira.duraspace.org/browse/DS-4006 is fixed
// See https://github.com/DSpace/dspace-angular/issues/292
private fixBadEPersonRestResponse(obj: any): any {
if (obj.type === ResourceType.EPerson) {
const groups = obj.groups;
const normGroups = [];
if (isNotEmpty(groups)) {
groups.forEach((group) => {
const parts = ['eperson', 'groups', group.uuid];
const href = new RESTURLCombiner(this.EnvConfig, ...parts).toString();
normGroups.push(href);
}
)
}
return Object.assign({}, obj, { groups: normGroups });
}
return obj;
}
}