From 67ab9092147a1922c7d947b401e5e43d93d11cf2 Mon Sep 17 00:00:00 2001 From: sundaram Date: Mon, 21 Sep 2020 20:59:30 +0530 Subject: [PATCH 1/4] making fields non-required --- .../forms/admin/settings/billing.js | 30 ------------------- .../forms/admin/settings/billing.hbs | 6 ++-- 2 files changed, 3 insertions(+), 33 deletions(-) diff --git a/app/components/forms/admin/settings/billing.js b/app/components/forms/admin/settings/billing.js index be195bad7f8..81fff177ae4 100644 --- a/app/components/forms/admin/settings/billing.js +++ b/app/components/forms/admin/settings/billing.js @@ -1,7 +1,6 @@ import classic from 'ember-classic-decorator'; import Component from '@ember/component'; import FormMixin from 'open-event-frontend/mixins/form'; -import { validPhoneNumber } from 'open-event-frontend/utils/validators'; import { action } from '@ember/object'; @classic @@ -12,25 +11,6 @@ export default class Billing extends Component.extend(FormMixin) { delay : false, on : 'blur', fields : { - adminBillingContactName: { - identifier : 'adminBillingContactName', - rules : [ - { - type : 'empty', - prompt : this.l10n.t('Please enter the Contact name') - } - ] - }, - adminBillingPhone: { - identifier : 'adminBillingPhone', - rules : [ - { - type : 'regExp', - value : validPhoneNumber, - prompt : this.l10n.t('Please enter a valid mobile number.') - } - ] - }, adminBillingEmail: { identifier : 'adminBillingEmail', rules : [ @@ -53,16 +33,6 @@ export default class Billing extends Component.extend(FormMixin) { } ] }, - - adminBillingTaxInfo: { - identifier : 'adminBillingTaxInfo', - rules : [ - { - type : 'empty', - prompt : this.l10n.t('Please enter the tax id') - } - ] - }, adminCompany: { identifier : 'adminCompany', rules : [ diff --git a/app/templates/components/forms/admin/settings/billing.hbs b/app/templates/components/forms/admin/settings/billing.hbs index 7f7bd148c18..73503f9779f 100644 --- a/app/templates/components/forms/admin/settings/billing.hbs +++ b/app/templates/components/forms/admin/settings/billing.hbs @@ -30,11 +30,11 @@ {{t 'Invoice Contact'}}
- +
- +
@@ -58,7 +58,7 @@
- +
From f6e249d656e0aee13ce36cc25c58145a50a32388 Mon Sep 17 00:00:00 2001 From: sundaram Date: Tue, 22 Sep 2020 08:20:06 +0530 Subject: [PATCH 2/4] making phone field to validate even if its optional --- app/components/forms/admin/settings/billing.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/components/forms/admin/settings/billing.js b/app/components/forms/admin/settings/billing.js index 81fff177ae4..3843d1679e9 100644 --- a/app/components/forms/admin/settings/billing.js +++ b/app/components/forms/admin/settings/billing.js @@ -1,6 +1,7 @@ import classic from 'ember-classic-decorator'; import Component from '@ember/component'; import FormMixin from 'open-event-frontend/mixins/form'; +import { validPhoneNumber } from 'open-event-frontend/utils/validators'; import { action } from '@ember/object'; @classic @@ -24,6 +25,17 @@ export default class Billing extends Component.extend(FormMixin) { } ] }, + adminBillingPhone: { + identifier : 'adminBillingPhone', + optional : true, + rules : [ + { + type : 'regExp', + value : validPhoneNumber, + prompt : this.l10n.t('Please enter a valid mobile number.') + } + ] + }, adminBillingCountry: { identifier : 'adminBillingCountry', rules : [ From 60523e430a7d1b2bf0cc9aef5a95a852da2381f6 Mon Sep 17 00:00:00 2001 From: sundaram Date: Tue, 22 Sep 2020 08:22:00 +0530 Subject: [PATCH 3/4] fix --- app/components/forms/admin/settings/billing.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/components/forms/admin/settings/billing.js b/app/components/forms/admin/settings/billing.js index 3843d1679e9..5789b394bbf 100644 --- a/app/components/forms/admin/settings/billing.js +++ b/app/components/forms/admin/settings/billing.js @@ -25,16 +25,16 @@ export default class Billing extends Component.extend(FormMixin) { } ] }, - adminBillingPhone: { - identifier : 'adminBillingPhone', + adminBillingPhone: { + identifier : 'adminBillingPhone', optional : true, - rules : [ - { - type : 'regExp', - value : validPhoneNumber, - prompt : this.l10n.t('Please enter a valid mobile number.') - } - ] + rules : [ + { + type : 'regExp', + value : validPhoneNumber, + prompt : this.l10n.t('Please enter a valid mobile number.') + } + ] }, adminBillingCountry: { identifier : 'adminBillingCountry', From 6a7a318250fd33957b59d12d3c3de4ddc38e1779 Mon Sep 17 00:00:00 2001 From: sundaram Date: Tue, 22 Sep 2020 08:46:32 +0530 Subject: [PATCH 4/4] cleaner --- .../forms/admin/settings/billing.js | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/components/forms/admin/settings/billing.js b/app/components/forms/admin/settings/billing.js index 5789b394bbf..59f6a609b1d 100644 --- a/app/components/forms/admin/settings/billing.js +++ b/app/components/forms/admin/settings/billing.js @@ -12,6 +12,17 @@ export default class Billing extends Component.extend(FormMixin) { delay : false, on : 'blur', fields : { + adminBillingPhone: { + identifier : 'adminBillingPhone', + optional : true, + rules : [ + { + type : 'regExp', + value : validPhoneNumber, + prompt : this.l10n.t('Please enter a valid mobile number.') + } + ] + }, adminBillingEmail: { identifier : 'adminBillingEmail', rules : [ @@ -25,17 +36,6 @@ export default class Billing extends Component.extend(FormMixin) { } ] }, - adminBillingPhone: { - identifier : 'adminBillingPhone', - optional : true, - rules : [ - { - type : 'regExp', - value : validPhoneNumber, - prompt : this.l10n.t('Please enter a valid mobile number.') - } - ] - }, adminBillingCountry: { identifier : 'adminBillingCountry', rules : [