Skip to content

Commit

Permalink
Merge pull request #12175 from Expensify/justice-remove-newdot-person…
Browse files Browse the repository at this point in the history
…al-bank-account-password

Remove password field from personal bank account flow
  • Loading branch information
Justice Arthur authored Nov 1, 2022
2 parents a220545 + 87cf176 commit d0ca09b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 32 deletions.
4 changes: 1 addition & 3 deletions src/libs/actions/BankAccounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,9 @@ function connectBankAccountWithPlaid(bankAccountID, selectedPlaidBankAccount) {
* Adds a bank account via Plaid
*
* @param {Object} account
* @param {String} password
* @TODO offline pattern for this command will have to be added later once the pattern B design doc is complete
*/
function addPersonalBankAccount(account, password) {
function addPersonalBankAccount(account) {
const commandName = 'AddPersonalBankAccount';

const parameters = {
Expand All @@ -130,7 +129,6 @@ function addPersonalBankAccount(account, password) {
bank: account.bankName,
plaidAccountID: account.plaidAccountID,
plaidAccessToken: account.plaidAccessToken,
password,
};

const onyxData = {
Expand Down
33 changes: 4 additions & 29 deletions src/pages/AddPersonalBankAccountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import defaultTheme from '../styles/themes/default';
import Button from '../components/Button';
import FixedFooter from '../components/FixedFooter';
import Form from '../components/Form';
import TextInput from '../components/TextInput';
import canFocusInputOnScreenFocus from '../libs/canFocusInputOnScreenFocus/index.native';
import ROUTES from '../ROUTES';

const propTypes = {
Expand Down Expand Up @@ -70,30 +68,18 @@ class AddPersonalBankAccountPage extends React.Component {
}

/**
* @param {Object} values - form input values passed by the Form component
* @param {Object} values.password The password of the user adding the bank account, for security.
* @returns {Object}
*/
validate(values) {
const errors = {};

if (_.isEmpty(values.password)) {
errors.password = `${this.props.translate('common.password')} ${this.props.translate('common.isRequiredField')}.`;
}

return errors;
validate() {
return {};
}

/**
* @param {Object} values - form input values passed by the Form component
* @param {Object} values.password The password of the user adding the bank account, for security.
*/
submit(values) {
submit() {
const selectedPlaidBankAccount = _.findWhere(lodashGet(this.props.plaidData, 'bankAccounts', []), {
plaidAccountID: this.state.selectedPlaidAccountID,
});

BankAccounts.addPersonalBankAccount(selectedPlaidBankAccount, values.password);
BankAccounts.addPersonalBankAccount(selectedPlaidBankAccount);
}

render() {
Expand Down Expand Up @@ -153,17 +139,6 @@ class AddPersonalBankAccountPage extends React.Component {
receivedRedirectURI={getPlaidOAuthReceivedRedirectURI()}
selectedPlaidAccountID={this.state.selectedPlaidAccountID}
/>
{Boolean(this.state.selectedPlaidAccountID) && (
<TextInput
inputID="password"
label={this.props.translate('addPersonalBankAccountPage.enterPassword')}
secureTextEntry
autoCompleteType="password"
textContentType="password"
autoCapitalize="none"
autoFocus={canFocusInputOnScreenFocus()}
/>
)}
</>
</Form>
)}
Expand Down

0 comments on commit d0ca09b

Please sign in to comment.