Skip to content

Commit 91f0051

Browse files
authored
Merge pull request #2289 from antgonza/jobs-list-as-modal
Jobs list as modal
2 parents a9aa1c4 + b8e3da4 commit 91f0051

File tree

3 files changed

+27
-41
lines changed

3 files changed

+27
-41
lines changed

qiita_pet/static/css/style.css

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@
33
height: 100%;
44
width: 100%;
55
}
6-
#qiita-processing {
7-
position: absolute;
8-
height: 100%;
9-
width: 0%;
10-
right: 0;
11-
top: 0;
12-
}
136
#template-content{
147
padding: 10px;
158
height: 100%;

qiita_pet/static/js/qiita.js

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -118,28 +118,6 @@ function delete_analysis(aname, analysis_id) {
118118
}
119119
}
120120

121-
/*
122-
* show_hide_process_list will toggle the process/job listing visibility
123-
*/
124-
125-
function show_hide_process_list() {
126-
if ($("#qiita-main").width() == $("#qiita-main").parent().width()) {
127-
// let's update the job list
128-
processing_jobs_vue.update_processing_job_data();
129-
$("#qiita-main").width("76%");
130-
$("#user-studies-table").width("76%");
131-
$("#studies-table").width("76%");
132-
$("#qiita-processing").width("24%");
133-
$("#qiita-processing").show();
134-
} else {
135-
$("#qiita-main").width("100%");
136-
$("#user-studies-table").width("100%");
137-
$("#studies-table").width("100%");
138-
$("#qiita-processing").width("0%");
139-
$("#qiita-processing").hide();
140-
}
141-
}
142-
143121
/*
144122
* send_samples_to_analysis send the selected samples for the given artifact ids to analysis
145123
*

qiita_pet/templates/sitebase.html

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -367,13 +367,15 @@
367367
mounted() {
368368
let vm = this;
369369
setInterval(function (){
370-
// the div is hidden
371-
if ($("#qiita-main").width() != $("#qiita-main").parent().width()) {
370+
// if modal is shown, https://stackoverflow.com/a/3282893
371+
if (($('#qiita-processing').data('bs.modal') || {}).isShown){
372372
vm.update_processing_job_data();
373373
}
374374
}, 30000);
375375
}
376376
});
377+
378+
$('#qiita-processing').on('shown.bs.modal', processing_jobs_vue.update_processing_job_data);
377379
});
378380

379381
</script>
@@ -476,7 +478,7 @@
476478
</ul>
477479
</li>
478480
<li class="dropdown">
479-
<a href="#" onClick="show_hide_process_list()" id="dflt-sel-info"><span class="glyphicon glyphicon-tasks"></span></a>
481+
<a href="#" data-toggle='modal' data-target='#qiita-processing' id="dflt-sel-info"><span class="glyphicon glyphicon-tasks"></span></a>
480482
</li>
481483
</ul>
482484
<!-- otherwise show the login form -->
@@ -606,15 +608,28 @@ <h1>This site only works with the following browsers</h1>
606608
</div>
607609
</div>
608610

609-
<div id="qiita-processing" class="pre-scrollable" style="max-height: 100%">
610-
<div id="processing-jobs-table" style="padding: 5px 5px;">
611-
<h3>
612-
Processing Jobs <br/>
613-
<small>(skipping successful jobs)</small>
614-
</h3>
615-
Search: <input v-model="search">
616-
<hr>
617-
<data-table-processing-jobs :jobs="filteredJobs"></data-table-processing-jobs>
611+
<!-- the jobs list is shown as a modal view -->
612+
<div id="qiita-processing" class="modal fade" role="dialog">
613+
<div class="modal-dialog">
614+
615+
<div class="modal-content">
616+
<div class="modal-header">
617+
<button type="button" class="close" data-dismiss="modal">&times;</button>
618+
<h4 class="modal-title">Active Jobs</h4>
619+
<h6 class="modal-title">succesful jobs are not shown</h6>
620+
</div>
621+
622+
<div id='processing-jobs-table' class="modal-body">
623+
Search: <input v-model="search">
624+
<hr>
625+
<data-table-processing-jobs :jobs="filteredJobs"></data-table-processing-jobs>
626+
</div>
627+
628+
<div class="modal-footer">
629+
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
630+
</div>
631+
</div>
632+
618633
</div>
619634
</div>
620635

0 commit comments

Comments
 (0)