Skip to content

Commit

Permalink
Merge pull request #1815 from hypersign-protocol/develop
Browse files Browse the repository at this point in the history
Develop => stage
  • Loading branch information
Raj6939 authored Nov 29, 2022
2 parents 9242083 + 7ebbaa3 commit 7322eff
Show file tree
Hide file tree
Showing 11 changed files with 110 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<img
style="padding-right: 5px"
src="../../../../assets/filled-rest-api-50.png"
height="22px"
height="18px"
/>
</span>
<span>{{ truncate1(eventAction.title, 6) }}</span>
Expand Down Expand Up @@ -138,7 +138,7 @@
style="min-width:90px;"
:title="attr.fieldName"
>
{{ truncate1(attr.fieldName,6) }}
{{ truncate1(attr.fieldName,8) }}
<span style="color: gray; padding-left: 5px">
<i style="" class="fas fa-minus-circle"></i>
</span>
Expand Down Expand Up @@ -230,7 +230,7 @@
style="min-width:90px;"
:title="attr.fieldName"
>
{{ truncate1(attr.fieldName,6) }}
{{ truncate1(attr.fieldName,8) }}
<span style="color: gray; padding-left: 5px">
<i style="" class="fas fa-minus-circle"></i>
</span>
Expand Down Expand Up @@ -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
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
style="padding-right: 5px"
src="../../../../assets/matic-logo.svg"
v-if="eventAction.type.includes('MATIC_NETWORK')"
height="20px"
height="16px"
/>
<img
style="padding-right: 5px"
Expand Down Expand Up @@ -275,6 +275,7 @@ import {
isEmpty,
isValidURL,
truncate,
isContractValid
} from "../../../../mixins/fieldValidationMixin";
import Messages from "../../../../utils/messages/admin/en";
import config from "../../../../config"
Expand Down Expand Up @@ -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: "<" },
Expand Down Expand Up @@ -364,7 +365,7 @@ export default {
contractABI: "",
methods: null,
operand: null,
operator: "",
operator: null,
returnType: "",
},
selected: {
Expand Down Expand Up @@ -441,15 +442,15 @@ export default {
contractABI: "",
methods: null,
operand: null,
operator: "",
operator: null,
returnType: "",
};
this.selected = clearData;
this.currentSelectedId = null;
},
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
Expand All @@ -458,31 +459,49 @@ 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;
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))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,14 @@
</div>
<div class="col-lg-9 col-md-9 px-0">

<select class="form-control" v-model="project.projectStatus">
<!-- <select class="form-control" v-model="project.projectStatus">
<option value="true" >OPEN</option>
<option value="false">CLOSE</option>
</select >
</select > -->
<b-form-select
v-model="project.projectStatus"
:options="statusOptions"
></b-form-select>
</div>
</div>

Expand Down Expand Up @@ -266,6 +270,10 @@ buttonThemeCss() {
"type": null,
"id": "",
},
statusOptions:[
{text:"OPEN",value:true},
{text:"CLOSE",value:false}
]
}
},
props:{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,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
Expand All @@ -280,6 +280,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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,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
Expand All @@ -284,9 +284,12 @@ 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)
}
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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
style="padding-right: 5px"
src="../../../../assets/matic-logo.svg"
v-if="eventAction.type.includes('MATIC_')"
height="20px"
height="16px"
/>
<img
style="padding-right: 5px"
Expand All @@ -55,7 +55,7 @@
style="padding-right: 5px"
src="../../../../assets/moonbase-alpha.svg"
v-if="eventAction.type.includes('MOON_')"
height="22px"
height="16px"
/>
<img
style="padding-right: 5px"
Expand Down Expand Up @@ -401,7 +401,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
Expand All @@ -410,7 +410,10 @@ 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;
this.notifyErr(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,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
Expand All @@ -418,6 +418,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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
style="padding-right: 5px"
src="../../../../assets/matic-logo.svg"
v-if="eventAction.type === 'BLOCKCHAIN_MATIC'"
height="20px"
height="16px"
/>
<img
style="padding-right: 5px"
Expand Down Expand Up @@ -67,7 +67,7 @@
style="padding-right: 5px"
src="../../../../assets/cardano_128.png"
v-if="eventAction.type === 'BLOCKCHAIN_CARDANO'"
height="22px"
height="20px"
/>
<img
style="padding-right: 5px"
Expand Down Expand Up @@ -335,7 +335,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
Expand All @@ -344,7 +344,10 @@ 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;
this.notifyErr(Messages.EVENTS.ACTIONS.BLOCKCHAIN.CHOOSE_TYPE);
Expand Down
6 changes: 6 additions & 0 deletions src/utils/messages/admin/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const EVENTS = {
EVENT_DELETED:"Event is deleted successfully",
WRONG_EVENT_ID:"Please enter valid event Id",
EVENT_CLOSED:"Cannot edit CLOSED event! OPEN it to edit",
EVENT_EXPIRY_DATE:"Event is expired! Please select expiry date greater than current date",
NO_EVENT_FOUND:"No events found, click on create button to create a new event!",
CHECK_ALL_TYPE: "PLease Check if any type left empty",
CHECK_ALL_TITLE_EMPTY: "Check if any Title field you left empty",
Expand Down Expand Up @@ -91,6 +92,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",
Expand Down
Loading

0 comments on commit 7322eff

Please sign in to comment.