Skip to content

Commit

Permalink
fix(routing): Use dynamic router basename
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyperkid123 authored and cdcabrera committed Oct 27, 2021
1 parent 1cdcf03 commit 2a73ac2
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/AppEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import '@patternfly/react-styles/css/components/Select/select.css';

const AppEntry = () => (
<Provider store={store}>
<BrowserRouter basename={routerHelpers.baseName}>
<BrowserRouter basename={routerHelpers.dynamicBaseName()}>
<App />
</BrowserRouter>
</Provider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ exports[`Authentication Component should return a message on 401 error: 401 erro

exports[`Authentication Component should return a redirect on 418 error: 418 error 1`] = `
<Redirect
baseName="/"
baseName="/subscriptions"
isForced={false}
route="/optin"
routes={
Expand Down Expand Up @@ -441,7 +441,7 @@ exports[`Authentication Component should return a redirect on a specific 403 err

exports[`Authentication Component should return a redirect on a specific 403 error and error code: 403 redirect error 1`] = `
<Redirect
baseName="/"
baseName="/subscriptions"
isForced={false}
route="/optin"
routes={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ exports[`Redirect Component should handle a forced redirect: forced route 1`] =
exports[`Redirect Component should handle a forced redirect: forced route, replace 1`] = `
Array [
Array [
"/dolor?dolor=sit",
"/subscriptions/dolor?dolor=sit",
],
]
`;
Expand Down
2 changes: 1 addition & 1 deletion src/components/router/redirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Redirect.propTypes = {
* isForced: boolean}}
*/
Redirect.defaultProps = {
baseName: routerHelpers.baseName,
baseName: routerHelpers.dynamicBaseName(),
isForced: false,
route: null,
routes: routerHelpers.routes,
Expand Down
2 changes: 1 addition & 1 deletion src/components/router/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const Router = ({ routes } = {}) => {
};

const routeDetail = {
baseName: routerHelpers.baseName,
baseName: routerHelpers.dynamicBaseName(),
errorRoute: activateOnErrorRoute,
routes,
routeItem: { ...item },
Expand Down

0 comments on commit 2a73ac2

Please sign in to comment.