Skip to content

Commit e642280

Browse files
committed
-> Better message for cohorts oversize for download but no social account available
2 parents 4819ddd + c091f59 commit e642280

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

static/js/cohorts/cohort-details.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,6 @@ require([
5555
], function($, jqueryui, base, tippy, bootstrap) {
5656
A11y.Core();
5757

58-
var enable_buttons = function() {
59-
$('#download-csv').removeAttr('disabled');
60-
$('#download-tsv').removeAttr('disabled');
61-
$('#download-json').removeAttr('disabled');
62-
$('#get-bq-table').removeAttr('disabled');
63-
};
64-
6558
var downloadToken = new Date().getTime();
6659

6760
$('#download-csv').on('click', function(e) {
@@ -131,7 +124,7 @@ require([
131124

132125
if(manifest_type == 'file-manifest') {
133126
base.blockResubmit(function () {
134-
enable_buttons();
127+
update_download_manifest_buttons();
135128
$('#manifest-in-progress').modal('hide');
136129
}, downloadToken, 'downloadToken');
137130
}
@@ -194,11 +187,11 @@ require([
194187
}
195188
},
196189
complete: function(xhr, status) {
190+
update_download_manifest_buttons();
197191
$('#manifest-in-progress').modal('hide');
198-
enable_buttons();
199192
$('#export-manifest-modal').modal('hide');
200-
$('input[name="manifest-type"][value="file-manifest"]').triggerHandler('click');
201193
$('#export-manifest-form')[0].reset();
194+
$('#bq-export-option input').prop('checked', true).trigger("click");
202195
}
203196
});
204197
}
@@ -220,12 +213,14 @@ require([
220213
$('#download-csv').attr('disabled', 'disabled');
221214
$('#download-tsv').attr('disabled', 'disabled');
222215
$('#download-json').attr('disabled', 'disabled');
216+
$('#get-bq-table').attr('disabled', 'disabled');
223217
}
224218
else
225219
{
226220
$('#download-csv').removeAttr('disabled');
227221
$('#download-tsv').removeAttr('disabled');
228222
$('#download-json').removeAttr('disabled');
223+
$('#get-bq-table').removeAttr('disabled');
229224
}
230225

231226
if (num_selected_column == 0) {

static/js/image_search.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,13 +1737,17 @@ require([
17371737
$('#file-export-option').prop('title', 'Your cohort exceeds the maximum for download.');
17381738
$('#file-export-option input').prop('disabled', 'disabled');
17391739
$('#file-export-option input').prop('checked', false);
1740+
$('#file-manifest').hide();
17401741
if(!user_is_social) {
17411742
$('#need-social-account').show();
17421743
} else {
17431744
$('#file-manifest-max-exceeded').show();
17441745
$('#bq-export-option input').prop('checked', true).trigger("click");
17451746
}
17461747
} else {
1748+
$('#file-manifest-max-exceeded').hide();
1749+
$('#file-manifest').show();
1750+
17471751
var select_box_div = $('#file-part-select-box');
17481752
var select_box = select_box_div.find('select');
17491753
if (data.file_parts_count > 1) {

0 commit comments

Comments
 (0)