This commit is contained in:
2020-10-08 17:41:35 +00:00
parent 2beec7ebde
commit dc20540e91
4 changed files with 42 additions and 23 deletions

View File

@@ -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))
);
},

View File

@@ -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(

View File

@@ -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;
// });

View File

@@ -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;
//************************************************************
//**************************************************************
//**************************************************************