diff --git a/src/dashboard/Data/Browser/DeleteRowsDialog.react.js b/src/dashboard/Data/Browser/DeleteRowsDialog.react.js index 93fc24a994..e995ef342e 100644 --- a/src/dashboard/Data/Browser/DeleteRowsDialog.react.js +++ b/src/dashboard/Data/Browser/DeleteRowsDialog.react.js @@ -21,10 +21,15 @@ export default class DeleteRowsDialog extends React.Component { } valid() { - if (this.state.confirmation === this.props.className) { + const selectionLength = Object.keys(this.props.selection).length; + + if (this.props.selection['*'] && this.state.confirmation.toLowerCase() === 'delete all') { + return true; + } + if (selectionLength >= 10 && this.state.confirmation.toLowerCase() === 'delete selected') { return true; } - if (!this.props.selection['*'] && Object.keys(this.props.selection).length < 10) { + if (!this.props.selection['*'] && selectionLength < 10) { return true; } return false; @@ -33,17 +38,35 @@ export default class DeleteRowsDialog extends React.Component { render() { let content = null; let selectionLength = Object.keys(this.props.selection).length; - if (this.props.selection['*'] || selectionLength >= 10) { + + if (selectionLength >= 10) { + content = ( + + } + input={ + this.setState({ confirmation })} /> + } /> + ); + } + + if (this.props.selection['*']) { content = ( + description='Enter "delete all" to continue.' /> } input={ this.setState({ confirmation })} /> } />