From 0bcdd38e8651ed9210c8f26d07e366c4118eb699 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 6 Apr 2020 20:24:51 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 3 -- ayanova/src/views/login.vue | 57 ++++++++++++++++++++++++++++++++++++- 2 files changed, 56 insertions(+), 4 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 415d90a7..06f21c26 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -53,9 +53,6 @@ CURRENT TODOs todo: login form, if trial or dev then needs to display list of sample users to login as and it fills in the login and password -todo: Why is there an error in the console when a user is not logged in and opens client? - - It should just go to login, no error should show in the console - todo: ANY TIME - SIDE v7 STUFF DataDump plugin needs an explanation of what it is in the flow, right now it's completely cryptic and people may be using it for stuff thinking it's for something it's not - Also, verify it's manager account only that can run it or maybe someone with total rights to everything? diff --git a/ayanova/src/views/login.vue b/ayanova/src/views/login.vue index e3518936..e7b7f88c 100644 --- a/ayanova/src/views/login.vue +++ b/ayanova/src/views/login.vue @@ -3,6 +3,7 @@
+ {{ trialMode }} /* xeslint-disable */ import auth from "../api/auth"; +let TRIAL_MODE = false; export default { - name: "Login", + // beforeCreate() { + // //calling this here because created is never called on this form and I don't know why + + // }, data() { return { input: { @@ -83,18 +88,32 @@ export default { // username: "CustomerLimited", // password: "CustomerLimited" }, + trialMode: false, errorBadCreds: false, reveal: false, formState: { errorBoxMessage: null } }; }, created() { + let vm = this; window.$gz.eventBus.$emit("menu-change", { isMain: true, icon: "", title: "" }); + window.$gz.api + .get("license/trial") + .then(res => { + if (res.data) { + // console.log("res.data:", res.data); + vm.trialMode = res.data; + } + }) + .catch(function handleGetTrialModeError(error) { + //squash it, this isn't critical + }); }, + computed: {}, methods: { onEnterUserName: function() { //move focus to password @@ -163,4 +182,40 @@ export default { }); } }; + +// created() { +// console.log("CREATED"); +// // window.$gz.api +// // .get("license/trial") +// // .then(res => { +// // debugger; +// // vm.formState.ready = true; +// // if (res.error != undefined) { +// // vm.formState.serverError = res.error; +// // window.$gz.form.setErrorBoxErrors(vm); +// // } else { +// // vm.trialMode = res.data; +// // // vm.obj = res.data; + +// // // //Update the form status +// // // window.$gz.form.setFormState({ +// // // vm: vm, +// // // dirty: false, +// // // valid: true, +// // // loading: false, +// // // readOnly: res.readOnly ? true : false +// // // }); +// // // //modify the menu as necessary +// // // generateMenu(vm); +// // } +// // }) +// // .catch(function handleGetDataFromAPIError(error) { +// // //Update the form status +// // window.$gz.form.setFormState({ +// // vm: vm, +// // loading: false +// // }); +// // window.$gz.errorHandler.handleFormError(error, vm); +// // }); +// },