Skip to content
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: The invalid incorporation date error message doesn't hide after the initial date selection #12288

Merged
merged 1 commit into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,6 @@ export default {
addressStreet: 'Please enter a valid street address that is not a PO Box',
addressState: 'Please select a valid state',
incorporationDate: 'Please enter a valid date',
incorporationDateFuture: 'Incorporation date cannot be in the future',
incorporationState: 'Please enter a valid state',
industryCode: 'Please enter a valid industry classification code. Must be 6 digits.',
restrictedBusiness: 'Please confirm company is not on the list of restricted businesses',
Expand Down
1 change: 0 additions & 1 deletion src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,6 @@ export default {
addressStreet: 'Ingresa una calle de dirección válida que no sea un apartado postal',
addressState: 'Por favor, selecciona un estado',
incorporationDate: 'Ingresa una fecha válida',
incorporationDateFuture: 'La fecha de incorporación no puede ser futura',
incorporationState: 'Ingresa un estado válido',
industryCode: 'Ingresa un código de clasificación de industria válido',
restrictedBusiness: 'Confirma que la empresa no está en la lista de negocios restringidos',
Expand Down
12 changes: 2 additions & 10 deletions src/pages/ReimbursementAccount/CompanyStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ class CompanyStep extends React.Component {
website: 'bankAccount.error.website',
companyTaxID: 'bankAccount.error.taxID',
incorporationDate: 'bankAccount.error.incorporationDate',
incorporationDateFuture: 'bankAccount.error.incorporationDateFuture',
incorporationType: 'bankAccount.error.companyType',
hasNoConnectionToCannabis: 'bankAccount.error.restrictedBusiness',
incorporationState: 'bankAccount.error.incorporationState',
Expand All @@ -109,9 +108,6 @@ class CompanyStep extends React.Component {
this.setState(newState);
ReimbursementAccount.updateReimbursementAccountDraft(newState);
this.clearError(inputKey);
if (inputKey === 'incorporationDate') {
this.clearError('incorporationDateFuture');
}
}

/**
Expand Down Expand Up @@ -144,12 +140,8 @@ class CompanyStep extends React.Component {
errors.companyTaxID = true;
}

if (!ValidationUtils.isValidDate(this.state.incorporationDate)) {
errors.incorporationDate = true;
}

if (!ValidationUtils.isValidPastDate(this.state.incorporationDate)) {
errors.incorporationDateFuture = true;
errors.incorporationDate = true;
}

if (!ValidationUtils.isValidUSPhone(this.state.companyPhone, true)) {
Expand Down Expand Up @@ -277,7 +269,7 @@ class CompanyStep extends React.Component {
onInputChange={value => this.clearErrorAndSetValue('incorporationDate', value)}
defaultValue={this.state.incorporationDate}
placeholder={this.props.translate('companyStep.incorporationDatePlaceholder')}
errorText={this.getErrorText('incorporationDate') || this.getErrorText('incorporationDateFuture')}
errorText={this.getErrorText('incorporationDate')}
maximumDate={new Date()}
/>
</View>
Expand Down