From 4063984e563b3c98c683135416a8d231de269e8e Mon Sep 17 00:00:00 2001 From: yogesh_gohil Date: Tue, 12 Nov 2019 20:09:45 +0530 Subject: [PATCH] fix small issues --- resources/assets/js/plugins/en.js | 1 + resources/assets/js/views/auth/Login.vue | 13 ++++++++--- .../assets/js/views/customers/Create.vue | 23 +++++++++++-------- .../assets/js/views/settings/UserProfile.vue | 6 ++++- .../assets/js/views/wizard/UserProfile.vue | 4 +++- resources/assets/sass/pages/wizard.scss | 3 +++ 6 files changed, 35 insertions(+), 15 deletions(-) diff --git a/resources/assets/js/plugins/en.js b/resources/assets/js/plugins/en.js index 76fab629..c8cd68d6 100644 --- a/resources/assets/js/plugins/en.js +++ b/resources/assets/js/plugins/en.js @@ -745,6 +745,7 @@ export default { invalid_url: 'Invalid url (ex: http://www.crater.com)', required: 'Field is required', email_incorrect: 'Incorrect Email.', + email_already_taken: 'The email has already been taken.', email_does_not_exist: "User with given email doesn't exist", send_reset_link: 'Send Reset Link', not_yet: 'Not yet? Send it again', diff --git a/resources/assets/js/views/auth/Login.vue b/resources/assets/js/views/auth/Login.vue index 5e253b38..62cca10a 100644 --- a/resources/assets/js/views/auth/Login.vue +++ b/resources/assets/js/views/auth/Login.vue @@ -12,10 +12,15 @@ focus type="email" name="email" + @input="$v.loginData.email.$touch()" />
- {{ $tc('validation.required') }} - {{ $tc('validation.email_incorrect') }} + + {{ $tc('validation.required') }} + + + {{ $tc('validation.email_incorrect') }} +
@@ -25,8 +30,10 @@ :invalid="$v.loginData.password.$error" type="password" name="password" + show-password + @input="$v.loginData.password.$touch()" /> -
+
{{ $tc('validation.required') }} {{ $tc('validation.password_min_length', $v.loginData.password.$params.minLength.min, {count: $v.loginData.password.$params.minLength.min}) }}
diff --git a/resources/assets/js/views/customers/Create.vue b/resources/assets/js/views/customers/Create.vue index f01bf58f..52d02b00 100644 --- a/resources/assets/js/views/customers/Create.vue +++ b/resources/assets/js/views/customers/Create.vue @@ -624,17 +624,20 @@ export default { this.isLoading = true this.formData.currency_id = this.currency.id } - - let response = await this.addCustomer(this.formData) - - if (response.data.success) { - window.toastr['success'](this.$t('customers.created_message')) - this.$router.push('/admin/customers') - this.isLoading = false - return true + try { + let response = await this.addCustomer(this.formData) + if (response.data.success) { + window.toastr['success'](this.$t('customers.created_message')) + this.$router.push('/admin/customers') + this.isLoading = false + return true + } + } catch (err) { + if (err.response.data.errors.email) { + this.isLoading = false + window.toastr['error'](this.$t('validation.email_already_taken')) + } } - - window.toastr['error'](response.data.error) } }, async fetchBillingState () { diff --git a/resources/assets/js/views/settings/UserProfile.vue b/resources/assets/js/views/settings/UserProfile.vue index 1fef2107..ce3df042 100644 --- a/resources/assets/js/views/settings/UserProfile.vue +++ b/resources/assets/js/views/settings/UserProfile.vue @@ -43,6 +43,9 @@ type="password" @input="$v.formData.password.$touch()" /> +
+ {{ $tc('validation.password_min_length', $v.formData.password.$params.minLength.min, {count: $v.formData.password.$params.minLength.min}) }} +
@@ -78,7 +81,7 @@