From 823b1aa7e53a124ee7d2957c0bbf69257950584a Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Sat, 4 Apr 2020 19:03:19 +0000 Subject: [PATCH] --- ayanova/src/api/errorhandler.js | 2 +- ayanova/src/api/gzapi.js | 14 +++++++++----- ayanova/src/main.js | 8 ++++++-- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/ayanova/src/api/errorhandler.js b/ayanova/src/api/errorhandler.js index 0fe0ffac..d188aa42 100644 --- a/ayanova/src/api/errorhandler.js +++ b/ayanova/src/api/errorhandler.js @@ -39,7 +39,7 @@ function dealWithError(msg, vm) { //If a form instance was provided (vue instance) //then put the error into it if (vm) { - if (window.$gz.errorHandler.devMode()) { + if (vm.ay.dev()) { //make sure formState.appError is defined on data if (!window.$gz._.has(vm, "formState.appError")) { throw "DEV ERROR errorHandler::dealWithError -> formState.appError seems to be missing from form's vue data object"; diff --git a/ayanova/src/api/gzapi.js b/ayanova/src/api/gzapi.js index 111075bf..f8ca6200 100644 --- a/ayanova/src/api/gzapi.js +++ b/ayanova/src/api/gzapi.js @@ -22,7 +22,7 @@ function stringifyPrimitive(v) { // Show unexpected errors during development // function devShowUnknownError(error) { - if (window.$gz.errorHandler.devMode) { + if (window.$gz.dev) { // eslint-disable-next-line console.error("gzapi::devShowUnknownError, error is:", error); @@ -300,7 +300,8 @@ export default { fetch(that.APIUrl(route), that.fetchGetOptions()) .then(that.status) .then(that.json) - .then(response => { + // eslint-disable-next-line + .then((response) => { resolve(response); }) .catch(function handleGetError(error) { @@ -331,7 +332,8 @@ export default { fetch(that.APIUrl(route), fetchOptions) .then(that.status) .then(that.json) - .then(response => { + // eslint-disable-next-line + .then((response) => { //Note: response.error indicates there is an error, however this is not an unusual condition //it could be validation errors or other general error so we need to treat it here like it's normal //and let the caller deal with it appropriately @@ -351,7 +353,8 @@ export default { fetch(that.APIUrl(route), that.fetchRemoveOptions()) .then(that.status) //.then(that.json) - .then(response => { + // eslint-disable-next-line + .then((response) => { resolve(response); }) .catch(function handleRemoveError(error) { @@ -369,7 +372,8 @@ export default { fetch(that.APIUrl(route), that.fetchPostOptions(null)) .then(that.status) .then(that.json) - .then(response => { + // eslint-disable-next-line + .then((response) => { //Note: response.error indicates there is an error, however this is not an unusual condition //it could be validation errors or other general error so we need to treat it here like it's normal //and let the caller deal with it appropriately diff --git a/ayanova/src/main.js b/ayanova/src/main.js index 3920c6d7..15841027 100644 --- a/ayanova/src/main.js +++ b/ayanova/src/main.js @@ -1,4 +1,7 @@ /* Xeslint-disable */ +//************************************************************ +const DEV_MODE = true; +//************************************************************ import "@fortawesome/fontawesome-free/css/all.css"; import "typeface-roboto/index.css"; import Vue from "vue"; @@ -70,7 +73,8 @@ window.$gz = { report: gzreport, errorHandler: errorhandler, store: store, - clientInfo: ayaNovaVersion + clientInfo: ayaNovaVersion, + dev: DEV_MODE }; ///////////////////////////////////////////////////////////////// @@ -184,7 +188,7 @@ Vue.directive("focus", { // Vue.prototype.$ay = { //development mode, this enables data-cy tags for testing, development level error messages etc - dev: true, + dev: DEV_MODE, t: function(tKey) { return translation.get(tKey); }