Unverified Commit 0f4d93d3 authored by Joaquim Rocha's avatar Joaquim Rocha Committed by GitHub
Browse files

Merge pull request #559 from kinvolk/sidebar-plugin-fixes

frontend: Do not duplicate children in dynamic sidebar items
parents 1c96685f 1d4cad1a
Showing with 3 additions and 1 deletion
+3 -1
import _ from 'lodash';
import { SidebarEntry } from '../../redux/reducers/ui';
import store from '../../redux/stores/store';
......@@ -124,7 +125,8 @@ function prepareRoutes(t: (arg: string) => string) {
// @todo: Find a better way to avoid modifying the objects in LIST_ITEMS.
const routes: SidebarEntry[] = JSON.parse(JSON.stringify(LIST_ITEMS));
for (const item of Object.values(items)) {
for (const i of Object.values(items)) {
const item = _.cloneDeep(i);
const parent = item.parent ? routes.find(({ name }) => name === item.parent) : null;
let placement = routes;
if (parent) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment