From 9eb4e7a125a1c9fdd3d4d0ac8f2a34b77f9d68fd Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Tue, 27 Aug 2019 14:12:54 +0300 Subject: [PATCH] pre-final-form naming pattern: form prop was conflicting with form api --- .../FieldBoolean/FieldBoolean.example.js | 2 +- .../FieldCheckbox/FieldCheckbox.example.js | 2 +- .../FieldPhoneNumberInput.example.js | 5 +--- .../FieldRadioButton.example.js | 2 -- .../FieldReviewRating.example.js | 6 ++-- src/components/Topbar/Topbar.js | 1 - src/components/TopbarDesktop/TopbarDesktop.js | 1 - .../TransactionPanel/TransactionPanel.js | 2 +- .../TransactionPanel.test.js.snap | 28 +++++++++---------- .../BookingDatesForm/BookingDatesForm.js | 6 ++-- src/forms/SendMessageForm/SendMessageForm.js | 3 +- 11 files changed, 26 insertions(+), 32 deletions(-) diff --git a/src/components/FieldBoolean/FieldBoolean.example.js b/src/components/FieldBoolean/FieldBoolean.example.js index 818161b8..a7764fd2 100644 --- a/src/components/FieldBoolean/FieldBoolean.example.js +++ b/src/components/FieldBoolean/FieldBoolean.example.js @@ -9,7 +9,7 @@ const formName = 'Styleguide.FieldBoolean.Form'; const FormComponent = props => ( { const { form, handleSubmit, onChange, invalid, pristine, submitting } = props; const required = validators.requiredBoolean('This field is required'); diff --git a/src/components/FieldCheckbox/FieldCheckbox.example.js b/src/components/FieldCheckbox/FieldCheckbox.example.js index e5009cdf..8a1511eb 100644 --- a/src/components/FieldCheckbox/FieldCheckbox.example.js +++ b/src/components/FieldCheckbox/FieldCheckbox.example.js @@ -8,7 +8,7 @@ const formName = 'Styleguide.FieldCheckbox.Form'; const FormComponent = props => ( { const { form, handleSubmit, onChange, invalid, pristine, submitting } = fieldRenderProps; diff --git a/src/components/FieldPhoneNumberInput/FieldPhoneNumberInput.example.js b/src/components/FieldPhoneNumberInput/FieldPhoneNumberInput.example.js index d27c0999..299fc24a 100644 --- a/src/components/FieldPhoneNumberInput/FieldPhoneNumberInput.example.js +++ b/src/components/FieldPhoneNumberInput/FieldPhoneNumberInput.example.js @@ -4,12 +4,9 @@ import * as validators from '../../util/validators'; import { Button } from '../../components'; import FieldPhoneNumberInput from './FieldPhoneNumberInput'; -const formName = 'Styleguide.FieldPhoneNumberInput.Form'; - const FormComponent = props => ( { const { formId, handleSubmit, onChange, invalid, pristine, submitting } = fieldRenderProps; const required = validators.required('This field is required'); @@ -41,7 +38,7 @@ const FormComponent = props => ( export const PhoneNumber = { component: FormComponent, props: { - formId: 'PhoneNumberExample', + formId: 'Styleguide.FieldPhoneNumberInput.Form', onChange: formState => { if (formState.dirty) { console.log('form values changed to:', formState.values); diff --git a/src/components/FieldRadioButton/FieldRadioButton.example.js b/src/components/FieldRadioButton/FieldRadioButton.example.js index 63664a62..0d66fcd0 100644 --- a/src/components/FieldRadioButton/FieldRadioButton.example.js +++ b/src/components/FieldRadioButton/FieldRadioButton.example.js @@ -2,12 +2,10 @@ import React from 'react'; import { Form as FinalForm, FormSpy } from 'react-final-form'; import { Button } from '..'; import FieldRadioButton from './FieldRadioButton'; -const formName = 'Styleguide.FieldRadioButton.Form'; const FormComponent = props => ( { const { handleSubmit, diff --git a/src/components/FieldReviewRating/FieldReviewRating.example.js b/src/components/FieldReviewRating/FieldReviewRating.example.js index 11a0cbbe..295c833f 100644 --- a/src/components/FieldReviewRating/FieldReviewRating.example.js +++ b/src/components/FieldReviewRating/FieldReviewRating.example.js @@ -10,9 +10,9 @@ const formName = 'Styleguide.FieldReviewRating.Form'; const FormComponent = props => ( { - const { form, handleSubmit, onChange, invalid, pristine, submitting } = fieldRenderProps; + const { formId, handleSubmit, onChange, invalid, pristine, submitting } = fieldRenderProps; const required = validators.required('This field is required'); const submitDisabled = invalid || pristine || submitting; @@ -25,7 +25,7 @@ const FormComponent = props => ( >
{ diff --git a/src/components/TransactionPanel/TransactionPanel.js b/src/components/TransactionPanel/TransactionPanel.js index 3587a25e..e5779599 100644 --- a/src/components/TransactionPanel/TransactionPanel.js +++ b/src/components/TransactionPanel/TransactionPanel.js @@ -395,7 +395,7 @@ export class TransactionPanelComponent extends Component { /> {showSendMessageForm ? (