File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
src/dashboard/Data/Browser Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -2528,6 +2528,8 @@ class Browser extends DashboardView {
25282528 this . setState ( { limit } ) ;
25292529 this . updateOrdering ( this . state . ordering ) ;
25302530 } }
2531+ hasSelectedRows = { Object . keys ( this . state . selection ) . length > 0 }
2532+ selectedRowsMessage = { SELECTED_ROWS_MESSAGE }
25312533 />
25322534 </ >
25332535 ) ;
Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ class BrowserFooter extends React.Component {
1919 }
2020
2121 handleLimitChange = event => {
22+ // Check if there are selected rows
23+ if ( this . props . hasSelectedRows && ! window . confirm ( this . props . selectedRowsMessage ) ) {
24+ return ;
25+ }
2226 const newLimit = parseInt ( event . target . value , 10 ) ;
2327 this . props . setLimit ( newLimit ) ;
2428 this . props . setSkip ( 0 ) ;
@@ -27,6 +31,10 @@ class BrowserFooter extends React.Component {
2731
2832 handlePageChange = newSkip => {
2933 if ( newSkip >= 0 && newSkip < this . props . count ) {
34+ // Check if there are selected rows
35+ if ( this . props . hasSelectedRows && ! window . confirm ( this . props . selectedRowsMessage ) ) {
36+ return ;
37+ }
3038 this . props . setSkip ( newSkip ) ;
3139 this . setState ( { pageInput : ( Math . floor ( newSkip / this . props . limit ) + 1 ) . toString ( ) } ) ;
3240 }
You can’t perform that action at this time.
0 commit comments