Created
May 21, 2019 14:26
-
-
Save johnpmitsch/b5e2de33e9c777a064712c69978d564b to your computer and use it in GitHub Desktop.
bastion pages not loading in katello dev box workaround
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/webpack/assets/javascripts/react_app/routes/index.js b/webpack/assets/javascripts/react_app/routes/index.js | |
index 22446c9..4a4afaa 100644 | |
--- a/webpack/assets/javascripts/react_app/routes/index.js | |
+++ b/webpack/assets/javascripts/react_app/routes/index.js | |
@@ -5,6 +5,26 @@ import { Switch, Route } from 'react-router-dom'; | |
import { routes } from './routes'; | |
let currentLocation = null; | |
+const katelloRoutes = [ | |
+ "/activation_keys", | |
+ "/content_credentials", | |
+ "/content_hosts", | |
+ "/content_views", | |
+ "/debs", | |
+ "/docker_tags", | |
+ "/files", | |
+ "/ostree_branches", | |
+ "/errata", | |
+ "/packages", | |
+ "/lifecycle_environments", | |
+ "/products", | |
+ "/puppet_modules", | |
+ "/legacy_subscriptions", | |
+ "/sync_plans", | |
+ "/host_collections", | |
+ "/katello_tasks", | |
+ "/select_organization" | |
+]; | |
const AppSwitcher = () => ( | |
<Switch> | |
@@ -27,8 +47,12 @@ const AppSwitcher = () => ( | |
currentLocation && | |
currentLocation.pathname !== child.location.pathname | |
) { | |
- if (!window.history.state.turbolinks) | |
- window.Turbolinks.visit(child.location.pathname); | |
+ if (!window.history.state.turbolinks){ | |
+ const newPath = child.location.pathname; | |
+ if (!katelloRoutes.includes(newPath)) { | |
+ window.Turbolinks.visit(newPath); | |
+ } | |
+ } | |
} | |
currentLocation = child.location; | |
return null; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment