mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
Virtual metadata on item delete - filter relationship types without relationships
This commit is contained in:
@@ -107,13 +107,20 @@ export class ItemDeleteComponent
|
|||||||
getSucceededRemoteData(),
|
getSucceededRemoteData(),
|
||||||
getRemoteDataPayload(),
|
getRemoteDataPayload(),
|
||||||
map((relationshipTypes) => relationshipTypes.page),
|
map((relationshipTypes) => relationshipTypes.page),
|
||||||
map((types) => types.reduce<RelationshipType[]>((includedTypes, type) => {
|
switchMap((types) =>
|
||||||
if (!includedTypes.some((includedType) => includedType.id === type.id)) {
|
combineLatest(types.map((type) => this.getRelationships(type))).pipe(
|
||||||
|
map((relationships) =>
|
||||||
|
types.reduce<RelationshipType[]>((includedTypes, type, index) => {
|
||||||
|
if (!includedTypes.some((includedType) => includedType.id === type.id)
|
||||||
|
&& !(relationships[index].length === 0)) {
|
||||||
return [...includedTypes, type];
|
return [...includedTypes, type];
|
||||||
} else {
|
} else {
|
||||||
return includedTypes;
|
return includedTypes;
|
||||||
}
|
}
|
||||||
}, [])),
|
}, [])
|
||||||
|
),
|
||||||
|
)
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
this.types$.pipe(
|
this.types$.pipe(
|
||||||
|
Reference in New Issue
Block a user