Skip to content

Commit 89040fe

Browse files
committed
-> Small visual changes for manifest downloads
1 parent 9cf92cd commit 89040fe

File tree

4 files changed

+22
-44
lines changed

4 files changed

+22
-44
lines changed

static/js/cohorts/cohort-details.js

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

58-
tippy('.manifest-size-warning',{
59-
content: 'Your cohort is too large to be downloaded in its entirety, and will be truncated at 65,000 records ' +
60-
'ordered by PatientID, CollectionID, StudyInstanceUID, SeriesInstanceUID, SOPInstanceUID, SourceDOI, ' +
61-
'CRDCInstanceUUID, and GCS_URL.',
62-
theme: 'light',
63-
placement: 'left',
64-
arrow: false,
65-
maxWidth: 400
66-
});
67-
6858
var enable_buttons = function() {
6959
$('#download-csv').removeAttr('disabled');
7060
$('#download-tsv').removeAttr('disabled');

static/js/image_search.js

Lines changed: 18 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -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','');

templates/cohorts/cohort_details.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ <h3 class="pull-left" role="heading" aria-level="1">Cohort Name: {{ cohort.name
4242
</div>
4343
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4">
4444
<div class="cohort-manifest pull-right">
45-
<div class="manifest-size-warning"><i class="fa fa-warning"></i></div>
4645
<button id="export-manifest" class="btn btn-special pull-right" data-toggle="modal"
4746
data-target="#export-manifest-modal"> Export Cohort Manifest
4847
</button>

templates/cohorts/export-manifest-modal.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ <h4 class="modal-title" id="exportManifestModal">Export Cohort Manifest</h4>
1818
<button type="button" class="close" data-hide="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
1919
At least one column needs to be selected to export manifest file.
2020
</div>
21+
<div id="file-manifest-max-exceeded" class="alert alert-warning alert-dismissable" style="display: none;">
22+
<button type="button" class="close" data-hide="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
23+
Your manifest is too large to be downloaded. Please use our BigQuery export option. (This requires a Google Account login.)
24+
</div>
2125
</div>
2226
</div>
2327

0 commit comments

Comments
 (0)