Skip to content

Commit 2a88f70

Browse files
authored
Merge pull request #474 from ImagingDataCommons/idc-test-sp
Sprint 15
2 parents b7f19fb + 9cb94d2 commit 2a88f70

File tree

7 files changed

+42
-42
lines changed

7 files changed

+42
-42
lines changed

idc/templatetags/custom_tags.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ def ceiling(item):
123123
return math.ceil(item)
124124

125125

126+
@register.filter
127+
def floor(item):
128+
return math.floor(item)
129+
130+
126131

127132

128133
@register.filter

static/css/style.css

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1745,29 +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.file_parts_count; ++i)
1760-
{
1761-
select_box.append($('<option/>', {
1762-
value: i,
1763-
text : "File Part " + (i + 1)
1764-
}));
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();
17651767
}
17661768
}
1767-
else
1768-
{
1769-
select_box_div.hide();
1770-
}
17711769
} else {
17721770
if (isFiltered && data.total > 0){
17731771
$('#save-cohort-btn').prop('disabled','');
@@ -2866,7 +2864,7 @@ require([
28662864
}
28672865
else{
28682866
min = Math.floor(curmin);
2869-
max = Math.floor(curmax);
2867+
max = Math.ceil(curmax);
28702868
lower=min;
28712869
upper=max;
28722870
//$(this).attr('data-curminrng', lower);

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: 6 additions & 2 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

@@ -116,8 +120,8 @@ <h4 class="modal-title" id="exportManifestModal">Export Cohort Manifest</h4>
116120

117121
<!-- Export Option -->
118122
<div class="export-option">
119-
<span class="value"><input type="radio" name="manifest-type" value="file-manifest" checked> Files</span>
120-
<span style="margin-left:10px" class="value" {% if not is_social %}title="Export to BigQuery is only available with a Google Account."{% endif %}>
123+
<span id="file-export-option" title="" class="value"><input type="radio" name="manifest-type" value="file-manifest" checked> Files</span>
124+
<span id="bq-export-option" style="margin-left:10px" class="value" {% if not is_social %}title="Export to BigQuery is only available with a Google Account."{% endif %}>
121125
<input type="radio" name="manifest-type" value="bq-manifest" {% if not is_social %}disabled{% endif %}> BigQuery</span>
122126
</div>
123127
<br>

templates/idc/explore_data_core.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@ <h4 class="panel-title">Search Configuration
178178
<div id="{{ attr.name }}" data-filter-attr-id="{{ attr.id }}" class="collapse list-group-item__body"
179179

180180
{% if attr.min_max %}
181-
data-min="{{ attr.min_max.min }}" data-max="{{ attr.min_max.max }}"
181+
data-min="{{ attr.min_max.min|floor }}" data-max="{{ attr.min_max.max|ceiling }}"
182182
data-curmin="{{ attr.min_max.min }}" data-curmax="{{ attr.min_max.max }}"
183-
data-curminrng="{{ attr.min_max.min }}" data-curmaxrng="{{ attr.min_max.max }}"
183+
data-curminrng="{{ attr.min_max.min|floor }}" data-curmaxrng="{{ attr.min_max.max|ceiling }}"
184184

185185
{% endif %}>
186186
{% comment %}
@@ -249,9 +249,9 @@ <h4 class="panel-title">Search Configuration
249249

250250
<div id="{{ attr.name }}" data-filter-attr-id="{{ attr.id }}" data-filter-display-attr="{{ attr.display_name }}" data-plotnm="{{ attr.name|plotnm }}" class="collapse list-group-item__body collapse"
251251
{% if attr.min_max %}
252-
data-min="{{ attr.min_max.min }}" data-max="{{ attr.min_max.max|ceiling }}"
253-
data-curmin="{{ attr.min_max.min }}" data-curmax="{{ attr.min_max.max|ceiling }}"
254-
data-curminrng="{{ attr.min_max.min }}" data-curmaxrng="{{ attr.min_max.max|ceiling }}"
252+
data-min="{{ attr.min_max.min|floor }}" data-max="{{ attr.min_max.max|ceiling }}"
253+
data-curmin="{{ attr.min_max.min }}" data-curmax="{{ attr.min_max.max }}"
254+
data-curminrng="{{ attr.min_max.min|floor }}" data-curmaxrng="{{ attr.min_max.max|ceiling }}"
255255
{% endif %}>
256256
<ul id="{{ attr.name }}_list" class="search-checkbox-list" style="list-style: none;">
257257
{% for val in attr.values|order_seg:attr_setK %}
@@ -316,10 +316,10 @@ <h4 class="panel-title">Search Configuration
316316
</div>
317317
<div id="{{ attr.name }}" data-filter-attr-id="{{ attr.id }}" class="collapse list-group-item__body collapse" aria-expanded="false"
318318
{% if attr.min_max %}
319-
data-min="{{ attr.min_max.min }}" data-filter-display-attr="{{ attr.display_name }}"
319+
data-min="{{ attr.min_max.min|floor }}" data-filter-display-attr="{{ attr.display_name }}"
320320
data-max="{{ attr.min_max.max|ceiling }}"
321-
data-curmin="{{ attr.min_max.min }}" data-curmax="{{ attr.min_max.max|ceiling }}"
322-
data-curminrng="{{ attr.min_max.min }}" data-curmaxrng="{{ attr.min_max.max|ceiling }}"
321+
data-curmin="{{ attr.min_max.min }}" data-curmax="{{ attr.min_max.max }}"
322+
data-curminrng="{{ attr.min_max.min|floor }}" data-curmaxrng="{{ attr.min_max.max|ceiling }}"
323323
{% endif %}>
324324
<ul id="{{ attr.name }}_list" class="search-checkbox-list" style="list-style: none;">
325325
{% for val in attr.values %}

0 commit comments

Comments
 (0)