From da206d4669cf9077261feb150a33d69f942a33d7 Mon Sep 17 00:00:00 2001 From: im-shubham-vish Date: Fri, 13 Sep 2024 12:56:20 +0530 Subject: [PATCH] Fix for #1602 Insufficient collection information when submitting an article --- .../sidebar-search-list-element.component.ts | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts b/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts index c607d114edb..20847d3c75d 100644 --- a/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts +++ b/src/app/shared/object-list/sidebar-search-list-element/sidebar-search-list-element.component.ts @@ -92,25 +92,25 @@ export class SidebarSearchListElementComponent, K exte }), ); } - + getHierarchicalName(): Observable { return this.getParentTitle().pipe( switchMap((parentTitle: string) => { - return this.getParent().pipe( - switchMap((parentRD: RemoteData) => { - if (hasValue(parentRD) && hasValue(parentRD.payload)) { - const parentInstance = this.createInstanceFromDSpaceObject(parentRD.payload); - return parentInstance.getHierarchicalName().pipe( - map((ancestorName: string) => ancestorName ? `${ancestorName} > ${parentTitle}` : parentTitle) - ); - } - return observableOf(parentTitle); - }) - ); - }) + return this.getParent().pipe( + switchMap((parentRD: RemoteData) => { + if (hasValue(parentRD) && hasValue(parentRD.payload)) { + const parentInstance = this.createInstanceFromDSpaceObject(parentRD.payload); + return parentInstance.getHierarchicalName().pipe( + map((ancestorName: string) => ancestorName ? `${ancestorName} > ${parentTitle}` : parentTitle), + ); + } + return observableOf(parentTitle); + }), + ); + }), ); } - + /** * Utility method to create an instance of the current class from a DSpaceObject */