remove unused components and layouts for auth

This commit is contained in:
ogerly 2022-03-30 16:34:26 +02:00
parent 6818b52e3e
commit de13e2f747
6 changed files with 0 additions and 682 deletions

View File

@ -1,16 +0,0 @@
<template>
<div>
<slot :name="type"></slot>
</div>
</template>
<script>
export default {
name: 'AuthItem',
props: {
type: {
type: String,
required: true,
},
},
}
</script>

View File

@ -1,65 +0,0 @@
<template>
<div class="auth-forgot-password">
<b-card no-body class="border-0 gradido-custom-background">
<div class="text-center">
<h1>{{ $t('settings.password.reset') }}</h1>
<!-- eslint-disable-next-line @intlify/vue-i18n/no-dynamic-keys-->
<p class="text-lead">{{ $t(subtitle) }}</p>
</div>
<b-card-body class="p-4">
<validation-observer ref="observer" v-slot="{ handleSubmit }">
<b-form role="form" @submit.prevent="handleSubmit(onSubmit)">
<input-email v-model="form.email"></input-email>
<div class="text-center">
<b-button type="submit" variant="gradido">
{{ $t('settings.password.send_now') }}
</b-button>
</div>
</b-form>
</validation-observer>
</b-card-body>
</b-card>
</div>
</template>
<script>
import { sendResetPasswordEmail } from '@/graphql/queries'
import InputEmail from '@/components/Inputs/InputEmail'
export default {
name: 'AuthForgotPassword',
components: {
InputEmail,
},
data() {
return {
disable: 'disabled',
form: {
email: '',
},
subtitle: 'settings.password.subtitle',
}
},
methods: {
async onSubmit() {
this.$apollo
.query({
query: sendResetPasswordEmail,
variables: {
email: this.form.email,
},
})
.then(() => {
this.$router.push('/thx/forgotPassword')
})
.catch(() => {
this.$router.push('/thx/forgotPassword')
})
},
},
created() {
if (this.$route.params.comingFrom) {
this.subtitle = 'settings.password.resend_subtitle'
}
},
}
</script>

View File

@ -1,142 +0,0 @@
<template>
<div class="auth-login">
<div class="h1 mt-7">Willkommen</div>
<div class="h1">Communities World Wide</div>
<div>1000 Dank, weil du bei uns bist!</div>
<b-card no-body class="border-0 mt-4 gradido-custom-background">
<b-row class="p-4">
<b-col>
<div>
<span>{{ $t('settings.language.de') }}</span>
|
<span>{{ $t('settings.language.en') }}</span>
</div>
</b-col>
<b-col class="text-right">
A
<span class="h1">A</span>
</b-col>
</b-row>
<div class="p-4">Melde dich mit deinen Zugangsdaten an. Bewahre sie stet's sicher auf!</div>
<b-card-body class="p-4">
<!-- <div class="text-center mb-4 test-communitydata">
<b>{{ $store.state.community.name }}</b>
<p class="text-lead">
{{ $store.state.community.description }}
</p>
{{ $t('login') }}
</div> -->
<label>Wähle deine Community</label>
<b-form-select
v-model="selected"
:options="options"
class="selectedLanguage mb-3"
></b-form-select>
<validation-observer ref="observer" v-slot="{ handleSubmit }">
<b-form @submit.stop.prevent="handleSubmit(onSubmit)">
<b-row>
<b-col><input-email v-model="form.email"></input-email></b-col>
<b-col>
<input-password
:label="$t('form.password')"
:placeholder="$t('form.password')"
:name="$t('form.password')"
v-model="form.password"
></input-password>
</b-col>
</b-row>
<b-row>
<b-col>
<b-form-checkbox
v-model="status"
name="checkbox-1"
value="saved"
unchecked-value="not_saved"
>
Anmeldung speichern
</b-form-checkbox>
</b-col>
<b-col>
<b-link
href="#!"
class="mt-3"
@click="$emit('setAuthItem', 'AUTH_FORGOT_PASSWORD')"
>
{{ $t('settings.password.forgot_pwd') }}
</b-link>
</b-col>
</b-row>
<div class="mt-4">
<b-button type="submit" variant="gradido">{{ $t('login') }}</b-button>
</div>
</b-form>
</validation-observer>
</b-card-body>
</b-card>
</div>
</template>
<script>
import InputPassword from '@/components/Inputs/InputPassword'
import InputEmail from '@/components/Inputs/InputEmail'
import { login } from '@/graphql/queries'
import { getCommunityInfoMixin } from '@/mixins/getCommunityInfo'
export default {
name: 'AuthLogin',
components: {
InputPassword,
InputEmail,
},
mixins: [getCommunityInfoMixin],
data() {
return {
form: {
email: '',
password: '',
},
passwordVisible: false,
selected: '01',
options: [{ value: '01', text: this.$store.state.community.name }],
}
},
methods: {
async onSubmit() {
const loader = this.$loading.show({
container: this.$refs.submitButton,
})
this.$apollo
.query({
query: login,
variables: {
email: this.form.email,
password: this.form.password,
publisherId: this.$store.state.publisherId,
},
fetchPolicy: 'network-only',
})
.then(async (result) => {
const {
data: { login },
} = result
this.$store.dispatch('login', login)
await loader.hide()
if (this.$route.params.code) {
this.$router.push(`/redeem/${this.$route.params.code}`)
} else {
this.$router.push('/overview')
}
})
.catch((error) => {
this.toastError(this.$t('error.no-account'))
if (error.message.includes('User email not validated')) {
this.$router.push('/thx/login')
} else if (error.message.includes('User has no password set yet')) {
this.$router.push('/reset-password/login')
}
loader.hide()
})
},
},
}
</script>

