From d25abdbdddd70df98d4938262b545cbe71cc2c8d Mon Sep 17 00:00:00 2001 From: Kimmo Puputti Date: Fri, 16 Jun 2017 15:37:37 +0300 Subject: [PATCH 1/7] Remove unused LabeledField component --- src/components/LabeledField/LabeledField.css | 9 ------ src/components/LabeledField/LabeledField.js | 30 -------------------- src/components/index.js | 2 -- 3 files changed, 41 deletions(-) delete mode 100644 src/components/LabeledField/LabeledField.css delete mode 100644 src/components/LabeledField/LabeledField.js diff --git a/src/components/LabeledField/LabeledField.css b/src/components/LabeledField/LabeledField.css deleted file mode 100644 index 27073f20..00000000 --- a/src/components/LabeledField/LabeledField.css +++ /dev/null @@ -1,9 +0,0 @@ -.label { - margin-top: 0px; - margin-bottom: 10px; - - /* Title: */ - font-size: 14px; - letter-spacing: 0; - line-height: 21px; -} diff --git a/src/components/LabeledField/LabeledField.js b/src/components/LabeledField/LabeledField.js deleted file mode 100644 index 85c5fbd2..00000000 --- a/src/components/LabeledField/LabeledField.js +++ /dev/null @@ -1,30 +0,0 @@ -import React, { PropTypes } from 'react'; -import { Field } from 'redux-form'; -import { Input } from '../../components'; - -import css from './LabeledField.css'; - -const LabeledField = props => { - const { label, name, type } = props; - - return ( -
- - -
- ); -}; - -LabeledField.defaultProps = { - type: 'input', -}; - -const { string } = PropTypes; - -LabeledField.propTypes = { - label: string.isRequired, - name: string.isRequired, - type: string, -}; - -export default LabeledField; diff --git a/src/components/index.js b/src/components/index.js index 53132a3c..0fd67ae8 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -18,7 +18,6 @@ import FilterPanel from './FilterPanel/FilterPanel'; import HeroSection from './HeroSection/HeroSection'; import Input from './Input/Input'; import InputField from './InputField/InputField'; -import LabeledField from './LabeledField/LabeledField'; import ListingCard from './ListingCard/ListingCard'; import ListingCardSmall from './ListingCardSmall/ListingCardSmall'; import LocationAutocompleteInput from './LocationAutocompleteInput/LocationAutocompleteInput'; @@ -71,7 +70,6 @@ export { InlineTextButton, Input, InputField, - LabeledField, ListingCard, ListingCardSmall, LocationAutocompleteInput, From 904a1aec1efbe8d36968fbdeca1c8ead66bec589 Mon Sep 17 00:00:00 2001 From: Kimmo Puputti Date: Fri, 16 Jun 2017 15:38:17 +0300 Subject: [PATCH 2/7] Remove Input.fieldComponent usage --- src/components/Input/Input.js | 17 ----------------- .../ChangeAccountPasswordForm.js | 8 ++++---- .../ChangeAccountPasswordForm.test.js.snap | 3 --- .../ChangePasswordForm/ChangePasswordForm.js | 6 +++--- .../ChangePasswordForm.test.js.snap | 2 -- .../PasswordForgottenForm.js | 4 ++-- .../PasswordForgottenForm.test.js.snap | 1 - 7 files changed, 9 insertions(+), 32 deletions(-) diff --git a/src/components/Input/Input.js b/src/components/Input/Input.js index a6260b39..1dd57841 100644 --- a/src/components/Input/Input.js +++ b/src/components/Input/Input.js @@ -23,21 +23,4 @@ Input.propTypes = { inline: bool, }; -/* - Creates a new Input component for Redux Form Field. - - Usage: - - ``` - - ``` -*/ -Input.fieldComponent = props => { - /* eslint-disable react/prop-types */ - const { input, type } = props; - /* eslint-enable react/prop-types */ - - return ; -}; - export default Input; diff --git a/src/containers/ChangeAccountPasswordForm/ChangeAccountPasswordForm.js b/src/containers/ChangeAccountPasswordForm/ChangeAccountPasswordForm.js index 80eb1d2b..fd11206d 100644 --- a/src/containers/ChangeAccountPasswordForm/ChangeAccountPasswordForm.js +++ b/src/containers/ChangeAccountPasswordForm/ChangeAccountPasswordForm.js @@ -1,17 +1,17 @@ import React from 'react'; import { Field, reduxForm, propTypes as formPropTypes } from 'redux-form'; -import { Button, Input } from '../../components'; +import { Button } from '../../components'; const ChangeAccountPasswordForm = props => { const { handleSubmit, pristine, submitting } = props; return (
- + - + - +

Delete account (module)

diff --git a/src/containers/ChangeAccountPasswordForm/__snapshots__/ChangeAccountPasswordForm.test.js.snap b/src/containers/ChangeAccountPasswordForm/__snapshots__/ChangeAccountPasswordForm.test.js.snap index ecfbfba0..4b071114 100644 --- a/src/containers/ChangeAccountPasswordForm/__snapshots__/ChangeAccountPasswordForm.test.js.snap +++ b/src/containers/ChangeAccountPasswordForm/__snapshots__/ChangeAccountPasswordForm.test.js.snap @@ -6,7 +6,6 @@ exports[`ChangeAccountPasswordForm matches snapshot 1`] = ` New password { const { handleSubmit, pristine, submitting } = props; return (
- + - + ); diff --git a/src/containers/ChangePasswordForm/__snapshots__/ChangePasswordForm.test.js.snap b/src/containers/ChangePasswordForm/__snapshots__/ChangePasswordForm.test.js.snap index d7606fb3..8c64f698 100644 --- a/src/containers/ChangePasswordForm/__snapshots__/ChangePasswordForm.test.js.snap +++ b/src/containers/ChangePasswordForm/__snapshots__/ChangePasswordForm.test.js.snap @@ -6,7 +6,6 @@ exports[`ChangePasswordForm matches snapshot 1`] = ` New password { const { handleSubmit, pristine, submitting } = props; return (
- +

We will send you instructions to your email.

diff --git a/src/containers/PasswordForgottenForm/__snapshots__/PasswordForgottenForm.test.js.snap b/src/containers/PasswordForgottenForm/__snapshots__/PasswordForgottenForm.test.js.snap index fd455265..abe77199 100644 --- a/src/containers/PasswordForgottenForm/__snapshots__/PasswordForgottenForm.test.js.snap +++ b/src/containers/PasswordForgottenForm/__snapshots__/PasswordForgottenForm.test.js.snap @@ -6,7 +6,6 @@ exports[`PasswordForgottenForm matches snapshot 1`] = ` Email Date: Fri, 16 Jun 2017 15:44:06 +0300 Subject: [PATCH 3/7] Fix handling groups names with spaces --- src/containers/StyleguidePage/StyleguidePage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/containers/StyleguidePage/StyleguidePage.js b/src/containers/StyleguidePage/StyleguidePage.js index d5f22422..5e82c85c 100644 --- a/src/containers/StyleguidePage/StyleguidePage.js +++ b/src/containers/StyleguidePage/StyleguidePage.js @@ -163,7 +163,7 @@ const examplesFor = (examples, group, componentName, exampleName) => { const StyleguidePage = props => { const { params, raw } = props; - const group = params.group || ALL; + const group = params.group ? decodeURIComponent(params.group) : ALL; const componentName = params.component || ALL; const exampleName = params.example || ALL; From fadea978992e1d48571143cec97834aab57608fc Mon Sep 17 00:00:00 2001 From: Kimmo Puputti Date: Fri, 16 Jun 2017 15:44:53 +0300 Subject: [PATCH 4/7] Change Styleguide grouping --- src/components/AddImages/AddImages.example.js | 2 +- src/components/BirthdayInput/BirthdayInput.example.js | 2 +- src/components/Button/Button.example.js | 2 +- src/components/CurrencyInput/CurrencyInput.example.js | 4 ++-- src/components/DateInput/DateInput.example.js | 2 +- .../LocationAutocompleteInput.example.js | 2 +- .../StripeBankAccountToken/StripeBankAccountToken.example.js | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/AddImages/AddImages.example.js b/src/components/AddImages/AddImages.example.js index 690dc274..f83e840d 100644 --- a/src/components/AddImages/AddImages.example.js +++ b/src/components/AddImages/AddImages.example.js @@ -82,5 +82,5 @@ class AddImagesTest extends Component { export const Empty = { component: AddImagesTest, - group: 'inputs', + group: 'custom inputs', }; diff --git a/src/components/BirthdayInput/BirthdayInput.example.js b/src/components/BirthdayInput/BirthdayInput.example.js index 0ac1acc1..f0486d00 100644 --- a/src/components/BirthdayInput/BirthdayInput.example.js +++ b/src/components/BirthdayInput/BirthdayInput.example.js @@ -33,5 +33,5 @@ export const Empty = { console.log('birthday changed to:', birthday ? birthday.toUTCString() : birthday); }, }, - group: 'inputs', + group: 'custom inputs', }; diff --git a/src/components/Button/Button.example.js b/src/components/Button/Button.example.js index bd7b8d09..3125f2b3 100644 --- a/src/components/Button/Button.example.js +++ b/src/components/Button/Button.example.js @@ -53,5 +53,5 @@ const ButtonsComponent = () => { export const Buttons = { component: ButtonsComponent, - group: 'buttons', + group: 'inputs and buttons', }; diff --git a/src/components/CurrencyInput/CurrencyInput.example.js b/src/components/CurrencyInput/CurrencyInput.example.js index ba37dcdd..ed5508bf 100644 --- a/src/components/CurrencyInput/CurrencyInput.example.js +++ b/src/components/CurrencyInput/CurrencyInput.example.js @@ -39,7 +39,7 @@ export const EmptyWithEnUS = { currencyConfig: defaultConfig, locale: 'en-US', }, - group: 'inputs', + group: 'custom inputs', }; // Default value with fi-FI locale @@ -50,5 +50,5 @@ export const defaultValueWithFiFI = { locale: 'fi-FI', defaultValue: 9999.99, }, - group: 'inputs', + group: 'custom inputs', }; diff --git a/src/components/DateInput/DateInput.example.js b/src/components/DateInput/DateInput.example.js index 392985b9..a5e56a9e 100644 --- a/src/components/DateInput/DateInput.example.js +++ b/src/components/DateInput/DateInput.example.js @@ -73,5 +73,5 @@ export const Empty = { console.log('Submitting a form with values:', v); }, }, - group: 'inputs', + group: 'custom inputs', }; diff --git a/src/components/LocationAutocompleteInput/LocationAutocompleteInput.example.js b/src/components/LocationAutocompleteInput/LocationAutocompleteInput.example.js index 3934f573..d928438a 100644 --- a/src/components/LocationAutocompleteInput/LocationAutocompleteInput.example.js +++ b/src/components/LocationAutocompleteInput/LocationAutocompleteInput.example.js @@ -67,5 +67,5 @@ class FormContainer extends Component { export const Empty = { component: FormContainer, - group: 'inputs', + group: 'custom inputs', }; diff --git a/src/components/StripeBankAccountToken/StripeBankAccountToken.example.js b/src/components/StripeBankAccountToken/StripeBankAccountToken.example.js index b392b143..c8e9fa04 100644 --- a/src/components/StripeBankAccountToken/StripeBankAccountToken.example.js +++ b/src/components/StripeBankAccountToken/StripeBankAccountToken.example.js @@ -77,5 +77,5 @@ class FormContainer extends Component { export const Empty = { component: FormContainer, - group: 'inputs', + group: 'custom inputs', }; From 804700a70cdd0600b2de56001c88d97933706378 Mon Sep 17 00:00:00 2001 From: Kimmo Puputti Date: Mon, 19 Jun 2017 14:26:28 +0300 Subject: [PATCH 5/7] Remove Input component --- src/components/CurrencyInput/CurrencyInput.js | 3 +-- src/components/Discussion/Discussion.js | 4 +-- src/components/Input/Input.css | 7 ----- src/components/Input/Input.js | 26 ------------------- .../OrderDiscussionPanel.test.js.snap | 2 +- .../StripeBankAccountToken.js | 6 ++--- src/components/index.js | 2 -- .../EditListingPhotosForm.js | 6 ++--- .../EditListingPricingForm.test.js.snap | 1 - src/util/forms.js | 4 +-- 10 files changed, 12 insertions(+), 49 deletions(-) delete mode 100644 src/components/Input/Input.css delete mode 100644 src/components/Input/Input.js diff --git a/src/components/CurrencyInput/CurrencyInput.js b/src/components/CurrencyInput/CurrencyInput.js index 0c45d7cb..b6526679 100644 --- a/src/components/CurrencyInput/CurrencyInput.js +++ b/src/components/CurrencyInput/CurrencyInput.js @@ -14,7 +14,6 @@ import { truncateToSubUnitPrecision, } from '../../util/currency'; import * as propTypes from '../../util/propTypes'; -import { Input } from '../../components'; const allowedInputProps = allProps => { // Strip away props that are not passed to input element (or are overwritten) @@ -167,7 +166,7 @@ class CurrencyInput extends Component { const { currencyConfig, defaultValue, placeholder, intl } = this.props; const placeholderText = placeholder || intl.formatNumber(defaultValue, currencyConfig); return ( - )}
- { - const { className, inline, ...rest } = props; - - const classes = classNames(css.root, { [css.inline]: inline }, className); - - return ; -}; - -const { string, bool } = PropTypes; - -Input.defaultProps = { - className: null, - inline: false, -}; - -Input.propTypes = { - className: string, - inline: bool, -}; - -export default Input; diff --git a/src/components/OrderDiscussionPanel/__snapshots__/OrderDiscussionPanel.test.js.snap b/src/components/OrderDiscussionPanel/__snapshots__/OrderDiscussionPanel.test.js.snap index 76ed4649..0d6e147a 100644 --- a/src/components/OrderDiscussionPanel/__snapshots__/OrderDiscussionPanel.test.js.snap +++ b/src/components/OrderDiscussionPanel/__snapshots__/OrderDiscussionPanel.test.js.snap @@ -22,7 +22,7 @@ exports[`OrderDiscussionPanel matches snapshot 1`] = ` onSubmit={[Function]}> diff --git a/src/components/StripeBankAccountToken/StripeBankAccountToken.js b/src/components/StripeBankAccountToken/StripeBankAccountToken.js index 9ed8a5e7..3ec54420 100644 --- a/src/components/StripeBankAccountToken/StripeBankAccountToken.js +++ b/src/components/StripeBankAccountToken/StripeBankAccountToken.js @@ -2,7 +2,7 @@ import React, { Component, PropTypes } from 'react'; import { intlShape, injectIntl, FormattedMessage } from 'react-intl'; import { debounce } from 'lodash'; -import { Input, ValidationError } from '../../components'; +import { ValidationError } from '../../components'; import config from '../../config'; import css from './StripeBankAccountToken.css'; @@ -207,7 +207,7 @@ class StripeBankAccountToken extends Component { - : } - { return (
- +
@@ -99,7 +99,7 @@ export class EditListingPhotosFormComponent extends Component { const { input, type, meta } = props; return (
- +
); diff --git a/src/containers/EditListingPricingForm/__snapshots__/EditListingPricingForm.test.js.snap b/src/containers/EditListingPricingForm/__snapshots__/EditListingPricingForm.test.js.snap index 0fa6ca4c..e199427c 100644 --- a/src/containers/EditListingPricingForm/__snapshots__/EditListingPricingForm.test.js.snap +++ b/src/containers/EditListingPricingForm/__snapshots__/EditListingPricingForm.test.js.snap @@ -8,7 +8,6 @@ exports[`EditListingPricingForm matches snapshot 1`] = ` className=""> { } else if (Comp === 'textarea') { component =