File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
src/dashboard/Data/Browser Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1246,6 +1246,13 @@ class Browser extends DashboardView {
1246
1246
}
1247
1247
1248
1248
updateFilters ( filters ) {
1249
+ // Check if there are selected rows
1250
+ if ( Object . keys ( this . state . selection ) . length > 0 ) {
1251
+ if ( ! window . confirm ( SELECTED_ROWS_MESSAGE ) ) {
1252
+ return ;
1253
+ }
1254
+ }
1255
+
1249
1256
const relation = this . state . relation ;
1250
1257
if ( relation ) {
1251
1258
this . setRelation ( relation , filters ) ;
@@ -2528,6 +2535,8 @@ class Browser extends DashboardView {
2528
2535
this . setState ( { limit } ) ;
2529
2536
this . updateOrdering ( this . state . ordering ) ;
2530
2537
} }
2538
+ hasSelectedRows = { Object . keys ( this . state . selection ) . length > 0 }
2539
+ selectedRowsMessage = { SELECTED_ROWS_MESSAGE }
2531
2540
/>
2532
2541
</ >
2533
2542
) ;
Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ class BrowserFooter extends React.Component {
19
19
}
20
20
21
21
handleLimitChange = event => {
22
+ // Check if there are selected rows
23
+ if ( this . props . hasSelectedRows && ! window . confirm ( this . props . selectedRowsMessage ) ) {
24
+ return ;
25
+ }
22
26
const newLimit = parseInt ( event . target . value , 10 ) ;
23
27
this . props . setLimit ( newLimit ) ;
24
28
this . props . setSkip ( 0 ) ;
@@ -27,6 +31,10 @@ class BrowserFooter extends React.Component {
27
31
28
32
handlePageChange = newSkip => {
29
33
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
+ }
30
38
this . props . setSkip ( newSkip ) ;
31
39
this . setState ( { pageInput : ( Math . floor ( newSkip / this . props . limit ) + 1 ) . toString ( ) } ) ;
32
40
}
You can’t perform that action at this time.
0 commit comments