From 34ce1bee5629e7970e4bedf73b44d9d609692a2b Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Thu, 31 Aug 2023 22:36:18 +0200 Subject: [PATCH 1/2] feat(webapp): create generic email field --- .../src/components/DonateDirectDebitForm.vue | 17 ++- .../src/components/Field/GenericEmail.vue | 101 ++++++++++++++++++ www/webapp/src/views/ChangeEmail.vue | 28 ++--- www/webapp/src/views/DeleteAccount.vue | 13 +-- www/webapp/src/views/HomePage.vue | 18 ++-- www/webapp/src/views/LoginPage.vue | 22 ++-- www/webapp/src/views/ResetPassword.vue | 27 ++--- www/webapp/src/views/SignUp.vue | 22 ++-- 8 files changed, 154 insertions(+), 94 deletions(-) create mode 100644 www/webapp/src/components/Field/GenericEmail.vue diff --git a/www/webapp/src/components/DonateDirectDebitForm.vue b/www/webapp/src/components/DonateDirectDebitForm.vue index f704400ec..cee529eb1 100644 --- a/www/webapp/src/components/DonateDirectDebitForm.vue +++ b/www/webapp/src/components/DonateDirectDebitForm.vue @@ -75,14 +75,10 @@ validate-on-blur /> - import axios from 'axios'; - import {email_pattern} from '@/validation'; import {digestError} from '@/utils'; import ErrorAlert from '@/components/ErrorAlert.vue'; - import {mdiAccount, mdiBank, mdiCash100, mdiEmail, mdiMessageTextOutline} from "@mdi/js"; + import {mdiAccount, mdiBank, mdiCash100, mdiMessageTextOutline} from "@mdi/js"; + import GenericEmail from "@/components/Field/GenericEmail.vue"; const HTTP = axios.create({ baseURL: '/api/v1/', @@ -112,6 +108,7 @@ export default { name: 'DonateDirectDebitForm', components: { + GenericEmail, ErrorAlert, }, data: () => ({ @@ -125,7 +122,6 @@ mdiBank, mdiCash100, mdiMessageTextOutline, - mdiEmail, /* from env */ creditorid: import.meta.env.VITE_APP_DESECSTACK_API_SEPA_CREDITOR_ID, @@ -154,7 +150,6 @@ /* email field */ email: '', - email_rules: [v => v === '' || !!email_pattern.test(v || '') || 'This is not an email address.'], email_errors: [], /* donation interval (every N months) */ diff --git a/www/webapp/src/components/Field/GenericEmail.vue b/www/webapp/src/components/Field/GenericEmail.vue new file mode 100644 index 000000000..a80cfd4e8 --- /dev/null +++ b/www/webapp/src/components/Field/GenericEmail.vue @@ -0,0 +1,101 @@ + + + diff --git a/www/webapp/src/views/ChangeEmail.vue b/www/webapp/src/views/ChangeEmail.vue index b36addecb..135608fa6 100644 --- a/www/webapp/src/views/ChangeEmail.vue +++ b/www/webapp/src/views/ChangeEmail.vue @@ -35,14 +35,10 @@

- - @@ -91,13 +80,13 @@ diff --git a/www/webapp/src/components/ResetPasswordActionHandler.vue b/www/webapp/src/components/ResetPasswordActionHandler.vue index 0d99830b6..f60d01369 100644 --- a/www/webapp/src/components/ResetPasswordActionHandler.vue +++ b/www/webapp/src/components/ResetPasswordActionHandler.vue @@ -1,19 +1,13 @@