Skip to content

Commit

Permalink
fix(routerConfig): ent-3541 rhcloud-12690 platform nav update (RedHat…
Browse files Browse the repository at this point in the history
  • Loading branch information
cdcabrera committed Mar 15, 2021
1 parent b0edf2b commit d8abb67
Show file tree
Hide file tree
Showing 8 changed files with 139 additions and 221 deletions.
2 changes: 1 addition & 1 deletion src/components/authentication/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Authentication extends Component {
hideGlobalFilter();

const appNav = onNavigation(event => {
const { routeHref } = routerHelpers.getNavRouteDetail({ id: event.navId, returnDefault: true });
const { routeHref } = routerHelpers.getNavRouteDetail({ id: event.navId });
history.push(routeHref);
});

Expand Down
50 changes: 12 additions & 38 deletions src/components/router/__tests__/__snapshots__/router.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,8 @@ exports[`Router Component should render a basic component: basic 1`] = `
},
"disabled": false,
"exact": true,
"id": "rhel-sw",
"redirect": "/rhel-sw/all",
"render": true,
"to": "/rhel-sw/:variant(all|arm|ibmpower|ibmz|x86)",
"to": "/:variant(rhel|rhel-arm|rhel-ibmpower|rhel-ibmz|rhel-x86)",
},
Object {
"component": Object {
Expand All @@ -106,7 +104,7 @@ exports[`Router Component should render a basic component: basic 1`] = `
"disabled": false,
"exact": true,
"render": true,
"to": "/openshift-sw",
"to": "/openshift-container",
},
Object {
"component": Object {
Expand All @@ -117,9 +115,8 @@ exports[`Router Component should render a basic component: basic 1`] = `
},
"disabled": false,
"exact": true,
"id": "openshift-sw",
"render": true,
"to": "/openshift-sw/ocp",
"to": "/openshift-dedicated",
},
Object {
"component": Object {
Expand All @@ -131,20 +128,7 @@ exports[`Router Component should render a basic component: basic 1`] = `
"disabled": false,
"exact": true,
"render": true,
"to": "/openshift-sw/dedicated",
},
Object {
"component": Object {
"$$typeof": Symbol(react.lazy),
"_ctor": [Function],
"_result": null,
"_status": -1,
},
"disabled": false,
"exact": true,
"id": "satellite-sw",
"render": true,
"to": "/satellite-sw/:variant(all|satellite-capsule|satellite-server)",
"to": "/:variant(satellite|satellite-capsule|satellite-server)",
},
Object {
"activateOnError": true,
Expand All @@ -156,7 +140,6 @@ exports[`Router Component should render a basic component: basic 1`] = `
},
"disabled": false,
"exact": true,
"id": "optin",
"render": true,
"to": "/optin",
},
Expand All @@ -166,32 +149,26 @@ exports[`Router Component should render a basic component: basic 1`] = `
<Switch>
<Route
exact={true}
key="/rhel-sw/:variant(all|arm|ibmpower|ibmz|x86)"
path="/rhel-sw/:variant(all|arm|ibmpower|ibmz|x86)"
render={[Function]}
/>
<Route
exact={true}
key="/openshift-sw"
path="/openshift-sw"
key="/:variant(rhel|rhel-arm|rhel-ibmpower|rhel-ibmz|rhel-x86)"
path="/:variant(rhel|rhel-arm|rhel-ibmpower|rhel-ibmz|rhel-x86)"
render={[Function]}
/>
<Route
exact={true}
key="/openshift-sw/ocp"
path="/openshift-sw/ocp"
key="/openshift-container"
path="/openshift-container"
render={[Function]}
/>
<Route
exact={true}
key="/openshift-sw/dedicated"
path="/openshift-sw/dedicated"
key="/openshift-dedicated"
path="/openshift-dedicated"
render={[Function]}
/>
<Route
exact={true}
key="/satellite-sw/:variant(all|satellite-capsule|satellite-server)"
path="/satellite-sw/:variant(all|satellite-capsule|satellite-server)"
key="/:variant(satellite|satellite-capsule|satellite-server)"
path="/:variant(satellite|satellite-capsule|satellite-server)"
render={[Function]}
/>
<Route
Expand All @@ -200,9 +177,6 @@ exports[`Router Component should render a basic component: basic 1`] = `
path="/optin"
render={[Function]}
/>
<Redirect
to="/rhel-sw/all"
/>
</Switch>
</Router>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -6,93 +6,82 @@ exports[`RouterConfig should return specific properties: navigation 1`] = `
Array [
Object {
"default": true,
"id": "all",
"path": "/rhel-sw/all",
"pathId": "rhel-sw",
"id": "rhel",
"path": "/rhel",
"pathParameter": "RHEL",
"productParameter": "RHEL",
"viewParameter": "viewRHEL",
},
Object {
"id": "arm",
"path": "/rhel-sw/arm",
"pathId": "rhel-sw",
"id": "rhel-arm",
"path": "/rhel-arm",
"pathParameter": "RHEL for ARM",
"productParameter": "RHEL",
"viewParameter": "viewRHEL",
},
Object {
"id": "ibmpower",
"path": "/rhel-sw/ibmpower",
"pathId": "rhel-sw",
"id": "rhel-ibmpower",
"path": "/rhel-ibmpower",
"pathParameter": "RHEL for IBM Power",
"productParameter": "RHEL",
"viewParameter": "viewRHEL",
},
Object {
"id": "ibmz",
"path": "/rhel-sw/ibmz",
"pathId": "rhel-sw",
"id": "rhel-ibmz",
"path": "/rhel-ibmz",
"pathParameter": "RHEL for IBM z",
"productParameter": "RHEL",
"viewParameter": "viewRHEL",
},
Object {
"id": "x86",
"path": "/rhel-sw/x86",
"pathId": "rhel-sw",
"id": "rhel-x86",
"path": "/rhel-x86",
"pathParameter": "RHEL for x86",
"productParameter": "RHEL",
"viewParameter": "viewRHEL",
},
Object {
"id": "openshift-sw",
"path": "/openshift-sw",
"pathId": "openshift-sw",
"id": "openshift-container",
"path": "/openshift-container",
"pathParameter": "OpenShift Container Platform",
"productParameter": "OpenShift Container Platform",
"viewParameter": "viewOpenShift Container Platform",
},
Object {
"id": "ocp",
"path": "/openshift-sw/ocp",
"pathId": "openshift-sw",
"pathParameter": "OpenShift Container Platform",
"productParameter": "OpenShift Container Platform",
"viewParameter": "viewOpenShift Container Platform",
},
Object {
"id": "dedicated",
"path": "/openshift-sw/dedicated",
"pathId": "openshift-sw",
"id": "openshift-dedicated",
"path": "/openshift-dedicated",
"pathParameter": "OpenShift-dedicated-metrics",
"productParameter": "OpenShift-dedicated-metrics",
"viewParameter": "viewOpenShift-dedicated-metrics",
},
Object {
"id": "satellite-sw",
"path": "/satellite-sw/all",
"pathId": "satellite-sw",
"id": "satellite",
"path": "/satellite",
"pathParameter": "Satellite",
"productParameter": "Satellite",
"viewParameter": "viewSatellite",
},
Object {
"id": "satellite-capsule",
"path": "/satellite-sw/satellite-capsule",
"pathId": "satellite-sw",
"path": "/satellite-capsule",
"pathParameter": "Satellite Capsule",
"productParameter": "Satellite",
"viewParameter": "viewSatellite",
},
Object {
"id": "satellite-server",
"path": "/satellite-sw/satellite-server",
"pathId": "satellite-sw",
"path": "/satellite-server",
"pathParameter": "Satellite Server",
"productParameter": "Satellite",
"viewParameter": "viewSatellite",
},
Object {
"id": "optin",
"path": "/optin",
"pathParameter": null,
"productParameter": null,
"viewParameter": null,
},
]
`;

Expand All @@ -102,20 +91,6 @@ exports[`RouterConfig should return specific properties: platformModalRedirect 1

exports[`RouterConfig should return specific properties: routes 1`] = `
Array [
Object {
"component": Object {
"$$typeof": Symbol(react.lazy),
"_ctor": [Function],
"_result": null,
"_status": -1,
},
"disabled": false,
"exact": true,
"id": "rhel-sw",
"redirect": "/rhel-sw/all",
"render": true,
"to": "/rhel-sw/:variant(all|arm|ibmpower|ibmz|x86)",
},
Object {
"component": Object {
"$$typeof": Symbol(react.lazy),
Expand All @@ -126,7 +101,7 @@ Array [
"disabled": false,
"exact": true,
"render": true,
"to": "/openshift-sw",
"to": "/:variant(rhel|rhel-arm|rhel-ibmpower|rhel-ibmz|rhel-x86)",
},
Object {
"component": Object {
Expand All @@ -137,9 +112,8 @@ Array [
},
"disabled": false,
"exact": true,
"id": "openshift-sw",
"render": true,
"to": "/openshift-sw/ocp",
"to": "/openshift-container",
},
Object {
"component": Object {
Expand All @@ -151,7 +125,7 @@ Array [
"disabled": false,
"exact": true,
"render": true,
"to": "/openshift-sw/dedicated",
"to": "/openshift-dedicated",
},
Object {
"component": Object {
Expand All @@ -162,9 +136,8 @@ Array [
},
"disabled": false,
"exact": true,
"id": "satellite-sw",
"render": true,
"to": "/satellite-sw/:variant(all|satellite-capsule|satellite-server)",
"to": "/:variant(satellite|satellite-capsule|satellite-server)",
},
Object {
"activateOnError": true,
Expand All @@ -176,7 +149,6 @@ Array [
},
"disabled": false,
"exact": true,
"id": "optin",
"render": true,
"to": "/optin",
},
Expand Down
Loading

0 comments on commit d8abb67

Please sign in to comment.