From da041db83af82f1599fcbb5d30aecd3b68fd38f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 27 Jan 2021 11:08:11 +0100 Subject: [PATCH 01/44] Add Story for CreateUserAccount.vue, as well for experimenting with storybook --- .../Registration/CreateUserAccount.story.js | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 webapp/components/Registration/CreateUserAccount.story.js diff --git a/webapp/components/Registration/CreateUserAccount.story.js b/webapp/components/Registration/CreateUserAccount.story.js new file mode 100644 index 000000000..054ee71b4 --- /dev/null +++ b/webapp/components/Registration/CreateUserAccount.story.js @@ -0,0 +1,84 @@ +import { storiesOf } from '@storybook/vue' +import { withA11y } from '@storybook/addon-a11y' +import { action } from '@storybook/addon-actions' +import Vuex from 'vuex' +import helpers from '~/storybook/helpers' +import links from '~/constants/links.js' +import metadata from '~/constants/metadata.js' +import LocaleSwitch from '~/components/LocaleSwitch/LocaleSwitch' +import CreateUserAccount from './CreateUserAccount.vue' + +helpers.init() + +const createStore = ({ loginSuccess }) => { + return new Vuex.Store({ + modules: { + auth: { + namespaced: true, + state: () => ({ + pending: false, + }), + mutations: { + SET_PENDING(state, pending) { + state.pending = pending + }, + }, + getters: { + pending(state) { + return !!state.pending + }, + }, + actions: { + async login({ commit, dispatch }, args) { + action('Vuex action `auth/login`')(args) + return new Promise((resolve, reject) => { + commit('SET_PENDING', true) + setTimeout(() => { + commit('SET_PENDING', false) + if (loginSuccess) { + resolve(loginSuccess) + } else { + reject(new Error('Login unsuccessful')) + } + }, 1000) + }) + }, + }, + }, + }, + }) +} + +storiesOf('CreateUserAccount', module) + .addDecorator(withA11y) + .addDecorator(helpers.layout) + .add('standard', () => ({ + components: { LocaleSwitch, CreateUserAccount }, + store: createStore({ loginSuccess: true }), + data: () => ({ + links, + metadata, + nonce: 'A34RB56', + email: 'user@example.org', + }), + methods: { + handleSuccess() { + action('You are logged in!')() + }, + }, + template: ` + + + + + + + + `, + })) From 1ffcb0f077355f3a2c3f7d9f3fc13c8295458b33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 27 Jan 2021 11:11:35 +0100 Subject: [PATCH 02/44] Add ComponentSlider and RegistrationSlider, as well as story, starting --- .../ComponentSlider/ComponentSlider.story.js | 128 ++++++++++ .../ComponentSlider/ComponentSlider.vue | 163 +++++++++++++ .../RegistrationItemCreateUserAccount.vue | 222 ++++++++++++++++++ .../Registration/RegistrationSlider.story.js | 127 ++++++++++ .../Registration/RegistrationSlider.vue | 214 +++++++++++++++++ 5 files changed, 854 insertions(+) create mode 100644 webapp/components/ComponentSlider/ComponentSlider.story.js create mode 100644 webapp/components/ComponentSlider/ComponentSlider.vue create mode 100644 webapp/components/Registration/RegistrationItemCreateUserAccount.vue create mode 100644 webapp/components/Registration/RegistrationSlider.story.js create mode 100644 webapp/components/Registration/RegistrationSlider.vue diff --git a/webapp/components/ComponentSlider/ComponentSlider.story.js b/webapp/components/ComponentSlider/ComponentSlider.story.js new file mode 100644 index 000000000..8a7bac923 --- /dev/null +++ b/webapp/components/ComponentSlider/ComponentSlider.story.js @@ -0,0 +1,128 @@ +import { storiesOf } from '@storybook/vue' +import { withA11y } from '@storybook/addon-a11y' +import ComponentSlider from './ComponentSlider.vue' +import helpers from '~/storybook/helpers' + +helpers.init() + +// export const searchResults = [ +// { +// id: 'post-by-jenny', +// __typename: 'Post', +// slug: 'user-post-by-jenny', +// title: 'User Post by Jenny', +// value: 'User Post by Jenny', +// shoutedCount: 0, +// commentsCount: 4, +// createdAt: '2019-11-13T03:03:16.155Z', +// author: { +// id: 'u3', +// name: 'Jenny Rostock', +// slug: 'jenny-rostock', +// }, +// }, +// { +// id: 'f48f00a0-c412-432f-8334-4276a4e15d1c', +// __typename: 'Post', +// slug: 'eum-quos-est-molestiae-enim-magni-consequuntur-sed-commodi-eos', +// title: 'Eum quos est molestiae enim magni consequuntur sed commodi eos.', +// value: 'Eum quos est molestiae enim magni consequuntur sed commodi eos.', +// shoutedCount: 0, +// commentsCount: 0, +// createdAt: '2019-11-13T03:00:45.478Z', +// author: { +// id: 'u6', +// name: 'Louie', +// slug: 'louie', +// }, +// }, +// { +// id: 'p7', +// __typename: 'Post', +// slug: 'this-is-post-7', +// title: 'This is post #7', +// value: 'This is post #7', +// shoutedCount: 1, +// commentsCount: 1, +// createdAt: '2019-11-13T03:00:23.098Z', +// author: { +// id: 'u6', +// name: 'Louie', +// slug: 'louie', +// }, +// }, +// { +// id: 'p12', +// __typename: 'Post', +// slug: 'this-is-post-12', +// title: 'This is post #12', +// value: 'This is post #12', +// shoutedCount: 0, +// commentsCount: 12, +// createdAt: '2019-11-13T03:00:23.098Z', +// author: { +// id: 'u6', +// name: 'Louie', +// slug: 'louie', +// }, +// }, +// { +// id: 'u1', +// __typename: 'User', +// avatar: { +// url: +// 'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/db/dbc9e03ebcc384b920c31542af2d27dd8eea9dc2_full.jpg', +// }, +// name: 'Peter Lustig', +// slug: 'peter-lustig', +// }, +// { +// id: 'cdbca762-0632-4564-b646-415a0c42d8b8', +// __typename: 'User', +// avatar: { +// url: +// 'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/db/dbc9e03ebcc384b920c31542af2d27dd8eea9dc2_full.jpg', +// }, +// name: 'Herbert Schultz', +// slug: 'herbert-schultz', +// }, +// { +// id: 'u2', +// __typename: 'User', +// avatar: { +// url: +// 'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/db/dbc9e03ebcc384b920c31542af2d27dd8eea9dc2_full.jpg', +// }, +// name: 'Bob der Baumeister', +// slug: 'bob-der-baumeister', +// }, +// { +// id: '7b654f72-f4da-4315-8bed-39de0859754b', +// __typename: 'User', +// avatar: { +// url: +// 'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/db/dbc9e03ebcc384b920c31542af2d27dd8eea9dc2_full.jpg', +// }, +// name: 'Tonya Mohr', +// slug: 'tonya-mohr', +// }, +// { +// id: 'Hashtag', +// __typename: 'Tag', +// }, +// ] + +storiesOf('ComponentSlider', module) + .addDecorator(withA11y) + .addDecorator(helpers.layout) + .add('standard', () => ({ + components: { ComponentSlider }, + store: helpers.store, + data: () => ({ + // searchResults, + }), + template: ` + + + `, + })) diff --git a/webapp/components/ComponentSlider/ComponentSlider.vue b/webapp/components/ComponentSlider/ComponentSlider.vue new file mode 100644 index 000000000..1d2c1b9bc --- /dev/null +++ b/webapp/components/ComponentSlider/ComponentSlider.vue @@ -0,0 +1,163 @@ + + + + + diff --git a/webapp/components/Registration/RegistrationItemCreateUserAccount.vue b/webapp/components/Registration/RegistrationItemCreateUserAccount.vue new file mode 100644 index 000000000..fb855017a --- /dev/null +++ b/webapp/components/Registration/RegistrationItemCreateUserAccount.vue @@ -0,0 +1,222 @@ + + + + + diff --git a/webapp/components/Registration/RegistrationSlider.story.js b/webapp/components/Registration/RegistrationSlider.story.js new file mode 100644 index 000000000..7acce0bf0 --- /dev/null +++ b/webapp/components/Registration/RegistrationSlider.story.js @@ -0,0 +1,127 @@ +import { storiesOf } from '@storybook/vue' +import { withA11y } from '@storybook/addon-a11y' +import RegistrationSlider from './RegistrationSlider.vue' +import helpers from '~/storybook/helpers' + +helpers.init() + +// export const searchResults = [ +// { +// id: 'post-by-jenny', +// __typename: 'Post', +// slug: 'user-post-by-jenny', +// title: 'User Post by Jenny', +// value: 'User Post by Jenny', +// shoutedCount: 0, +// commentsCount: 4, +// createdAt: '2019-11-13T03:03:16.155Z', +// author: { +// id: 'u3', +// name: 'Jenny Rostock', +// slug: 'jenny-rostock', +// }, +// }, +// { +// id: 'f48f00a0-c412-432f-8334-4276a4e15d1c', +// __typename: 'Post', +// slug: 'eum-quos-est-molestiae-enim-magni-consequuntur-sed-commodi-eos', +// title: 'Eum quos est molestiae enim magni consequuntur sed commodi eos.', +// value: 'Eum quos est molestiae enim magni consequuntur sed commodi eos.', +// shoutedCount: 0, +// commentsCount: 0, +// createdAt: '2019-11-13T03:00:45.478Z', +// author: { +// id: 'u6', +// name: 'Louie', +// slug: 'louie', +// }, +// }, +// { +// id: 'p7', +// __typename: 'Post', +// slug: 'this-is-post-7', +// title: 'This is post #7', +// value: 'This is post #7', +// shoutedCount: 1, +// commentsCount: 1, +// createdAt: '2019-11-13T03:00:23.098Z', +// author: { +// id: 'u6', +// name: 'Louie', +// slug: 'louie', +// }, +// }, +// { +// id: 'p12', +// __typename: 'Post', +// slug: 'this-is-post-12', +// title: 'This is post #12', +// value: 'This is post #12', +// shoutedCount: 0, +// commentsCount: 12, +// createdAt: '2019-11-13T03:00:23.098Z', +// author: { +// id: 'u6', +// name: 'Louie', +// slug: 'louie', +// }, +// }, +// { +// id: 'u1', +// __typename: 'User', +// avatar: { +// url: +// 'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/db/dbc9e03ebcc384b920c31542af2d27dd8eea9dc2_full.jpg', +// }, +// name: 'Peter Lustig', +// slug: 'peter-lustig', +// }, +// { +// id: 'cdbca762-0632-4564-b646-415a0c42d8b8', +// __typename: 'User', +// avatar: { +// url: +// 'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/db/dbc9e03ebcc384b920c31542af2d27dd8eea9dc2_full.jpg', +// }, +// name: 'Herbert Schultz', +// slug: 'herbert-schultz', +// }, +// { +// id: 'u2', +// __typename: 'User', +// avatar: { +// url: +// 'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/db/dbc9e03ebcc384b920c31542af2d27dd8eea9dc2_full.jpg', +// }, +// name: 'Bob der Baumeister', +// slug: 'bob-der-baumeister', +// }, +// { +// id: '7b654f72-f4da-4315-8bed-39de0859754b', +// __typename: 'User', +// avatar: { +// url: +// 'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/db/dbc9e03ebcc384b920c31542af2d27dd8eea9dc2_full.jpg', +// }, +// name: 'Tonya Mohr', +// slug: 'tonya-mohr', +// }, +// { +// id: 'Hashtag', +// __typename: 'Tag', +// }, +// ] + +storiesOf('RegistrationSlider', module) + .addDecorator(withA11y) + .addDecorator(helpers.layout) + .add('standard', () => ({ + components: { RegistrationSlider }, + store: helpers.store, + data: () => ({ + // searchResults, + }), + template: ` + + `, + })) diff --git a/webapp/components/Registration/RegistrationSlider.vue b/webapp/components/Registration/RegistrationSlider.vue new file mode 100644 index 000000000..3cb248931 --- /dev/null +++ b/webapp/components/Registration/RegistrationSlider.vue @@ -0,0 +1,214 @@ + + + + + From e062cbaa0c631c250486f7e55c67597f38f8f70e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Wed, 27 Jan 2021 17:14:36 +0100 Subject: [PATCH 03/44] Implement ResistrationEnterInvite.vue, start --- .../ComponentSlider/ComponentSlider.vue | 176 +++++------------- .../RegistrationItemCreateUserAccount.vue | 1 + .../RegistrationItemEnterInvite.vue | 78 ++++++++ .../Registration/RegistrationSlider.vue | 173 ++--------------- 4 files changed, 146 insertions(+), 282 deletions(-) create mode 100644 webapp/components/Registration/RegistrationItemEnterInvite.vue diff --git a/webapp/components/ComponentSlider/ComponentSlider.vue b/webapp/components/ComponentSlider/ComponentSlider.vue index 1d2c1b9bc..41bf9b1cb 100644 --- a/webapp/components/ComponentSlider/ComponentSlider.vue +++ b/webapp/components/ComponentSlider/ComponentSlider.vue @@ -1,12 +1,18 @@

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

- - - - - Test!!! - + + + - @@ -68,6 +29,7 @@ From 2068dd507bba76349ffa4e6cf4c29a696d76f4b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 28 Jan 2021 13:51:26 +0100 Subject: [PATCH 04/44] Play with callbacks --- .../ComponentSlider/ComponentSlider.vue | 42 ++++++------------- .../RegistrationItemEnterInvite.vue | 11 ++++- .../Registration/RegistrationSlider.vue | 31 ++++++++------ 3 files changed, 41 insertions(+), 43 deletions(-) diff --git a/webapp/components/ComponentSlider/ComponentSlider.vue b/webapp/components/ComponentSlider/ComponentSlider.vue index 41bf9b1cb..80f5de462 100644 --- a/webapp/components/ComponentSlider/ComponentSlider.vue +++ b/webapp/components/ComponentSlider/ComponentSlider.vue @@ -1,19 +1,7 @@

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

- + +

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

- - +

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

+ + + + + @@ -31,20 +48,24 @@ diff --git a/webapp/components/utils/PasswordFormHelper.js b/webapp/components/utils/PasswordFormHelper.js index 578238aca..da6cead90 100644 --- a/webapp/components/utils/PasswordFormHelper.js +++ b/webapp/components/utils/PasswordFormHelper.js @@ -15,7 +15,7 @@ export default function PasswordForm({ translate }) { }, passwordConfirmation: [ { - validator(rule, value, callback, source, options) { + validator(_rule, value, callback, source, _options) { var errors = [] if (source.password !== value) { errors.push(new Error(passwordMismatchMessage)) From a93d70b2d646f5d15a382af324d2987a4220f58f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 4 Feb 2021 15:33:17 +0100 Subject: [PATCH 18/44] Add experimental own validators and set values on mounted --- .../RegistrationItemCreateUserAccount.vue | 226 +++++------------- .../Registration/RegistrationSlider.vue | 5 +- 2 files changed, 68 insertions(+), 163 deletions(-) diff --git a/webapp/components/Registration/RegistrationItemCreateUserAccount.vue b/webapp/components/Registration/RegistrationItemCreateUserAccount.vue index cd3814984..e63f24c3c 100644 --- a/webapp/components/Registration/RegistrationItemCreateUserAccount.vue +++ b/webapp/components/Registration/RegistrationItemCreateUserAccount.vue @@ -160,10 +160,14 @@ export default { supportEmail: emails.SUPPORT, formData: { name: '', - // about: '', - // Wolle name: this.sliderData.collectedInputData.name ? this.sliderData.collectedInputData.name : '', - about: this.sliderData.collectedInputData.about ? this.sliderData.collectedInputData.about : '', + about: '', + // name: this.sliderData.collectedInputData.name ? this.sliderData.collectedInputData.name : '', + // about: this.sliderData.collectedInputData.about ? this.sliderData.collectedInputData.about : '', ...passwordForm.formData, + // ...{ + // password: this.sliderData.collectedInputData.password ? this.sliderData.collectedInputData.password : '', + // passwordConfirmation: this.sliderData.collectedInputData.passwordConfirmation ? this.sliderData.collectedInputData.passwordConfirmation : '', + // } }, formSchema: { name: { @@ -183,191 +187,91 @@ export default { // TODO: Our styleguide does not support checkmarks. // Integrate termsAndConditionsConfirmed into `this.formData` once we // have checkmarks available. - // termsAndConditionsConfirmed: false, - // dataPrivacy: false, - // minimumAge: false, - // noCommercial: false, - // noPolitical: false, + termsAndConditionsConfirmed: false, + dataPrivacy: false, + minimumAge: false, + noCommercial: false, + noPolitical: false, // TODO: Our styleguide does not support checkmarks. // Integrate termsAndConditionsConfirmed into `this.formData` once we // have checkmarks available. - termsAndConditionsConfirmed: this.sliderData.collectedInputData.termsAndConditionsConfirmed ? this.sliderData.collectedInputData.termsAndConditionsConfirmed : false, - dataPrivacy: this.sliderData.collectedInputData.dataPrivacy ? this.sliderData.collectedInputData.dataPrivacy : false, - minimumAge: this.sliderData.collectedInputData.minimumAge ? this.sliderData.collectedInputData.minimumAge : false, - noCommercial: this.sliderData.collectedInputData.noCommercial ? this.sliderData.collectedInputData.noCommercial : false, - noPolitical: this.sliderData.collectedInputData.noPolitical ? this.sliderData.collectedInputData.noPolitical : false, + // termsAndConditionsConfirmed: this.sliderData.collectedInputData.termsAndConditionsConfirmed ? this.sliderData.collectedInputData.termsAndConditionsConfirmed : false, + // dataPrivacy: this.sliderData.collectedInputData.dataPrivacy ? this.sliderData.collectedInputData.dataPrivacy : false, + // minimumAge: this.sliderData.collectedInputData.minimumAge ? this.sliderData.collectedInputData.minimumAge : false, + // noCommercial: this.sliderData.collectedInputData.noCommercial ? this.sliderData.collectedInputData.noCommercial : false, + // noPolitical: this.sliderData.collectedInputData.noPolitical ? this.sliderData.collectedInputData.noPolitical : false, } }, + mounted: function () { + this.$nextTick(function () { + // Code that will run only after the + // entire view has been rendered + console.log('mounted !!! ') + this.formData.name = this.sliderData.collectedInputData.name ? this.sliderData.collectedInputData.name : '', + this.formData.about = this.sliderData.collectedInputData.about ? this.sliderData.collectedInputData.about : '', + this.formData.password = this.sliderData.collectedInputData.password ? this.sliderData.collectedInputData.password : '' + this.formData.passwordConfirmation = this.sliderData.collectedInputData.passwordConfirmation ? this.sliderData.collectedInputData.passwordConfirmation : '' + this.termsAndConditionsConfirmed = this.sliderData.collectedInputData.termsAndConditionsConfirmed ? this.sliderData.collectedInputData.termsAndConditionsConfirmed : false + this.dataPrivacy = this.sliderData.collectedInputData.dataPrivacy ? this.sliderData.collectedInputData.dataPrivacy : false + this.minimumAge = this.sliderData.collectedInputData.minimumAge ? this.sliderData.collectedInputData.minimumAge : false + this.noCommercial = this.sliderData.collectedInputData.noCommercial ? this.sliderData.collectedInputData.noCommercial : false + this.noPolitical = this.sliderData.collectedInputData.noPolitical ? this.sliderData.collectedInputData.noPolitical : false + }) + }, computed: { valid() { - // console.log('valid !!! this.formErrors: ', this.formErrors) - // console.log('valid !!! this.$slots: ', this.$slots) - // console.log('valid !!! this.$scopedSlots: ', this.$scopedSlots) - // console.log('this.formSchema: ', this.formSchema) - // console.log('this.formData: ', this.formData) - // return (this.formErrors || - // !this.termsAndConditionsConfirmed || - // !this.dataPrivacy || - // !this.minimumAge || - // !this.noCommercial || - // !this.noPolitical) - // const isNotValid = - // // this.formErrors || - // this.formErrors || - // !this.termsAndConditionsConfirmed || - // !this.dataPrivacy || - // !this.minimumAge || - // !this.noCommercial || - // !this.noPolitical + // console.log('valid !!! this.formData: ', this.formData, ' this.formData.password === this.formData.passwordConfirmation: ', this.formData.password === this.formData.passwordConfirmation) + // console.log('this.formData.name.length: ', this.formData.name.length, ' this.formData.password.length: ', this.formData.password.length) const isValid = - !this.formErrors && - this.formData.name.lenght >= 3 && + // !this.formErrors && + (this.formData.name.length >= 3) && + (this.formData.password.length >= 1) && + (this.formData.password === this.formData.passwordConfirmation) && this.termsAndConditionsConfirmed && this.dataPrivacy && this.minimumAge && this.noCommercial && this.noPolitical - // console.log('valid : ', !isNotValid) console.log('valid : ', isValid) - // const { name, about } = this.formData - // // const { email, nonce } = this - // // const { email, nonce } = this.sliderData.collectedInputData - // const termsAndConditionsAgreedVersion = VERSION - // const { - // termsAndConditionsConfirmed, - // dataPrivacy, - // minimumAge, - // noCommercial, - // noPolitical, - // } = this - // // const locale = this.$i18n.locale() - // // this.sliderData.validateCallback(true, { - // this.sliderData.validateCallback(!isNotValid, { - // name, - // // password, - // about, - // // email, - // // nonce, - // termsAndConditionsAgreedVersion, - // termsAndConditionsConfirmed, - // dataPrivacy, - // minimumAge, - // noCommercial, - // noPolitical, - // // locale, - // }) - // return !isNotValid return isValid }, }, watch: { - // notValid(newVal, _oldVal) { - // // Wolle const [oldPropertyA, oldProvertyB] = oldVal.split('|'); - // // const [newPropertyA, newProvertyB] = newVal.split('|'); - // // doSomething - // if (newVal) { - // this.sliderData.validateCallback(false) - // } else { - // const { name, about } = this.formData - // // const { email, nonce } = this - // // const { email, nonce } = this.sliderData.collectedInputData - // const termsAndConditionsAgreedVersion = VERSION - // const { - // termsAndConditionsConfirmed, - // dataPrivacy, - // minimumAge, - // noCommercial, - // noPolitical, - // } = this - // // const locale = this.$i18n.locale() - // // this.sliderData.validateCallback(true, { - // this.sliderData.validateCallback(true, { - // name, - // // password, - // about, - // // email, - // // nonce, - // termsAndConditionsAgreedVersion, - // termsAndConditionsConfirmed, - // dataPrivacy, - // minimumAge, - // noCommercial, - // noPolitical, - // // locale, - // }) - // } + // formData: { + // handler() { + // console.log('formData: ', this.formData) + // this.sendValidation() + // }, + // deep: true, + // immediate: true, // }, - valid(newVal) { - // Wolle const [oldPropertyA, oldProvertyB] = oldVal.split('|'); - // const [newPropertyA, newProvertyB] = newVal.split('|'); - // doSomething - if (newVal) { - this.sliderData.validateCallback(false) - } else { - const { name, about } = this.formData - // const { email, nonce } = this - // const { email, nonce } = this.sliderData.collectedInputData - const termsAndConditionsAgreedVersion = VERSION - const { - termsAndConditionsConfirmed, - dataPrivacy, - minimumAge, - noCommercial, - noPolitical, - } = this - // const locale = this.$i18n.locale() - // this.sliderData.validateCallback(true, { - this.sliderData.validateCallback(true, { - name, - // password, - about, - // email, - // nonce, - termsAndConditionsAgreedVersion, - termsAndConditionsConfirmed, - dataPrivacy, - minimumAge, - noCommercial, - noPolitical, - // locale, - }) - } + formData() { + console.log('formData: ', this.formData) + this.sendValidation() }, - formData: { - handler(newValue) { - this.sendValidation(newValue) - }, - deep: true, - immediate: true, + termsAndConditionsConfirmed() { + this.sendValidation() }, - termsAndConditionsConfirmed(newValue) { - this.sendValidation({termsAndConditionsConfirmed: newValue}) + dataPrivacy() { + this.sendValidation() }, - dataPrivacy(newValue) { - this.sendValidation({dataPrivacy: newValue}) + minimumAge() { + this.sendValidation() }, - minimumAge(newValue) { - this.sendValidation({minimumAge: newValue}) + noCommercial() { + this.sendValidation() }, - noCommercial(newValue) { - this.sendValidation({noCommercial: newValue}) - }, - noPolitical(newValue) { - this.sendValidation({noPolitical: newValue}) + noPolitical() { + this.sendValidation() }, }, methods: { - // setErrors(errors) { - // this.formErrors = errors - // // console.log('setErrors !!! this.formErrors: ', this.formErrors) - // return errors - // }, watchScopedSlotsCallback({errors}) { this.formErrors = errors console.log('watchScopedSlotsCallback !!! this.formErrors: ', this.formErrors) }, - sendValidation(newValues) { - const { name, about } = this.formData + sendValidation() { + const { name, about, password, passwordConfirmation } = this.formData // const { email, nonce } = this // const { email, nonce } = this.sliderData.collectedInputData const termsAndConditionsAgreedVersion = VERSION @@ -379,10 +283,11 @@ export default { noPolitical, } = this // const locale = this.$i18n.locale() - const nowValues = { + const value = { name, - // password, about, + password, + passwordConfirmation, // email, // nonce, termsAndConditionsAgreedVersion, @@ -393,7 +298,8 @@ export default { noPolitical, // locale, } - this.sliderData.validateCallback(this.valid, {...nowValues, ...newValues}) + console.log('sendValidation !!!', ' this.valid: ', this.valid, ' value: ', value) + this.sliderData.validateCallback(this.valid, value) }, async submit() { const { name, password, about } = this.formData diff --git a/webapp/components/Registration/RegistrationSlider.vue b/webapp/components/Registration/RegistrationSlider.vue index 51902a205..1fed20045 100644 --- a/webapp/components/Registration/RegistrationSlider.vue +++ b/webapp/components/Registration/RegistrationSlider.vue @@ -139,9 +139,8 @@ export default { }, }, methods: { - validateCallback(is, data = null) { - this.sliderData.sliders[this.sliderIndex].validated = is - // if (is) { + validateCallback(isValid, data = null) { + this.sliderData.sliders[this.sliderIndex].validated = isValid if (data) { this.sliderData.collectedInputData = { ...this.sliderData.collectedInputData, From d9e65597ceadc2b0740464405574d52ca2889b46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 4 Feb 2021 15:45:29 +0100 Subject: [PATCH 19/44] Fix lint --- .../ComponentSlider/ComponentSlider.vue | 9 +- .../RegistrationItemCreateUserAccount.vue | 82 +++++++++---------- .../RegistrationItemEnterInvite.vue | 6 +- .../Registration/RegistrationSlider.vue | 28 +++---- .../Registration/WatchScopedSlotsCallback.vue | 8 +- 5 files changed, 62 insertions(+), 71 deletions(-) diff --git a/webapp/components/ComponentSlider/ComponentSlider.vue b/webapp/components/ComponentSlider/ComponentSlider.vue index 7b324f763..1be5c1371 100644 --- a/webapp/components/ComponentSlider/ComponentSlider.vue +++ b/webapp/components/ComponentSlider/ComponentSlider.vue @@ -13,15 +13,10 @@