View File

@ -1,225 +0,0 @@
<template>
<div class="auth-register">
<b-card no-body class="border-0 gradido-custom-background">
<b-card-body class="p-4">
<div class="text-center text-muted mb-4 test-communitydata">
<b>{{ $store.state.community.name }}</b>
<p class="text-lead">
{{ $store.state.community.description }}
</p>
<div>{{ $t('signup') }}</div>
</div>
<validation-observer ref="observer" v-slot="{ handleSubmit }">
<b-form role="form" @submit.prevent="handleSubmit(onSubmit)">
<validation-provider
:name="$t('form.firstname')"
:rules="{ required: true, min: 3 }"
v-slot="validationContext"
>
<b-form-group
class="mb-3"
:label="$t('form.firstname')"
label-for="registerFirstname"
>
<b-form-input
id="registerFirstname"
:name="$t('form.firstname')"
v-model="form.firstname"
:placeholder="$t('form.firstname')"
:state="getValidationState(validationContext)"
aria-describedby="registerFirstnameLiveFeedback"
></b-form-input>
<b-form-invalid-feedback id="registerFirstnameLiveFeedback">
{{ validationContext.errors[0] }}
</b-form-invalid-feedback>
</b-form-group>
</validation-provider>
<validation-provider
:name="$t('form.lastname')"
:rules="{ required: true, min: 2 }"
v-slot="validationContext"
>
<b-form-group class="mb-3" :label="$t('form.lastname')" label-for="registerLastname">
<b-form-input
id="registerLastname"
:name="$t('form.lastname')"
v-model="form.lastname"
:placeholder="$t('form.lastname')"
:state="getValidationState(validationContext)"
aria-describedby="registerLastnameLiveFeedback"
></b-form-input>
<b-form-invalid-feedback id="registerLastnameLiveFeedback">
{{ validationContext.errors[0] }}
</b-form-invalid-feedback>
</b-form-group>
</validation-provider>
<input-email v-model="form.email"></input-email>
<hr />
<b-row>
<b-col cols="12">
{{ $t('language') }}
<language-switch-select @update-language="updateLanguage" />
</b-col>
</b-row>
<b-row class="my-4">
<b-col cols="12">
<b-form-checkbox
id="registerCheckbox"
v-model="form.agree"
:name="$t('site.signup.agree')"
>
<!-- eslint-disable-next-line @intlify/vue-i18n/no-v-html -->
<span class="text-muted" v-html="$t('site.signup.agree')"></span>
</b-form-checkbox>
</b-col>
</b-row>
<b-alert v-if="showError" show dismissible variant="danger" @dismissed="closeAlert">
<span class="alert-icon"><i class="ni ni-point"></i></span>
<span class="alert-text">
<strong>{{ $t('error.error') }}</strong>
{{ messageError }}
</span>
</b-alert>
<b-row v-b-toggle:my-collapse class="text-muted shadow-sm p-3 publisherCollaps">
<b-col>{{ $t('publisher.publisherId') }} {{ $store.state.publisherId }}</b-col>
<b-col class="text-right">
<b-icon icon="chevron-down" aria-hidden="true"></b-icon>
</b-col>
</b-row>
<b-row>
<b-col>
<b-collapse id="my-collapse" class="">
<b-input-group class="shadow-sm p-2 bg-white rounded">
<b-input-group-prepend is-text>
<b-icon icon="person-fill"></b-icon>
</b-input-group-prepend>
<b-form-input
id="publisherid"
type="text"
placeholder="Publisher ID"
v-model="publisherId"
@input="commitStorePublisherId(publisherId)"
></b-form-input>
</b-input-group>
<div v-b-toggle:my-collapse class="text-center mt-1 shadow-lg p-3 mb-5 rounded">
{{ $t('publisher.infoText') }}
<div class="text-center">
<b-icon icon="chevron-up" aria-hidden="true"></b-icon>
</div>
</div>
</b-collapse>
</b-col>
</b-row>
<div class="text-center mt-5">
<div class="text-center">
<b-button
:disabled="disabled"
type="submit"
:variant="disabled ? 'outline-light' : 'gradido'"
>
{{ $t('signup') }}
</b-button>
</div>
</div>
</b-form>
</validation-observer>
</b-card-body>
</b-card>
</div>
</template>
<script>
import InputEmail from '@/components/Inputs/InputEmail.vue'
import LanguageSwitchSelect from '@/components/LanguageSwitchSelect.vue'
import { createUser } from '@/graphql/mutations'
import { getCommunityInfoMixin } from '@/mixins/getCommunityInfo'
export default {
name: 'AuthRegister',
components: { InputEmail, LanguageSwitchSelect },
mixins: [getCommunityInfoMixin],
data() {
return {
form: {
firstname: '',
lastname: '',
email: '',
agree: false,
},
language: '',
submitted: false,
showError: false,
messageError: '',
register: true,
publisherId: this.$store.state.publisherId,
redeemCode: this.$route.params.code,
}
},
methods: {
updateLanguage(e) {
this.language = e
this.$store.commit('language', this.language)
},
getValidationState({ dirty, validated, valid = null }) {
return dirty || validated ? valid : null
},
commitStorePublisherId(val) {
this.$store.commit('publisherId', val)
},
async onSubmit() {
this.$apollo
.mutate({
mutation: createUser,
variables: {
email: this.form.email,
firstName: this.form.firstname,
lastName: this.form.lastname,
language: this.language,
publisherId: this.$store.state.publisherId,
redeemCode: this.redeemCode,
},
})
.then(() => {
this.$router.push('/thx/register')
})
.catch((error) => {
this.showError = true
this.messageError = error.message
})
},
closeAlert() {
this.showError = false
this.messageError = ''
this.form.email = ''
this.form.firstname = ''
this.form.lastname = ''
},
},
computed: {
namesFilled() {
return (
this.form.firstname !== '' &&
this.form.firstname.length > 2 &&
this.form.lastname !== '' &&
this.form.lastname.length > 1
)
},
emailFilled() {
return this.form.email !== ''
},
disabled() {
return !(this.namesFilled && this.emailFilled && this.form.agree && !!this.language)
},
},
}
</script>

