From 2a1f5dc9e5453ec9d11a2967fa5007e5f9c01f94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milo=C5=A1=20Paunovi=C4=87?= Date: Mon, 22 Jul 2024 11:14:45 +0200 Subject: [PATCH] fix(ui): only stringify inputs if they're not strings already (#4391) * fix(ui): only stringify inputs if they're not strings already * chore(ui): removed obsolete code --- ui/src/components/inputs/InputsForm.vue | 9 --------- ui/src/utils/inputs.js | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/ui/src/components/inputs/InputsForm.vue b/ui/src/components/inputs/InputsForm.vue index f8554f51fb..860e41652d 100644 --- a/ui/src/components/inputs/InputsForm.vue +++ b/ui/src/components/inputs/InputsForm.vue @@ -183,17 +183,8 @@ }, beforeUnmount() { document.removeEventListener("keydown", this._keyListener); - }, - computed: { - }, methods: { - parseInput(input) { - if (input && input.length > 0) { - return JSON.parse(input) - } - return input - }, updateDefaults() { for (const input of this.inputsList || []) { if (input.type === "MULTISELECT") { diff --git a/ui/src/utils/inputs.js b/ui/src/utils/inputs.js index 5ce06eeb55..4524e4b757 100644 --- a/ui/src/utils/inputs.js +++ b/ui/src/utils/inputs.js @@ -11,7 +11,7 @@ export default class Inputs { } else if (type === "DURATION" || type === "TIME") { res = moment().startOf("day").add(res, "seconds").toString() } else if (type === "ARRAY" || type === "MULTISELECT" || type === "JSON") { - res = JSON.stringify(res).toString(); + if(typeof res !== "string") res = JSON.stringify(res).toString(); } else if (type === "BOOLEAN" && type === undefined){ res = "undefined"; } else if (type === "STRING" && Array.isArray(res)){