-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: remove maxLength property for taxId and expiration date fields #8764
Changes from 7 commits
03624d7
e3509ae
a48ba65
50caa13
ff0468f
8c31474
70b90f3
d104d5d
08076bf
f967968
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -355,6 +355,16 @@ function isExistingRoomName(roomName, reports, policyID) { | |
); | ||
} | ||
|
||
/** | ||
* Validate that this is a valid tax ID (consisting of 9 digits) | ||
* | ||
* @param {String} taxID | ||
* @returns {Boolean} | ||
*/ | ||
function isValidTaxID(taxID) { | ||
return CONST.REGEX.TAX_ID.test(taxID.replace(/\D/g, '')); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here too |
||
} | ||
|
||
export { | ||
meetsAgeRequirements, | ||
isValidAddress, | ||
|
@@ -381,4 +391,5 @@ export { | |
doesFailCharacterLimit, | ||
isReservedRoomName, | ||
isExistingRoomName, | ||
isValidTaxID, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,7 +142,7 @@ class CompanyStep extends React.Component { | |
errors.website = true; | ||
} | ||
|
||
if (!/[0-9]{9}/.test(this.state.companyTaxID)) { | ||
if (!ValidationUtils.isValidTaxID(this.state.companyTaxID)) { | ||
errors.companyTaxID = true; | ||
} | ||
|
||
|
@@ -176,7 +176,7 @@ class CompanyStep extends React.Component { | |
} | ||
|
||
const incorporationDate = moment(this.state.incorporationDate).format(CONST.DATE.MOMENT_FORMAT_STRING); | ||
BankAccounts.setupWithdrawalAccount({...this.state, incorporationDate}); | ||
BankAccounts.setupWithdrawalAccount({...this.state, incorporationDate, companyTaxID: this.state.companyTaxID.replace(/\D/g, '')}); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NAB: @eVoloshchak we could move this regex to const too There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True, updated the PR |
||
} | ||
|
||
render() { | ||
|
@@ -262,7 +262,6 @@ class CompanyStep extends React.Component { | |
disabled={shouldDisableCompanyTaxID} | ||
placeholder={this.props.translate('companyStep.taxIDNumberPlaceholder')} | ||
errorText={this.getErrorText('companyTaxID')} | ||
maxLength={CONST.BANK_ACCOUNT.MAX_LENGTH.TAX_ID_NUMBER} | ||
/> | ||
<View style={styles.mt4}> | ||
<Picker | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.