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

V5.8.0 #1566

Merged
merged 77 commits into from
Aug 14, 2022
Merged

V5.8.0 #1566

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
5d78225
fixed bug of appsetting
varsha766 Jul 26, 2022
4485c31
no need to make an extra API call for sub usage.
Vishwas1 Jul 27, 2022
cb3df55
no need to have this API call since usage data already present in the UI
Vishwas1 Jul 27, 2022
0178405
removed comment
Vishwas1 Jul 27, 2022
a89e674
hide search event by tag field when no event exists
varsha766 Jul 28, 2022
d44b11b
Merge pull request #1506 from hypersign-protocol/issues#1499
Vishwas1 Jul 28, 2022
ef5dd38
Merge pull request #1505 from hypersign-protocol/appsettingBug
Vishwas1 Jul 28, 2022
c19c951
Merge pull request #1507 from hypersign-protocol/develop
Vishwas1 Jul 28, 2022
c801474
changed validation message
varsha766 Jul 29, 2022
3d9c013
changed column width
varsha766 Jul 29, 2022
bc6d14d
changed column width
varsha766 Jul 29, 2022
0d59c0b
Merge pull request #1514 from hypersign-protocol/issues#1512
Vishwas1 Jul 29, 2022
8d4544f
Merge pull request #1515 from hypersign-protocol/issues/1510
Vishwas1 Jul 29, 2022
79703d7
Merge pull request #1516 from hypersign-protocol/develop
Vishwas1 Jul 29, 2022
6420280
Merge branch 'develop' of https://github.com/hypersign-protocol/hyper…
varsha766 Jul 29, 2022
bec1530
truncated event name at participant side
varsha766 Jul 29, 2022
c4b3bfe
added hypersign atuh along with basic auth
Vishwas1 Aug 5, 2022
effc634
Merge branch 'develop' of https://github.com/hypersign-protocol/hyper…
Vishwas1 Aug 5, 2022
180d83d
changed response
varsha766 Aug 5, 2022
9531c99
Merge branch 'develop' of https://github.com/hypersign-protocol/hyper…
varsha766 Aug 5, 2022
4985e2a
removed console.log
varsha766 Aug 7, 2022
4f189ea
implemented schedules
Vishwas1 Aug 8, 2022
9d1f457
Merge pull request #1533 from hypersign-protocol/optimization
Vishwas1 Aug 8, 2022
de8c736
Merge pull request #1518 from hypersign-protocol/issues#1517
Vishwas1 Aug 8, 2022
03ae8fa
adde refresh button
Vishwas1 Aug 8, 2022
3cc9152
Merge branch 'develop' of https://github.com/hypersign-protocol/hyper…
Vishwas1 Aug 8, 2022
9f7fd39
Merge pull request #1535 from hypersign-protocol/develop
Vishwas1 Aug 8, 2022
b9dbacf
just commiting
Raj6939 Aug 9, 2022
492cd02
Admin side coupon generation flow done
Raj6939 Aug 9, 2022
40a31c7
Just commiting
Raj6939 Aug 9, 2022
0d1431b
just commiting
Raj6939 Aug 9, 2022
a3c88f9
coupon apply at subscription page done
Raj6939 Aug 9, 2022
cca8453
Coupon apply scenario done
Raj6939 Aug 10, 2022
cf78f01
coupon added while make post req for payment
Raj6939 Aug 10, 2022
036e674
Merge pull request #1537 from hypersign-protocol/issues/new_1529
varsha766 Aug 10, 2022
bc6f78b
Merge pull request #1538 from hypersign-protocol/issues/1528
varsha766 Aug 10, 2022
75295f9
correction
Raj6939 Aug 10, 2022
4e6a21f
date edit correction
Raj6939 Aug 10, 2022
27b1c22
small correction
Raj6939 Aug 10, 2022
0458206
small changes
Raj6939 Aug 10, 2022
7ab5359
validation changes
Raj6939 Aug 10, 2022
495471c
reviewed
Vishwas1 Aug 10, 2022
8633e01
fixed some bug
Vishwas1 Aug 10, 2022
4cbd0ec
removed redundant code
Vishwas1 Aug 10, 2022
1697037
grand total code redundent removed
Raj6939 Aug 10, 2022
3bef818
Merge branch 'develop' into feature/coupon
Vishwas1 Aug 10, 2022
668eea8
Merge pull request #1539 from hypersign-protocol/feature/coupon
Vishwas1 Aug 10, 2022
344a09e
Merge pull request #1540 from hypersign-protocol/develop
Vishwas1 Aug 10, 2022
3c41786
updated schedule table
Vishwas1 Aug 10, 2022
b96d35c
updated field name
Vishwas1 Aug 10, 2022
0343ad3
Merge pull request #1541 from hypersign-protocol/develop
Vishwas1 Aug 10, 2022
849dd95
just checking discount percentage value
varsha766 Aug 10, 2022
5938273
Merge pull request #1542 from hypersign-protocol/develop
varsha766 Aug 10, 2022
47afb8c
made font color of nav button same as button text color
varsha766 Aug 11, 2022
94e5c2f
changed validation messages and added some field check
varsha766 Aug 11, 2022
863599a
added validation message for empty
varsha766 Aug 11, 2022
cd87eea
issues/1549 fixed with reset coupon discount if input changes
Raj6939 Aug 11, 2022
f691faf
Merge pull request #1547 from hypersign-protocol/issues#1532
Vishwas1 Aug 11, 2022
fc7a52e
Merge pull request #1551 from hypersign-protocol/issues#1544
Vishwas1 Aug 11, 2022
d96d7aa
Merge branch 'develop' into issues/1549
varsha766 Aug 11, 2022
135c5f5
Merge pull request #1552 from hypersign-protocol/issues/1549
varsha766 Aug 11, 2022
038019d
apply coupon box not displaying bug fixed
Raj6939 Aug 11, 2022
57547ff
bug 1548 fixed
Raj6939 Aug 12, 2022
f1cb26c
Merge pull request #1554 from hypersign-protocol/issues/1553
varsha766 Aug 12, 2022
14f0064
Merge pull request #1555 from hypersign-protocol/issues/1548
varsha766 Aug 12, 2022
2956dc7
issues/1546 is fixed
Raj6939 Aug 12, 2022
6c3ee03
Merge pull request #1556 from hypersign-protocol/issues/1546
varsha766 Aug 12, 2022
983fe41
issues1548 fixed with error number 4
Raj6939 Aug 12, 2022
f14fa7c
Merge pull request #1557 from hypersign-protocol/issues/new1548
varsha766 Aug 12, 2022
ab10729
Merge pull request #1558 from hypersign-protocol/develop
varsha766 Aug 12, 2022
b03e752
small change
Raj6939 Aug 12, 2022
9e319a2
added refresh button
Raj6939 Aug 12, 2022
09b9e63
Merge pull request #1559 from hypersign-protocol/develop
varsha766 Aug 12, 2022
30e5d89
added validation message
varsha766 Aug 12, 2022
4c7a564
Merge pull request #1563 from hypersign-protocol/smallBug
varsha766 Aug 12, 2022
57e1956
Merge pull request #1564 from hypersign-protocol/develop
varsha766 Aug 12, 2022
d9617b0
updated version
varsha766 Aug 14, 2022
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hyperfye-frontend",
"version": "v5.7.0",
"version": "v5.8.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve --mode production",
Expand Down
40 changes: 3 additions & 37 deletions src/components/admin/Charts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ export default {
totalAvailable: 0,
totalUsed: 0,
unused: 0,
user: {},
usage: {},
user: {},
sections: [
{ label: "REQUESTS CONSUMED", value: this.totalUsed, color: "#ed5c5c" },
{ label: "REQUESTS LEFT", value: this.unused, color: "#60c860" },
Expand All @@ -55,47 +54,14 @@ export default {
this.user = {
...JSON.parse(usrStr),
};
await this.fetchSubscription();

this.totalAvailable = this.usage["totalAvailable"];
this.totalUsed = this.usage["totalUsed"];
this.totalAvailable = this.user.usage["totalAvailable"];
this.totalUsed = this.user.usage["totalUsed"];
this.unused = this.totalAvailable - this.totalUsed;
this.sections[0].value = this.totalUsed;
this.sections[1].value = this.unused;

},
methods: {
handleSectionClick() {},
async fetchSubscription() {
try {
this.isLoading = true;

// if (!this.user.id) throw new Error("No project owner found");

const url = `${this.$config.studioServer.BASE_URL}api/v1/subscription?usage=true`;
const headers = {
Authorization: `Bearer ${this.authToken}`,
AccessToken:`Bearer ${this.accessToken}`
};
const resp = await fetch(url, {
headers,
method: "GET",
});

if (!resp.ok) {
return this.notifyErr(resp.statusText);
}
const json = await resp.json();
this.usage = json["usage"];

// localStorage.setItem("subscriptions", JSON.stringify(json));
// this.notifySuccess("No. of projects fetched " + this.projects.length);
} catch (e) {
this.notifyErr(e.message);
} finally {
this.isLoading = false;
}
},
},
};
</script>
140 changes: 133 additions & 7 deletions src/components/admin/selectPlanSlider/SelectPlanSlide.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
</style>
<template>
<div>
<loading :active.sync="isLoading" :can-cancel="true" :is-full-page="fullPage"></loading>
<b-sidebar
backdrop
width="50%"
Expand Down Expand Up @@ -85,6 +86,21 @@
</div>
</div>
</div>
<hr v-if="showCoupon===true"/>
<div style="display:flex" v-if="showCoupon===true">
<div class="col-lg-6 col-md-9 px-0">
<input type="text" class="form-control w-100"
placeholder="Enter Coupon Code"
@keydown="handleInput($event)"
v-model="coupon">
</div>
<div class="col-lg-4 col-md-3 " style="display:block">
<button type="button" class="btn btn-outline-primary button-theme"
:style="buttonThemeCss"
@click="applyCoupon"
>Apply</button>
</div>
</div>
<hr />
<div>
<div class="row" style="margin-top: 2%">
Expand All @@ -95,6 +111,10 @@
<div class="col-md-6"><b>Discount</b></div>
<div class="col-md-6">$ {{ discount }}</div>
</div>
<div class="row" style="margin-top: 2%" v-if="showCoupon===true">
<div class="col-md-6"><b>Coupon Discount</b></div>
<div class="col-md-6">$ {{ couponDiscount }}</div>
</div>
<!-- <div class="row" style="margin-top: 2%;">
<div class="col-md-6"><b>Subtotal</b></div>
<div class="col-md-6"></div>
Expand Down Expand Up @@ -182,13 +202,16 @@ import GeneralConfig from "./components/GeneralConfig.vue";
import ReferralConfig from "./components/ReferralConfig.vue";
import notificationMixins from "../../../mixins/notificationMixins";
import Messages from "../../../utils/messages/admin/en";
import Loading from "vue-loading-overlay";
import "vue-loading-overlay/dist/vue-loading.css";
export default {
name: "CreateProjectSlide",
components: {
GeneralConfig,
EventActionConfig,
ReferralConfig,
InputDate,
Loading
},

props: {
Expand Down Expand Up @@ -229,27 +252,48 @@ export default {
'--header-bg-color': config.app.headerBGColor,
'--header-text-color':config.app.headerTextColor
}
},
couponDiscount(){
return this.couponDiscount = (this.plan.price * this.fetchedCouponDiscount)/100
// this.discount = (this.plan.price * 30) / 100;
},
grandTotal() {
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
this.plan.grandTotal = this.plan.price - this.discount;
return this.plan.grandTotal;

let total = this.plan.price - this.discount;
if(this.selectedCurrency !=="" && this.selectedNetwork !==""){
this.showCoupon = true;
this.plan.grandTotal = total - this.couponDiscount;

}
else{

this.plan.grandTotal = total;

}
return this.plan.grandTotal
},
},

data() {
return {
/// TODO: Need to do it in a neat way
// Use api https://localhost:6006/api/v1/actions
// it returns:
// {"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,
subTotal: 0,
discount: 0,
couponDiscount: 0,
fetchedCouponDiscount:0,
selectedCurrency: "",
selectedNetwork: "",
marketPairs: [],

coupon:"",
coupons:[],
applied:false,
isLoading:false,
fullPage: true,
options: {
currency: [
{
Expand Down Expand Up @@ -281,8 +325,73 @@ export default {
this.fetchTokenPriceCMC();
},
methods: {
handleInput(e){
if (e.key === "Backspace" || e.key === "Delete") {
this.applied = false;
this.couponDiscount=0;
this.coupons = []
}
},
async applyCoupon(){

try{
if(this.selectedCurrency !== "" && this.selectedNetwork !== "")
{
this.applied = true;
if(!this.coupon){
throw new Error('Enter Coupon and Apply')
}
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 = {
"Content-Type": "application/json",
Authorization: `Bearer ${this.authToken}`,
};
let body={
coupon:this.coupon
}
const resp = await fetch(url, {
method: "POST",
body:JSON.stringify(body),
headers
});
const json = await resp.json();
this.fetchedCouponDiscount = json;
if (this.fetchedCouponDiscount) {
if (!resp.ok) {
this.applied = false;
return this.notifyErr(json);
} else {
this.coupons.push(this.coupon)
this.couponDiscount = (this.plan.grandTotal * this.fetchedCouponDiscount) / 100;
return this.notifySuccess("Coupon Applied");
}
} else {
throw new Error("Error while applying coupon code");
}
}
else{
return this.notifyErr("coupon code already applied")
}
}
else{
return this.notifyErr(Messages.SUBSCRIPTIONS.SELECT_CURRENCY_AND_NETWORK)
}
}catch(e){
return this.notifyErr(e.message)
}
finally{
this.isLoading = false
}
},
resetAllValues() {
this.coupons = [];
this.showCoupon = false;
this.discount = 0;
this.couponDiscount = 0;
this.coupon = ""
this.selectedCurrency = "";
this.selectedNetwork = "";
this.options.network = [
Expand All @@ -292,30 +401,44 @@ export default {
{ text: "Harmony (Coming Soon..)", value: "ONE", disabled: true },
];
},
resetAllPayment(){
this.coupon = "";
this.discount = 0;
this.couponDiscount = 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 },
{text: "Binance Smart Chain",value: "BSC",disabled: true},
{ text: "Harmony (Coming Soon..)", value: "ONE", disabled: true },
];
this.plan.grandTotal = 0;
this.discount = (this.plan.price * 30) / 100;
} else {
this.discount = 0;
}
if (__arg == "MATIC") {
this.resetAllPayment();
// this.couponDiscount = (this.plan.price * this.fetchedCouponDiscount) / 100;
this.options.network = [
{ text: "Ethereum", value: "ETH", disabled: true },
{ text: "Polygon", value: "MATIC", disabled: false },
{ text: "Binance Smart Chain",value: "BSC",disabled: true,},
{ text: "Harmony (Coming Soon..)", value: "ONE", disabled: true },
];
this.selectedNetwork = "MATIC";

}
if (__arg == "ETH") {
this.resetAllPayment();
this.options.network = [
{ text: "Ethereum", value: "ETH", disabled: false },
{ text: "Polygon", value: "MATIC", disabled: true },
Expand All @@ -325,6 +448,7 @@ export default {
this.selectedNetwork = "ETH";
}
if (__arg == "BNB") {
this.resetAllPayment();
this.options.network = [
{ text: "Ethereum", value: "ETH", disabled: true },
{ text: "Polygon", value: "MATIC", disabled: true },
Expand All @@ -334,7 +458,7 @@ export default {
this.selectedNetwork = "BSC";
}
if (__arg == "USDT") {
this.selectedNetwork = "";
this.resetAllPayment();
this.options.network = [
{ text: "Ethereum", value: "ETH", disabled: false },
{ text: "Polygon", value: "MATIC", disabled: false },
Expand All @@ -344,7 +468,7 @@ export default {
//this.selectedNetwork = "ETH";
}
if (__arg == "USDC") {
this.selectedNetwork = "";
this.resetAllPayment();
this.options.network = [
{ text: "Ethereum", value: "ETH", disabled: false },
{ text: "Polygon", value: "MATIC", disabled: false },
Expand Down Expand Up @@ -400,6 +524,9 @@ export default {
var planbody = {};
this.plan.selectedCurrency = this.selectedCurrency;
this.plan.selectedNetwork = this.selectedNetwork;
if(this.applied===true){
this.plan.coupon_name = this.coupon;
}
this.plan.coupon_code = "Dummy30";
planbody = Object.assign(planbody, this.plan);

Expand All @@ -425,7 +552,6 @@ export default {
"Content-Type": "application/json",
Authorization: `Bearer ${this.authToken}`,
};

const resp = await fetch(url, {
method: "POST",
body: JSON.stringify({
Expand Down
9 changes: 7 additions & 2 deletions src/components/participant/Banner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
<b-card no-body class="banner rounded-0">
<img :src="logoUrl" @error="onBannerError($event)" v-if="!brokenUrl">
<div class="no-banner" v-if="brokenUrl">
{{eventName}}
<!-- {{eventName}} -->
{{ truncate1(eventName,30) }}
</div>
</b-card>
</b-col>
</b-row>
</template>
<script>
import {truncate} from '../../mixins/fieldValidationMixin'
export default {
props: {
eventName: String,
Expand All @@ -22,10 +24,13 @@ export default {
},
data() {
return {
brokenUrl: false
brokenUrl: false,
}
},
methods: {
truncate1(str, number) {
return truncate(str, number);
},
onBannerError(e) {
console.error(e);
this.brokenUrl = true
Expand Down
5 changes: 3 additions & 2 deletions src/components/participant/NavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ color: white !important;
</b-navbar-brand>
<b-nav-item-dropdown size="sm" right class=" m-2 menu ml-auto text-white text-decoration-none">
<template #button-content>
<b-icon style="color:white" icon="menu-button-wide"></b-icon>
<b-icon style="color:var(--theme-text-color)" icon="menu-button-wide"></b-icon>
</template>
<b-dropdown-item to="/user/home/" @click="updateIsForm">
Home
Expand Down Expand Up @@ -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'
}
}
},
Expand Down
Loading