diff --git a/ayanova/src/api/gzutil.js b/ayanova/src/api/gzutil.js index 0a8fbd83..ba09e26f 100644 --- a/ayanova/src/api/gzutil.js +++ b/ayanova/src/api/gzutil.js @@ -438,7 +438,7 @@ export default { return ( !!obj && (keyParts.length > 1 - ? has(obj[key.split(".")[0]], keyParts.slice(1).join(".")) + ? this.has(obj[key.split(".")[0]], keyParts.slice(1).join(".")) : hasOwnProperty.call(obj, key)) ); }, diff --git a/ayanova/src/api/translation.js b/ayanova/src/api/translation.js index 545469fd..f6a6035a 100644 --- a/ayanova/src/api/translation.js +++ b/ayanova/src/api/translation.js @@ -12,33 +12,52 @@ export default { if (editedTranslation) { //iterate the keys that are cached and set them from whatever is in editedTranslation for that key - window.$gz._.forOwn(window.$gz.store.state.translationText, function( - cacheval, - cachekey - ) { - //find match - //de-lodash - // let display = window.$gz. _.find(editedTranslation.translationItems, { - // key: cachekey - // }).display; - let display = editedTranslation.translationItems.find( - z => z.key == cachekey - ).display; + + //de-lodash + // window.$gz._.forOwn(window.$gz.store.state.translationText, function( + // cacheval, + // cachekey + // ) { + // //find match + // //de-lodash + // // let display = window.$gz. _.find(editedTranslation.translationItems, { + // // key: cachekey + // // }).display; + // let display = editedTranslation.translationItems.find( + // z => z.key == cachekey + // ).display; + + // window.$gz.store.commit("setTranslationText", { + // key: cachekey, + // value: display + // }); + // }); + + for (const [key, value] of Object.entries(window.$gz.type)) { + let display = editedTranslation.translationItems.find(z => z.key == key) + .display; window.$gz.store.commit("setTranslationText", { - key: cachekey, - value: display + key: key, + value: value }); - }); + } } else { //gather up the keys that are cached and fetch the latest and then replace them let needIt = []; - window.$gz._.forOwn(window.$gz.store.state.translationText, function( - cacheval, - cachekey - ) { - needIt.push(cachekey); + + //de-lodash + // window.$gz._.forOwn(window.$gz.store.state.translationText, function( + // cacheval, + // cachekey + // ) { + // needIt.push(cachekey); + // }); + + Object.keys(window.$gz.store.state.translationText).forEach(z => { + needIt.push(z); }); + //fetch these keys let transData = await window.$gz.api.upsert("translation/subset", needIt); transData.data.forEach(function commitFetchedTranslationItemToStore( diff --git a/ayanova/src/components/gz-data-table.vue b/ayanova/src/components/gz-data-table.vue index 115287ca..6494c648 100644 --- a/ayanova/src/components/gz-data-table.vue +++ b/ayanova/src/components/gz-data-table.vue @@ -514,7 +514,7 @@ export default { //this example does remove from the array and does update a plain mustache rendition of it on the page but doesn't update the select itself //whereas using the native javascript array splice function *does* update the select because vue wraps splice and other native methods specifically //so it can properly update the dom - // window.$gz._.remove(vm.selectLists.listViews, function(n) { + // window.$gz. _.remove(vm.selectLists.listViews, function(n) { // return n.id == -1; // }); diff --git a/ayanova/src/main.js b/ayanova/src/main.js index 9fb3cea9..b698c1b5 100644 --- a/ayanova/src/main.js +++ b/ayanova/src/main.js @@ -62,7 +62,7 @@ import chartBarHorizontalControl from "./components/chart-bar-horizontal-control //DEVELOPMENT MODE //THIS SHOULD BE FALSE IN RELEASE //************************************************************ -const DEV_MODE = false; +const DEV_MODE = true; //************************************************************ //************************************************************** //**************************************************************