File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ public class DataRegionSelection
6161 public static final String SEPARATOR = "$" ;
6262 public static final String DATA_REGION_SELECTION_KEY = "dataRegionSelectionKey" ;
6363
64- // Issue 53997: Establish a maximum number of selected items allowed for a query.
64+ // Issue 53997: Establish a maximum size for query selections
6565 public static final int MAX_QUERY_SELECTION_SIZE = 100_000 ;
6666
6767 // set/updated using query-setSnapshotSelection
Original file line number Diff line number Diff line change @@ -853,6 +853,7 @@ if (!LABKEY.DataRegions) {
853853 _selDocClick = $ ( document ) . on ( 'click' , _onDocumentClick ) ;
854854 }
855855
856+ // Issue 53997: Establish a maximum size for query selections
856857 if ( _isShowSelectAll ( this ) ) {
857858 _getNavTreeSelectAllSelector ( this ) . html ( _getSelectAllText ( this ) ) ;
858859 }
@@ -1051,12 +1052,17 @@ if (!LABKEY.DataRegions) {
10511052 _toggleAllRows ( this , true ) ;
10521053 }
10531054 else {
1055+ // The number of selected rows exceeds MAX_SELECTION_SIZE, so here we determine
1056+ // which rows should be checked given which page (offset) we're on.
10541057 const lastRowIdx = this . offset + this . rowCount ;
10551058 if ( lastRowIdx < MAX_SELECTION_SIZE ) {
1059+ // On a page where ALL rows are within the first MAX_SELECTION_SIZE rows,
10561060 _toggleAllRows ( this , true ) ;
10571061 } else if ( this . offset < MAX_SELECTION_SIZE && MAX_SELECTION_SIZE < lastRowIdx ) {
1062+ // On a page where SOME rows are within the first MAX_SELECTION_SIZE rows.
10581063 _checkRows ( this , MAX_SELECTION_SIZE - this . offset ) ;
10591064 } else {
1065+ // On a page where NONE rows are within the first MAX_SELECTION_SIZE rows.
10601066 _toggleAllRows ( this , false ) ;
10611067 }
10621068 }
You can’t perform that action at this time.
0 commit comments