From 61666fbd74b253454fd6abc0393bba4222846855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 28 Jan 2021 15:50:23 +0100 Subject: [PATCH] Introduced 'sliderData' --- .../ComponentSlider/ComponentSlider.vue | 49 ++----------------- .../RegistrationItemEnterInvite.vue | 16 ++---- .../Registration/RegistrationSlider.vue | 39 ++++++++++----- 3 files changed, 37 insertions(+), 67 deletions(-) diff --git a/webapp/components/ComponentSlider/ComponentSlider.vue b/webapp/components/ComponentSlider/ComponentSlider.vue index 80f5de462..c14c7eb60 100644 --- a/webapp/components/ComponentSlider/ComponentSlider.vue +++ b/webapp/components/ComponentSlider/ComponentSlider.vue @@ -1,19 +1,17 @@ @@ -21,31 +19,8 @@ @@ -54,18 +29,4 @@ export default { // Wolle .pointer { // cursor: pointer; // } - -// .Slider { -// &__component { -// // Wolle &:hover { -// // border-bottom: 2px solid #c9c6ce; -// // } - -// // Wolle &.--visible { -// // } -// // &.--hidden { -// // display: none; -// // } -// } -// } diff --git a/webapp/components/Registration/RegistrationItemEnterInvite.vue b/webapp/components/Registration/RegistrationItemEnterInvite.vue index 7a9835179..a4902ebd0 100644 --- a/webapp/components/Registration/RegistrationItemEnterInvite.vue +++ b/webapp/components/Registration/RegistrationItemEnterInvite.vue @@ -28,9 +28,8 @@ export default { name: 'RegistrationItemEnterInvite', props: { - validateCallback: { type: Function, required: true }, + sliderData: { type: Object, required: true }, email: { type: String, required: true }, - // test: { type: Boolean, required: true }, }, data() { return { @@ -51,25 +50,20 @@ export default { }, methods: { async handleInput() { - // Wolle this.disabled = true console.log('handleInput !!!') console.log('email: ', this.email) - // console.log('test: ', this.test) - this.validateCallback(false) + this.sliderData.validateCallback(false) }, async handleInputValid() { console.log('handleInputValid !!!') - // Wolle this.disabled = false const { nonce } = this.formData const email = this.email - // Wolle this.$emit('nonceEntered', { email, nonce }) - // this.$emit('validation', { email, nonce }) - this.validateCallback(true, { email, nonce }) + this.sliderData.validateCallback(true, { email, nonce }) }, handleSubmitVerify() { - // const { nonce } = this.formData + // Wolle const { nonce } = this.formData // const email = this.email - // Wolle this.$emit('nonceEntered', { email, nonce }) + // this.$emit('nonceEntered', { email, nonce }) // this.$emit('validation', { email, nonce }) }, }, diff --git a/webapp/components/Registration/RegistrationSlider.vue b/webapp/components/Registration/RegistrationSlider.vue index eb31bf03c..2dfe4e989 100644 --- a/webapp/components/Registration/RegistrationSlider.vue +++ b/webapp/components/Registration/RegistrationSlider.vue @@ -7,12 +7,9 @@

{{ $t('components.registration.signup.title', metadata) }}

- + @@ -59,21 +56,39 @@ export default { links, metadata, sliders: ['enter-invite', 'create-user-account'], + sliderData: { + sliders: ['enter-invite', 'create-user-account'], + activeSliderName: 'enter-invite', + validateCallback: this.validateCallback, + submitCallback: this.submitCallback, + button: { + title: 'Next', // Wolle + // title: 'Submit', // Wolle + disabled: true, + callback: this.buttonCallback, + }, + }, } }, computed: { - // Wolle emptyText() { - // return this.isActive && !this.loading ? this.$t('search.failed') : this.$t('search.hint') - // }, + sliderIndex() { + return this.sliderData.sliders.findIndex((name) => name === this.sliderData.activeSliderName) + }, }, methods: { - validation(is, data = null) { + validateCallback(is, data = null) { console.log('validation: ', is, data) - // this.disabled = !is + this.sliderData.button.disabled = !is }, - submit() { + submitCallback() { console.log('submit !!!') }, + buttonCallback() { + console.log('buttonCallback !!!') + if (this.sliderIndex < this.sliderData.sliders.length - 1) { + this.sliderData.activeSliderName = this.sliderData.sliders[this.sliderIndex + 1] + } + }, }, }