@@ -1745,42 +1745,27 @@ require([
17451745 success : function ( data ) {
17461746 var isFiltered = Boolean ( $ ( '#search_def p' ) . length > 0 ) ;
17471747 if ( is_cohort ) {
1748- if ( data . total > 65000 ) {
1749- $ ( '.manifest-size-warning' ) . show ( ) ;
1748+ if ( data . file_parts_count > data . display_file_parts_count ) {
1749+ $ ( '#file-export-option' ) . prop ( 'title' , 'Your cohort exceeds the maximum for download.' ) ;
1750+ $ ( '#file-manifest-max-exceeded' ) . show ( ) ;
1751+ $ ( '#file-export-option input' ) . prop ( 'disabled' , 'disabled' ) ;
1752+ $ ( '#file-export-option input' ) . prop ( 'checked' , false ) ;
1753+ $ ( '#bq-export-option input' ) . prop ( 'checked' , true ) . trigger ( "click" ) ;
17501754 } else {
1751- $ ( '.manifest-size-warning' ) . hide ( ) ;
1752- }
1753-
1754- var select_box_div = $ ( '#file-part-select-box' ) ;
1755- var select_box = select_box_div . find ( 'select' ) ;
1756- if ( data . file_parts_count > 1 )
1757- {
1758- select_box_div . show ( ) ;
1759- for ( let i = 0 ; i < data . display_file_parts_count ; ++ i )
1760- {
1761- select_box . append ( $ ( '<option/>' , {
1762- value : i ,
1763- text : "File Part " + ( i + 1 )
1764- } ) ) ;
1765- }
1766-
1767- if ( data . display_file_parts_count < data . file_parts_count )
1768- {
1769- $ ( '#file-export-option' ) . prop ( 'title' , 'Export to files is only available for smaller manifest' ) ;
1770- $ ( '#file-export-option input' ) . prop ( 'disabled' , 'disabled' ) ;
1771- $ ( '#file-export-option input' ) . prop ( 'checked' , false ) ;
1772- $ ( '#bq-export-option input' ) . prop ( 'checked' , true ) . trigger ( "click" ) ;
1773- }
1774- else
1775- {
1776- $ ( '#file-export-option' ) . prop ( 'title' , '' ) ;
1777- $ ( '#file-export-option input' ) . prop ( 'disabled' , '' ) ;
1755+ var select_box_div = $ ( '#file-part-select-box' ) ;
1756+ var select_box = select_box_div . find ( 'select' ) ;
1757+ if ( data . file_parts_count > 1 ) {
1758+ select_box_div . show ( ) ;
1759+ for ( let i = 0 ; i < data . display_file_parts_count ; ++ i ) {
1760+ select_box . append ( $ ( '<option/>' , {
1761+ value : i ,
1762+ text : "File Part " + ( i + 1 )
1763+ } ) ) ;
1764+ }
1765+ } else {
1766+ select_box_div . hide ( ) ;
17781767 }
17791768 }
1780- else
1781- {
1782- select_box_div . hide ( ) ;
1783- }
17841769 } else {
17851770 if ( isFiltered && data . total > 0 ) {
17861771 $ ( '#save-cohort-btn' ) . prop ( 'disabled' , '' ) ;
0 commit comments