View File

@ -1,122 +0,0 @@
<template>
<div class="auth-resetpwd-form">
<b-card class="border-0 gradido-custom-background">
<div class="text-center">
<!-- eslint-disable-next-line @intlify/vue-i18n/no-dynamic-keys-->
<h1>{{ $t(displaySetup.title) }}</h1>
<div class="pb-4">
<!-- eslint-disable-next-line @intlify/vue-i18n/no-dynamic-keys-->
{{ $t(displaySetup.text) }}
</div>
</div>
<b-card-body class="p-4">
<validation-observer ref="observer" v-slot="{ handleSubmit }">
<b-form role="form" @submit.prevent="handleSubmit(onSubmit)">
<input-password-confirmation v-model="form" />
<div class="text-center">
<b-button type="submit" variant="gradido" class="mt-4">
<!-- eslint-disable-next-line @intlify/vue-i18n/no-dynamic-keys-->
{{ $t(displaySetup.button) }}
</b-button>
</div>
</b-form>
</validation-observer>
</b-card-body>
</b-card>
</div>
</template>
<script>
import InputPasswordConfirmation from '@/components/Inputs/InputPasswordConfirmation'
import { setPassword } from '@/graphql/mutations'
import { queryOptIn } from '@/graphql/queries'
const textFields = {
reset: {
title: 'settings.password.change-password',
text: 'settings.password.reset-password.text',
button: 'settings.password.change-password',
linkTo: '/login',
},
checkEmail: {
title: 'settings.password.set',
text: 'settings.password.set-password.text',
button: 'settings.password.set',
linkTo: '/login',
},
login: {
headline: 'site.thx.errorTitle',
subtitle: 'site.thx.activateEmail',
},
}
export default {
name: 'AuthResetPassword',
components: {
InputPasswordConfirmation,
},
data() {
return {
form: {
password: '',
passwordRepeat: '',
},
displaySetup: {},
}
},
methods: {
async onSubmit() {
this.$apollo
.mutate({
mutation: setPassword,
variables: {
code: this.$route.params.optin,
password: this.form.password,
},
})
.then(() => {
this.form.password = ''
if (this.$route.path.includes('checkEmail')) {
if (this.$route.params.code) {
this.$router.push('/thx/checkEmail/' + this.$route.params.code)
} else {
this.$router.push('/thx/checkEmail')
}
} else {
this.$router.push('/thx/resetPassword')
}
})
.catch((error) => {
this.toastError(error.message)
if (error.message.includes('Code is older than 10 minutes'))
this.$router.push('/forgot-password/resetPassword')
})
},
checkOptInCode() {
this.$apollo
.query({
query: queryOptIn,
variables: {
optIn: this.$route.params.optin,
},
})
.then()
.catch((error) => {
this.toastError(error.message)
this.$router.push('/forgot-password/resetPassword')
})
},
setDisplaySetup() {
this.checkOptInCode()
if (this.$route.path.includes('checkEmail')) {
this.displaySetup = textFields.checkEmail
}
if (this.$route.path.includes('reset-password')) {
this.displaySetup = textFields.reset
}
},
},
created() {
this.setDisplaySetup()
},
}
</script>

