Skip to content

Commit

Permalink
fixes #26052 - navigation missing IDs
Browse files Browse the repository at this point in the history
  • Loading branch information
glekner committed Mar 7, 2019
1 parent b48d799 commit f978bbb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -88,7 +88,7 @@
"multiselect": "~0.9.12",
"number_helpers": "^0.1.1",
"patternfly": "^3.58.0",
"patternfly-react": "^2.29.0",
"patternfly-react": "^2.30.0",
"prop-types": "^15.6.0",
"react": "^16.8.1",
"react-bootstrap": "0.32.1",
Expand Down
@@ -1,5 +1,5 @@
import { createSelector } from 'reselect';
import { get } from 'lodash';
import { get, snakeCase } from 'lodash';

export const selectLayout = state => state.layout;

Expand Down Expand Up @@ -27,6 +27,8 @@ const patternflyItems = (data, currentLocation, currentOrganization) => {
const childrenArray = [];
item.children.forEach(child => {
const childObject = {
id: child.url ? `menu_item_${snakeCase(child.url)}` : '',
dataID: child.url ? `aid_${snakeCase(child.url)}` : '',
title: child.name,
isDivider: child.type === 'divider' && !!child.name,
className:
Expand Down
Expand Up @@ -96,15 +96,19 @@ Array [
"subItems": Array [
Object {
"className": "",
"dataID": "aid_",
"href": "/",
"id": "menu_item_",
"isDivider": false,
"onClick": null,
"preventHref": false,
"title": "Dashboard",
},
Object {
"className": "",
"dataID": "aid_fact_values",
"href": "/fact_values",
"id": "menu_item_fact_values",
"isDivider": false,
"onClick": null,
"preventHref": false,
Expand All @@ -120,15 +124,19 @@ Array [
"subItems": Array [
Object {
"className": "",
"dataID": "aid_hosts_new",
"href": "/hosts/new",
"id": "menu_item_hosts_new",
"isDivider": false,
"onClick": null,
"preventHref": false,
"title": "All Hosts",
},
Object {
"className": "",
"dataID": "aid_architectures",
"href": "/architectures",
"id": "menu_item_architectures",
"isDivider": false,
"onClick": null,
"preventHref": false,
Expand All @@ -144,15 +152,19 @@ Array [
"subItems": Array [
Object {
"className": "",
"dataID": "aid_environments",
"href": "/environments",
"id": "menu_item_environments",
"isDivider": false,
"onClick": null,
"preventHref": false,
"title": "Environments",
},
Object {
"className": "",
"dataID": "aid_architectures",
"href": "/architectures",
"id": "menu_item_architectures",
"isDivider": false,
"onClick": null,
"preventHref": false,
Expand All @@ -168,15 +180,19 @@ Array [
"subItems": Array [
Object {
"className": "",
"dataID": "aid_domains",
"href": "/domains",
"id": "menu_item_domains",
"isDivider": false,
"onClick": null,
"preventHref": false,
"title": "Domains",
},
Object {
"className": "",
"dataID": "aid_realms",
"href": "/realms",
"id": "menu_item_realms",
"isDivider": false,
"onClick": null,
"preventHref": false,
Expand Down

0 comments on commit f978bbb

Please sign in to comment.