From bf80df7354d6d8f8cb02a1e3a742c8cb0ba4c9ce Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 9 Feb 2021 18:57:27 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 3 --- .../src/components/custom-fields-control.vue | 24 ++++++++++--------- ayanova/src/components/tag-picker.vue | 1 - 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 61e6f260..28c7b22f 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -8,9 +8,6 @@ MISC ITEMS THAT CAME UP -todo: tagpicker, don't like how it works, it's funky to enter multiple tags and input doesn't go away when you select it just leaves the typed text there - once a selection is made it should not repeat the typed text again, it shoudl be ready to type another tag from start -todo: enabled first custom field for customer and got weird error about mutating a prop directly but then it just worked as if no problem ? todo: check timeout algorithm for notification checking, when server is down it seems to top out at 10 minutes delay, but that seems short if the server is down all night and it's checking constantly or something ** IMPORTANT todo: double check concurrency code with Customer or Project just to be sure, it has been changed but not sure if it was ever properly tested. diff --git a/ayanova/src/components/custom-fields-control.vue b/ayanova/src/components/custom-fields-control.vue index cc512b9b..07f4b97d 100644 --- a/ayanova/src/components/custom-fields-control.vue +++ b/ayanova/src/components/custom-fields-control.vue @@ -208,10 +208,13 @@ export default { default: "{}", type: String }, - formKey: String, //used to grab template from store + formKey: { type: String, default: "" }, //used to grab template from store readonly: Boolean, disabled: Boolean, - parentVM: Object + parentVM: { + default: null, + type: Object + } }, methods: { @@ -238,13 +241,11 @@ export default { return template.find(z => z.type != undefined); }, GetValueForField: function(dataKey) { - if (this.value == null) { - //return null; - this.value = "{}"; - } - + let cData = {}; //get the data out of the JSON string value - let cData = JSON.parse(this.value); + if (this.value != null) { + cData = JSON.parse(this.value); + } //Custom field types can be changed by the user and cause old entered data to be invalid for that field type //Here we need to take action if the data is of an incompatible type for the control field type and attempt to coerce or simply nullify if not co-ercable the data @@ -334,10 +335,11 @@ export default { SetValueForField: function(dataKey, newValue) { //Get the current data out of the json string value // - if (this.value == null) { - this.value = "{}"; + let cData = {}; + if (this.value != null) { + cData = JSON.parse(this.value); } - let cData = JSON.parse(this.value); + if (!window.$gz.util.has(cData, dataKey)) { cData[dataKey] = null; } diff --git a/ayanova/src/components/tag-picker.vue b/ayanova/src/components/tag-picker.vue index 05428902..b652b7cd 100644 --- a/ayanova/src/components/tag-picker.vue +++ b/ayanova/src/components/tag-picker.vue @@ -102,7 +102,6 @@ export default { return true; }, input(e) { - console.log("input", e); this.tagSearchEntry = ""; this.$emit("input", e); },