Skip to content

Commit

Permalink
fix(ui): only stringify inputs if they're not strings already (#4391)
Browse files Browse the repository at this point in the history
* fix(ui): only stringify inputs if they're not strings already

* chore(ui): removed obsolete code
  • Loading branch information
MilosPaunovic committed Jul 22, 2024
1 parent cc93344 commit 2a1f5dc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
9 changes: 0 additions & 9 deletions ui/src/components/inputs/InputsForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/utils/inputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)){
Expand Down

0 comments on commit 2a1f5dc

Please sign in to comment.