Skip to content

Commit

Permalink
Merge pull request #94 from sharetribe/update-v4.4.3-from-upstream
Browse files Browse the repository at this point in the history
New release v6.5.1 (update v4.4.3 from upstream)
  • Loading branch information
Gnito authored May 13, 2020
2 parents ff3c18f + de9c316 commit e1b17fb
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 16 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,20 @@ https://github.com/sharetribe/flex-template-web/

## Upcoming version 2020-XX-XX

## [v6.5.1] 2020-05-13

- [fix] Check length of `selectedConfigOptions` in `SectionFeaturesMaybe` to choose between one and
two column layout. [#92](https://github.com/sharetribe/ftw-hourly/pull/90)

### Updates from upstream

This is update from [upstream](https://github.com/sharetribe/ftw-daily): v4.4.3

- [fix] Allow white space on Japanese bank account info. Japan collects bank name and account owner
name in addition to routing numbers. [#1287](https://github.com/sharetribe/ftw-daily/pull/1287)
- [fix] wrongly named default props handleSubmit renamed to onSubmit
[#1288](https://github.com/sharetribe/ftw-daily/pull/1288)

## [v6.5.0] 2020-04-17

- [change] Reorganize search filters [#89](https://github.com/sharetribe/ftw-hourly/pull/89)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "app",
"version": "6.5.0",
"version": "6.5.1",
"private": true,
"license": "Apache-2.0",
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import config from '../../config';

import {
BANK_ACCOUNT_INPUTS,
cleanedString,
formatFieldMessage,
requiredInputs,
mapInputsToStripeAccountKeys,
Expand Down Expand Up @@ -150,19 +149,16 @@ class TokenInputFieldComponent extends Component {
return result.token.id;
})
.then(token => {
// Check if value has changed during async call.
const changedValues = inputsNeeded.filter(
inputType => values[inputType] !== cleanedString(this.state[inputType].value)
inputType => values[inputType] !== this.state[inputType].value
);
const valuesAreUnchanged = changedValues.length === 0;

// Handle response only if the input values haven't changed
if (this._isMounted && valuesAreUnchanged) {
this.setState(prevState => {
const errorsClearedFromInputs = inputsNeeded.map(inputType => {
const input = prevState[inputType];
return { ...input, error: null };
});
return { ...errorsClearedFromInputs, stripeError: null };
return { stripeError: null };
});

onChange(token);
Expand All @@ -181,8 +177,8 @@ class TokenInputFieldComponent extends Component {
}

handleInputChange(e, inputType, country, intl) {
const rawValue = e.target.value;
const value = cleanedString(rawValue);
const value = e.target.value;

let inputError = null;

// Validate the changed routing number
Expand All @@ -194,7 +190,7 @@ class TokenInputFieldComponent extends Component {

// Save changes to the state
this.setState(prevState => {
const input = { ...prevState[inputType], value: rawValue, error: inputError };
const input = { ...prevState[inputType], value, error: inputError };
return {
[inputType]: input,
stripeError: null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,11 @@ export const mapInputsToStripeAccountKeys = (country, values) => {

case 'JP':
return {
bank_name: cleanedString(values[BANK_NAME]),
branch_name: cleanedString(values[BRANCH_NAME]),
bank_name: values[BANK_NAME],
branch_name: values[BRANCH_NAME],
routing_number: cleanedString(values[BANK_CODE]).concat(values[BRANCH_CODE]),
account_number: cleanedString(values[ACCOUNT_NUMBER]),
account_holder_name: cleanedString(values[ACCOUNT_OWNER_NAME]),
account_holder_name: values[ACCOUNT_OWNER_NAME],
};

case 'MX':
Expand Down
4 changes: 2 additions & 2 deletions src/forms/PaymentMethodsForm/PaymentMethodsForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ PaymentMethodsForm.defaultProps = {
className: null,
rootClassName: null,
inProgress: false,
handleSubmit: null,
onSubmit: null,
addPaymentMethodError: null,
deletePaymentMethodError: null,
createStripeCustomerError: null,
Expand All @@ -294,7 +294,7 @@ PaymentMethodsForm.defaultProps = {
PaymentMethodsForm.propTypes = {
formId: string,
intl: intlShape.isRequired,
handleSubmit: func,
onSubmit: func,
addPaymentMethodError: object,
deletePaymentMethodError: object,
createStripeCustomerError: object,
Expand Down

0 comments on commit e1b17fb

Please sign in to comment.