From 3e7b927118aeaa9ce132cd4cabf11c91c26b7776 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 18 Dec 2019 22:39:18 +0000 Subject: [PATCH] --- ayanova/src/App.vue | 2 +- ayanova/src/api/errorhandler.js | 1 + ayanova/src/api/gzapi.js | 2 +- ayanova/src/api/gzmenu.js | 2 +- ayanova/src/router.js | 51 +++++-------------- ayanova/src/views/login.vue | 2 +- ayanova/src/views/notfound.vue | 1 + ...dit.vue => test-inventory-widget-edit.vue} | 0 8 files changed, 19 insertions(+), 42 deletions(-) rename ayanova/src/views/{inventory-widget-edit.vue => test-inventory-widget-edit.vue} (100%) diff --git a/ayanova/src/App.vue b/ayanova/src/App.vue index 3a2fcb8c..020f4feb 100644 --- a/ayanova/src/App.vue +++ b/ayanova/src/App.vue @@ -263,7 +263,7 @@ export default { //redirect to login if not authenticated if (!this.$store.state.authenticated) { - this.$router.push({ name: "login" }); + this.$router.push("\login"); } //FUTURE: If need to detect a reload, this works reliably diff --git a/ayanova/src/api/errorhandler.js b/ayanova/src/api/errorhandler.js index 60717d19..58183eef 100644 --- a/ayanova/src/api/errorhandler.js +++ b/ayanova/src/api/errorhandler.js @@ -31,6 +31,7 @@ function dealWithError(msg, vm) { msg; // eslint-disable-next-line no-console console.log(errMsg); + debugger; window.$gz.eventBus.$emit("notify-error", "Dev error see log / console"); } diff --git a/ayanova/src/api/gzapi.js b/ayanova/src/api/gzapi.js index 82eedf3b..9e069c71 100644 --- a/ayanova/src/api/gzapi.js +++ b/ayanova/src/api/gzapi.js @@ -55,7 +55,7 @@ function handleError(action, error, route, reject) { "notify-warning", window.$gz.locale.get("ErrorUserNotAuthorized") ); - router.push("/"); + router.push("/dashboard"); return reject("[ErrorUserNotAuthorized]"); } diff --git a/ayanova/src/api/gzmenu.js b/ayanova/src/api/gzmenu.js index 6f6d1b3d..8313ab35 100644 --- a/ayanova/src/api/gzmenu.js +++ b/ayanova/src/api/gzmenu.js @@ -147,7 +147,7 @@ export default { window.open(helpurl, "_blank"); break; case "logout": - vm.$router.push({ name: "login" }); + vm.$router.push("/login"); break; case "customize": vm.$router.push({ diff --git a/ayanova/src/router.js b/ayanova/src/router.js index ecce273a..0c5f7677 100644 --- a/ayanova/src/router.js +++ b/ayanova/src/router.js @@ -254,6 +254,15 @@ export default new Router({ import(/* webpackChunkName: "test" */ "./views/test-inventory.vue") }, + { + path: "/inventory/widget/edit/:id", + name: "inventory-widget-edit", + component: () => + import( + /* webpackChunkName: "inventory" */ "./views/test-inventory-widget-edit.vue" + ) + }, + { path: "/vendors", name: "vendors", @@ -314,7 +323,7 @@ export default new Router({ path: "/history", name: "history", component: () => - import(/* webpackChunkName: "administration" */ "./views/files.vue") + import(/* webpackChunkName: "administration" */ "./views/history.vue") }, { @@ -360,7 +369,7 @@ export default new Router({ /* webpackChunkName: "operations" */ "./views/notify-settings.vue" ) }, - //**********************************OLD OLD OLD RENAME AND REMOVE */ + //**********************************GENERAL */ { path: "/about", name: "about", @@ -376,41 +385,6 @@ export default new Router({ component: () => import(/* webpackChunkName: "aybase" */ "./views/log.vue") }, - - { - path: "/inventory/widget/edit/:id", - name: "inventory-widget-edit", - component: () => - import( - /* webpackChunkName: "inventory" */ "./views/inventory-widget-edit.vue" - ) - }, - { - path: "/service", - name: "service", - component: service - }, - { - path: "/dispatch", - name: "dispatch", - component: dispatch - }, - { - path: "/accounting", - name: "accounting", - //meta: { scrollToTop: true }, - component: accounting - }, - { - path: "/admin", - name: "administration", - component: administration - }, - { - path: "/ops", - name: "operations", - component: operations - }, { path: "/customize/:formCustomTemplateKey", name: "customize", @@ -420,7 +394,8 @@ export default new Router({ { path: "*", name: "notfound", - component: notfound + component: () => + import(/* webpackChunkName: "aybase" */ "./views/notfound.vue") } ] }); diff --git a/ayanova/src/views/login.vue b/ayanova/src/views/login.vue index 51ecb4a1..ed550ae2 100644 --- a/ayanova/src/views/login.vue +++ b/ayanova/src/views/login.vue @@ -93,7 +93,7 @@ export default { auth .authenticate(this.input.username, this.input.password) .then(() => { - vm.$router.push({ name: "home" }); + vm.$router.push("/dashboard"); }) .catch(function handleCaughtLoginError(error) { /* xeslint-disable-next-line */ diff --git a/ayanova/src/views/notfound.vue b/ayanova/src/views/notfound.vue index ff8904a4..803f2d2a 100644 --- a/ayanova/src/views/notfound.vue +++ b/ayanova/src/views/notfound.vue @@ -16,6 +16,7 @@