From faa3309a8e99cba1ff5e5c73e100a834ebb5f988 Mon Sep 17 00:00:00 2001 From: claudiulodro Date: Fri, 9 Mar 2018 09:57:08 -0800 Subject: [PATCH] Disable Done button if no display selected --- plugins/woocommerce-blocks/assets/js/products-block.js | 3 ++- plugins/woocommerce-blocks/assets/js/products-block.jsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/woocommerce-blocks/assets/js/products-block.js b/plugins/woocommerce-blocks/assets/js/products-block.js index 362e41cba66..3c2e779c897 100644 --- a/plugins/woocommerce-blocks/assets/js/products-block.js +++ b/plugins/woocommerce-blocks/assets/js/products-block.js @@ -458,8 +458,9 @@ var ProductsBlockSettingsEditor = function (_React$Component3) { { type: 'button', className: 'button wc-products-settings__footer-button', onClick: this.props.done_callback }, __('Done') ); - if (['specific', 'category', 'attribute'].includes(this.state.display) && !this.props.selected_display_setting.length) { + if (['', 'specific', 'category', 'attribute'].includes(this.state.display) && !this.props.selected_display_setting.length) { var done_tooltips = { + '': __('Please make a selection'), specific: __('Please search for and select products to display'), category: __('Please select at least one category to display'), attribute: __('Please select an attribute') diff --git a/plugins/woocommerce-blocks/assets/js/products-block.jsx b/plugins/woocommerce-blocks/assets/js/products-block.jsx index 5d1e095c2cb..9bd5e9b8e2b 100644 --- a/plugins/woocommerce-blocks/assets/js/products-block.jsx +++ b/plugins/woocommerce-blocks/assets/js/products-block.jsx @@ -268,8 +268,9 @@ class ProductsBlockSettingsEditor extends React.Component { } let done_button = ; - if ( [ 'specific', 'category', 'attribute' ].includes( this.state.display ) && ! this.props.selected_display_setting.length ) { + if ( ['', 'specific', 'category', 'attribute'].includes( this.state.display ) && ! this.props.selected_display_setting.length ) { const done_tooltips = { + '': __( 'Please make a selection' ), specific: __( 'Please search for and select products to display' ), category: __( 'Please select at least one category to display' ), attribute: __( 'Please select an attribute' ),