From 7afbc8dc3c1f3cd4b6aaed2247564043864de34e Mon Sep 17 00:00:00 2001 From: elweyn Date: Tue, 23 Nov 2021 09:36:10 +0100 Subject: [PATCH] Implemented a switch for reset & checkEmail so that both send to ResetPassword.vue but show different textes. --- frontend/src/views/Pages/ResetPassword.vue | 34 ++++++++++++++++++---- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/frontend/src/views/Pages/ResetPassword.vue b/frontend/src/views/Pages/ResetPassword.vue index 81b3d7df7..15c14b5ac 100644 --- a/frontend/src/views/Pages/ResetPassword.vue +++ b/frontend/src/views/Pages/ResetPassword.vue @@ -8,10 +8,10 @@

{{ $t('settings.password.reset') }}

- {{ $t('settings.password.reset-password.text') }} + {{ $t(displaySetup.authenticated) }} - {{ $t('settings.password.reset-password.not-authenticated') }} + {{ $t(displaySetup.notAuthenticated) }}
@@ -29,7 +29,7 @@
- {{ $t('settings.password.reset') }} + {{ $t(displaySetup.button) }}
@@ -38,9 +38,9 @@ - + - {{ $t('back') }} + {{ $t('back') }} @@ -51,6 +51,25 @@ import InputPasswordConfirmation from '../../components/Inputs/InputPasswordConf import { loginViaEmailVerificationCode } from '../../graphql/queries' import { resetPassword } from '../../graphql/mutations' +const textFields = { + reset: { + authenticated: 'settings.password.reset-password.text', + notAuthenticated: 'settings.password.not-authenticated', + button: 'settings.password.reset', + linkTo: '/login', + }, + checkEmail: { + authenticated: 'settings.password.set-password.text', + notAuthenticated: 'settings.password.not-authenticated', + button: 'settings.password.set', + linkTo: '/login', + }, + login: { + headline: 'site.thx.errorTitle', + subtitle: 'site.thx.activateEmail', + }, +} + export default { name: 'ResetPassword', components: { @@ -67,6 +86,7 @@ export default { email: null, pending: true, register: false, + displaySetup: {}, } }, methods: { @@ -111,9 +131,13 @@ export default { loader.hide() this.pending = false }, + setDisplaySetup(from) { + this.displaySetup = textFields[this.$route.params.comingFrom] + }, }, mounted() { this.authenticate() + this.setDisplaySetup() }, }