Disable Done button if no display selected

This commit is contained in:
claudiulodro 2018-03-09 09:57:08 -08:00
parent 4c10e3312c
commit faa3309a8e
2 changed files with 4 additions and 2 deletions

View File

@ -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')

View File

@ -268,8 +268,9 @@ class ProductsBlockSettingsEditor extends React.Component {
}
let done_button = <button type="button" className="button wc-products-settings__footer-button" onClick={ this.props.done_callback }>{ __( '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' ),