diff --git a/webapp/components/PasswordReset/VerifyNonce.spec.js b/webapp/components/EnterNonce/EnterNonce.spec.js similarity index 67% rename from webapp/components/PasswordReset/VerifyNonce.spec.js rename to webapp/components/EnterNonce/EnterNonce.spec.js index ebe552f0d..67f1f9073 100644 --- a/webapp/components/PasswordReset/VerifyNonce.spec.js +++ b/webapp/components/EnterNonce/EnterNonce.spec.js @@ -1,12 +1,12 @@ import { mount, createLocalVue } from '@vue/test-utils' -import VerifyNonce from './VerifyNonce.vue' +import EnterNonce from './EnterNonce.vue' import Styleguide from '@human-connection/styleguide' const localVue = createLocalVue() localVue.use(Styleguide) -describe('VerifyNonce ', () => { +describe('EnterNonce ', () => { let wrapper let Wrapper let mocks @@ -25,28 +25,28 @@ describe('VerifyNonce ', () => { beforeEach(jest.useFakeTimers) Wrapper = () => { - return mount(VerifyNonce, { + return mount(EnterNonce, { mocks, localVue, propsData, }) } - it('renders a verify nonce form', () => { + it('renders an enter nonce form', () => { wrapper = Wrapper() - expect(wrapper.find('.verify-nonce').exists()).toBe(true) + expect(wrapper.find('form').exists()).toBe(true) }) - describe('after verification nonce given', () => { + describe('after nonce entered', () => { beforeEach(() => { wrapper = Wrapper() wrapper.find('input#nonce').setValue('123456') wrapper.find('form').trigger('submit') }) - it('emits `verification`', () => { + it('emits `nonceEntered`', () => { const expected = [[{ nonce: '123456', email: 'mail@example.org' }]] - expect(wrapper.emitted('verification')).toEqual(expected) + expect(wrapper.emitted('nonceEntered')).toEqual(expected) }) }) }) diff --git a/webapp/components/EnterNonce/EnterNonce.vue b/webapp/components/EnterNonce/EnterNonce.vue new file mode 100644 index 000000000..a70c137cb --- /dev/null +++ b/webapp/components/EnterNonce/EnterNonce.vue @@ -0,0 +1,65 @@ + + + diff --git a/webapp/components/PasswordReset/ChangePassword.spec.js b/webapp/components/PasswordReset/ChangePassword.spec.js index e93d5d00d..b5d85dea7 100644 --- a/webapp/components/PasswordReset/ChangePassword.spec.js +++ b/webapp/components/PasswordReset/ChangePassword.spec.js @@ -39,7 +39,7 @@ describe('ChangePassword ', () => { }) } - describe('given email and verification nonce', () => { + describe('given email and nonce', () => { beforeEach(() => { propsData.email = 'mail@example.org' propsData.nonce = '123456' @@ -66,7 +66,7 @@ describe('ChangePassword ', () => { describe('password reset successful', () => { it('displays success message', () => { - const expected = 'verify-nonce.form.change-password.success' + const expected = 'components.password-reset.change-password.success' expect(mocks.$t).toHaveBeenCalledWith(expected) }) diff --git a/webapp/components/PasswordReset/ChangePassword.vue b/webapp/components/PasswordReset/ChangePassword.vue index 3de4f048a..a98026b2e 100644 --- a/webapp/components/PasswordReset/ChangePassword.vue +++ b/webapp/components/PasswordReset/ChangePassword.vue @@ -1,54 +1,58 @@ diff --git a/webapp/components/Registration/Signup.spec.js b/webapp/components/Registration/Signup.spec.js index ed78d47a2..48b70a15f 100644 --- a/webapp/components/Registration/Signup.spec.js +++ b/webapp/components/Registration/Signup.spec.js @@ -42,7 +42,7 @@ describe('Signup', () => { describe('without invitation code', () => { it('renders signup form', () => { wrapper = Wrapper() - expect(wrapper.find('.signup').exists()).toBe(true) + expect(wrapper.find('form').exists()).toBe(true) }) describe('submit', () => { diff --git a/webapp/components/Registration/Signup.vue b/webapp/components/Registration/Signup.vue index 2924183da..bba984e0e 100644 --- a/webapp/components/Registration/Signup.vue +++ b/webapp/components/Registration/Signup.vue @@ -8,7 +8,9 @@ :schema="formSchema" @submit="handleSubmit" > -

{{ invitation ? $t('profile.invites.title') : $t('registration.signup.title') }}

+

+ {{ invitation ? $t('profile.invites.title') : $t('components.registration.signup.title') }} +

@@ -17,7 +19,7 @@ {{ invitation ? $t('profile.invites.description') - : $t('registration.signup.form.description') + : $t('components.registration.signup.form.description') }} @@ -38,7 +40,7 @@ type="submit" icon="envelope" > - {{ $t('registration.signup.form.submit') }} + {{ $t('components.registration.signup.form.submit') }}
diff --git a/webapp/locales/de.json b/webapp/locales/de.json index 0d317402b..fc8cd8a69 100644 --- a/webapp/locales/de.json +++ b/webapp/locales/de.json @@ -1,4 +1,49 @@ { + "components": { + "password-reset": { + "request": { + "form": { + "description": "Eine Mail zum Zurücksetzen des Passworts wird an die angegebene E-Mail Adresse geschickt.", + "submit": "Email anfordern", + "submitted": "Eine E-Mail mit weiteren Instruktionen wurde verschickt an {email}" + } + }, + "change-password": { + "success": "Änderung des Passworts war erfolgreich!", + "error": "Passwort Änderung fehlgeschlagen. Möglicherweise falscher Sicherheitscode?", + "help": "Falls Probleme auftreten, schreib uns gerne eine Mail an:" + } + }, + "enter-nonce": { + "form": { + "nonce": "Code eingeben", + "description": "Öffne dein E-Mail Postfach und gib den Code ein, den wir geschickt haben.", + "next": "Weiter", + "validations": { + "length": "muss genau 6 Buchstaben lang sein" + } + } + }, + "registration": { + "signup": { + "title": "Mach mit bei Human Connection!", + "form": { + "description": "Um loszulegen, gib deine E-Mail Adresse ein:", + "invitation-code": "Dein Einladungscode lautet: {code}", + "errors": { + "email-exists": "Es gibt schon ein Benutzerkonto mit dieser E-Mail Adresse!", + "invalid-invitation-token": "Es sieht so aus, als ob der Einladungscode schon eingelöst wurde. Jeder Code kann nur einmalig benutzt werden." + }, + "submit": "Konto erstellen", + "success": "Eine Mail mit einem Bestätigungslink für die Registrierung wurde an {email} geschickt" + } + }, + "create-user-account": { + "title": "Benutzerkonto anlegen", + "success": "Dein Benutzerkonto wurde erstellt!" + } + } + }, "maintenance": { "title": "Human Connection befindet sich in der Wartung", "explanation": "Zurzeit führen wir einige geplante Wartungsarbeiten durch, bitte versuch es später erneut.", @@ -42,7 +87,7 @@ "bank": "Bankverbindung", "germany": "Deutschland", "code-of-conduct": "Verhaltenscodex", - "login": "Zurück zum Anmeldung" + "back-to-login": "Zurück zur Anmeldung" }, "sorting": { "newest": "Neueste", @@ -63,45 +108,6 @@ "hello": "Hallo", "success": "Du bist eingeloggt!" }, - "password-reset": { - "form": { - "description": "Eine Mail zum Zurücksetzen des Passworts wird an die angegebene E-Mail Adresse geschickt.", - "submit": "Email anfordern", - "submitted": "Eine E-Mail mit weiteren Instruktionen wurde verschickt an {email}" - } - }, - "registration": { - "signup": { - "title": "Mach mit bei Human Connection!", - "form": { - "description": "Um loszulegen, gib deine E-Mail Adresse ein:", - "invitation-code": "Dein Einladungscode lautet: {code}", - "errors": { - "email-exists": "Es gibt schon ein Benutzerkonto mit dieser E-Mail Adresse!", - "invalid-invitation-token": "Es sieht so aus, als ob der Einladungscode schon eingelöst wurde. Jeder Code kann nur einmalig benutzt werden." - }, - "submit": "Konto erstellen", - "success": "Eine Mail mit einem Bestätigungslink für die Registrierung wurde an {email} geschickt" - }, - "back-to-login": "Zurück zur Anmeldung" - }, - "create-user-account": { - "title": "Benutzerkonto anlegen", - "success": "Dein Benutzerkonto wurde erstellt!" - } - }, - "verify-nonce": { - "form": { - "nonce": "Code eingeben", - "description": "Öffne dein E-Mail Postfach und gib den Code ein, den wir geschickt haben.", - "next": "Weiter", - "change-password": { - "success": "Änderung des Passworts war erfolgreich!", - "error": "Passwort Änderung fehlgeschlagen. Möglicherweise falscher Sicherheitscode?", - "help": "Falls Probleme auftreten, schreib uns gerne eine Mail an:" - } - } - }, "editor": { "placeholder": "Schreib etwas Inspirierendes …", "mention": { @@ -400,8 +406,7 @@ "reportContent": "Melden", "validations": { "email": "muss eine gültige E-Mail Adresse sein", - "url": "muss eine gültige URL sein", - "verification-nonce": "muss genau 6 Buchstaben lang sein" + "url": "muss eine gültige URL sein" } }, "actions": { diff --git a/webapp/locales/en.json b/webapp/locales/en.json index 8ba1edad5..bcbff1861 100644 --- a/webapp/locales/en.json +++ b/webapp/locales/en.json @@ -1,4 +1,50 @@ { + "components": { + "password-reset": { + "request": { + "title": "Reset your password", + "form": { + "description": "A password reset email will be sent to the given email address.", + "submit": "Request email", + "submitted": "An email with further instructions has been sent to {email}" + } + }, + "change-password": { + "success": "Changing your password was successful!", + "error": "Changing your password failed. Maybe the security code was not correct?", + "help": "In case of problems, feel free to ask for help by sending us a mail to:" + } + }, + "enter-nonce": { + "form": { + "nonce": "Enter your code", + "description": "Open your inbox and enter the code that we've sent to you.", + "next": "Continue", + "validations": { + "length": "must be 6 characters long" + } + } + }, + "registration": { + "signup": { + "title": "Join Human Connection!", + "form": { + "description": "To get started, enter your email address:", + "invitation-code": "Your invitation code is: {code}", + "errors": { + "email-exists": "There is already a user account with this email address!", + "invalid-invitation-token": "It looks like as if the invitation has been used already. Invitation links can only be used once." + }, + "submit": "Create an account", + "success": "A mail with a link to complete your registration has been sent to {email}" + } + }, + "create-user-account": { + "title": "Create user account", + "success": "Your account has been created!" + } + } + }, "maintenance": { "title": "Human Connection is under maintenance", "explanation": "At the moment we are doing some scheduled maintenance, please try again later.", @@ -42,7 +88,7 @@ "bank": "bank account", "germany": "Germany", "code-of-conduct": "Code of Conduct", - "login": "Back to login" + "back-to-login": "Back to login page" }, "sorting": { "newest": "Newest", @@ -63,46 +109,6 @@ "hello": "Hello", "success": "You are logged in!" }, - "password-reset": { - "title": "Reset your password", - "form": { - "description": "A password reset email will be sent to the given email address.", - "submit": "Request email", - "submitted": "An email with further instructions has been sent to {email}" - } - }, - "registration": { - "signup": { - "title": "Join Human Connection!", - "form": { - "description": "To get started, enter your email address:", - "invitation-code": "Your invitation code is: {code}", - "errors": { - "email-exists": "There is already a user account with this email address!", - "invalid-invitation-token": "It looks like as if the invitation has been used already. Invitation links can only be used once." - }, - "submit": "Create an account", - "success": "A mail with a link to complete your registration has been sent to {email}" - }, - "back-to-login": "Back to login page" - }, - "create-user-account": { - "title": "Create user account", - "success": "Your account has been created!" - } - }, - "verify-nonce": { - "form": { - "nonce": "Enter your code", - "description": "Open your inbox and enter the code that we've sent to you.", - "next": "Continue", - "change-password": { - "success": "Changing your password was successful!", - "error": "Changing your password failed. Maybe the security code was not correct?", - "help": "In case of problems, feel free to ask for help by sending us a mail to:" - } - } - }, "editor": { "placeholder": "Leave your inspirational thoughts …", "mention": { @@ -401,8 +407,7 @@ "reportContent": "Report", "validations": { "email": "must be a valid email address", - "url": "must be a valid URL", - "verification-nonce": "must be 6 characters long" + "url": "must be a valid URL" } }, "actions": { diff --git a/webapp/locales/pl.json b/webapp/locales/pl.json index f6880e157..305487717 100644 --- a/webapp/locales/pl.json +++ b/webapp/locales/pl.json @@ -1,4 +1,31 @@ { + "components": { + "password-reset": { + "request": { + "title": "Zresetuj hasło", + "form": { + "description": "Na podany adres e-mail zostanie wysłany email z resetem hasła.", + "submit": "Poproś o wiadomość e-mail", + "submitted": "Na adres {email} została wysłana wiadomość z dalszymi instrukcjami." + } + }, + "change-password": { + "success": "Zmiana hasła zakończyła się sukcesem!", + "error": "Zmiana hasła nie powiodła się. Może kod bezpieczeństwa nie był poprawny?", + "help": "W przypadku problemów, zachęcamy do zwrócenia się o pomoc, wysyłając do nas wiadomość e-mail:" + } + }, + "enter-nonce": { + "form": { + "nonce": "Wprowadź swój kod", + "description": "Otwórz swoją skrzynkę odbiorczą i wpisz kod, który do Ciebie wysłaliśmy.", + "next": "Kontynuuj", + "validations": { + "length": "musi mieć długość 6 znaków." + } + } + } + }, "filter-menu": { "title": "Twoja bańka filtrująca" }, @@ -29,26 +56,6 @@ "moreInfoHint": "idź po więcej szczegółów", "hello": "Cześć" }, - "password-reset": { - "title": "Zresetuj hasło", - "form": { - "description": "Na podany adres e-mail zostanie wysłany email z resetem hasła.", - "submit": "Poproś o wiadomość e-mail", - "submitted": "Na adres {email} została wysłana wiadomość z dalszymi instrukcjami." - } - }, - "verify-nonce": { - "form": { - "nonce": "Wprowadź swój kod", - "description": "Otwórz swoją skrzynkę odbiorczą i wpisz kod, który do Ciebie wysłaliśmy.", - "next": "Kontynuuj", - "change-password": { - "success": "Zmiana hasła zakończyła się sukcesem!", - "error": "Zmiana hasła nie powiodła się. Może kod bezpieczeństwa nie był poprawny?", - "help": "W przypadku problemów, zachęcamy do zwrócenia się o pomoc, wysyłając do nas wiadomość e-mail:" - } - } - }, "editor": { "placeholder": "Napisz coś inspirującego..." }, @@ -236,8 +243,7 @@ "loading": "załadunek", "reportContent": "Sprawozdanie", "validations": { - "email": "musi być ważny adres e-mail.", - "verification-nonce": "musi mieć długość 6 znaków." + "email": "musi być ważny adres e-mail." } }, "actions": { diff --git a/webapp/nuxt.config.js b/webapp/nuxt.config.js index f79e5982c..808c5982a 100644 --- a/webapp/nuxt.config.js +++ b/webapp/nuxt.config.js @@ -36,7 +36,7 @@ export default { 'login', 'logout', 'password-reset-request', - 'password-reset-verify-nonce', + 'password-reset-enter-nonce', 'password-reset-change-password', 'registration-signup', 'registration-enter-nonce', diff --git a/webapp/pages/password-reset.vue b/webapp/pages/password-reset.vue index e8f6ab4d6..df5ae39f9 100644 --- a/webapp/pages/password-reset.vue +++ b/webapp/pages/password-reset.vue @@ -1,17 +1,22 @@ + diff --git a/webapp/pages/password-reset/change-password.vue b/webapp/pages/password-reset/change-password.vue index 7ab124782..3efdd001b 100644 --- a/webapp/pages/password-reset/change-password.vue +++ b/webapp/pages/password-reset/change-password.vue @@ -3,7 +3,11 @@ :email="email" :nonce="nonce" @passwordResetResponse="handlePasswordResetResponse" - /> + > + + {{ $t('site.back-to-login') }} + +