From 015ef8a0c8be9519a0de11d7296d78525009762b Mon Sep 17 00:00:00 2001 From: Pratap Mridha Date: Thu, 2 Jun 2022 23:16:50 +0530 Subject: [PATCH 1/2] fixed --- .../components/ActionInputs/BinanceNetwork.vue | 6 +++--- .../components/ActionInputs/EthereumNetwork.vue | 6 +++--- .../components/ActionInputs/MaticNetwork.vue | 6 +++--- .../participant/ActionInputs/BinanceNetwork.vue | 6 +++--- .../participant/ActionInputs/EthereumNetwork.vue | 16 ++++++++++------ .../participant/ActionInputs/MaticNetwork.vue | 6 +++--- 6 files changed, 25 insertions(+), 21 deletions(-) diff --git a/src/components/admin/createProjectSlider/components/ActionInputs/BinanceNetwork.vue b/src/components/admin/createProjectSlider/components/ActionInputs/BinanceNetwork.vue index 7043b1f6..d77a3d33 100644 --- a/src/components/admin/createProjectSlider/components/ActionInputs/BinanceNetwork.vue +++ b/src/components/admin/createProjectSlider/components/ActionInputs/BinanceNetwork.vue @@ -212,7 +212,7 @@ export default { this.$emit( "input", JSON.stringify({ - ...this.value.operand, + ...this.value, }) ); } else { @@ -226,7 +226,7 @@ export default { this.$emit( "input", JSON.stringify({ - ...this.value.operand, + ...this.value, }) ); } else { @@ -240,7 +240,7 @@ export default { this.$emit( "input", JSON.stringify({ - ...this.value.operand, + ...this.value, }) ); this.notifySuccess("Success"); diff --git a/src/components/admin/createProjectSlider/components/ActionInputs/EthereumNetwork.vue b/src/components/admin/createProjectSlider/components/ActionInputs/EthereumNetwork.vue index fee942c9..b9216408 100644 --- a/src/components/admin/createProjectSlider/components/ActionInputs/EthereumNetwork.vue +++ b/src/components/admin/createProjectSlider/components/ActionInputs/EthereumNetwork.vue @@ -211,7 +211,7 @@ export default { this.$emit( "input", JSON.stringify({ - ...this.value.operand, + ...this.value, }) ); } else { @@ -225,7 +225,7 @@ export default { this.$emit( "input", JSON.stringify({ - ...this.value.operand, + ...this.value, }) ); } else { @@ -239,7 +239,7 @@ export default { this.$emit( "input", JSON.stringify({ - ...this.value.operand, + ...this.value, }) ); this.notifySuccess("Success"); diff --git a/src/components/admin/createProjectSlider/components/ActionInputs/MaticNetwork.vue b/src/components/admin/createProjectSlider/components/ActionInputs/MaticNetwork.vue index 6c8c0921..0b1a03ac 100644 --- a/src/components/admin/createProjectSlider/components/ActionInputs/MaticNetwork.vue +++ b/src/components/admin/createProjectSlider/components/ActionInputs/MaticNetwork.vue @@ -211,7 +211,7 @@ export default { this.$emit( "input", JSON.stringify({ - ...this.value.operand, + ...this.value, }) ); } else { @@ -225,7 +225,7 @@ export default { this.$emit( "input", JSON.stringify({ - ...this.value.operand, + ...this.value, }) ); } else { @@ -239,7 +239,7 @@ export default { this.$emit( "input", JSON.stringify({ - ...this.value.operand, + ...this.value, }) ); this.notifySuccess("Success"); diff --git a/src/components/participant/ActionInputs/BinanceNetwork.vue b/src/components/participant/ActionInputs/BinanceNetwork.vue index 7043b1f6..d77a3d33 100644 --- a/src/components/participant/ActionInputs/BinanceNetwork.vue +++ b/src/components/participant/ActionInputs/BinanceNetwork.vue @@ -212,7 +212,7 @@ export default { this.$emit( "input", JSON.stringify({ - ...this.value.operand, + ...this.value, }) ); } else { @@ -226,7 +226,7 @@ export default { this.$emit( "input", JSON.stringify({ - ...this.value.operand, + ...this.value, }) ); } else { @@ -240,7 +240,7 @@ export default { this.$emit( "input", JSON.stringify({ - ...this.value.operand, + ...this.value, }) ); this.notifySuccess("Success"); diff --git a/src/components/participant/ActionInputs/EthereumNetwork.vue b/src/components/participant/ActionInputs/EthereumNetwork.vue index fb73715c..991723ce 100644 --- a/src/components/participant/ActionInputs/EthereumNetwork.vue +++ b/src/components/participant/ActionInputs/EthereumNetwork.vue @@ -89,6 +89,7 @@ id="title" :required="true" class="form-control w-100" + disabled="disableInput" /> @@ -166,12 +167,14 @@ export default { }; }, mounted() { - if (this.data.value) { + + if (this.data.value ) { Object.assign(this.value, { ...JSON.parse(this.data.value) }); } - eventBus.$on(`disableInput${this.data._id}`, this.disableInput); - console.log(this.value); + + let s = this.value.methods; + console.log(this.value); s = s.substring(s.indexOf("(") + 1, s.indexOf(")")); if (s !== "") { s = s.split(","); @@ -179,6 +182,7 @@ export default { this.value.paramsList.push({ name: element, value: "" }); }); } + eventBus.$on(`disableInput${this.data._id}`, this.disableInput); }, methods: { async update() { @@ -210,7 +214,7 @@ export default { this.$emit( "input", JSON.stringify({ - ...this.value.operand, + ...this.value, }) ); } else { @@ -224,7 +228,7 @@ export default { this.$emit( "input", JSON.stringify({ - ...this.value.operand, + ...this.value, }) ); } else { @@ -238,7 +242,7 @@ export default { this.$emit( "input", JSON.stringify({ - ...this.value.operand, + ...this.value, }) ); this.notifySuccess("Success"); diff --git a/src/components/participant/ActionInputs/MaticNetwork.vue b/src/components/participant/ActionInputs/MaticNetwork.vue index ea241f9f..2b0b9bc5 100644 --- a/src/components/participant/ActionInputs/MaticNetwork.vue +++ b/src/components/participant/ActionInputs/MaticNetwork.vue @@ -211,7 +211,7 @@ export default { this.$emit( "input", JSON.stringify({ - ...this.value.operand, + ...this.value, }) ); } else { @@ -225,7 +225,7 @@ export default { this.$emit( "input", JSON.stringify({ - ...this.value.operand, + ...this.value, }) ); } else { @@ -239,7 +239,7 @@ export default { this.$emit( "input", JSON.stringify({ - ...this.value.operand, + ...this.value, }) ); this.notifySuccess("Success"); From 0b764bf83027f803e009a23081049a57e8f6b888 Mon Sep 17 00:00:00 2001 From: Pratap Mridha Date: Thu, 2 Jun 2022 23:30:36 +0530 Subject: [PATCH 2/2] fix little bug --- .../ActionInputs/BinanceNetwork.vue | 8 +++- .../ActionInputs/EthereumNetwork.vue | 37 +++++++++---------- .../participant/ActionInputs/MaticNetwork.vue | 8 +++- 3 files changed, 30 insertions(+), 23 deletions(-) diff --git a/src/components/participant/ActionInputs/BinanceNetwork.vue b/src/components/participant/ActionInputs/BinanceNetwork.vue index d77a3d33..bf324446 100644 --- a/src/components/participant/ActionInputs/BinanceNetwork.vue +++ b/src/components/participant/ActionInputs/BinanceNetwork.vue @@ -78,19 +78,23 @@ v-for="(param, index) in value.paramsList" v-bind:key="index" > -
+
-
+
diff --git a/src/components/participant/ActionInputs/EthereumNetwork.vue b/src/components/participant/ActionInputs/EthereumNetwork.vue index 991723ce..737ccb0e 100644 --- a/src/components/participant/ActionInputs/EthereumNetwork.vue +++ b/src/components/participant/ActionInputs/EthereumNetwork.vue @@ -76,20 +76,23 @@ v-for="(param, index) in value.paramsList" v-bind:key="index" > -
+
-
+
@@ -167,14 +170,12 @@ export default { }; }, mounted() { - - if (this.data.value ) { + if (this.data.value) { Object.assign(this.value, { ...JSON.parse(this.data.value) }); } - - + let s = this.value.methods; - console.log(this.value); + s = s.substring(s.indexOf("(") + 1, s.indexOf(")")); if (s !== "") { s = s.split(","); @@ -182,7 +183,7 @@ export default { this.value.paramsList.push({ name: element, value: "" }); }); } - eventBus.$on(`disableInput${this.data._id}`, this.disableInput); + eventBus.$on(`disableInput${this.data._id}`, this.disableInput); }, methods: { async update() { @@ -238,7 +239,6 @@ export default { } case "bool": { if (!!this.value.operand === !!result) { - this.$emit( "input", JSON.stringify({ @@ -263,7 +263,7 @@ export default { case "uint256": { result = Number.parseFloat(result); this.value.operand = Number.parseFloat(this.value.operand); - if (result < this.value.operand) { + if (result < this.value.operand) { this.notifySuccess("Success"); this.$emit( @@ -279,13 +279,13 @@ export default { } break; } - case ">": { + case ">": { switch (this.value.returnType) { case "uint8": case "uint256": { result = Number.parseFloat(result); this.value.operand = Number.parseFloat(this.value.operand); - if (result > this.value.operand) { + if (result > this.value.operand) { this.notifySuccess("Success"); this.$emit( @@ -302,14 +302,13 @@ export default { break; } - - case "<==": { + case "<==": { switch (this.value.returnType) { case "uint8": case "uint256": { result = Number.parseFloat(result); this.value.operand = Number.parseFloat(this.value.operand); - if (result<= this.value.operand ) { + if (result <= this.value.operand) { this.notifySuccess("Success"); this.$emit( @@ -325,13 +324,13 @@ export default { } break; } - case ">==": { + case ">==": { switch (this.value.returnType) { case "uint8": case "uint256": { result = Number.parseFloat(result); this.value.operand = Number.parseFloat(this.value.operand); - if (result>=this.value.operand) { + if (result >= this.value.operand) { this.notifySuccess("Success"); this.$emit( @@ -340,7 +339,7 @@ export default { ...this.value, }) ); - } else { + } else { throw new Error("Condition Mismatch"); } } diff --git a/src/components/participant/ActionInputs/MaticNetwork.vue b/src/components/participant/ActionInputs/MaticNetwork.vue index 2b0b9bc5..f64b1f2f 100644 --- a/src/components/participant/ActionInputs/MaticNetwork.vue +++ b/src/components/participant/ActionInputs/MaticNetwork.vue @@ -77,19 +77,23 @@ v-for="(param, index) in value.paramsList" v-bind:key="index" > -
+
-
+