From 119cb4d7c225d03b86997396e8d282b73a536f9b Mon Sep 17 00:00:00 2001 From: raj6939 Date: Tue, 29 Nov 2022 12:02:04 +0530 Subject: [PATCH 1/5] tile breaking bug fixed by reducing icon height --- .../components/CustomApiEventActionConfig.vue | 2 +- .../components/CustomContractEventActionConfig.vue | 2 +- .../components/SmartContractEventActionConfig.vue | 4 ++-- .../components/WalletEventActionConfig.vue | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/admin/createProjectSlider/components/CustomApiEventActionConfig.vue b/src/components/admin/createProjectSlider/components/CustomApiEventActionConfig.vue index beee69a4..b09a88fd 100644 --- a/src/components/admin/createProjectSlider/components/CustomApiEventActionConfig.vue +++ b/src/components/admin/createProjectSlider/components/CustomApiEventActionConfig.vue @@ -23,7 +23,7 @@ {{ truncate1(eventAction.title, 6) }} diff --git a/src/components/admin/createProjectSlider/components/CustomContractEventActionConfig.vue b/src/components/admin/createProjectSlider/components/CustomContractEventActionConfig.vue index 304dd0cf..8d351da1 100644 --- a/src/components/admin/createProjectSlider/components/CustomContractEventActionConfig.vue +++ b/src/components/admin/createProjectSlider/components/CustomContractEventActionConfig.vue @@ -31,7 +31,7 @@ style="padding-right: 5px" src="../../../../assets/matic-logo.svg" v-if="eventAction.type.includes('MATIC_NETWORK')" - height="20px" + height="16px" /> Date: Tue, 29 Nov 2022 12:15:32 +0530 Subject: [PATCH 2/5] attribute tile breaking fixed --- .../components/CustomApiEventActionConfig.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/admin/createProjectSlider/components/CustomApiEventActionConfig.vue b/src/components/admin/createProjectSlider/components/CustomApiEventActionConfig.vue index b09a88fd..542a4967 100644 --- a/src/components/admin/createProjectSlider/components/CustomApiEventActionConfig.vue +++ b/src/components/admin/createProjectSlider/components/CustomApiEventActionConfig.vue @@ -138,7 +138,7 @@ style="min-width:90px;" :title="attr.fieldName" > - {{ truncate1(attr.fieldName,6) }} + {{ truncate1(attr.fieldName,8) }} @@ -230,7 +230,7 @@ style="min-width:90px;" :title="attr.fieldName" > - {{ truncate1(attr.fieldName,6) }} + {{ truncate1(attr.fieldName,8) }} From d1b1f8e340e80f0110feef807b87ce335c5a1070 Mon Sep 17 00:00:00 2001 From: raj6939 Date: Tue, 29 Nov 2022 13:27:09 +0530 Subject: [PATCH 3/5] validation added for custom contract --- .../CustomContractEventActionConfig.vue | 36 +++++++++++++------ src/utils/messages/admin/en.js | 5 +++ 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/src/components/admin/createProjectSlider/components/CustomContractEventActionConfig.vue b/src/components/admin/createProjectSlider/components/CustomContractEventActionConfig.vue index 8d351da1..a669588e 100644 --- a/src/components/admin/createProjectSlider/components/CustomContractEventActionConfig.vue +++ b/src/components/admin/createProjectSlider/components/CustomContractEventActionConfig.vue @@ -275,6 +275,7 @@ import { isEmpty, isValidURL, truncate, + isContractValid } from "../../../../mixins/fieldValidationMixin"; import Messages from "../../../../utils/messages/admin/en"; import config from "../../../../config" @@ -330,7 +331,7 @@ export default { return { appName: config.appName, allCondition: [ - { text: "None", value: null }, + { text: "Operator", value: null }, { text: "=", value: "===" }, { text: ">", value: ">" }, { text: "<", value: "<" }, @@ -364,7 +365,7 @@ export default { contractABI: "", methods: null, operand: null, - operator: "", + operator: null, returnType: "", }, selected: { @@ -441,7 +442,7 @@ export default { contractABI: "", methods: null, operand: null, - operator: "", + operator: null, returnType: "", }; this.selected = clearData; @@ -464,25 +465,40 @@ export default { this.notifyErr( Messages.EVENTS.ACTIONS.SMARTCONTRACT.CHOOSE_CONTRACT_TYPE ); - }else if (this.contract.methods===null || isEmpty(this.contract.methods)) { + } else if (isEmpty(this.contract.contractAddress)) { isvalid = false; this.notifyErr( - Messages.EVENTS.ACTIONS.SMARTCONTRACT.METHODS_EMPTY + Messages.EVENTS.ACTIONS.SMARTCONTRACT.ADDRESS_NOT_EMPTY ); - } else if (isEmpty(this.contract.contractAddress)) { + } else if (!isContractValid(this.contract.contractAddress)) { isvalid = false; this.notifyErr( - Messages.EVENTS.ACTIONS.SMARTCONTRACT.ADDRESS_NOT_EMPTY - ); + Messages.EVENTS.ACTIONS.SMARTCONTRACT.VALID_CONTRACT_ADDRESS + ) } else if (isEmpty(this.contract.contractABI)) { isvalid = false; this.notifyErr( Messages.EVENTS.ACTIONS.SMARTCONTRACT.ABI_NOT_EMPTY ) - }else if (isValidURL(this.selected.title)) { + } else if (this.contract.methods===null || isEmpty(this.contract.methods)) { + isvalid = false; + this.notifyErr( + Messages.EVENTS.ACTIONS.SMARTCONTRACT.METHODS_EMPTY + ); + } else if (this.contract.operator === null) { + isvalid = false; + this.notifyErr( + Messages.EVENTS.ACTIONS.CUSTOM_CONTRACT.SELECT_OPERATOR + ); + } else if (isEmpty(this.contract.operand)) { + isvalid = false; + this.notifyErr( + Messages.EVENTS.ACTIONS.CUSTOM_CONTRACT.ENTER_CONDITION_VALUE + ) + } else if (isValidURL(this.selected.title)) { isvalid = false; this.notifyErr(Messages.EVENTS.ACTIONS.TITLE_URL); - }else if (isEmpty(this.selected.title)) { + } else if (isEmpty(this.selected.title)) { isvalid = false; this.notifyErr(Messages.EVENTS.ACTIONS.EMPTY_TITLE); } else if (isNaN(parseInt(this.selected.score))) { diff --git a/src/utils/messages/admin/en.js b/src/utils/messages/admin/en.js index c98d43ae..985e97e4 100644 --- a/src/utils/messages/admin/en.js +++ b/src/utils/messages/admin/en.js @@ -91,6 +91,11 @@ const EVENTS = { THBALANCE_NOT_NEGATIVE: "Enter the Threshold balance that should be a Positive Number", VALID_CONTRACT_ADDRESS: "Please enter valid Contract address" }, + CUSTOM_CONTRACT: { + SELECT_OPERATOR: "Select operator", + ENTER_CONDITION_VALUE: "Enter condition value" + + }, PRIZECARD: { PRIZE_TYPE: "Please select prize type", From 579ac0d9ff003fab992ff92b6c5772d6a8c18a91 Mon Sep 17 00:00:00 2001 From: raj6939 Date: Tue, 29 Nov 2022 15:08:46 +0530 Subject: [PATCH 4/5] validation added for prize type --- .../createProjectSlider/components/PrizeEventActionConfig.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/admin/createProjectSlider/components/PrizeEventActionConfig.vue b/src/components/admin/createProjectSlider/components/PrizeEventActionConfig.vue index e1931727..88826d9c 100644 --- a/src/components/admin/createProjectSlider/components/PrizeEventActionConfig.vue +++ b/src/components/admin/createProjectSlider/components/PrizeEventActionConfig.vue @@ -286,7 +286,7 @@ export default { return this.notifyErr(Messages.EVENTS.EVENT_CLOSED) } this.selected.type = "PRIZE_CARD" - if (this.selected.type === null) { + if (this.prizeDetails.type === null) { isvalid = false; this.notifyErr(Messages.EVENTS.ACTIONS.PRIZECARD.PRIZE_TYPE); } else if (isEmpty(this.selected.title)) { From debd5125262719d77ae0fe9389d8533e53634e9a Mon Sep 17 00:00:00 2001 From: raj6939 Date: Tue, 29 Nov 2022 17:37:51 +0530 Subject: [PATCH 5/5] added validation for expiry date --- .../components/CustomApiEventActionConfig.vue | 5 +++- .../CustomContractEventActionConfig.vue | 5 +++- .../components/CustomEventActionConfig.vue | 8 +++--- .../components/GeneralConfig.vue | 12 +++++++-- .../components/KycEventActionConfig.vue | 5 +++- .../components/PrizeEventActionConfig.vue | 5 +++- .../SmartContractEventActionConfig.vue | 7 +++-- .../components/SocialEventActionConfig.vue | 5 +++- .../components/WalletEventActionConfig.vue | 7 +++-- src/utils/messages/admin/en.js | 1 + src/views/admin/Events.vue | 26 +++++++++++++++++-- 11 files changed, 70 insertions(+), 16 deletions(-) diff --git a/src/components/admin/createProjectSlider/components/CustomApiEventActionConfig.vue b/src/components/admin/createProjectSlider/components/CustomApiEventActionConfig.vue index 542a4967..f882a52c 100644 --- a/src/components/admin/createProjectSlider/components/CustomApiEventActionConfig.vue +++ b/src/components/admin/createProjectSlider/components/CustomApiEventActionConfig.vue @@ -1184,7 +1184,7 @@ export default { }, handleEventActionValidation() { let isvalid = true; - + const ToDate = new Date(); ////// //// WARNINGS: This is worst way of handeling validation //// You should return or break the moment first error occured @@ -1193,6 +1193,9 @@ export default { if(this.project.projectStatus ==false){ isvalid = false; return this.notifyErr(Messages.EVENTS.EVENT_CLOSED) + } if(new Date(this.project.toDate).getTime() <= ToDate.getTime()) { + isvalid = false + return this.notifyErr(Messages.EVENTS.EVENT_EXPIRY_DATE) } if (isEmpty(this.selected.title)) { isvalid = false; diff --git a/src/components/admin/createProjectSlider/components/CustomContractEventActionConfig.vue b/src/components/admin/createProjectSlider/components/CustomContractEventActionConfig.vue index a669588e..3a40c662 100644 --- a/src/components/admin/createProjectSlider/components/CustomContractEventActionConfig.vue +++ b/src/components/admin/createProjectSlider/components/CustomContractEventActionConfig.vue @@ -450,7 +450,7 @@ export default { }, handleEventActionValidation() { let isvalid = true; - + const ToDate = new Date(); ////// //// WARNINGS: This is worst way of handeling validation //// You should return or break the moment first error occured @@ -459,6 +459,9 @@ export default { if(this.project.projectStatus ==false){ isvalid = false; return this.notifyErr(Messages.EVENTS.EVENT_CLOSED) + } if(new Date(this.project.toDate).getTime() <= ToDate.getTime()) { + isvalid = false + return this.notifyErr(Messages.EVENTS.EVENT_EXPIRY_DATE) } if (this.selected.type === null) { isvalid = false; diff --git a/src/components/admin/createProjectSlider/components/CustomEventActionConfig.vue b/src/components/admin/createProjectSlider/components/CustomEventActionConfig.vue index 642da7aa..2b979514 100644 --- a/src/components/admin/createProjectSlider/components/CustomEventActionConfig.vue +++ b/src/components/admin/createProjectSlider/components/CustomEventActionConfig.vue @@ -365,7 +365,7 @@ export default { }, handleEventActionValidation() { let isvalid = true; - + const ToDate = new Date(); ////// //// WARNINGS: This is worst way of handeling validation //// You should return or break the moment first error occured @@ -374,8 +374,10 @@ export default { if(this.project.projectStatus ==false){ isvalid = false; return this.notifyErr(Messages.EVENTS.EVENT_CLOSED) - } - if (this.selected.type === null) { + } if(new Date(this.project.toDate).getTime() <= ToDate.getTime()) { + isvalid = false + return this.notifyErr(Messages.EVENTS.EVENT_EXPIRY_DATE) + } if (this.selected.type === null) { isvalid = false; this.notifyErr(Messages.EVENTS.ACTIONS.CUSTOM.CUSTOM_TYPE); } else if (isEmpty(this.selected.title)) { diff --git a/src/components/admin/createProjectSlider/components/GeneralConfig.vue b/src/components/admin/createProjectSlider/components/GeneralConfig.vue index 76042a34..18f84b35 100644 --- a/src/components/admin/createProjectSlider/components/GeneralConfig.vue +++ b/src/components/admin/createProjectSlider/components/GeneralConfig.vue @@ -126,10 +126,14 @@
-