From 6aba26aa3e6efdaef6e0474c3f5da53a39bc046b Mon Sep 17 00:00:00 2001 From: Sofia Papacharalampous Date: Mon, 3 Jun 2024 16:27:38 +0300 Subject: [PATCH] fix on breadcrumbs --- .../description/editor/description-editor.resolver.ts | 3 +-- .../misc/breadcrumb/navigation-breadcrumb.component.ts | 10 ++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dmp-frontend/src/app/ui/description/editor/description-editor.resolver.ts b/dmp-frontend/src/app/ui/description/editor/description-editor.resolver.ts index 7ceb3ba6c..656d0528c 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-editor.resolver.ts +++ b/dmp-frontend/src/app/ui/description/editor/description-editor.resolver.ts @@ -168,8 +168,7 @@ export class DescriptionEditorResolver extends BaseEditorResolver { } else if (dmpId != null && dmpSectionId != null && copyDmpId == null) { return this.dmpService.getSingle(Guid.parse(dmpId), DescriptionEditorResolver.dmpLookupFields()) .pipe(tap(x => { - this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label); - this.breadcrumbService.addIdResolvedValue(dmpSectionId, this.language.instant("DESCRIPTION-EDITOR.TITLE-NEW")); + this.breadcrumbService.addIdResolvedValue(`${x.id}/${dmpSectionId}`, this.language.instant("DESCRIPTION-EDITOR.TITLE-NEW")); }), takeUntil(this._destroyed), map(dmp => { diff --git a/dmp-frontend/src/app/ui/misc/breadcrumb/navigation-breadcrumb.component.ts b/dmp-frontend/src/app/ui/misc/breadcrumb/navigation-breadcrumb.component.ts index c4ee00eba..5c70231c5 100644 --- a/dmp-frontend/src/app/ui/misc/breadcrumb/navigation-breadcrumb.component.ts +++ b/dmp-frontend/src/app/ui/misc/breadcrumb/navigation-breadcrumb.component.ts @@ -144,6 +144,16 @@ export class NavigationBreadcrumbComponent extends BaseComponent { } + // replace whole pathParams + const paramText = Object.keys(pathParams) + .map(key => pathParams[key]) + .join('/'); + + if (this.paramToStringDictionary[paramText]) { + return [this.paramToStringDictionary[paramText], null]; + } + + // replace path params segments const title = Object.keys(pathParams) .sort((a, b) => b.length - a.length) // avoid param overlapping => :id2 (length 3) should be replaced before :id (length 2) .reduce(