From 9c39c3322963441c967196d53253bdecb26cf1c9 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 29 Jul 2020 23:13:20 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 3 --- ayanova/src/App.vue | 30 ++++++-------------------- ayanova/src/api/open-object-handler.js | 19 ---------------- ayanova/src/store.js | 9 -------- ayanova/src/views/login.vue | 4 ++-- 5 files changed, 8 insertions(+), 57 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index e9aa4585..8eb82035 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -15,9 +15,6 @@ ____________ ########################## -todo: logging sql queries in trace at server - maybe too much or maybe that's trace level and everything else I've done at trace sb debug so can filter OUT that sql shit - Also the user count license circumvention query is plainly visible, if it were to be executed directly instead of through EF core it may not be visible? todo: add method to continue on to requested url when a login needs to happen (like capture the requested url and if found after login go to it) diff --git a/ayanova/src/App.vue b/ayanova/src/App.vue index 59ffefd6..ea559fdf 100644 --- a/ayanova/src/App.vue +++ b/ayanova/src/App.vue @@ -324,33 +324,15 @@ export default { //this smells bad but it works vm.$root.$gz = window.$gz; - // //Capture open object type and id if present - // //localhost:8080/login?type=2&id=22 - - // if (window.location.search) { - // //https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams - // var searchParams = new URLSearchParams(window.location.search); - // var openObject = {}; - // //data should be format for open-object-handler - // // { type: [AYATYPE], id: [RECORDID] } - // if (searchParams.has("type")) { - // openObject.type = Number(searchParams.get("type")); - // if (searchParams.has("id")) { - // openObject.id = Number(searchParams.get("id")); - // } - // window.$gz.store.commit("setOpenObject", openObject); - // } - // } - //redirect to login if not authenticated if (!vm.$store.state.authenticated) { - vm.$router.push("login"); - } else { - //this can be safely called any time, it checks if there is an open object in store and - //opens it or if not just returns - // window.$gz.eventBus.$emit("openobject", null); + //If a direct open path was being used but user is not logged in this will catch it + //otherwise they will just go on to that path directly + vm.$router.push({ + name: "login", + params: { topath: window.location.pathname } + }); } - //RELOAD / REFRESH HANDLING //Restart notification polling due to refresh? if (window.$gz.store.state.authenticated) { diff --git a/ayanova/src/api/open-object-handler.js b/ayanova/src/api/open-object-handler.js index e7796a6b..68f78b38 100644 --- a/ayanova/src/api/open-object-handler.js +++ b/ayanova/src/api/open-object-handler.js @@ -8,25 +8,6 @@ export default { // called from App.vue handleOpenObjectClick(vm, tid) { //expects extra data (tid) to be one of { type: [AYATYPE], id: [RECORDID] } - //or null which is what is called when asking to check if there is a direct openObject in store and open it - - // if (tid == null) { - // let op = vm.$store.state.openObject; - // //clear it out so it doesn't recur - // window.$gz.store.commit("clearOpenObject"); - // if (op && op.type) { - // tid = op; - // } else { - // //log it in case we need to see it in tech support - // window.$gz.store.commit( - // "logItem", - // `Error: open object url was not valid, missing type or invalid type ${JSON.stringify( - // op - // )}` - // ); - // return; //bail out, nothing to open here - // } - // } //NOTE: for new objects all edit pages assume record ID 0 means create rather than open diff --git a/ayanova/src/store.js b/ayanova/src/store.js index 987fcc56..3aa91e0a 100644 --- a/ayanova/src/store.js +++ b/ayanova/src/store.js @@ -19,7 +19,6 @@ if (window.location.search) { export default new Vuex.Store({ plugins: [createPersistedState({ key: "AyaNova" })], state: { - openObject: null, lastClientVersion: "", authenticated: false, apiUrl: "", @@ -144,14 +143,6 @@ export default new Vuex.Store({ setHomePage(state, data) { state.homePage = data; }, - setOpenObject(state, data) { - //data should be format for open-object-handler - // { type: [AYATYPE], id: [RECORDID] } - state.openObject = data; - }, - clearOpenObject(state) { - state.openObject = null; - }, setDarkMode(state, data) { state.darkMode = data; }, diff --git a/ayanova/src/views/login.vue b/ayanova/src/views/login.vue index b6f07674..b4aaa3fe 100644 --- a/ayanova/src/views/login.vue +++ b/ayanova/src/views/login.vue @@ -307,8 +307,8 @@ export default { })(); } - if (vm.$store.state.openObject != null) { - window.$gz.eventBus.$emit("openobject", null); + if (vm.$route.params.topath != undefined) { + vm.$router.push(vm.$route.params.topath); } else { vm.$router.push(vm.$store.state.homePage); }