From 50d1bc1e4bb3702708f489aadd88b9434288bede Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Tue, 12 May 2020 15:48:21 +0300 Subject: [PATCH 1/5] Remove string cleaning from state-saved values. --- .../StripeBankAccountTokenInputField.js | 16 ++++++---------- .../StripeBankAccountTokenInputField.util.js | 6 +++--- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/components/StripeBankAccountTokenInputField/StripeBankAccountTokenInputField.js b/src/components/StripeBankAccountTokenInputField/StripeBankAccountTokenInputField.js index 4f8d3d85a..cecd97f70 100644 --- a/src/components/StripeBankAccountTokenInputField/StripeBankAccountTokenInputField.js +++ b/src/components/StripeBankAccountTokenInputField/StripeBankAccountTokenInputField.js @@ -9,7 +9,6 @@ import config from '../../config'; import { BANK_ACCOUNT_INPUTS, - cleanedString, formatFieldMessage, requiredInputs, mapInputsToStripeAccountKeys, @@ -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); @@ -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 @@ -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, diff --git a/src/components/StripeBankAccountTokenInputField/StripeBankAccountTokenInputField.util.js b/src/components/StripeBankAccountTokenInputField/StripeBankAccountTokenInputField.util.js index 735159af3..e638940ea 100644 --- a/src/components/StripeBankAccountTokenInputField/StripeBankAccountTokenInputField.util.js +++ b/src/components/StripeBankAccountTokenInputField/StripeBankAccountTokenInputField.util.js @@ -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': From 0001a832208f7358a3814bc449e34293b00a6db6 Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Wed, 13 May 2020 09:37:19 +0300 Subject: [PATCH 2/5] Update Changelog --- CHANGELOG.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd4c5979c..607413ad8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,23 +14,28 @@ way to update this template, but currently, we follow a pattern: ## Upcoming version 2020-XX-XX +- [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) + ## [v4.4.2] 2020-04-09 -- [fix] Handle deleted reviews in ActivityFeed [#1283](https://github.com/sharetribe/ftw-daily/pull/1283) +- [fix] Handle deleted reviews in ActivityFeed + [#1283](https://github.com/sharetribe/ftw-daily/pull/1283) [v4.4.2]: https://github.com/sharetribe/flex-template-web/compare/v4.4.1...v4.4.2 - ## [v4.4.1] 2020-03-30 -- [change] Improve the search page sorting and filters UI for different screen sizes [#1280](https://github.com/sharetribe/ftw-daily/pull/1280) +- [change] Improve the search page sorting and filters UI for different screen sizes + [#1280](https://github.com/sharetribe/ftw-daily/pull/1280) [v4.4.1]: https://github.com/sharetribe/flex-template-web/compare/v4.4.0...v4.4.1 ## [v4.4.0] 2020-03-25 - [add] Search result sorting [#1277](https://github.com/sharetribe/ftw-daily/pull/1277) -- [change] Move category and amenities search filters from primary filters to secondary filters. [#1275](https://github.com/sharetribe/ftw-daily/pull/1275) +- [change] Move category and amenities search filters from primary filters to secondary filters. + [#1275](https://github.com/sharetribe/ftw-daily/pull/1275) [v4.4.0]: https://github.com/sharetribe/flex-template-web/compare/v4.3.0...v4.4.0 From 94658d2400aeef692bf96d94ed01bb2651095544 Mon Sep 17 00:00:00 2001 From: "tam.vu" Date: Fri, 27 Mar 2020 11:15:58 +0700 Subject: [PATCH 3/5] Fix "Cannot POST" error for PaymentMethodsForm: - When using npm, the null handleSubmit would override the FinalForm handleSubmit method - This would cause error when the form is submit because the formRenderProps give out null handleSubmit function --- src/forms/PaymentMethodsForm/PaymentMethodsForm.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/forms/PaymentMethodsForm/PaymentMethodsForm.js b/src/forms/PaymentMethodsForm/PaymentMethodsForm.js index 7be277b0e..a9247c732 100644 --- a/src/forms/PaymentMethodsForm/PaymentMethodsForm.js +++ b/src/forms/PaymentMethodsForm/PaymentMethodsForm.js @@ -283,7 +283,7 @@ PaymentMethodsForm.defaultProps = { className: null, rootClassName: null, inProgress: false, - handleSubmit: null, + onSubmit: null, addPaymentMethodError: null, deletePaymentMethodError: null, createStripeCustomerError: null, @@ -294,7 +294,7 @@ PaymentMethodsForm.defaultProps = { PaymentMethodsForm.propTypes = { formId: string, intl: intlShape.isRequired, - handleSubmit: func, + onSubmit: func, addPaymentMethodError: object, deletePaymentMethodError: object, createStripeCustomerError: object, From 7a2efddfc7e3fbbe5c80145b97ed596e90f4ba42 Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Wed, 13 May 2020 10:03:26 +0300 Subject: [PATCH 4/5] Update Changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 607413ad8..854818da4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ way to update this template, but currently, we follow a pattern: - [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) ## [v4.4.2] 2020-04-09 From 1264468f0ba89943c95932fc6d2db07bb8794973 Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Wed, 13 May 2020 21:32:23 +0300 Subject: [PATCH 5/5] New release v4.4.3 --- CHANGELOG.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 854818da4..dc7312a15 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,11 +14,15 @@ way to update this template, but currently, we follow a pattern: ## Upcoming version 2020-XX-XX +## [v4.4.3] 2020-05-13 + - [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) +[v4.4.3]: https://github.com/sharetribe/flex-template-web/compare/v4.4.2...v4.4.3 + ## [v4.4.2] 2020-04-09 - [fix] Handle deleted reviews in ActivityFeed diff --git a/package.json b/package.json index 75cf5e389..b8584f056 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "app", - "version": "4.4.2", + "version": "4.4.3", "private": true, "license": "Apache-2.0", "dependencies": {