View File

@ -1,112 +0,0 @@
<template>
<div class="auth-template">
<auth-header @setAuthItem="setAuthItem" />
<b-row class="auth-template-content">
<b-col lg="6" md="none" sm="none">
<div class="bg-img-box d-none d-lg-block">
<!-- <b-img class="bg-img" src="/img/template/Foto_01.jpg"></b-img>-->
</div>
<div class="w-100 bg-txt-box d-none d-lg-block text-center align-self-center">
<div class="text-light h0">Dankbarkeit</div>
<div class="text-light h1">Die neue Währung</div>
<div class="text-light h2 text-uppercase">Für Einander, Für alle, Für die Natur</div>
<b-button variant="gradido">Erfahre mehr...</b-button>
</div>
</b-col>
<b-col lg="6" md="12" sm="12" class="pr-5">
<auth-item :type="itemType">
<template #AUTH_LOGIN>
<auth-login @setAuthItem="setAuthItem" />
</template>
<br />
<br />
<template #AUTH_REGISTER>
<auth-register :itemType="itemType" />
</template>
<br />
<br />
<template #AUTH_FORGOT_PASSWORD>
<auth-forgot-password :itemType="itemType" />
</template>
<br />
<br />
<template #AUTH_RESET_PASSWORD>
<auth-reset-password :itemType="itemType" />
</template>
</auth-item>
</b-col>
</b-row>
<!-- <auth-layout-gdd />-->
</div>
</template>
<script>
import AuthItem from '@/components/Auth/AuthItem'
import AuthHeader from '@/components/Auth/Header.vue'
import AuthLogin from '@/components/Auth/Login.vue'
import AuthRegister from '@/components/Auth/Register.vue'
import AuthForgotPassword from '@/components/Auth/ForgotPassword.vue'
import AuthResetPassword from '@/components/Auth/ResetPassword.vue'
// import AuthLayoutGdd from '@/layouts/AuthLayout_gdd.vue'
export default {
name: 'AuthTemplate',
components: {
AuthItem,
AuthHeader,
AuthLogin,
AuthRegister,
AuthForgotPassword,
AuthResetPassword,
// AuthLayoutGdd,
},
data() {
return {
itemType: 'AUTH_LOGIN',
}
},
methods: {
setAuthItem(item) {
// console.log('item', item)
this.itemType = item
},
},
}
</script>
<style lang="scss">
.auth-template {
height: 92%;
}
.auth-template-content {
height: 100%;
}
.auth-header {
z-index: 1000;
}
.bg-img-box {
margin-top: -178px;
margin-left: -80px;
position: absolute;
top: 0px;
bottom: 0px;
min-width: 600px;
max-width: 800px;
background-color: bisque;
border-radius: 0% 50% 70% 0% / 50% 70% 70% 50%;
}
.bg-txt-box {
position: inherit;
padding-top: 30%;
height: auto;
}
.bg-txt-box > .h0 {
font-size: 4em;
}
.bg-img {
width: 100%;
border-radius: 0% 50% 70% 0% / 50% 70% 70% 50%;
overflow: hidden;
}
</style>