diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 1938e3c6..ccdd12ce 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -11,13 +11,7 @@ ____________ ## CURRENT STAGE: -todo: Make this route work - http://localhost:8080/open?type=Widget&id=104 - if user not logged in then it should login first then go to object - if user is logged in then it should just open that object - there need be no form "open" anywhere -todo: open object link url not working at client, asks for login but then doesn't navigate like it should -todo: test notification in alternate language + todo: subscription form should autofill in user's personal email address when they pick a new email subscription but still let them change it todo: subscription form still not completed, needs to be coded for when to show tags (for example) and other stuff todo: Localize this message or get rid of it, it's annoying and possibly useless @@ -25,7 +19,7 @@ todo: Localize this message or get rid of it, it's annoying and possibly useless todo: Back end notification related settings GlobalOpsNotificationSettings (copy from backup settings) SMTP creds, return address - +todo: back end email subject could use the object type in addition to the name of the object i.e. AY:Object changed:User:Christina Shanahan 25 todo: notifysubscriptionbiz Check for duplicate before accepting new / edit in validator @@ -73,6 +67,10 @@ todo: wo, quote and any other AgeValue notify objects are going to need to be ab todo: As biz objects are fleshed out need to also code their notification event stuff as well ########################## +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) +todo: clean out leftover openurl stuff from old system +todo: Evaluate form generate sample data sb inside a dialog, it's only done once or twice at most and takes focus away from the other buttons and future stuff todo: for some reason getting error about checking for notifications logout and back in again even after clean reboot Not sure why or how the notification check is starting but it's not right at the moment At most sb one message saying server is unreachable and one more saying it's ok if it comes back but nothing in between diff --git a/ayanova/src/api/initialize.js b/ayanova/src/api/initialize.js index 4effdb73..74a862ed 100644 --- a/ayanova/src/api/initialize.js +++ b/ayanova/src/api/initialize.js @@ -765,7 +765,9 @@ async function getUserOptions() { languageOverride: null, timeZoneOverride: null, currencyName: null, - hour12: true + hour12: true, + uiColor: "#000000", + emailAddress: null }; //get language to use, try user set override first, if empty then browser set, if empty then default to en-us @@ -785,7 +787,10 @@ async function getUserOptions() { l.hour12 = res.data.hour12; } - window.$gz.store.commit("setLocale", l); + l.uiColor = res.data.uiColor || "#000000"; + l.emailAddress = res.data.emailAddress || null; + + window.$gz.store.commit("setUserOptions", l); } } catch (error) { window.$gz.store.commit( diff --git a/ayanova/src/api/locale.js b/ayanova/src/api/locale.js index f15bf64a..3ff2c099 100644 --- a/ayanova/src/api/locale.js +++ b/ayanova/src/api/locale.js @@ -32,13 +32,13 @@ export default { // Get the user's chosen currency name //https://en.wikipedia.org/wiki/ISO_4217 getCurrencyName() { - return window.$gz.store.state.locale.currencyName; + return window.$gz.store.state.userOptions.currencyName; }, ////////////////////////////////////////////////// // Get the user's chosen 12hr clock // getHour12() { - return window.$gz.store.state.locale.hour12; + return window.$gz.store.state.userOptions.hour12; }, /////////////////////////////////////////// // Turn a utc date into a displayable diff --git a/ayanova/src/api/open-object-handler.js b/ayanova/src/api/open-object-handler.js index 5da2dfd2..e7796a6b 100644 --- a/ayanova/src/api/open-object-handler.js +++ b/ayanova/src/api/open-object-handler.js @@ -10,29 +10,27 @@ export default { //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 - } - } + // 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 if (tid.type && tid.id != null) { - console.log("tid", tid); - console.log("ayatype", ayatype); switch (tid.type) { case ayatype.Widget: vm.$router.push({ diff --git a/ayanova/src/components/attachment-control.vue b/ayanova/src/components/attachment-control.vue index 2dfe45a9..6fd4ef9c 100644 --- a/ayanova/src/components/attachment-control.vue +++ b/ayanova/src/components/attachment-control.vue @@ -273,7 +273,7 @@ export default { let timeZoneName = window.$gz.locale.getBrowserTimeZoneName(); let languageName = window.$gz.locale.getBrowserLanguages(); - let hour12 = window.$gz.store.state.locale.hour12; + let hour12 = window.$gz.store.state.userOptions.hour12; let ret = []; for (let i = 0; i < data.length; i++) { let o = data[i]; diff --git a/ayanova/src/components/gz-data-table.vue b/ayanova/src/components/gz-data-table.vue index 95edfa84..596a84a3 100644 --- a/ayanova/src/components/gz-data-table.vue +++ b/ayanova/src/components/gz-data-table.vue @@ -637,8 +637,8 @@ function buildRecords(listData, columndefinitions) { //cache display format stuff let timeZoneName = window.$gz.locale.getBrowserTimeZoneName(); let languageName = window.$gz.locale.getBrowserLanguages(); - let hour12 = window.$gz.store.state.locale.hour12; - let currencyName = window.$gz.store.state.locale.currencyName; + let hour12 = window.$gz.store.state.userOptions.hour12; + let currencyName = window.$gz.store.state.userOptions.currencyName; //comes as an array of arrays, needs to leave as an array of objects representing each row for (let iRow = 0; iRow < listData.length; iRow++) { diff --git a/ayanova/src/store.js b/ayanova/src/store.js index fcc5d2bd..987fcc56 100644 --- a/ayanova/src/store.js +++ b/ayanova/src/store.js @@ -33,11 +33,13 @@ export default new Vuex.Store({ homePage: undefined, translationText: {}, enums: {}, //all enum values with translated text to match stored as key e.g. enums:={AuthorizationRoles:{0:"no role",1:"Limited role"},UserTypes:{0:"Technician",1:"Client user"}} - locale: { + userOptions: { languageOverride: "en-US", timeZoneOverride: "America/New_York", currencyName: "USD", - hour12: true + hour12: true, + uiColor: "#000000", + emailAddress: null }, globalSettings: {}, navItems: [], @@ -77,10 +79,12 @@ export default new Vuex.Store({ state.enums = {}; state.formCustomTemplate = {}; state.apiUrl = ""; - state.locale.languageOverride = "en-US"; - state.locale.timeZoneOverride = "America/New_York"; - state.locale.currencyName = "USD"; - state.locale.hour12 = true; + state.userOptions.languageOverride = "en-US"; + state.userOptions.timeZoneOverride = "America/New_York"; + state.userOptions.currencyName = "USD"; + state.userOptions.hour12 = true; + state.userOptions.uiColor = "#000000"; + state.userOptions.emailAddress = null; state.globalSettings = {}; state.knownPassword = false; state.newNotificationCount = 0; @@ -96,12 +100,14 @@ export default new Vuex.Store({ data.concurrency; state.formCustomTemplate[data.formKey] = data.value; }, - setLocale(state, data) { + setUserOptions(state, data) { // mutate state - state.locale.languageOverride = data.languageOverride; - state.locale.currencyName = data.currencyName; - state.locale.hour12 = data.hour12; - state.locale.timeZoneOverride = data.timeZoneOverride; + state.userOptions.languageOverride = data.languageOverride; + state.userOptions.currencyName = data.currencyName; + state.userOptions.hour12 = data.hour12; + state.userOptions.timeZoneOverride = data.timeZoneOverride; + state.userOptions.emailAddress = data.emailAddress; + state.userOptions.uiColor = data.uiColor; }, setGlobalSettings(state, data) { // mutate state diff --git a/ayanova/src/views/ay-history.vue b/ayanova/src/views/ay-history.vue index 76acf41b..99b25dec 100644 --- a/ayanova/src/views/ay-history.vue +++ b/ayanova/src/views/ay-history.vue @@ -291,7 +291,7 @@ export default { let currentEventCount = vm.obj.length; let timeZoneName = window.$gz.locale.getBrowserTimeZoneName(); let languageName = window.$gz.locale.getBrowserLanguages(); - let hour12 = window.$gz.store.state.locale.hour12; + let hour12 = window.$gz.store.state.userOptions.hour12; for (let i = 0; i < temp.length; i++) { temp[i].date = window.$gz.locale.utcDateToShortDateAndTimeLocalized( temp[i].date, diff --git a/ayanova/src/views/home-notifications.vue b/ayanova/src/views/home-notifications.vue index 40610a49..e1364ad8 100644 --- a/ayanova/src/views/home-notifications.vue +++ b/ayanova/src/views/home-notifications.vue @@ -160,7 +160,7 @@ export default { let timeZoneName = window.$gz.locale.getBrowserTimeZoneName(); let languageName = window.$gz.locale.getBrowserLanguages(); - let hour12 = window.$gz.store.state.locale.hour12; + let hour12 = window.$gz.store.state.userOptions.hour12; for (let i = 0; i < temp.length; i++) { temp[ i diff --git a/ayanova/src/views/home-notify-subscription.vue b/ayanova/src/views/home-notify-subscription.vue index 0a890863..0d0b9aef 100644 --- a/ayanova/src/views/home-notify-subscription.vue +++ b/ayanova/src/views/home-notify-subscription.vue @@ -175,6 +175,8 @@ export default { await vm.getDataFromApi(vm.$route.params.recordid); //let getdata handle loading } } else { + //default to their configured email address on new record + this.obj.deliveryAddress = this.$store.state.userOptions.emailAddress; vm.formState.loading = false; //here we handle it immediately } //set initial form status diff --git a/ayanova/src/views/home-user-settings.vue b/ayanova/src/views/home-user-settings.vue index 9f9d62af..83e633f8 100644 --- a/ayanova/src/views/home-user-settings.vue +++ b/ayanova/src/views/home-user-settings.vue @@ -316,7 +316,7 @@ export default { }); //Set values in store so they are updated immediately for user - let l = vm.$store.state.locale; + let l = vm.$store.state.userOptions; if (vm.obj.languageOverride) { l.languageOverride = vm.obj.languageOverride; @@ -334,7 +334,14 @@ export default { l.hour12 = vm.obj.hour12; } - window.$gz.store.commit("setLocale", l); + if (vm.obj.uiColor) { + l.uiColor = vm.obj.uiColor; + } + if (vm.obj.emailAddress) { + l.emailAddress = vm.obj.emailAddress; + } + + window.$gz.store.commit("setUserOptions", l); if ( vm.activeTranslationId && diff --git a/ayanova/src/views/ops-server-state.vue b/ayanova/src/views/ops-server-state.vue index 443620b2..deff2f45 100644 --- a/ayanova/src/views/ops-server-state.vue +++ b/ayanova/src/views/ops-server-state.vue @@ -180,26 +180,27 @@ export default { dirty: false }); - //Set values in store so they are updated immediately for user - let l = vm.$store.state.locale; + //why is this crap here, copied over from user settings form I guess , remove + // //Set values in store so they are updated immediately for user + // let l = vm.$store.state.userOptions; - if (vm.obj.languageOverride) { - l.languageOverride = vm.obj.languageOverride; - } + // if (vm.obj.languageOverride) { + // l.languageOverride = vm.obj.languageOverride; + // } - if (vm.obj.timeZoneOverride) { - l.timeZoneOverride = vm.obj.timeZoneOverride; - } + // if (vm.obj.timeZoneOverride) { + // l.timeZoneOverride = vm.obj.timeZoneOverride; + // } - if (vm.obj.currencyName) { - l.currencyName = vm.obj.currencyName; - } + // if (vm.obj.currencyName) { + // l.currencyName = vm.obj.currencyName; + // } - if (vm.obj.hour12) { - l.hour12 = vm.obj.hour12; - } + // if (vm.obj.hour12) { + // l.hour12 = vm.obj.hour12; + // } - window.$gz.store.commit("setLocale", l); + // window.$gz.store.commit("setUserOptions", l); } } catch (error) { vm.formState.loading = false;