[HIMA-28] add breadcrumb to article search

This commit is contained in:
Eraldo Hasanaj
2019-02-12 15:18:39 +01:00
parent c3692554b3
commit 5f5190c879

View File

@@ -578,7 +578,7 @@ export class ProcessState {
...state,
processes: state.processes.map(process => {
if (process.selected === true) {
return { ...process, breadcrumbs: [...process.breadcrumbs, payload] };
return { ...this.updateBreadcrumbForCurrentProcess(process, payload.name, payload.path) };
}
return { ...process };
})
@@ -611,9 +611,7 @@ export class ProcessState {
}
const updatedBreadcrumbs = process.breadcrumbs.map(
(breadcrumb: Breadcrumb) => {
if (breadcrumb.path === path) {
return { name: payload, path: path };
} else if (breadcrumb.path.substring(0, 16) === path.substring(0, 16)) {
if (breadcrumb.path === path || breadcrumb.path.substring(0, 16) === path.substring(0, 16)) {
return { name: payload, path: path };
}
return breadcrumb;