From a3370f89c305e1c927395a98b01a3ba693cab166 Mon Sep 17 00:00:00 2001 From: Kelly Dwan Date: Wed, 8 Nov 2017 13:25:12 -0500 Subject: [PATCH] Update label text & the default select text. --- .../components/product-search/variations.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/client/extensions/woocommerce/components/product-search/variations.js b/client/extensions/woocommerce/components/product-search/variations.js index fbfc96461de36f..af27b1d73c6a8a 100644 --- a/client/extensions/woocommerce/components/product-search/variations.js +++ b/client/extensions/woocommerce/components/product-search/variations.js @@ -16,6 +16,9 @@ import FormLegend from 'components/forms/form-legend'; import FormSelect from 'components/forms/form-select'; import Notice from 'components/notice'; +// Use a constant for the default attribute state. +const DEFAULT_ATTR = 'any'; + class ProductVariations extends Component { static propTypes = { onChange: PropTypes.func, @@ -27,7 +30,7 @@ class ProductVariations extends Component { this.state = {}; const attributes = filter( props.product.attributes, { variation: true } ); forEach( attributes, attr => { - this.state[ attr.name ] = 'any'; // Values default to any. + this.state[ attr.name ] = DEFAULT_ATTR; } ); } @@ -47,8 +50,8 @@ class ProductVariations extends Component { id={ `select-${ kebabCase( attribute.name ) }` } onChange={ this.onChange( attribute.name ) } > - { attribute.options.map( ( opt, i ) => ) } @@ -71,7 +74,7 @@ class ProductVariations extends Component { { translate( - '%(product)s has variations. Select a specific customization, or add the base product.', + '%(product)s has variations. Choose a specific customization to select.', { args: { product: product.name } } ) }