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.6.0 #1487

Merged
merged 3 commits into from
Jul 22, 2022
Merged

V5.6.0 #1487

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
19 changes: 10 additions & 9 deletions src/components/participant/Action.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template>
<div class="accordion mt-3 mx-auto overflow-hidden" role="tablist" style="max-width: 600px" @click="checkIfUserHasLoggedIn()">
<div class="accordion mt-3 mx-auto overflow-hidden" role="tablist" style="max-width: 600px"
@click="checkIfUserHasLoggedIn()">
<loading :active.sync="isLoading" :can-cancel="true" :is-full-page="fullPage"></loading>
<Profile v-if="userProfile" :user="userProfile" />

Expand All @@ -14,9 +15,9 @@

<template v-for="(actionItem, index) in ActionSchema">

<component v-if="actionItem.type!=='INFO_TEXT'" :is="CapitaliseString(actionItem.type)" :key="index"
:idValue="index" :data="actionItem" :authToken="authToken" :done="actionItem.isDone"
@input="updateUserInfo(actionItem, $event)" :themeData="themeData">
<component v-if="(actionItem.type !== 'INFO_TEXT') && (actionItem.type !=='PRIZE_CARD') "
:is="CapitaliseString(actionItem.type)" :key="index" :idValue="index" :data="actionItem" :authToken="authToken"
:done="actionItem.isDone" @input="updateUserInfo(actionItem, $event)">
</component>
</template>
</div>
Expand Down Expand Up @@ -165,8 +166,10 @@ export default {
computed: {
// eslint-disable-next-line vue/return-in-computed-property
isPrizedata() {
if (this.prizeData.length > 0) {
if (this.prizeData && this.prizeData.length > 0) {
return true;
} else {
return false;
}
},
},
Expand Down Expand Up @@ -205,11 +208,9 @@ export default {
};
const ts=Math.floor(Date.now() / 1000);
const endPoint='api/v1/investor'

const signature=crypto.createHmac('sha256',config.investor_sign_key)

const signature= crypto.createHmac('sha256',config.investor_sign_key)
signature.update(ts+endPoint+JSON.stringify(body))
const sig=signature.digest('hex')
const sig= signature.digest('hex')
let url = `${this.$config.studioServer.BASE_URL}api/v1/investor?rcToken=${this.RecaptchaToken}`;
if (this.$route.query.referrer && this.$route.query.referrer != "") {
url += `&referrer=${this.$route.query.referrer}`;
Expand Down
32 changes: 11 additions & 21 deletions src/components/participant/ActionInputs/PrizeCard.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
<template>
<b-card no-body class="action-wrap">
<b-card-header
:class="visible ? null : 'collapsed'"
:aria-expanded="visible ? 'true' : 'false'"
aria-controls="profile"
@click="visible = !visible"

>
<b-card no-body class="action-wrap">
<b-card-header :class="visible ? null : 'collapsed'" :aria-expanded="visible ? 'true' : 'false'"
aria-controls="profile" @click="visible = !visible">
<b-row>
<b-col cols="1" sm="1" md="1">
<img src="../../../assets/gift.svg" height="25px" />
Expand All @@ -16,16 +11,11 @@
</b-col>
</b-row>
</b-card-header>
<b-collapse id="profile" v-model="visible" >
<b-collapse id="profile" v-model="visible">
<b-card-body class="user-details">
<table
v-if="prizeData.length"
class="table table-bordered"
style="background: #ffff
<table v-if="prizeData && prizeData.length" class="table table-bordered" style="background: #ffff
table-layout:fixed;
word-wrap:break-word;"

>
word-wrap:break-word;">
<thead class="thead-light">
<tr>
<th>Prize Name</th>
Expand All @@ -35,14 +25,14 @@
</thead>
<tbody>
<tr v-for="row in prizeData" :key="row._id">
<th class="wrapword" >
{{row.title}}
<th class="wrapword">
{{row.title}}
</th>
<td class="wrapword">
{{ JSON.parse(row.value).winners }}
</td>
{{ JSON.parse(row.value).winners }}
</td>
<td class="wrapword">
{{ JSON.parse(row.value).prizeValue }}
{{ JSON.parse(row.value).prizeValue }}
</td>
</tr>
</tbody>
Expand Down
13 changes: 13 additions & 0 deletions src/components/participant/ActionInputs/TelegramJoin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,19 @@ computed:{
},
};
},
updated() {
try {
if (this.data.value) {
if (this.tg.sourceScreenName == "" || this.tg.targetScreenName == ""){
const tg = JSON.parse(this.data.value);
this.tg = { ...tg };
}
}
} catch (e) {
this.tg.sourceScreenName = this.data.value;
}
},

async mounted() {
try {
if (this.data.value) {
Expand Down
9 changes: 5 additions & 4 deletions src/components/participant/ActionInputs/TwitterFollow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,13 @@ computed:{
},
updated() {
try {
if (this.data.value && this.twitter.sourceScreenName == "") {
const twitter = JSON.parse(this.data.value);
this.twitter = { ...twitter };
if (this.data.value ) {
if (this.twitter.sourceScreenName == "" || this.twitter.targetScreenName == ""){
const twitter = JSON.parse(this.data.value);
this.twitter = { ...twitter };
}
}
} catch (e) {
console.error(e)
this.twitter.sourceScreenName = this.data.value;
}
},
Expand Down
6 changes: 3 additions & 3 deletions src/views/participant/Event.vue
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export default {
this.authToken = authToken;
eventBus.$emit('getAuthToken', authToken)
await this.fetchUserDetails();
this.fetchUserInfoOnLogin();
await this.fetchUserInfoOnLogin();
}catch(e){
this.notifyErr(Messages.EVENT.ERROR_OCCURED + e.message);
}
Expand Down Expand Up @@ -299,12 +299,12 @@ export default {
header: headers,
method: "GET",
})
if(res.data.length === 0){

if (res.data == "undefined" || !res.data || res.data.length === 0){
// a user can participate in event
// Participate in event
try{
const hypersignAuthAction = this.eventData.actions.find(x => x.type == "HYPERSIGN_AUTH")

if(hypersignAuthAction){
eventBus.$emit('UpdateUserInfoFromEvent', { actionItem: hypersignAuthAction, value: "Authorized"});
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/participant/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export default {
this.authToken = authToken;
eventBus.$emit("getAuthToken", authToken);
await this.fetchUserDetails();
this.fetchUserEventData();
await this.fetchUserEventData();
} catch (e) {
this.notifyErr(Messages.EVENT.ERROR_OCCURED + e.message);
}
Expand Down