Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cardano added #1176

Merged
merged 1 commit into from
May 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"hdkey": "^2.0.1",
"js-file-download": "^0.4.12",
"marked": "^3.0.8",
"multicoin-address-validator": "^0.5.10",
"node-fetch": "^2.6.0",
"simple-vue-validator": "^0.16.0",
"v-markdown-editor": "^1.2.6",
Expand Down Expand Up @@ -106,4 +107,4 @@
"last 2 versions",
"not ie <= 8"
]
}
}
Binary file added src/assets/cardano_128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ export default {
{ text: "Avalanche", value: "BLOCKCHAIN_AVAX" },
{ text: "Reef", value: "BLOCKCHAIN_REEF" },
{ text: "Tezos", value: "BLOCKCHAIN_TEZ" },
{ text: "Cardano", value: "BLOCKCHAIN_CARDANO" },
],
smartContractAction: [
{ text: "Select Contract Type", value: null },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@
src="../../../../assets/tezos.png"
v-if="eventAction.type.includes('BLOCKCHAIN_TEZ')"
height="22px"
/>
<img
style="padding-right: 5px"
src="../../../../assets/cardano_128.png"
v-if="eventAction.type.includes('BLOCKCHAIN_CARDANO')"
height="22px"
/>
<img
style="padding-right: 5px"
Expand Down
2 changes: 2 additions & 0 deletions src/components/participant/Action.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import TelegramJoin from "./ActionInputs/TelegramJoin.vue";
import InputText from "./ActionInputs/InputText.vue";
import BlockchainEth from "./ActionInputs/BlockchainEth.vue";
import BlockchainTez from "./ActionInputs/BlockchainTez.vue";
import BlockchainCardano from "./ActionInputs/BlockchainCardano.vue";
import BlockchainAvax from "./ActionInputs/BlockchainAvax.vue";
import BlockchainBsc from "./ActionInputs/BlockchainBsc.vue";
import BlockchainMatic from "./ActionInputs/BlockchainMatic.vue";
Expand Down Expand Up @@ -94,6 +95,7 @@ export default {
InputText,
BlockchainEth,
BlockchainTez,
BlockchainCardano,
BlockchainAvax,
BlockchainBsc,
BlockchainMatic,
Expand Down
121 changes: 121 additions & 0 deletions src/components/participant/ActionInputs/BlockchainCardano.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<template>
<b-card no-body class="action-wrap">
<b-card-header
:class="visible ? null : 'collapsed'"
:aria-expanded="visible ? 'true' : 'false'"
:aria-controls="`collapse-${idValue}`"
@click="visible = !visible"
>
<b-row>
<b-col cols="1" sm="1" md="1">
<img src="../../../assets/cardano_128.png" height="25px" />
</b-col>
<b-col cols="9" sm="9" class="text-left" md="9">
<div class="text text-capitalize">{{ data.title }}</div>
</b-col>
<b-col cols="2" sm="2" md="2">
<b-badge class="btn-score" @click="update()" v-if="!done">
<img src="../../../assets/plus.svg" />
{{ data.score }}
</b-badge>
<img
class="check-mark"
src="../../../assets/check-circle-fill.svg"
height="25px"
v-if="done"
/>
</b-col>
</b-row>
</b-card-header>
<b-collapse :id="`collapse-${idValue}`" v-model="visible">
<b-card-body class="user-details">
<b-row>
<b-col cols="12" sm="12" md="12">
<div class="follow">
<b-form-input
type="text"
:placeholder="data.placeHolder"
v-model="data.value"
:disabled="done"
:required="data.isManadatory"
></b-form-input>
</div>
</b-col>
</b-row>

<b-row v-if="!done">
<b-col cols="12" sm="12" md="12" >
<button class="btn btn-link center" @click="update()">Continue</button>
</b-col>
</b-row>
</b-card-body>
</b-collapse>
</b-card>
</template>
<style scoped>
.center{
display: block; margin-left: auto;margin-right: auto
}
</style>

<script>
import eventBus from "../../../eventBus.js";
import {
isValidURL,
isValidText,
isEmpty,
} from "../../../mixins/fieldValidationMixin";
import notificationMixins from "../../../mixins/notificationMixins";
import Messages from "../../../utils/messages/participants/en";
export default {
name: "BlockchainCardano",
props: {
idValue: {
required: true,
},
data: {
required: true,
},
},
data() {
return {
visible: false,
done: this.data.isDone,
};
},
mounted() {
eventBus.$on(`disableInput${this.data._id}`, this.disableInput);
},
methods: {
update() {
if (!this.isFieldValid()) {
this.data.value = "";
return this.notifyErr(Messages.EVENT_ACTIONS.INVALID_INPUT);
} else {
this.$emit("input", this.data.value);
}
},
isFieldValid() {
if (isEmpty(this.data.value)) {
return false;
}
if (isValidURL(this.data.value)) {
return false;
}
if (!this.isValidAddress(this.data.value)) {

return false;
}
return true;
},
isValidAddress(data){
const WAValidator = require('multicoin-address-validator');
return WAValidator.validate(data,'cardano','ada')
},
disableInput(data) {
this.done = data;
},
},
mixins: [notificationMixins],
};
</script>
2 changes: 2 additions & 0 deletions src/views/admin/Events.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1076,9 +1076,11 @@ export default {
x.type !== "BLOCKCHAIN_AVAX" &&
x.type !== "BLOCKCHAIN_REEF" &&
x.type !== "BLOCKCHAIN_TEZ" &&
x.type !== "BLOCKCHAIN_CARDANO" &&
x.type !== "PRIZE_CARD" &&
x.type !== "PUSH_NOTIFICATION"&&
x.type!=="SUMSUB_KYC"

);
const filteredValueList = checkValue(eventActionValue, "value");
if (filteredValueList.includes(false)) {
Expand Down