Skip to content
Merged
5 changes: 3 additions & 2 deletions app/components/forms/user-profile-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,16 @@ export default Component.extend(FormMixin, {
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Parth910 Just add

optional  : true,

Rest is done

Copy link
Member Author

@Parth910 Parth910 Aug 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for help, I made some unwanted changes. I have made requested changes.

phone: {
identifier : 'phone',
optional : true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need optional here?

rules : [
{
type : 'empty',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the empty rule completely, optional and empty both don't make sense.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

prompt : this.l10n.t('Please enter a phone number.')
prompt : this.l10n.t('Please enter a phone number')
},
{
type : 'regExp',
value : validPhoneNumber,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that after removing an "empty" type, a validator can't allow empty input in the phone field. so I just remove it and add inputtype=number.

prompt : this.l10n.t('Please enter a valid phone number.')
prompt : this.l10n.t('Please enter a valid phone number')
}
]
}
Expand Down