slider jumps to enter-nonce when link contains invite-code, email and nonce and method is invite-code. Thanks @tirokk

This commit is contained in:
Moriz Wahl 2021-04-06 13:34:18 +02:00
parent 21a667eb25
commit c80b3a2128
4 changed files with 25 additions and 15 deletions

View File

@ -7,8 +7,8 @@
<td style="background-color: #ffffff;">
<img
src="{{{ welcomeImageUrl }}}"
width="600" height="" alt="Welcome image" border="0"
style="width: 100%; max-width: 600px; height: auto; background: #ffffff; font-family: Lato, sans-serif; font-size: 16px; line-height: 15px; color: #555555; margin: auto; display: block;"
width="300" height="" alt="Welcome image" border="0"
style="width: 100%; max-width: 300px; height: auto; background: #ffffff; font-family: Lato, sans-serif; font-size: 16px; line-height: 15px; color: #555555; margin: auto; display: block; padding: 20px;"
class="g-img">
</td>
</tr>
@ -118,8 +118,8 @@
<td style="background-color: #ffffff;">
<img
src="{{{ welcomeImageUrl }}}"
width="600" height="" alt="Welcome image" border="0"
style="width: 100%; max-width: 600px; height: auto; background: #ffffff; font-family: Lato, sans-serif; font-size: 16px; line-height: 15px; color: #555555; margin: auto; display: block;"
width="300" height="" alt="Welcome image" border="0"
style="width: 100%; max-width: 300px; height: auto; background: #ffffff; font-family: Lato, sans-serif; font-size: 16px; line-height: 15px; color: #555555; margin: auto; display: block; padding: 20px;"
class="g-img">
</td>
</tr>

View File

@ -72,10 +72,10 @@ const signupCypher = (inviteCode) => {
(inviteCode:InviteCode {code: $inviteCode})<-[:GENERATED]-(host:User)
`
optionalMerge = `
MERGE(user)-[:REDEEMED]->(inviteCode)
MERGE(host)-[:INVITED]->(user)
MERGE(user)-[:FOLLOWS]->(host)
MERGE(host)-[:FOLLOWS]->(user)
MERGE(user)-[:REDEEMED { createdAt: toString(datetime()) }]->(inviteCode)
MERGE(host)-[:INVITED { createdAt: toString(datetime()) }]->(user)
MERGE(user)-[:FOLLOWS { createdAt: toString(datetime()) }]->(host)
MERGE(host)-[:FOLLOWS { createdAt: toString(datetime()) }]->(user)
`
}
const cypher = `

View File

@ -67,6 +67,7 @@ export default {
props: {
registrationType: { type: String, required: true },
overwriteSliderData: { type: Object, default: () => {} },
activePage: { type: String, default: null, required: false },
},
data() {
const slidersPortfolio = {
@ -172,7 +173,8 @@ export default {
termsAndConditionsConfirmed: null,
recieveCommunicationAsEmailsEtcConfirmed: null,
},
sliderIndex: 0,
sliderIndex:
this.activePage === null ? 0 : sliders.findIndex((el) => el.name === this.activePage),
sliders: sliders,
sliderSelectorCallback: this.sliderSelectorCallback,
setSliderValuesCallback: this.setSliderValuesCallback,

View File

@ -1,6 +1,7 @@
<template>
<registration-slider
:registrationType="registrationType"
:registrationType="registrationType.method"
:activePage="registrationType.activePage"
:overwriteSliderData="overwriteSliderData"
/>
</template>
@ -39,18 +40,25 @@ export default {
registrationType() {
if (!this.method) {
return (
(this.publicRegistration && 'public-registration') ||
(this.inviteRegistration && 'invite-code') ||
'no-public-registration'
(this.publicRegistration && { method: 'public-registration', activePage: null }) ||
(this.inviteRegistration && { method: 'invite-code', activePage: null }) || {
method: 'no-public-registration',
activePage: null,
}
)
} else {
if (
this.method === 'invite-mail' ||
(this.method === 'invite-code' && this.inviteRegistration)
) {
return this.method
if (this.method === 'invite-code' && this.inviteCode && this.nonce && this.email)
return { method: this.method, activePage: 'enter-nonce' }
return { method: this.method, activePage: null }
}
return {
method: this.publicRegistration ? 'public-registration' : 'no-public-registration',
activePage: null,
}
return this.publicRegistration ? 'public-registration' : 'no-public-registration'
}
},
},