Clean up code

This commit is contained in:
Christian Cueni 2020-05-12 10:59:22 +02:00
parent 685fa3ff34
commit 47129e81a6
9 changed files with 45 additions and 57 deletions

View File

@ -1,7 +1,7 @@
<template>
<div class="check-email">
<main class="check-email__content content" data-cy="email-check">
<p class="content__instructions">Ein Email ist auf dem Weg, bitte überprüfen sie ihre E-mail Konto.</p>
<p class="content__instructions">Eine Email ist auf dem Weg, bitte überprüfen sie ihre E-mail Konto.</p>
</main>
</div>

View File

@ -55,7 +55,7 @@ export default {
} else {
switch (data.registration.message) {
case 'invalid_key':
this.errorMessage = 'Der angegebene Verifizierungscode ist falsch oder abgelaufen.';
this.errorMessage = 'Der angegebene Verifizierungscode ist ungültig oder abgelaufen.';
break;
case 'no_valid_license':
this.$router.push({name: 'licenseActivation'});
@ -65,7 +65,9 @@ export default {
}
}
})
.catch(() => this.errorMessage = 'Ein Fehler ist aufgetreten. Bitte kontaktieren Sie den Administrator.');
.catch(() => {
this.errorMessage = 'Ein Fehler ist aufgetreten. Bitte kontaktieren Sie den Administrator.'
});
},
};

View File

@ -5,7 +5,7 @@
</header>
<section class="forgot-password__section forgot-password__text">
<p class="forgot-info">Ihr Benutzerkonto wird durch den Hep Verlag verwaltet und deshalb können Sie das Passwort ausschliesslicht auf
<a class="noserif-link" href="https://www.hep-verlag.ch">www.hep-verlag.ch</a> verwaltet werden.</p>
<a class="hep-link" href="https://www.hep-verlag.ch">www.hep-verlag.ch</a> verwaltet werden.</p>
<p class="forgot-info">Melden Sie sich mit der gleichen E-Mail-Adresse und dem gleichen </p>
</section>
<section class="forgot-password__section forgot-password__link">

View File

@ -41,8 +41,8 @@
<section class="get-license">
<h2>Oder, kaufen Sie eine Lizenz</h2>
<ul class="license-links">
<li class="license-links__item"><a :href="teacherEditionUrl" class="noserif-link">mySkillobx für Lehrpersonen</a></li>
<li class="license-links__item"><a :href="studentEditionUrl" class="noserif-link">mySkillobx für Lernende</a></li>
<li class="license-links__item"><a :href="teacherEditionUrl" class="hep-link">mySkillobx für Lehrpersonen</a></li>
<li class="license-links__item"><a :href="studentEditionUrl" class="hep-link">mySkillobx für Lernende</a></li>
</ul>
</section>
</div>
@ -50,11 +50,12 @@
<script>
import me from '@/mixins/me';
import REDEEM_COUPON from '@/graphql/gql/mutations/redeemCoupon.gql';
import ME_QUERY from '@/graphql/gql/meQuery.gql';
export default {
mixins: [me],
methods: {
validateBeforeSubmit() {
this.$validator.validate().then(result => {
@ -84,7 +85,7 @@ export default {
}
}).catch(({message}) => {
if (message.indexOf('invalid_coupon') > -1) {
that.couponErrors = ['Der angegebene Coupon-Code ist falsch.'];
that.couponErrors = ['Der angegebene Coupon-Code ist ungültig.'];
} else {
that.couponErrors = ['Es ist ein Fehler aufgetreten. Bitte versuchen Sie es nochmals oder kontaktieren Sie den Administrator.'];
}
@ -112,12 +113,6 @@ export default {
studentEditionUrl: `${process.env.HEP_URL}/myskillbox-fur-lernende`
};
},
apollo: {
me: {
query: ME_QUERY,
},
},
};
</script>

View File

@ -40,7 +40,7 @@
import HELLO_EMAIL from '@/graphql/gql/local/helloEmail.gql';
import LOGIN_MUTATION from '@/graphql/gql/mutations/login.gql';
import {login} from '../hep-client/index';
import {login} from '@/hep-client/index';
export default {
components: {},
@ -159,7 +159,7 @@ export default {
margin-left: auto;
line-height: 19px;;
display: inline-block;
padding: 15px;
padding: $small-spacing;
}
}

View File

@ -209,6 +209,29 @@
import {register} from '../hep-client/index'
import HELLO_EMAIL from '@/graphql/gql/local/helloEmail.gql';
function initialData() {
return {
prefix: 'Herr',
lastname: '',
firstname: '',
password: '',
passwordConfirmation: '',
street: '',
postcode: '',
city: '',
firstnameErrors: '',
lastnameErrors: '',
emailErrors: '',
passwordsErrors: [],
passwordErrors: [],
streetErrors: [],
cityErrors: [],
postcodeErrors: [],
registrationError: '',
submitted: false,
}
}
export default {
components: {},
@ -256,50 +279,18 @@ export default {
});
},
resetForm() {
this.prefix = 'Herr';
this.lastname = '';
this.firstname = '';
this.street = '';
this.city = '';
this.postcode = '';
this.password = '';
this.passwordConfirmation = '';
this.firstnameErrors = [];
this.lastnameErrors = [];
this.emailErrors = [];
this.passwordsError = [];
this.passwordError = [];
this.streetErrors = [];
this.postcodeErrors = [];
this.cityErrors = [];
this.registrationError = [];
this.submitted = false;
Object.assign(this.$data, initialData());
this.$validator.reset();
}
},
data() {
return {
prefix: 'Herr',
lastname: '',
firstname: '',
password: '',
passwordConfirmation: '',
street: '',
postcode: '',
city: '',
firstnameErrors: '',
lastnameErrors: '',
emailErrors: '',
passwordsErrors: [],
passwordErrors: [],
streetErrors: [],
cityErrors: [],
postcodeErrors: [],
registrationError: '',
submitted: false,
helloEmail: ''
};
return Object.assign(
{
helloEmail: ''
},
initialData()
);
},
apollo: {

View File

@ -76,7 +76,7 @@ input, textarea, select, button {
@include inline-title;
}
.noserif-link {
.hep-link {
font-family: $sans-serif-font-family;
color: $color-brand-dark;
}

View File

@ -22,7 +22,7 @@
@import "public-page";
@import "student-submission";
@import "module-activity";
@import "info_header";
@import "info-header";
@import "book-subnavigation";
@import "simple-list";
@import "widget-popover";