fixed issue with adding devices to group
This commit is contained in:
parent
765ac72431
commit
539dd667c7
3 changed files with 13 additions and 24 deletions
|
|
@ -278,7 +278,6 @@ export default function SmartBreadcrumb(props: Props) {
|
|||
|
||||
const breadcrumbLinks = (): ReactNode[] => {
|
||||
const breadcrumbMap = getBreadcrumbMap();
|
||||
//console.log(breadcrumbMap)
|
||||
|
||||
let links: ReactNode[] = [];
|
||||
let pathnames = location.pathname.split("/").filter((x: any) => x);
|
||||
|
|
@ -288,24 +287,15 @@ export default function SmartBreadcrumb(props: Props) {
|
|||
return [linkComponent("/", "Dashboard", true)];
|
||||
}
|
||||
|
||||
// if (prependPaths) pathnames.unshift(...prependPaths)
|
||||
// if (prependPaths) pathnames.push(...prependPaths)
|
||||
if (prependPaths) pathnames.splice(pathnames.length - 1, 0, ...prependPaths);
|
||||
|
||||
//console.log(pathnames)
|
||||
|
||||
pathnames.forEach((_value: any, index: any) => {
|
||||
|
||||
const lastPath = index === pathnames.length - 1;
|
||||
//console.log(lastPath)
|
||||
const to = `/${pathnames.slice(0, index + 1).join("/")}`;
|
||||
//console.log("to: " + to)
|
||||
let label = breadcrumbMap[to];
|
||||
//console.log("label: "+label)
|
||||
let result = to.split("/").filter(str => str !== "");
|
||||
//console.log("result: " + result.toString())
|
||||
if (!label) {
|
||||
//console.log("no label")
|
||||
if (result.length > 1) {
|
||||
if (result[result.length - 1] !== "components") {
|
||||
label = breadcrumbMap["/" + result[result.length - 1]];
|
||||
|
|
@ -317,12 +307,10 @@ export default function SmartBreadcrumb(props: Props) {
|
|||
}
|
||||
|
||||
if (!blacklist.includes(to) && label) {
|
||||
//console.log("push link")
|
||||
links.push(linkComponent(to, label, lastPath));
|
||||
}
|
||||
|
||||
});
|
||||
//console.log(links)
|
||||
return links;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue