Confirm, privacy policy, minimum age at registration

This commit is contained in:
ogerly 2019-10-15 19:21:05 +02:00
parent 461defd460
commit d7dc0646e0
4 changed files with 21 additions and 31 deletions

View File

@ -61,7 +61,9 @@ describe('CreateUserAccount', () => {
wrapper.find('input#password').setValue('hellopassword') wrapper.find('input#password').setValue('hellopassword')
wrapper.find('textarea#about').setValue('Hello I am the `about` attribute') wrapper.find('textarea#about').setValue('Hello I am the `about` attribute')
wrapper.find('input#passwordConfirmation').setValue('hellopassword') wrapper.find('input#passwordConfirmation').setValue('hellopassword')
wrapper.find('input#checkbox').setChecked() wrapper.find('input#checkbox0').setChecked()
wrapper.find('input#checkbox1').setChecked()
wrapper.find('input#checkbox2').setChecked()
await wrapper.find('form').trigger('submit') await wrapper.find('form').trigger('submit')
await wrapper.html() await wrapper.html()
} }

View File

@ -64,7 +64,7 @@
<ds-text> <ds-text>
<input <input
id="checkbox" id="checkbox0"
type="checkbox" type="checkbox"
v-model="termsAndConditionsConfirmed" v-model="termsAndConditionsConfirmed"
:checked="termsAndConditionsConfirmed" :checked="termsAndConditionsConfirmed"
@ -74,12 +74,24 @@
v-html="$t('termsAndConditions.termsAndConditionsConfirmed')" v-html="$t('termsAndConditions.termsAndConditionsConfirmed')"
></label> ></label>
</ds-text> </ds-text>
<p>
<label>
<input id="checkbox1" type="checkbox" v-model="dataPrivacy" :checked="dataPrivacy" />
<span v-html="$t('components.registration.signup.form.data-privacy')"></span>
</label>
</p>
<p>
<label>
<input id="checkbox2" type="checkbox" v-model="minimumAge" :checked="minimumAge" />
<span v-html="$t('components.registration.signup.form.minimum-age')"></span>
</label>
</p>
<ds-button <ds-button
style="float: right;" style="float: right;"
icon="check" icon="check"
type="submit" type="submit"
:loading="$apollo.loading" :loading="$apollo.loading"
:disabled="errors || !termsAndConditionsConfirmed" :disabled="errors || !termsAndConditionsConfirmed || !dataPrivacy || !minimumAge"
primary primary
> >
{{ $t('actions.save') }} {{ $t('actions.save') }}
@ -129,6 +141,8 @@ export default {
// Integrate termsAndConditionsConfirmed into `this.formData` once we // Integrate termsAndConditionsConfirmed into `this.formData` once we
// have checkmarks available. // have checkmarks available.
termsAndConditionsConfirmed: false, termsAndConditionsConfirmed: false,
dataPrivacy: false,
minimumAge: false,
} }
}, },
props: { props: {

View File

@ -30,25 +30,6 @@
name="email" name="email"
icon="envelope" icon="envelope"
/> />
<p>
<label class="add-checkbox">
<input @change="handleInputValid" type="checkbox" v-model="checkbox1" />
<span v-html="$t('components.registration.signup.form.terms-and-condition')"></span>
</label>
</p>
<p>
<label class="add-checkbox">
<input@change="handleInputValid" type="checkbox" v-model="checkbox2"/>
<span v-html="$t('components.registration.signup.form.data-privacy')"></span>
</label>
</p>
<p>
<label class="add-checkbox">
<input @change="handleInputValid" type="checkbox" v-model="checkbox3" />
<span v-html="$t('components.registration.signup.form.minimum-age')"></span>
</label>
</p>
<ds-button <ds-button
:disabled="disabled" :disabled="disabled"
:loading="$apollo.loading" :loading="$apollo.loading"
@ -121,9 +102,6 @@ export default {
disabled: true, disabled: true,
success: false, success: false,
error: null, error: null,
checkbox1: false,
checkbox2: false,
checkbox3: false,
} }
}, },
computed: { computed: {
@ -137,11 +115,7 @@ export default {
this.disabled = true this.disabled = true
}, },
handleInputValid() { handleInputValid() {
if (this.checkbox1 && this.checkbox2 && this.checkbox3) { this.disabled = false
this.disabled = false
} else {
this.disabled = true
}
}, },
async handleSubmit() { async handleSubmit() {
const mutation = this.token ? SignupByInvitationMutation : SignupMutation const mutation = this.token ? SignupByInvitationMutation : SignupMutation

View File

@ -30,7 +30,7 @@
"title": "Mach mit bei Human Connection!", "title": "Mach mit bei Human Connection!",
"form": { "form": {
"description": "Um loszulegen, gib deine E-Mail Adresse ein:", "description": "Um loszulegen, gib deine E-Mail Adresse ein:",
"terms-and-condition": "Ich stimme den <a href=\"/terms-and-conditions\"><ds-text bold color=\"primary\" > Nutzungsbedingungen!</ds-text></a>zu.", "terms-and-condition": "Ich stimme den <a href=\"/terms-and-conditions\"><ds-text bold color=\"primary\" > Nutzungsbedingungen</ds-text></a>zu.",
"data-privacy": "Ich habe die <a href=\"https://human-connection.org/datenschutz/\" target=\"_blank\"><ds-text bold color=\"primary\" >Datenschutzerklärungen!</ds-text></a> gelesen und verstanden", "data-privacy": "Ich habe die <a href=\"https://human-connection.org/datenschutz/\" target=\"_blank\"><ds-text bold color=\"primary\" >Datenschutzerklärungen!</ds-text></a> gelesen und verstanden",
"minimum-age": "Ich bin 18 Jahre oder älter.", "minimum-age": "Ich bin 18 Jahre oder älter.",
"invitation-code": "Dein Einladungscode lautet: <b>{code}</b>", "invitation-code": "Dein Einladungscode lautet: <b>{code}</b>",