From f7eb1605092301921632d6df6996d5ee35e35661 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 28 Nov 2021 16:04:38 +0100 Subject: [PATCH 01/19] fix: move forgot password link next to password label In some languages, the texts on the "log in" and "register" buttons were so long they wrapped underneath each other. Moving the "forgot password" link next to the password label leaves these two buttons enough space to always stay next to each other. --- src/views/user/Login.vue | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/src/views/user/Login.vue b/src/views/user/Login.vue index 127e673a..2a4ae3f4 100644 --- a/src/views/user/Login.vue +++ b/src/views/user/Login.vue @@ -20,11 +20,21 @@ autocomplete="username" v-focus @keyup.enter="submit" + tabindex="1" />
- +
@@ -52,6 +63,7 @@ type="text" v-focus @keyup.enter="submit" + tabindex="3" /> @@ -61,6 +73,7 @@ {{ $t('user.auth.login') }} @@ -68,15 +81,11 @@ :to="{ name: 'user.register' }" v-if="registrationEnabled" type="secondary" + tabindex="5" > {{ $t('user.auth.register') }} -
- - {{ $t('user.auth.forgotPassword') }} - -
@@ -227,6 +236,15 @@ export default { .reset-password-link { display: inline-block; - padding-top: 5px; +} + +.label-with-link { + display: flex; + justify-content: space-between; + margin-bottom: .5rem; + + .label { + margin-bottom: 0; + } } From 05e054f501be1a73d63788468a995f092d279e43 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 28 Nov 2021 16:33:03 +0100 Subject: [PATCH 02/19] feat: improve input validation for register form --- src/helpers/isEmail.ts | 6 +++++ src/i18n/lang/en.json | 6 +++-- src/icons.js | 4 +++ src/views/user/Register.vue | 49 +++++++++++++++++++++++++++++++++---- 4 files changed, 58 insertions(+), 7 deletions(-) create mode 100644 src/helpers/isEmail.ts diff --git a/src/helpers/isEmail.ts b/src/helpers/isEmail.ts new file mode 100644 index 00000000..08957d0f --- /dev/null +++ b/src/helpers/isEmail.ts @@ -0,0 +1,6 @@ +export function isEmail(email: string): Boolean { + const format = /^.+@.+$/ + const match = email.match(format) + + return match === null ? false : match.length > 0 +} diff --git a/src/i18n/lang/en.json b/src/i18n/lang/en.json index 56a4bd11..2aeea991 100644 --- a/src/i18n/lang/en.json +++ b/src/i18n/lang/en.json @@ -34,7 +34,6 @@ "email": "E-mail address", "emailPlaceholder": "e.g. frederic{'@'}vikunja.io", "password": "Password", - "passwordRepeat": "Retype your password", "passwordPlaceholder": "e.g. •••••••••••", "forgotPassword": "Forgot your password?", "resetPassword": "Reset your password", @@ -50,7 +49,10 @@ "authenticating": "Authenticating…", "openIdStateError": "State does not match, refusing to continue!", "openIdGeneralError": "An error occured while authenticating against the third party.", - "logout": "Logout" + "logout": "Logout", + "emailInvalid": "Please enter a valid email address.", + "usernameRequired": "Please provide a username.", + "passwordRequired": "Please provide a password." }, "settings": { "title": "Settings", diff --git a/src/icons.js b/src/icons.js index 48ef230c..89e1d1a3 100644 --- a/src/icons.js +++ b/src/icons.js @@ -16,6 +16,8 @@ import { faCocktail, faCoffee, faCog, + faEye, + faEyeSlash, faEllipsisH, faEllipsisV, faExclamation, @@ -87,6 +89,8 @@ library.add(faCocktail) library.add(faCoffee) library.add(faCog) library.add(faComments) +library.add(faEye) +library.add(faEyeSlash) library.add(faEllipsisH) library.add(faEllipsisV) library.add(faExclamation) diff --git a/src/views/user/Register.vue b/src/views/user/Register.vue index ef9f4a15..a3a74da7 100644 --- a/src/views/user/Register.vue +++ b/src/views/user/Register.vue @@ -18,8 +18,12 @@ v-focus v-model="credentials.username" @keyup.enter="submit" + @focusout="validateUsername" /> +

+ {{ $t('user.auth.usernameRequired') }} +

@@ -33,12 +37,16 @@ type="email" v-model="credentials.email" @keyup.enter="submit" + @focusout="validateEmail" />
+

+ {{ $t('user.auth.emailInvalid') }} +

-
+
+

+ {{ $t('user.auth.passwordRequired') }} +

@@ -76,6 +88,7 @@ id="register-submit" @click="submit" class="mr-2" + :disabled="!everythingValid" > {{ $t('user.auth.register') }} @@ -89,12 +102,14 @@ + + From 1d916e7e03add8f8a4f8e809eed7600080bd3579 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sun, 28 Nov 2021 16:35:59 +0100 Subject: [PATCH 04/19] feat: change wording --- src/i18n/lang/en.json | 6 +++--- src/router/index.ts | 2 +- src/views/user/Login.vue | 2 +- src/views/user/Register.vue | 5 +---- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/i18n/lang/en.json b/src/i18n/lang/en.json index 2aeea991..2c1fdf26 100644 --- a/src/i18n/lang/en.json +++ b/src/i18n/lang/en.json @@ -31,7 +31,7 @@ "username": "Username", "usernameEmail": "Username Or Email Address", "usernamePlaceholder": "e.g. frederick", - "email": "E-mail address", + "email": "Email address", "emailPlaceholder": "e.g. frederic{'@'}vikunja.io", "password": "Password", "passwordPlaceholder": "e.g. •••••••••••", @@ -44,7 +44,7 @@ "totpTitle": "Two Factor Authentication Code", "totpPlaceholder": "e.g. 123456", "login": "Login", - "register": "Register", + "createAccount": "Create account", "loginWith": "Log in with {provider}", "authenticating": "Authenticating…", "openIdStateError": "State does not match, refusing to continue!", @@ -63,7 +63,7 @@ "currentPasswordPlaceholder": "Your current password", "passwordsDontMatch": "The new password and its confirmation don't match.", "passwordUpdateSuccess": "The password was successfully updated.", - "updateEmailTitle": "Update Your E-Mail Address", + "updateEmailTitle": "Update Your Email Address", "updateEmailNew": "New Email Address", "updateEmailSuccess": "Your email address was successfully updated. We've sent you a link to confirm it.", "general": { diff --git a/src/router/index.ts b/src/router/index.ts index 21e4a96a..cf126b5a 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -132,7 +132,7 @@ const router = createRouter({ name: 'user.register', component: RegisterComponent, meta: { - title: 'user.auth.register', + title: 'user.auth.createAccount', }, }, { diff --git a/src/views/user/Login.vue b/src/views/user/Login.vue index 2a4ae3f4..b525cf02 100644 --- a/src/views/user/Login.vue +++ b/src/views/user/Login.vue @@ -83,7 +83,7 @@ type="secondary" tabindex="5" > - {{ $t('user.auth.register') }} + {{ $t('user.auth.createAccount') }}
diff --git a/src/views/user/Register.vue b/src/views/user/Register.vue index dbe5d482..ea78f24b 100644 --- a/src/views/user/Register.vue +++ b/src/views/user/Register.vue @@ -77,7 +77,7 @@ class="mr-2" :disabled="!everythingValid" > - {{ $t('user.auth.register') }} + {{ $t('user.auth.createAccount') }} {{ $t('user.auth.login') }} @@ -91,7 +91,6 @@ - - From fda0b81d9c653a1a93803a98582ebe9b10f3f433 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 11 Dec 2021 21:57:54 +0100 Subject: [PATCH 07/19] feat: add tooltip and aria-label --- src/i18n/lang/en.json | 4 +++- src/views/user/Login.vue | 6 +++++- src/views/user/Register.vue | 6 +++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/i18n/lang/en.json b/src/i18n/lang/en.json index 2c1fdf26..7fecb029 100644 --- a/src/i18n/lang/en.json +++ b/src/i18n/lang/en.json @@ -52,7 +52,9 @@ "logout": "Logout", "emailInvalid": "Please enter a valid email address.", "usernameRequired": "Please provide a username.", - "passwordRequired": "Please provide a password." + "passwordRequired": "Please provide a password.", + "showPassword": "Show the password", + "hidePassword": "Hide the password" }, "settings": { "title": "Settings", diff --git a/src/views/user/Login.vue b/src/views/user/Login.vue index 145e2c66..6be2e783 100644 --- a/src/views/user/Login.vue +++ b/src/views/user/Login.vue @@ -53,7 +53,11 @@ tabindex="2" @focusout="validateField('password')" /> - + diff --git a/src/views/user/Register.vue b/src/views/user/Register.vue index ce994220..29ebed5b 100644 --- a/src/views/user/Register.vue +++ b/src/views/user/Register.vue @@ -59,7 +59,11 @@ @keyup.enter="submit" @focusout="validatePassword" /> - + From a1814ea29d74631f7befb5d51d85b2a16d1741a3 Mon Sep 17 00:00:00 2001 From: kolaente Date: Sat, 11 Dec 2021 22:08:26 +0100 Subject: [PATCH 08/19] fix: message spacing --- src/views/user/Login.vue | 11 +++++++++-- src/views/user/PasswordReset.vue | 4 ++-- src/views/user/Register.vue | 2 +- src/views/user/RequestPasswordReset.vue | 4 ++-- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/views/user/Login.vue b/src/views/user/Login.vue index 6be2e783..a59805f0 100644 --- a/src/views/user/Login.vue +++ b/src/views/user/Login.vue @@ -1,9 +1,9 @@