From a170f1f8a97bfa1c98e64f8d34a9f630e207cacf Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Fri, 24 Sep 2021 13:17:35 +0200 Subject: [PATCH] [CST-4591] Fix issue with navigate when entity type is empty --- .../my-dspace-new-external-dropdown.component.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.ts b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.ts index e806f162f4..651178e7a1 100644 --- a/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.ts +++ b/src/app/my-dspace-page/my-dspace-new-submission/my-dspace-new-external-dropdown/my-dspace-new-external-dropdown.component.ts @@ -92,7 +92,11 @@ export class MyDSpaceNewExternalDropdownComponent implements OnInit, OnDestroy { * Method called on clicking the button 'Import metadata from external source'. It opens the page of the external import. */ openPage(entity: ItemType) { - this.router.navigate(['/import-external'], { queryParams: { entity: entity.label } }); + const params = Object.create({}); + if (entity) { + params.entity = entity.label; + } + this.router.navigate(['/import-external'], { queryParams: params }); } /**