From 47afb8c0041d05d32971b8d3f725e20cc2f27a5d Mon Sep 17 00:00:00 2001 From: varsha Date: Thu, 11 Aug 2022 12:56:28 +0530 Subject: [PATCH 1/8] made font color of nav button same as button text color --- src/components/participant/NavBar.vue | 5 +++-- src/views/participant/Event.vue | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/participant/NavBar.vue b/src/components/participant/NavBar.vue index efcf72c3..aa2beba5 100644 --- a/src/components/participant/NavBar.vue +++ b/src/components/participant/NavBar.vue @@ -19,7 +19,7 @@ color: white !important; Home @@ -57,7 +57,8 @@ export default { computed: { themeCss(){ return{ - '--theme-bg-color': (this.themeData.themeColor && this.isForm) ? this.themeData.themeColor : config.app.themeBgColor + '--theme-bg-color': (this.themeData.themeColor && this.isForm) ? this.themeData.themeColor : config.app.themeBgColor, + '--theme-text-color': (this.themeData.buttonTextColor && this.isForm) ? this.themeData.buttonTextColor : 'white' } } }, diff --git a/src/views/participant/Event.vue b/src/views/participant/Event.vue index d5943205..79f92b54 100644 --- a/src/views/participant/Event.vue +++ b/src/views/participant/Event.vue @@ -238,7 +238,8 @@ export default { eventBus.$emit('UpdateThemeEvent', { logoPath: this.eventData['orgData'].logoPath, - themeColor: this.eventData['orgData'].themeColor + themeColor: this.eventData['orgData'].themeColor, + buttonTextColor: this.eventData['orgData'].buttonTextColor }) /// deleting data wich is not required. From 94e5c2fb7883a4add910cf5c2b808a551e00643f Mon Sep 17 00:00:00 2001 From: varsha Date: Thu, 11 Aug 2022 17:08:36 +0530 Subject: [PATCH 2/8] changed validation messages and added some field check --- src/views/superAdmin/Home.vue | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/views/superAdmin/Home.vue b/src/views/superAdmin/Home.vue index 46d75fe0..d3c3a369 100644 --- a/src/views/superAdmin/Home.vue +++ b/src/views/superAdmin/Home.vue @@ -325,7 +325,7 @@ import Loading from "vue-loading-overlay"; import "vue-loading-overlay/dist/vue-loading.css"; import notificationMixins from "../../mixins/notificationMixins"; import Datepicker from "vuejs-datetimepicker"; -import { isValidSlug } from "../../mixins/fieldValidationMixin"; +import { isValidURL } from "../../mixins/fieldValidationMixin"; import masterKeyPopupMixin from "../../mixins/masterKeyPopupMixin.js"; import dayjs from "dayjs"; export default { @@ -572,7 +572,6 @@ export default { url = url.replace("", resource.value.trim()); } url = url.replace("", masterKey); - console.log(url); const Url = new URL(this.$config.studioServer.BASE_URL); const headers = { Orign: Url.origin, @@ -641,10 +640,12 @@ export default { if (!resource.value.name) { throw new Error("Enter coupon code"); } - - // if (isValidSlug(resource.value.name)) { - // throw new Error("Enter valid coupon code"); - // } + if(isValidURL(resource.value.name)){ + throw new Error("Coupon should not be a url") + } + if(resource.value.name.trim().includes(' ')){ + throw new Error('There should not be space in coupon') + } if (!resource.value.expiredAt) { throw new Error("Enter expiry date time"); @@ -654,14 +655,14 @@ export default { resource.value.maxClaimCount <= 0 || isNaN(parseInt(resource.value.maxClaimCount)) ) { - throw new Error("Enter Valid number for max limit"); + throw new Error("Limit should be a number greater than 0"); } if ( - !resource.value.discount || (resource.value.discount <= 0 || resource.value.discount >= 70) || + !resource.value.discount || (resource.value.discount <= 0 || resource.value.discount >= 70) || isNaN(parseInt(resource.value.discount)) ) { - throw new Error("Enter valid coupon discount "); + throw new Error("Discount value should be a number greater than 0"); } const ToDate = new Date(); From 863599a0c5a5a5213aae9f558d11faaf98b997c0 Mon Sep 17 00:00:00 2001 From: varsha Date: Thu, 11 Aug 2022 17:44:24 +0530 Subject: [PATCH 3/8] added validation message for empty --- src/components/admin/selectPlanSlider/SelectPlanSlide.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/admin/selectPlanSlider/SelectPlanSlide.vue b/src/components/admin/selectPlanSlider/SelectPlanSlide.vue index 1d8238bb..6a4f6a19 100644 --- a/src/components/admin/selectPlanSlider/SelectPlanSlide.vue +++ b/src/components/admin/selectPlanSlider/SelectPlanSlide.vue @@ -325,14 +325,17 @@ export default { }, methods: { async applyCoupon(){ - + try{ if(this.selectedCurrency !== "" && this.selectedNetwork !== "") { + if(!this.coupon){ + throw new Error('Enter Coupon and Apply') + } if(!this.couponCount>0){ - this.isLoading = true; const url = `${this.$config.studioServer.BASE_URL}api/v1/subscription/coupon/verify`; + console.log(this.coupon) let headers = { "Content-Type": "application/json", Authorization: `Bearer ${this.authToken}`, From cd87eead8b8acfc9d5976bf331dd2ade82203da1 Mon Sep 17 00:00:00 2001 From: rajpatil6939 Date: Thu, 11 Aug 2022 17:57:34 +0530 Subject: [PATCH 4/8] issues/1549 fixed with reset coupon discount if input changes --- .../selectPlanSlider/SelectPlanSlide.vue | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/components/admin/selectPlanSlider/SelectPlanSlide.vue b/src/components/admin/selectPlanSlider/SelectPlanSlide.vue index 1d8238bb..0cf72d38 100644 --- a/src/components/admin/selectPlanSlider/SelectPlanSlide.vue +++ b/src/components/admin/selectPlanSlider/SelectPlanSlide.vue @@ -91,6 +91,7 @@
@@ -267,14 +268,12 @@ export default { } else{ - total = this.plan.price; this.plan.grandTotal = total; } return this.plan.grandTotal }, }, - data() { return { /// TODO: Need to do it in a neat way @@ -292,7 +291,9 @@ export default { selectedNetwork: "", marketPairs: [], coupon:"", + coupons:[], isLoading:false, + fullPage: true, options: { currency: [ { @@ -324,13 +325,18 @@ export default { this.fetchTokenPriceCMC(); }, methods: { + handleInput(e){ + if (e.key === "Backspace" || e.key === "Delete") { + this.couponDiscount=0; + } + }, async applyCoupon(){ try{ if(this.selectedCurrency !== "" && this.selectedNetwork !== "") { - if(!this.couponCount>0){ - + if(!this.coupons.includes(this.coupon)){ + this.grandTotal this.isLoading = true; const url = `${this.$config.studioServer.BASE_URL}api/v1/subscription/coupon/verify`; let headers = { @@ -352,6 +358,7 @@ export default { return this.notifyErr(json); } else { this.couponCount = 1; + this.coupons.push(this.coupon) this.couponDiscount = (this.plan.grandTotal * this.fetchedCouponDiscount) / 100; return this.notifySuccess("Coupon Applied"); } @@ -360,7 +367,7 @@ export default { } } else{ - return this.notifyErr("Coupon applied already") + return this.notifyErr("coupon code already applied") } } }catch(e){ @@ -371,6 +378,7 @@ export default { } }, resetAllValues() { + this.coupons = []; this.couponCount = 0; this.showCoupon = false; this.discount = 0; @@ -391,6 +399,7 @@ export default { this.discount = 0; this.couponDiscount = 0; this.couponCount = 0; + this.coupons = [] }, setDiscount(__arg) { if (__arg) { @@ -462,7 +471,6 @@ export default { ]; // this.selectedNetwork = "ETH"; } - this.grandTotal; } }, getHidPrice() { From 038019dd61153ae8d6924e54e069f631902d2f4b Mon Sep 17 00:00:00 2001 From: rajpatil6939 Date: Thu, 11 Aug 2022 23:11:47 +0530 Subject: [PATCH 5/8] apply coupon box not displaying bug fixed --- .../admin/selectPlanSlider/SelectPlanSlide.vue | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/components/admin/selectPlanSlider/SelectPlanSlide.vue b/src/components/admin/selectPlanSlider/SelectPlanSlide.vue index 07efb854..8eae02dd 100644 --- a/src/components/admin/selectPlanSlider/SelectPlanSlide.vue +++ b/src/components/admin/selectPlanSlider/SelectPlanSlide.vue @@ -282,7 +282,6 @@ export default { // {"actionTypes":["INPUT_TEXT","INPUT_NUMBER","TWITTER_FOLLOW","TWITTER_RETWEET","TELEGRAM_JOIN","DISCORD_JOIN","BLOCKCHAIN_ETH","BLOCKCHAIN_TEZ","HYPERSIGN_AUTH"],"length":9} authToken: localStorage.getItem("authToken"), showCoupon:false, - couponCount:0, subTotal: 0, discount: 0, couponDiscount: 0, @@ -328,6 +327,7 @@ export default { handleInput(e){ if (e.key === "Backspace" || e.key === "Delete") { this.couponDiscount=0; + this.coupons = [] } }, async applyCoupon(){ @@ -340,11 +340,8 @@ export default { } if(!this.coupons.includes(this.coupon)){ this.grandTotal - - if(!this.couponCount>0){ this.isLoading = true; const url = `${this.$config.studioServer.BASE_URL}api/v1/subscription/coupon/verify`; - // console.log(this.coupon) let headers = { "Content-Type": "application/json", Authorization: `Bearer ${this.authToken}`, @@ -363,7 +360,6 @@ export default { if (!resp.ok) { return this.notifyErr(json); } else { - this.couponCount = 1; this.coupons.push(this.coupon) this.couponDiscount = (this.plan.grandTotal * this.fetchedCouponDiscount) / 100; return this.notifySuccess("Coupon Applied"); @@ -376,6 +372,8 @@ export default { return this.notifyErr("coupon code already applied") } } + else{ + return this.notifyErr(Messages.SUBSCRIPTIONS.SELECT_CURRENCY_AND_NETWORK) } }catch(e){ return this.notifyErr(e.message) @@ -386,7 +384,6 @@ export default { }, resetAllValues() { this.coupons = []; - this.couponCount = 0; this.showCoupon = false; this.discount = 0; this.couponDiscount = 0; @@ -402,17 +399,17 @@ export default { }, resetAllPayment(){ this.coupon = ""; - this.showCoupon = false; this.discount = 0; this.couponDiscount = 0; - this.couponCount = 0; this.coupons = [] }, setDiscount(__arg) { if (__arg) { if (__arg == "HID") { this.resetAllPayment(); + if(this.selectedNetwork==="BSC"){ this.selectedNetwork = ""; + } this.options.network = [ { text: "Ethereum", value: "ETH", disabled: false }, { text: "Polygon", value: "MATIC", disabled: false }, @@ -458,7 +455,6 @@ export default { } if (__arg == "USDT") { this.resetAllPayment(); - this.selectedNetwork = ""; this.options.network = [ { text: "Ethereum", value: "ETH", disabled: false }, { text: "Polygon", value: "MATIC", disabled: false }, @@ -469,7 +465,6 @@ export default { } if (__arg == "USDC") { this.resetAllPayment(); - this.selectedNetwork = ""; this.options.network = [ { text: "Ethereum", value: "ETH", disabled: false }, { text: "Polygon", value: "MATIC", disabled: false }, From 57547ffa6a2ee696524cb45055ed958cbba82add Mon Sep 17 00:00:00 2001 From: rajpatil6939 Date: Fri, 12 Aug 2022 10:20:18 +0530 Subject: [PATCH 6/8] bug 1548 fixed --- src/views/superAdmin/Home.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/views/superAdmin/Home.vue b/src/views/superAdmin/Home.vue index d3c3a369..c9a84ac8 100644 --- a/src/views/superAdmin/Home.vue +++ b/src/views/superAdmin/Home.vue @@ -479,9 +479,9 @@ export default { if (x.id === 5) { return (x.value = { name: "", - discount: "", + discount: 0, expiredAt: null, - maxClaimCount: "", + maxClaimCount: 0, }); } return (x.value = ""); @@ -614,6 +614,7 @@ export default { this.schedules.unshift(schedule); } } else if (json.discount) { + this.notifySuccess("Coupon"+" "+ json.name + " "+ "successfully created"); this.couponTable.unshift(json); this.isEdit = false; } From 2956dc7cec25dcab835c83a3fa75842ab6db3697 Mon Sep 17 00:00:00 2001 From: rajpatil6939 Date: Fri, 12 Aug 2022 11:49:24 +0530 Subject: [PATCH 7/8] issues/1546 is fixed --- src/mixins/fieldValidationMixin.js | 8 +++++++- src/views/superAdmin/Home.vue | 10 ++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/mixins/fieldValidationMixin.js b/src/mixins/fieldValidationMixin.js index 8decac02..7d5491b7 100644 --- a/src/mixins/fieldValidationMixin.js +++ b/src/mixins/fieldValidationMixin.js @@ -125,7 +125,13 @@ export function checkValue(arr, prop) { return actionValue; } - +export function isFloat(n) { + if(n === n && n % 1 !== 0){ + return true; + }else{ + return false; + } + } export function urlSanitizer(url, endsWith) { switch (endsWith) { case true: diff --git a/src/views/superAdmin/Home.vue b/src/views/superAdmin/Home.vue index c9a84ac8..df8ff1a2 100644 --- a/src/views/superAdmin/Home.vue +++ b/src/views/superAdmin/Home.vue @@ -325,7 +325,7 @@ import Loading from "vue-loading-overlay"; import "vue-loading-overlay/dist/vue-loading.css"; import notificationMixins from "../../mixins/notificationMixins"; import Datepicker from "vuejs-datetimepicker"; -import { isValidURL } from "../../mixins/fieldValidationMixin"; +import { isValidURL,isFloat } from "../../mixins/fieldValidationMixin"; import masterKeyPopupMixin from "../../mixins/masterKeyPopupMixin.js"; import dayjs from "dayjs"; export default { @@ -624,7 +624,6 @@ export default { this.notifyErr(e.message); } finally { this.Loading = false; - this.clearAll(); this.getAllCoupon(); } }, @@ -653,17 +652,16 @@ export default { } if ( - resource.value.maxClaimCount <= 0 || - isNaN(parseInt(resource.value.maxClaimCount)) + resource.value.maxClaimCount <= 0 || isFloat(resource.value.maxClaimCount) ) { throw new Error("Limit should be a number greater than 0"); } if ( - !resource.value.discount || (resource.value.discount <= 0 || resource.value.discount >= 70) || + !resource.value.discount || (resource.value.discount <= 0 || resource.value.discount > 70) || isNaN(parseInt(resource.value.discount)) ) { - throw new Error("Discount value should be a number greater than 0"); + throw new Error("Discount value should be a number greater than 0 and less than 70"); } const ToDate = new Date(); From 983fe41aacb75dd17fa1cfecc3485728a367ed6f Mon Sep 17 00:00:00 2001 From: rajpatil6939 Date: Fri, 12 Aug 2022 12:33:53 +0530 Subject: [PATCH 8/8] issues1548 fixed with error number 4 --- src/components/admin/selectPlanSlider/SelectPlanSlide.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/admin/selectPlanSlider/SelectPlanSlide.vue b/src/components/admin/selectPlanSlider/SelectPlanSlide.vue index 8eae02dd..0b1c40bb 100644 --- a/src/components/admin/selectPlanSlider/SelectPlanSlide.vue +++ b/src/components/admin/selectPlanSlider/SelectPlanSlide.vue @@ -291,6 +291,7 @@ export default { marketPairs: [], coupon:"", coupons:[], + applied:false, isLoading:false, fullPage: true, options: { @@ -326,6 +327,7 @@ export default { methods: { handleInput(e){ if (e.key === "Backspace" || e.key === "Delete") { + this.applied = false; this.couponDiscount=0; this.coupons = [] } @@ -335,6 +337,7 @@ export default { try{ if(this.selectedCurrency !== "" && this.selectedNetwork !== "") { + this.applied = true; if(!this.coupon){ throw new Error('Enter Coupon and Apply') } @@ -520,7 +523,9 @@ export default { var planbody = {}; this.plan.selectedCurrency = this.selectedCurrency; this.plan.selectedNetwork = this.selectedNetwork; - this.plan.coupon_name = this.coupon; + if(this.applied===true){ + this.plan.coupon_name = this.coupon; + } this.plan.coupon_code = "Dummy30"; planbody = Object.assign(planbody, this.plan);