diff options
author | Yoshie Muranaka <yoshiemuranaka@gmail.com> | 2020-09-03 23:58:35 +0300 |
---|---|---|
committer | Yoshie Muranaka <yoshiemuranaka@gmail.com> | 2020-09-25 06:27:21 +0300 |
commit | 3dd167a13191eedb4b7ed8cd80cf4f941049b463 (patch) | |
tree | 3883ea3ff41230557d6317dd8eabd3a594a3c496 | |
parent | f15cc7ac46022487ca36a3d8a66eb86791e040f9 (diff) | |
download | webui-vue-3dd167a13191eedb4b7ed8cd80cf4f941049b463.tar.xz |
Make customizations to IBM router
Removes KVM definition from default router. Before this change,
the IBM environment build would remove KVM from the app navigation,
but users could still access the page by typing in url directly for the
KVM page. With this change, the route should no longer be accessible
and will redirect to our 404 page.
Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Change-Id: I75439bc9443f9cbabbedf80b1142dd97209f5456
-rw-r--r-- | .env.ibm | 3 | ||||
-rw-r--r-- | src/env/router/ibm.js | 14 |
2 files changed, 15 insertions, 2 deletions
@@ -2,4 +2,5 @@ NODE_ENV=production VUE_APP_ENV_NAME=ibm VUE_APP_COMPANY_NAME="IBM" CUSTOM_STYLES=true -CUSTOM_APP_NAV=true
\ No newline at end of file +CUSTOM_APP_NAV=true +CUSTOM_ROUTER=true
\ No newline at end of file diff --git a/src/env/router/ibm.js b/src/env/router/ibm.js index 3a25650f..213920db 100644 --- a/src/env/router/ibm.js +++ b/src/env/router/ibm.js @@ -1,3 +1,15 @@ +import { remove } from 'lodash'; import routes from '@/router/routes'; -export default routes; +const customRoutes = routes.map(route => { + // Removes router definition that includes kvm + // in name property (main and console layouts) + + // TODO: will revisit this, removing the definition + // removes the route from the application but + // the component is still included in the final build + remove(route.children, ({ name }) => name.includes('kvm')); + return route; +}); + +export default customRoutes; |