Skip to content
Merged
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
17 changes: 17 additions & 0 deletions src/pages/ReimbursementAccount/CompanyStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,20 @@ class CompanyStep extends React.Component {
hasNoConnectionToCannabis: lodashGet(props, ['achData', 'hasNoConnectionToCannabis'], false),
password: '',
};

// These fields need to be filled out in order to submit the form
this.requiredFields = [
'companyName',
'addressStreet',
'addressCity',
'addressState',
'addressZipCode',
'website',
'companyTaxID',
'incorporationDate',
'industryCode',
'password',
];
}

/**
Expand Down Expand Up @@ -111,6 +125,8 @@ class CompanyStep extends React.Component {
render() {
const shouldDisableCompanyName = Boolean(this.props.achData.bankAccountID && this.props.achData.companyName);
const shouldDisableCompanyTaxID = Boolean(this.props.achData.bankAccountID && this.props.achData.companyTaxID);
const shouldDisableSubmitButton = this.requiredFields
.reduce((acc, curr) => acc || !this.state[curr].trim(), false);
return (
<>
<HeaderWithCloseButton
Expand Down Expand Up @@ -253,6 +269,7 @@ class CompanyStep extends React.Component {
onPress={this.submit}
style={[styles.w100]}
text={this.props.translate('common.saveAndContinue')}
isDisabled={shouldDisableSubmitButton}
/>
</FixedFooter>
</>
Expand Down