mirror of
https://github.com/ansible/awx.git
synced 2026-02-17 11:10:03 -03:30
update map function to be chained
This commit is contained in:
committed by
Marliana Lara
parent
f83b59cb48
commit
00c9ae1376
10
src/App.jsx
10
src/App.jsx
@@ -57,11 +57,11 @@ const SideNavItems = ({ items, history }) => {
|
||||
const currentPath = history.location.pathname.replace(/^\//, '');
|
||||
let activeGroup;
|
||||
if (currentPath !== '') {
|
||||
const groupPaths = items.map(({ groupName, routes }) => ({
|
||||
groupName,
|
||||
paths: routes.map(({ path }) => path)
|
||||
}));
|
||||
[{ groupName: activeGroup }] = groupPaths
|
||||
[{ groupName: activeGroup }] = items
|
||||
.map(({ groupName, routes }) => ({
|
||||
groupName,
|
||||
paths: routes.map(({ path }) => path)
|
||||
}))
|
||||
.filter(({ paths }) => paths.indexOf(currentPath) > -1);
|
||||
} else {
|
||||
activeGroup = 'views';
|
||||
|
||||
Reference in New Issue
Block a user