mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +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(),
|
||||
getRemoteDataPayload(),
|
||||
map((relationshipTypes) => relationshipTypes.page),
|
||||
map((types) => types.reduce<RelationshipType[]>((includedTypes, type) => {
|
||||
if (!includedTypes.some((includedType) => includedType.id === type.id)) {
|
||||
switchMap((types) =>
|
||||
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];
|
||||
} else {
|
||||
return includedTypes;
|
||||
}
|
||||
}, [])),
|
||||
}, [])
|
||||
),
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
this.types$.pipe(
|
||||
|
Reference in New Issue
Block a user