From 9fdcd79b9684a145e0bb85bd3716630119fac601 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Mon, 16 Jan 2023 09:56:56 -0400 Subject: [PATCH 1/3] Remove debug code --- src/mixins/ScreenBase.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mixins/ScreenBase.js b/src/mixins/ScreenBase.js index f151d7d1a..f943c3fd4 100644 --- a/src/mixins/ScreenBase.js +++ b/src/mixins/ScreenBase.js @@ -145,7 +145,6 @@ export default { }, async submitForm() { await this.validateNow(findRootScreen(this)); - console.log(this.valid__, this.message__); if (!this.valid__) { window.ProcessMaker.alert(this.message__, "danger"); // if the form is not valid the data is not emitted From fa9fa25566f6e30ca6aec1ce5de524fa8e80ce6f Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Mon, 16 Jan 2023 09:57:44 -0400 Subject: [PATCH 2/3] Fix debounced function --- src/App.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/App.vue b/src/App.vue index 0d5c99d86..d62d14011 100644 --- a/src/App.vue +++ b/src/App.vue @@ -400,6 +400,9 @@ export default { return warnings; }, }, + created() { + this.updateDataInput = debounce(this.updateDataInput, 1000); + }, mounted() { this.countElements = debounce(this.countElements, 2000); if (globalObject.ProcessMaker && globalObject.ProcessMaker.user && globalObject.ProcessMaker.user.lang) { @@ -422,10 +425,9 @@ export default { }, methods: { ...mapMutations("globalErrorsModule", { setStoreMode: "setMode" }), - // eslint-disable-next-line func-names - updateDataInput: debounce(function () { + updateDataInput() { this.updateDataInputNow(); - }, 1000), + }, updateDataInputNow() { if (this.previewInputValid) { // Copy data over From 570f6858e3a60c4777e4f4e190722e2156850bdf Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Mon, 16 Jan 2023 09:59:47 -0400 Subject: [PATCH 3/3] Fix debounce of updateDataPreview --- src/App.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/App.vue b/src/App.vue index d62d14011..ce49aae48 100644 --- a/src/App.vue +++ b/src/App.vue @@ -402,6 +402,7 @@ export default { }, created() { this.updateDataInput = debounce(this.updateDataInput, 1000); + this.updateDataPreview = debounce(this.updateDataPreview, 1000); }, mounted() { this.countElements = debounce(this.countElements, 2000); @@ -435,10 +436,9 @@ export default { this.updateDataPreview(); } }, - // eslint-disable-next-line func-names - updateDataPreview: debounce(function () { + updateDataPreview() { this.previewDataStringify = JSON.stringify(this.previewData, null, 2); - }, 1000), + }, monacoMounted(editor) { this.editor = editor; this.editor.updateOptions({ readOnly: true });