From df40fc91729ebd66941705637b440033036c8b8e Mon Sep 17 00:00:00 2001
From: Carl Schwan
Date: Thu, 1 Sep 2022 01:11:25 +0200
Subject: [PATCH] Use new vue components in login form
- Improve accessibility
- Simply code
Signed-off-by: Carl Schwan
---
core/css/guest.css | 42 -------
core/src/components/login/LoginForm.vue | 132 +++++++++-----------
core/src/components/login/ResetPassword.vue | 58 +++++----
core/src/views/Login.vue | 17 +--
4 files changed, 101 insertions(+), 148 deletions(-)
diff --git a/core/css/guest.css b/core/css/guest.css
index 813e04db213..5ef3d865694 100644
--- a/core/css/guest.css
+++ b/core/css/guest.css
@@ -108,14 +108,6 @@ form {
margin: auto;
padding: 0;
}
-form fieldset {
- width: 260px;
- margin-top: 8px;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- user-select: none;
-}
form #sqliteInformation {
margin-top: 0px;
margin-bottom: 20px;
@@ -160,9 +152,6 @@ form #datadirField legend {
.wrapper {
margin-top: 0;
}
- .alternative-logins {
- margin: auto;
- }
}
@@ -262,9 +251,6 @@ input[type='email'] {
color: var(--color-text-lighter);
cursor: text;
font-family: inherit;
- -webkit-appearance: textfield;
- -moz-appearance: textfield;
- box-sizing: content-box;
font-weight: normal;
margin-left: 0;
margin-right: 0;
@@ -491,34 +477,6 @@ form .warning input[type='checkbox']+label {
color: var(--color-primary-text);
}
-/* Alternative Logins */
-.alternative-logins legend {
- margin-bottom: 10px;
-}
-.alternative-logins li {
- height: 40px;
- white-space: nowrap;
- padding: 05px;
-}
-.alternative-logins a.button,
-.alternative-logins li a {
- width: 100%;
- display: inline-block;
- text-align: center;
- box-sizing: border-box;
- border: 2px solid var(--color-primary-text);
- background-color: var(--color-primary);
- color: var(--color-primary-text);
- border-radius: 100px; /* --border-radius-pill */
-}
-
-.alternative-logins a.button:focus,
-.alternative-logins li a:focus {
- border: 2px solid var(--color-primary-hover);
- background-image: linear-gradient(40deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
- background-position: initial;
-}
-
/* fixes for update page TODO should be fixed some time in a proper way */
/* this is just for an error while updating the ownCloud instance */
.updateProgress .error {
diff --git a/core/src/components/login/LoginForm.vue b/core/src/components/login/LoginForm.vue
index 88a465d1aa5..6d33d37d5c8 100644
--- a/core/src/components/login/LoginForm.vue
+++ b/core/src/components/login/LoginForm.vue
@@ -21,11 +21,12 @@
-
+
{{ t('core', 'A password reset message has been sent to the email address of this account. If you do not receive it, check your spam/junk folders or ask your local administrator for help.') }}
{{ t('core', 'If it is not there ask your local administrator.') }}
-
-
+
+
{{ t('core', 'Couldn\'t send reset email. Please contact your administrator.') }}
-
-
+
+
{{ t('core', 'Password cannot be changed. Please contact your administrator.') }}
-
+
@@ -66,11 +62,15 @@
import axios from '@nextcloud/axios'
import { generateUrl } from '@nextcloud/router'
import LoginButton from './LoginButton.vue'
+import NcTextField from '@nextcloud/vue/dist/Components/NcTextField.js'
+import NcNoteCard from '@nextcloud/vue/dist/Components/NcNoteCard.js'
export default {
name: 'ResetPassword',
components: {
LoginButton,
+ NcNoteCard,
+ NcTextField,
},
props: {
username: {
@@ -131,7 +131,15 @@ export default {
diff --git a/core/src/views/Login.vue b/core/src/views/Login.vue
index 0cc8dc39cca..c42d5acced1 100644
--- a/core/src/views/Login.vue
+++ b/core/src/views/Login.vue
@@ -192,6 +192,9 @@ export default {