diff --git a/package.json b/package.json index ec24f0bc..bf8a8802 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "system": "^2.0.1", "v-markdown-editor": "^1.2.6", "valid-url": "^1.0.9", + "validator": "^13.7.0", "vue": "^2.5.16", "vue-codemirror": "^4.0.6", "vue-css-donut-chart": "^1.3.0", diff --git a/src/assets/filled-rest-api-50.png b/src/assets/filled-rest-api-50.png new file mode 100644 index 00000000..fdee50c8 Binary files /dev/null and b/src/assets/filled-rest-api-50.png differ diff --git a/src/components/admin/createProjectSlider/CreateProjectSlide.vue b/src/components/admin/createProjectSlider/CreateProjectSlide.vue index c55245e1..acb68e26 100644 --- a/src/components/admin/createProjectSlider/CreateProjectSlide.vue +++ b/src/components/admin/createProjectSlider/CreateProjectSlide.vue @@ -283,6 +283,28 @@ + + + + + + + Custom API Configurations + + + + + + + + + + + +
{{ data.title }}
+
+ + + + + {{ data.score }} + + + + + + + + + +
+ + +
+
+
+ + + + + +
+
+ + + + + diff --git a/src/components/admin/createProjectSlider/components/CustomApiEventActionConfig.vue b/src/components/admin/createProjectSlider/components/CustomApiEventActionConfig.vue new file mode 100644 index 00000000..be50ad80 --- /dev/null +++ b/src/components/admin/createProjectSlider/components/CustomApiEventActionConfig.vue @@ -0,0 +1,866 @@ + + + diff --git a/src/components/admin/createProjectSlider/components/PreviewConfig.vue b/src/components/admin/createProjectSlider/components/PreviewConfig.vue index 1ab059b4..5e1df5cd 100644 --- a/src/components/admin/createProjectSlider/components/PreviewConfig.vue +++ b/src/components/admin/createProjectSlider/components/PreviewConfig.vue @@ -271,6 +271,12 @@ cursor:default !important src="../../../../assets/cosmos-2.svg" v-if="action.type.includes('BLOCKCHAIN_COSMOS')" height="20px" + /> + diff --git a/src/components/participant/Action.vue b/src/components/participant/Action.vue index 99f04361..ca9e7185 100644 --- a/src/components/participant/Action.vue +++ b/src/components/participant/Action.vue @@ -75,7 +75,7 @@ import Messsages from "../../utils/messages/participants/en"; import EthereumNetwork from "./ActionInputs/EthereumNetwork.vue"; import MaticNetwork from './ActionInputs/MaticNetwork.vue'; import BinanceNetwork from './ActionInputs/BinanceNetwork.vue'; - +import CustomApi from "./ActionInputs/CustomApi.vue"; export default { name: "Action", props: { @@ -143,6 +143,7 @@ export default { MoonriverErc721, PushNotification, SumsubKyc, + CustomApi, RecaptchaToken: "", }, mounted() { diff --git a/src/components/participant/ActionInputs/CustomApi.vue b/src/components/participant/ActionInputs/CustomApi.vue new file mode 100644 index 00000000..e151a5e2 --- /dev/null +++ b/src/components/participant/ActionInputs/CustomApi.vue @@ -0,0 +1,203 @@ + + + + diff --git a/src/mixins/fieldValidationMixin.js b/src/mixins/fieldValidationMixin.js index d345888c..c4dc64e8 100644 --- a/src/mixins/fieldValidationMixin.js +++ b/src/mixins/fieldValidationMixin.js @@ -133,7 +133,8 @@ export function checkValue(arr, prop) { } export function isFloat(n) { - if(n === n && n % 1 !== 0){ + const parsedNumber = parseFloat(n) + if(parsedNumber === parsedNumber && parsedNumber % 1 !== 0){ return true; }else{ return false; @@ -160,4 +161,13 @@ export function urlSanitizer(url, endsWith) { default: return url; } -} \ No newline at end of file +} + +export function ifSpaceExists(str) { + str= str.trim() + str = str.split(' ') + if (str.length > 1) { + return true + } + else return false + } \ No newline at end of file diff --git a/src/views/participant/Event.vue b/src/views/participant/Event.vue index f1565ea2..1b758de7 100644 --- a/src/views/participant/Event.vue +++ b/src/views/participant/Event.vue @@ -358,16 +358,43 @@ export default { (ea.type === "MOONRIVER_ERC20") || (ea.type === "MOONRIVER_ERC721") || (ea.type === "MOON_ERC20") || - (ea.type === "MOON_ERC721") - ){ + (ea.type === "MOON_ERC721") || + (ea.type === "CUSTOM_API_GET") || + (ea.type === "CUSTOM_API_POST") + ){ const parsedVal = JSON.parse(ea.value) ea.value = parsedVal; } return ea - }) - - } else { - this.eventActionsToShow = eventActions; + }) + } else { + const temp = eventActions.map((x)=>{ + if((x.type === "ETHEREUM_NETWORK") || + (x.type === "BINANCE_NETWORK") || + (x.type === "MATIC_NETWORK") || + (x.type === "ETHEREUM_ERC20") || + (x.type === "ETHEREUM_ERC721") || + (x.type === "MATIC_ERC20") || + (x.type === "MATIC_ERC721") || + (x.type === "BINANCE_ERC20") || + (x.type === "BINANCE_ERC721") || + (x.type === "REEF_ERC20") || + (x.type === "REEF_ERC721") || + (x.type === "MOONBEAM_ERC20") || + (x.type === "MOONBEAM_ERC721") || + (x.type === "MOONRIVER_ERC20") || + (x.type === "MOONRIVER_ERC721") || + (x.type === "MOON_ERC20") || + (x.type === "MOON_ERC721") || + (x.type === "CUSTOM_API_GET") || + (x.type === "CUSTOM_API_POST") + ){ + const parsedVal = JSON.parse(x.value) + x.value = parsedVal; + } + return x + }) + this.eventActionsToShow = temp; } } else { this.eventActionsToShow = this.eventData.actions;