mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Refactor to 'setSliderValuesCallback'
This commit is contained in:
parent
05352e52c9
commit
091ed52b54
@ -36,7 +36,7 @@
|
|||||||
filled
|
filled
|
||||||
:loading="false"
|
:loading="false"
|
||||||
:disabled="!sliderData.sliders[sliderIndex].validated"
|
:disabled="!sliderData.sliders[sliderIndex].validated"
|
||||||
@click="sliderData.sliders[sliderIndex].button.callback"
|
@click="onClick"
|
||||||
>
|
>
|
||||||
{{ sliderData.sliders[sliderIndex].button.title }}
|
{{ sliderData.sliders[sliderIndex].button.title }}
|
||||||
</base-button>
|
</base-button>
|
||||||
@ -58,6 +58,18 @@ export default {
|
|||||||
return this.sliderData.sliderIndex // have a shorter notation
|
return this.sliderData.sliderIndex // have a shorter notation
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
|
async onClick() {
|
||||||
|
let success = true
|
||||||
|
if (this.sliderData.sliders[this.sliderIndex].button.slotOnNextClick) {
|
||||||
|
success = await this.sliderData.sliders[this.sliderIndex].button.slotOnNextClick()
|
||||||
|
}
|
||||||
|
// this.sliderData.sliders[this.sliderIndex].button.callback()
|
||||||
|
if (success && this.sliderIndex < this.sliderData.sliders.length - 1) {
|
||||||
|
this.sliderData.sliderSelectorCallback(this.sliderIndex + 1)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -226,6 +226,9 @@ export default {
|
|||||||
? this.sliderData.collectedInputData.noPolitical
|
? this.sliderData.collectedInputData.noPolitical
|
||||||
: false
|
: false
|
||||||
this.sendValidation()
|
this.sendValidation()
|
||||||
|
|
||||||
|
// Wolle this.sliderData.setSliderValuesCallback(this.validInput, {}, {}, this.onNextClick)
|
||||||
|
this.sliderData.setSliderValuesCallback(this.valid, {}, this.onNextClick)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -271,7 +274,7 @@ export default {
|
|||||||
noPolitical,
|
noPolitical,
|
||||||
} = this
|
} = this
|
||||||
const locale = this.$i18n.locale()
|
const locale = this.$i18n.locale()
|
||||||
const value = {
|
const values = {
|
||||||
name,
|
name,
|
||||||
about,
|
about,
|
||||||
password,
|
password,
|
||||||
@ -286,7 +289,7 @@ export default {
|
|||||||
}
|
}
|
||||||
// Wolle validate in backend
|
// Wolle validate in backend
|
||||||
// toaster
|
// toaster
|
||||||
this.sliderData.validateCallback(this.valid, value)
|
this.sliderData.setSliderValuesCallback(this.valid, { collectedInputData: values }, {})
|
||||||
},
|
},
|
||||||
async handleInput() {
|
async handleInput() {
|
||||||
this.sendValidation()
|
this.sendValidation()
|
||||||
@ -324,6 +327,9 @@ export default {
|
|||||||
this.response = 'error'
|
this.response = 'error'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onNextClick() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -43,6 +43,21 @@
|
|||||||
{{ $t('components.registration.signup.form.submit') }}
|
{{ $t('components.registration.signup.form.submit') }}
|
||||||
</base-button> -->
|
</base-button> -->
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
|
<ds-text v-if="sliderData.collectedInputData.emailSend">
|
||||||
|
<!-- Wolle <ds-text v-if="sliderData.collectedInputData.emailSend"> -->
|
||||||
|
<input
|
||||||
|
id="checkbox"
|
||||||
|
type="checkbox"
|
||||||
|
v-model="sendEmailAgain"
|
||||||
|
:checked="sendEmailAgain"
|
||||||
|
/>
|
||||||
|
<label for="checkbox0">
|
||||||
|
<!-- Wolle {{ $t('termsAndConditions.termsAndConditionsConfirmed') }} -->
|
||||||
|
Send e-mail again
|
||||||
|
<!-- <br />
|
||||||
|
<nuxt-link to="/terms-and-conditions">{{ $t('site.termsAndConditions') }}</nuxt-link> -->
|
||||||
|
</label>
|
||||||
|
</ds-text>
|
||||||
</ds-form>
|
</ds-form>
|
||||||
</ds-space>
|
</ds-space>
|
||||||
<div v-else margin="large">
|
<div v-else margin="large">
|
||||||
@ -108,6 +123,7 @@ export default {
|
|||||||
message: this.$t('common.validations.email'),
|
message: this.$t('common.validations.email'),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
sendEmailAgain: false,
|
||||||
// Wolle disabled: true,
|
// Wolle disabled: true,
|
||||||
data: null,
|
data: null,
|
||||||
error: null,
|
error: null,
|
||||||
@ -120,6 +136,8 @@ export default {
|
|||||||
? this.sliderData.collectedInputData.email
|
? this.sliderData.collectedInputData.email
|
||||||
: ''
|
: ''
|
||||||
this.sendValidation()
|
this.sendValidation()
|
||||||
|
|
||||||
|
this.sliderData.setSliderValuesCallback(this.validInput, {}, this.onNextClick)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -140,9 +158,9 @@ export default {
|
|||||||
this.formData.email = normalizeEmail(this.formData.email)
|
this.formData.email = normalizeEmail(this.formData.email)
|
||||||
}
|
}
|
||||||
const { email } = this.formData
|
const { email } = this.formData
|
||||||
const value = { email }
|
const values = { email }
|
||||||
|
|
||||||
this.sliderData.validateCallback(this.validInput, value)
|
this.sliderData.setSliderValuesCallback(this.validInput, { collectedInputData: values }, {})
|
||||||
},
|
},
|
||||||
async handleInput() {
|
async handleInput() {
|
||||||
this.sendValidation()
|
this.sendValidation()
|
||||||
@ -150,30 +168,33 @@ export default {
|
|||||||
async handleInputValid() {
|
async handleInputValid() {
|
||||||
this.sendValidation()
|
this.sendValidation()
|
||||||
},
|
},
|
||||||
async handleSubmitVerify() {
|
async onNextClick() {
|
||||||
const mutation = this.token ? SignupByInvitationMutation : SignupMutation
|
const mutation = this.token ? SignupByInvitationMutation : SignupMutation
|
||||||
const { token } = this
|
const { token } = this
|
||||||
const { email } = this.formData
|
const { email } = this.formData
|
||||||
const variables = { email, token }
|
const variables = { email, token }
|
||||||
|
|
||||||
|
// Wolle test for resend
|
||||||
if (
|
if (
|
||||||
!this.sliderData.sliders[this.sliderIndex].data.request ||
|
!this.sliderData.sliders[this.sliderIndex].data.request ||
|
||||||
!this.sliderData.sliders[this.sliderIndex].data.request.variables ||
|
(this.sliderData.sliders[this.sliderIndex].data.request && !this.sliderData.sliders[this.sliderIndex].data.request.variables) ||
|
||||||
(this.sliderData.sliders[this.sliderIndex].data.request &&
|
(this.sliderData.sliders[this.sliderIndex].data.request &&
|
||||||
this.sliderData.sliders[this.sliderIndex].data.request.variables &&
|
this.sliderData.sliders[this.sliderIndex].data.request.variables &&
|
||||||
!this.sliderData.sliders[this.sliderIndex].data.request.variables.is(variables))
|
!this.sliderData.sliders[this.sliderIndex].data.request.variables === variables)
|
||||||
) {
|
) {
|
||||||
this.sliderData.sliders[this.sliderIndex].data = {
|
// this.sliderData.sliders[this.sliderIndex].data = {
|
||||||
...this.sliderData.sliders[this.sliderIndex].data,
|
// ...this.sliderData.sliders[this.sliderIndex].data,
|
||||||
request: { variables },
|
// request: { variables },
|
||||||
}
|
// }
|
||||||
|
this.sliderData.setSliderValuesCallback(this.sliderData.sliders[this.sliderIndex].validated, { sliderData: { request: { variables }, response: null } })
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await this.$apollo.mutate({ mutation, variables }) // e-mail is send in emailMiddleware of backend
|
const response = await this.$apollo.mutate({ mutation, variables }) // e-mail is send in emailMiddleware of backend
|
||||||
this.sliderData.sliders[this.sliderIndex].data = {
|
// this.sliderData.sliders[this.sliderIndex].data = {
|
||||||
...this.sliderData.sliders[this.sliderIndex].data,
|
// ...this.sliderData.sliders[this.sliderIndex].data,
|
||||||
response: response.data,
|
// response: response.data,
|
||||||
}
|
// }
|
||||||
|
this.sliderData.setSliderValuesCallback(this.sliderData.sliders[this.sliderIndex].validated, { sliderData: { response: response.data } })
|
||||||
|
|
||||||
if (this.sliderData.sliders[this.sliderIndex].data.response) {
|
if (this.sliderData.sliders[this.sliderIndex].data.response) {
|
||||||
this.sliderData.collectedInputData.emailSend = true
|
this.sliderData.collectedInputData.emailSend = true
|
||||||
@ -184,8 +205,10 @@ export default {
|
|||||||
this.$t('components.registration.email.form.success', { email: respnseEmail }),
|
this.$t('components.registration.email.form.success', { email: respnseEmail }),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
return true
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.sliderData.sliders[this.sliderIndex].data = { request: null, response: null }
|
// this.sliderData.sliders[this.sliderIndex].data = { request: null, response: null }
|
||||||
|
this.sliderData.setSliderValuesCallback(this.sliderData.sliders[this.sliderIndex].validated, { sliderData: { request: null, response: null } })
|
||||||
this.sliderData.collectedInputData.emailSend = false
|
this.sliderData.collectedInputData.emailSend = false
|
||||||
|
|
||||||
const { message } = err
|
const { message } = err
|
||||||
@ -203,6 +226,7 @@ export default {
|
|||||||
if (!this.error) {
|
if (!this.error) {
|
||||||
this.$toast.error(message)
|
this.$toast.error(message)
|
||||||
}
|
}
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -56,6 +56,8 @@ export default {
|
|||||||
? this.sliderData.collectedInputData.inviteCode
|
? this.sliderData.collectedInputData.inviteCode
|
||||||
: ''
|
: ''
|
||||||
this.sendValidation()
|
this.sendValidation()
|
||||||
|
|
||||||
|
this.sliderData.setSliderValuesCallback(this.validInput, {}, this.onNextClick)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -76,7 +78,7 @@ export default {
|
|||||||
await this.handleSubmitVerify()
|
await this.handleSubmitVerify()
|
||||||
validated = this.sliderData.sliders[this.sliderIndex].data.response.isValidInviteCode
|
validated = this.sliderData.sliders[this.sliderIndex].data.response.isValidInviteCode
|
||||||
}
|
}
|
||||||
this.sliderData.validateCallback(validated, values)
|
this.sliderData.setSliderValuesCallback(validated, { collectedInputData: values })
|
||||||
},
|
},
|
||||||
async handleInput() {
|
async handleInput() {
|
||||||
this.sendValidation()
|
this.sendValidation()
|
||||||
@ -90,17 +92,19 @@ export default {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
!this.sliderData.sliders[this.sliderIndex].data.request ||
|
!this.sliderData.sliders[this.sliderIndex].data.request ||
|
||||||
!this.sliderData.sliders[this.sliderIndex].data.request.variables ||
|
(this.sliderData.sliders[this.sliderIndex].data.request && !this.sliderData.sliders[this.sliderIndex].data.request.variables) ||
|
||||||
(this.sliderData.sliders[this.sliderIndex].data.request &&
|
(this.sliderData.sliders[this.sliderIndex].data.request &&
|
||||||
this.sliderData.sliders[this.sliderIndex].data.request.variables &&
|
this.sliderData.sliders[this.sliderIndex].data.request.variables &&
|
||||||
!this.sliderData.sliders[this.sliderIndex].data.request.variables.is(variables))
|
!this.sliderData.sliders[this.sliderIndex].data.request.variables === variables)
|
||||||
) {
|
) {
|
||||||
// this.sliderData.sliders[this.sliderIndex].data.request.variables = variables
|
// this.sliderData.sliders[this.sliderIndex].data.request.variables = variables
|
||||||
this.sliderData.sliders[this.sliderIndex].data.request = { variables }
|
// this.sliderData.sliders[this.sliderIndex].data.request = { variables }
|
||||||
|
this.sliderData.setSliderValuesCallback(this.sliderData.sliders[this.sliderIndex].validated, { sliderData: { request: { variables }, response: null } })
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await this.$apollo.query({ query: isValidInviteCodeQuery, variables })
|
const response = await this.$apollo.query({ query: isValidInviteCodeQuery, variables })
|
||||||
this.sliderData.sliders[this.sliderIndex].data.response = response.data
|
// this.sliderData.sliders[this.sliderIndex].data.response = response.data
|
||||||
|
this.sliderData.setSliderValuesCallback(this.sliderData.sliders[this.sliderIndex].validated, { sliderData: { response: response.data } })
|
||||||
|
|
||||||
if (
|
if (
|
||||||
this.sliderData.sliders[this.sliderIndex].data.response &&
|
this.sliderData.sliders[this.sliderIndex].data.response &&
|
||||||
@ -111,13 +115,17 @@ export default {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.sliderData.sliders[this.sliderIndex].data.response = { isValidInviteCode: false }
|
// this.sliderData.sliders[this.sliderIndex].data.response = { isValidInviteCode: false }
|
||||||
|
this.sliderData.setSliderValuesCallback(this.sliderData.sliders[this.sliderIndex].validated, { sliderData: { response: { isValidInviteCode: false } } })
|
||||||
|
|
||||||
const { message } = err
|
const { message } = err
|
||||||
this.$toast.error(message)
|
this.$toast.error(message)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onNextClick() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -43,8 +43,8 @@ export default {
|
|||||||
formSchema: {
|
formSchema: {
|
||||||
nonce: {
|
nonce: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
min: 6,
|
// Wolle min: 6,
|
||||||
max: 6,
|
// max: 6,
|
||||||
required: true,
|
required: true,
|
||||||
message: this.$t('components.enter-nonce.form.validations.length'),
|
message: this.$t('components.enter-nonce.form.validations.length'),
|
||||||
},
|
},
|
||||||
@ -60,26 +60,28 @@ export default {
|
|||||||
? this.sliderData.collectedInputData.nonce
|
? this.sliderData.collectedInputData.nonce
|
||||||
: ''
|
: ''
|
||||||
this.sendValidation()
|
this.sendValidation()
|
||||||
|
|
||||||
|
// Wolle this.sliderData.setSliderValuesCallback(this.validInput, {}, {}, this.onNextClick)
|
||||||
|
this.sliderData.setSliderValuesCallback(this.valid, {}, this.onNextClick)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
valid() {
|
valid() {
|
||||||
const isValid = this.formData.nonce.length === 6
|
return this.formData.nonce.length === 6
|
||||||
return isValid
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
sendValidation() {
|
sendValidation() {
|
||||||
const { nonce } = this.formData
|
const { nonce } = this.formData
|
||||||
const value = {
|
const values = {
|
||||||
nonce,
|
nonce,
|
||||||
}
|
}
|
||||||
// console.log('sendValidation !!! value: ', value)
|
// console.log('sendValidation !!! value: ', value)
|
||||||
this.sliderData.validateCallback(this.valid, value)
|
this.sliderData.setSliderValuesCallback(this.valid, { collectedInputData: values })
|
||||||
},
|
},
|
||||||
async handleInput() {
|
async handleInput() {
|
||||||
// this.disabled = true
|
// this.disabled = true
|
||||||
// this.sliderData.validateCallback(false)
|
// this.sliderData.setSliderValuesCallback(false)
|
||||||
this.sendValidation()
|
this.sendValidation()
|
||||||
},
|
},
|
||||||
async handleInputValid() {
|
async handleInputValid() {
|
||||||
@ -87,7 +89,7 @@ export default {
|
|||||||
// const { nonce } = this.formData
|
// const { nonce } = this.formData
|
||||||
// validate in backend?
|
// validate in backend?
|
||||||
// toaster?
|
// toaster?
|
||||||
// this.sliderData.validateCallback(true, { nonce })
|
// this.sliderData.setSliderValuesCallback(true, { nonce })
|
||||||
this.sendValidation()
|
this.sendValidation()
|
||||||
},
|
},
|
||||||
handleSubmitVerify() {
|
handleSubmitVerify() {
|
||||||
@ -95,6 +97,9 @@ export default {
|
|||||||
// const email = this.email
|
// const email = this.email
|
||||||
// this.$emit('nonceEntered', { email, nonce })
|
// this.$emit('nonceEntered', { email, nonce })
|
||||||
},
|
},
|
||||||
|
onNextClick() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -87,7 +87,7 @@ storiesOf('RegistrationSlider', module)
|
|||||||
collectedInputData: {
|
collectedInputData: {
|
||||||
inviteCode: null,
|
inviteCode: null,
|
||||||
email: 'wolle.huss@pjannto.com',
|
email: 'wolle.huss@pjannto.com',
|
||||||
emailSend: true,
|
emailSend: false,
|
||||||
nonce: 'NTRSCZ',
|
nonce: 'NTRSCZ',
|
||||||
name: 'Wolle',
|
name: 'Wolle',
|
||||||
password: 'Hello',
|
password: 'Hello',
|
||||||
|
|||||||
@ -25,7 +25,6 @@
|
|||||||
<!-- Wolle !!! may create same source with 'webapp/pages/registration/signup.vue' -->
|
<!-- Wolle !!! may create same source with 'webapp/pages/registration/signup.vue' -->
|
||||||
<!-- <signup v-if="publicRegistration" :invitation="false" @submit="handleSubmitted"> -->
|
<!-- <signup v-if="publicRegistration" :invitation="false" @submit="handleSubmitted"> -->
|
||||||
<registration-item-enter-email
|
<registration-item-enter-email
|
||||||
ref="RegistrationItemEnterEmail"
|
|
||||||
:sliderData="sliderData"
|
:sliderData="sliderData"
|
||||||
:invitation="false"
|
:invitation="false"
|
||||||
/>
|
/>
|
||||||
@ -96,6 +95,7 @@ export default {
|
|||||||
title: 'Next', // Wolle
|
title: 'Next', // Wolle
|
||||||
icon: 'arrow-right',
|
icon: 'arrow-right',
|
||||||
callback: this.buttonCallback,
|
callback: this.buttonCallback,
|
||||||
|
slotOnNextClick: null, // optional set by slot
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -108,27 +108,32 @@ export default {
|
|||||||
title: this.enterEmailButtonTitle(this.overwriteSliderData.emailSend), // Wolle
|
title: this.enterEmailButtonTitle(this.overwriteSliderData.emailSend), // Wolle
|
||||||
icon: 'envelope',
|
icon: 'envelope',
|
||||||
callback: this.buttonCallback,
|
callback: this.buttonCallback,
|
||||||
|
slotOnNextClick: null, // optional set by slot
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'enter-nonce',
|
name: 'enter-nonce',
|
||||||
title: 'E-Mail Confirmation', // Wolle
|
title: 'E-Mail Confirmation', // Wolle
|
||||||
validated: false,
|
validated: false,
|
||||||
|
data: { request: null, response: null },
|
||||||
button: {
|
button: {
|
||||||
title: 'Confirm', // Wolle
|
title: 'Confirm', // Wolle
|
||||||
icon: 'arrow-right',
|
icon: 'arrow-right',
|
||||||
callback: this.buttonCallback,
|
callback: this.buttonCallback,
|
||||||
|
slotOnNextClick: null, // optional set by slot
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'create-user-account',
|
name: 'create-user-account',
|
||||||
title: this.$t('components.registration.create-user-account.title'),
|
title: this.$t('components.registration.create-user-account.title'),
|
||||||
validated: false,
|
validated: false,
|
||||||
|
data: { request: null, response: null },
|
||||||
button: {
|
button: {
|
||||||
// title: this.$t('actions.save'), // Wolle
|
// title: this.$t('actions.save'), // Wolle
|
||||||
title: 'Create', // Wolle
|
title: 'Create', // Wolle
|
||||||
icon: 'check',
|
icon: 'check',
|
||||||
callback: this.buttonCallback,
|
callback: this.buttonCallback,
|
||||||
|
slotOnNextClick: null, // optional set by slot
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
@ -174,7 +179,7 @@ export default {
|
|||||||
sliderIndex: 0,
|
sliderIndex: 0,
|
||||||
sliders: sliders,
|
sliders: sliders,
|
||||||
sliderSelectorCallback: this.sliderSelectorCallback,
|
sliderSelectorCallback: this.sliderSelectorCallback,
|
||||||
validateCallback: this.validateCallback,
|
setSliderValuesCallback: this.setSliderValuesCallback,
|
||||||
...this.overwriteSliderData,
|
...this.overwriteSliderData,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -186,40 +191,65 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
enterEmailButtonTitle(emailSend) {
|
enterEmailButtonTitle(emailSend) {
|
||||||
return emailSend ? 'Resend E-Mail' : 'Send E-Mail'
|
// return emailSend ? 'Resend e-mail' : 'Send e-mail'
|
||||||
|
return emailSend ? 'Skip send' : 'Send e-mail' // Wolle
|
||||||
},
|
},
|
||||||
validateCallback(isValid, data = null) {
|
setSliderValuesCallback(isValid, { collectedInputData, sliderData, sliderSettings }, slotOnNextClick = null) {
|
||||||
this.sliderData.sliders[this.sliderIndex].validated = isValid
|
this.sliderData.sliders[this.sliderIndex].validated = isValid
|
||||||
if (data) {
|
|
||||||
|
if (collectedInputData) {
|
||||||
this.sliderData.collectedInputData = {
|
this.sliderData.collectedInputData = {
|
||||||
...this.sliderData.collectedInputData,
|
...this.sliderData.collectedInputData,
|
||||||
...data,
|
...collectedInputData,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (sliderData) {
|
||||||
|
if (this.sliderData.sliders[this.sliderIndex].data) {
|
||||||
|
this.sliderData.sliders[this.sliderIndex].data = {
|
||||||
|
request: sliderData.request ? sliderData.request : this.sliderData.sliders[this.sliderIndex].data.request,
|
||||||
|
response: sliderData.response ? sliderData.response : this.sliderData.sliders[this.sliderIndex].data.response,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (sliderSettings) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (slotOnNextClick) {
|
||||||
|
this.sliderData.sliders[this.sliderIndex].button.slotOnNextClick = slotOnNextClick
|
||||||
|
}
|
||||||
},
|
},
|
||||||
sliderSelectorCallback(selectedIndex) {
|
sliderSelectorCallback(selectedIndex) {
|
||||||
if (selectedIndex < this.sliderIndex) {
|
if (selectedIndex <= this.sliderIndex + 1 && selectedIndex < this.sliderData.sliders.length) {
|
||||||
|
if (this.sliderData.sliders[this.sliderIndex].name === 'enter-email') {
|
||||||
|
this.sliderData.sliders[this.sliderIndex].button.title = this.enterEmailButtonTitle(
|
||||||
|
this.sliderData.collectedInputData.emailSend,
|
||||||
|
)
|
||||||
|
}
|
||||||
this.sliderData.sliderIndex = selectedIndex
|
this.sliderData.sliderIndex = selectedIndex
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
buttonCallback() {
|
buttonCallback() {
|
||||||
if (this.sliderData.sliders[this.sliderIndex].name === 'enter-email') {
|
// Wolle
|
||||||
this.$refs.RegistrationItemEnterEmail.handleSubmitVerify()
|
// if (this.sliderData.sliders[this.sliderIndex].name === 'enter-email') {
|
||||||
this.sliderData.sliders[this.sliderIndex].button.title = this.enterEmailButtonTitle(
|
// // if (this.sliderData.sliders[this.sliderIndex].button.slotOnNextClick) {
|
||||||
this.sliderData.collectedInputData.emailSend,
|
// // this.sliderData.sliders[this.sliderIndex].button.slotOnNextClick()
|
||||||
)
|
// // }
|
||||||
}
|
// this.sliderData.sliders[this.sliderIndex].button.title = this.enterEmailButtonTitle(
|
||||||
|
// this.sliderData.collectedInputData.emailSend,
|
||||||
|
// )
|
||||||
|
// }
|
||||||
|
|
||||||
if (this.sliderIndex === this.sliderData.sliders.length - 1) {
|
// if (this.sliderIndex === this.sliderData.sliders.length - 1) {
|
||||||
// console.log('submit data: ', this.sliderData.collectedInputData)
|
// // console.log('submit data: ', this.sliderData.collectedInputData)
|
||||||
} else {
|
// } else {
|
||||||
if (this.sliderIndex < this.sliderData.sliders.length - 1) {
|
// if (this.sliderIndex < this.sliderData.sliders.length - 1) {
|
||||||
this.sliderData.sliderIndex++
|
// this.sliderData.sliderIndex++
|
||||||
if (this.sliderData.sliders[this.sliderIndex] === 'create-user-account') {
|
// if (this.sliderData.sliders[this.sliderIndex] === 'create-user-account') {
|
||||||
this.sliderData.sliders[this.sliderIndex].validated = false
|
// this.sliderData.sliders[this.sliderIndex].validated = false
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user