Skip to content

Conversation

@Parth910
Copy link
Member

@Parth910 Parth910 commented Aug 11, 2019

Fixes #3289

Short description of what this resolves:

In the profile section, a phone number was a compulsory field, so I made it an optional field

Checklist

  • I have read the Contribution & Best practices Guide.
  • My branch is up-to-date with the Upstream development branch.
  • The acceptance, integration, unit tests and linter pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Copy link
Member

@kushthedude kushthedude left a comment

Choose a reason for hiding this comment

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

Removing validation does not make a field optional, Read more about UI Validations.

@Parth910
Copy link
Member Author

@kushthedude yes that's true, but here it was the compulsory field made by validation so no other way to make it optional.

@kushthedude
Copy link
Member

@kushthedude yes that's true, but here it was the compulsory field made by validation so no other way to make it optional.

Are you sure ?

},
{
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 email ID')
}
]
},
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.

@kushthedude kushthedude changed the title user profile update:phone number compulsory field remove fix: phone number compulsory field remove Aug 11, 2019
@auto-label auto-label bot added the fix label Aug 11, 2019
Copy link
Member

@kushthedude kushthedude left a comment

Choose a reason for hiding this comment

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

Dont change the other linea

@fossasia fossasia deleted a comment Aug 11, 2019
@Parth910 Parth910 closed this Aug 11, 2019
@Parth910 Parth910 reopened this Aug 11, 2019
optional : true,
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

},
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?

@abhinavk96 abhinavk96 merged commit 1c3c4bf into fossasia:development Aug 13, 2019
@mrsaicharan1
Copy link
Member

mrsaicharan1 commented Aug 13, 2019

@Parth910 Just a pointer. Make sure that you link the issues properly in the description(Fixes #3378). This helps in closing the issue automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compulsory phone number when updating profile details

5 participants