fix on breadcrumbs

This commit is contained in:
Sofia Papacharalampous 2024-06-03 16:27:38 +03:00
parent 601b748388
commit 6aba26aa3e
2 changed files with 11 additions and 2 deletions

View File

@ -168,8 +168,7 @@ export class DescriptionEditorResolver extends BaseEditorResolver {
} else if (dmpId != null && dmpSectionId != null && copyDmpId == null) { } else if (dmpId != null && dmpSectionId != null && copyDmpId == null) {
return this.dmpService.getSingle(Guid.parse(dmpId), DescriptionEditorResolver.dmpLookupFields()) return this.dmpService.getSingle(Guid.parse(dmpId), DescriptionEditorResolver.dmpLookupFields())
.pipe(tap(x => { .pipe(tap(x => {
this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label); this.breadcrumbService.addIdResolvedValue(`${x.id}/${dmpSectionId}`, this.language.instant("DESCRIPTION-EDITOR.TITLE-NEW"));
this.breadcrumbService.addIdResolvedValue(dmpSectionId, this.language.instant("DESCRIPTION-EDITOR.TITLE-NEW"));
}), takeUntil(this._destroyed), map(dmp => { }), takeUntil(this._destroyed), map(dmp => {

View File

@ -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) 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) .sort((a, b) => b.length - a.length) // avoid param overlapping => :id2 (length 3) should be replaced before :id (length 2)
.reduce( .reduce(