diff --git a/src/dashboard/Data/Browser/Browser.react.js b/src/dashboard/Data/Browser/Browser.react.js index 6e0e21abe..ca760536d 100644 --- a/src/dashboard/Data/Browser/Browser.react.js +++ b/src/dashboard/Data/Browser/Browser.react.js @@ -1246,6 +1246,13 @@ class Browser extends DashboardView { } updateFilters(filters) { + // Check if there are selected rows + if (Object.keys(this.state.selection).length > 0) { + if (!window.confirm(SELECTED_ROWS_MESSAGE)) { + return; + } + } + const relation = this.state.relation; if (relation) { this.setRelation(relation, filters); @@ -2528,6 +2535,8 @@ class Browser extends DashboardView { this.setState({ limit }); this.updateOrdering(this.state.ordering); }} + hasSelectedRows={Object.keys(this.state.selection).length > 0} + selectedRowsMessage={SELECTED_ROWS_MESSAGE} /> ); diff --git a/src/dashboard/Data/Browser/BrowserFooter.react.js b/src/dashboard/Data/Browser/BrowserFooter.react.js index 04f69474d..cf75462f2 100644 --- a/src/dashboard/Data/Browser/BrowserFooter.react.js +++ b/src/dashboard/Data/Browser/BrowserFooter.react.js @@ -19,6 +19,10 @@ class BrowserFooter extends React.Component { } handleLimitChange = event => { + // Check if there are selected rows + if (this.props.hasSelectedRows && !window.confirm(this.props.selectedRowsMessage)) { + return; + } const newLimit = parseInt(event.target.value, 10); this.props.setLimit(newLimit); this.props.setSkip(0); @@ -27,6 +31,10 @@ class BrowserFooter extends React.Component { handlePageChange = newSkip => { if (newSkip >= 0 && newSkip < this.props.count) { + // Check if there are selected rows + if (this.props.hasSelectedRows && !window.confirm(this.props.selectedRowsMessage)) { + return; + } this.props.setSkip(newSkip); this.setState({ pageInput: (Math.floor(newSkip / this.props.limit) + 1).toString() }); }