Skip to content

Commit 69b5645

Browse files
danteeseantgonza
authored andcommitted
Fix 2230 (#2372)
* fix calls to system_call and ebi submissions * fixing errors * fix if state == submitting: * just raise error * EBISubmissionError -> ComputeError * Fix #2230 solved using modal in order to prevent large file download * Function moved into in order to keep order. Some details fixed.
1 parent 9fe81b0 commit 69b5645

File tree

2 files changed

+26
-17
lines changed

2 files changed

+26
-17
lines changed

qiita_pet/templates/sitebase.html

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,12 @@
235235
});
236236
});
237237

238+
$('#qiita_download_accept').click(function(e){
239+
e.preventDefault();
240+
$('.qiita_pet_download_confirm').modal('hide');
241+
window.location.href = '{% raw qiita_config.portal_dir %}/release/download/public';
242+
});
243+
238244
// Based on http://codepen.io/willvincent/pen/LbeKKW
239245
// and https://datatables.net/examples/api/row_details.html
240246

@@ -555,11 +561,11 @@ <h6>
555561
<a href="#" data-toggle="dropdown" class="dropdown-toggle">Downloads<b class="caret"></b></a>
556562
<ul class="dropdown-menu">
557563
<li>
558-
<a href="{% raw qiita_config.portal_dir %}/release/download/public">
564+
<a type="button" data-toggle="modal" data-target=".qiita_pet_download_confirm">
559565
Public BIOM and metadata files
560566
<small>
561567
<br/><b>MD5:</b> {{public_md5}}
562-
<br/><b>Last update:</b>{{public_timestamp}}
568+
<br/><b>Last update:</b> {{public_timestamp}}
563569
</small>
564570
</a>
565571
</li>
@@ -570,6 +576,24 @@ <h6>
570576
</div>
571577
</div> <!--/.main nav-bar -->
572578

579+
<div class="modal fade qiita_pet_download_confirm" tabindex="-1" role="dialog" aria-labelledby="Confirm download">
580+
<div class="modal-dialog modal-lg" role="document">
581+
<div class="modal-content">
582+
<div class="modal-header">
583+
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
584+
<h4 class="modal-title">File really big.</h4>
585+
</div>
586+
<div class="modal-body">
587+
<p>The file you're trying to download is really big. Would you like to proceed?</p>
588+
</div>
589+
<div class="modal-footer">
590+
<button type="button" class="btn btn-danger" data-dismiss="modal">No</button>
591+
<button type="button" class="btn btn-success" id="qiita_download_accept">Yes</button>
592+
</div>
593+
</div>
594+
</div>
595+
</div>
596+
573597

574598
{% if message != '' %}
575599
{% if level not in {'danger', 'success', 'info', 'warning'} %}

qiita_pet/test/test_download.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -161,21 +161,6 @@ def test_download_study(self):
161161
response = self.get('/download_study_bioms/1')
162162
self.assertEqual(response.code, 200)
163163
exp = (
164-
'- 1256812 /protected/processed_data/1_study_1001_closed_'
165-
'reference_otu_table.biom processed_data/1_study_1001_closed_'
166-
'reference_otu_table.biom\n'
167-
'- 36615 /protected/templates/1_prep_1_qiime_[0-9]*-'
168-
'[0-9]*.txt mapping_files/4_mapping_file.txt\n'
169-
'- 1256812 /protected/processed_data/'
170-
'1_study_1001_closed_reference_otu_table.biom processed_data/'
171-
'1_study_1001_closed_reference_otu_table.biom\n'
172-
'- 36615 /protected/templates/1_prep_1_qiime_[0-9]*-'
173-
'[0-9]*.txt mapping_files/5_mapping_file.txt\n'
174-
'- 1256812 /protected/processed_data/'
175-
'1_study_1001_closed_reference_otu_table_Silva.biom processed_data'
176-
'/1_study_1001_closed_reference_otu_table_Silva.biom\n'
177-
'- 36615 /protected/templates/1_prep_1_qiime_[0-9]*-'
178-
'[0-9]*.txt mapping_files/6_mapping_file.txt\n'
179164
'- [0-9]* /protected/BIOM/{0}/otu_table.biom '
180165
'BIOM/{0}/otu_table.biom\n'
181166
'- 1 /protected/BIOM/{0}/sortmerna_picked_otus/seqs_otus.log '

0 commit comments

Comments
 (0)