Skip to content

Commit a058102

Browse files
authored
Merge pull request #2200 from antgonza/partial-2188
partial fix -- 2188
2 parents 1648e9f + 737207c commit a058102

File tree

8 files changed

+13
-502
lines changed

8 files changed

+13
-502
lines changed

qiita_pet/handlers/api_proxy/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@
3434
artifact_patch_request, artifact_get_info)
3535
from .ontology import ontology_patch_handler
3636
from .processing import (
37-
list_commands_handler_get_req, process_artifact_handler_get_req,
38-
list_options_handler_get_req, workflow_handler_post_req,
39-
workflow_handler_patch_req, workflow_run_post_req,
40-
job_ajax_get_req)
37+
list_commands_handler_get_req, list_options_handler_get_req,
38+
workflow_handler_post_req, workflow_handler_patch_req,
39+
workflow_run_post_req, job_ajax_get_req)
4140
from .user import (user_jobs_get_req)
4241

4342
__version__ = "0.2.0-dev"

qiita_pet/handlers/api_proxy/processing.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,10 @@
1010

1111
from qiita_db.user import User
1212
from qiita_db.software import Command, Parameters, DefaultParameters
13-
from qiita_db.artifact import Artifact
1413
from qiita_db.processing_job import ProcessingWorkflow, ProcessingJob
1514
from qiita_db.exceptions import QiitaDBUnknownIDError
1615

1716

18-
def process_artifact_handler_get_req(artifact_id):
19-
"""Returns the information for the process artifact handler
20-
21-
Parameters
22-
----------
23-
artifact_id : int
24-
The artifact to be processed
25-
26-
Returns
27-
-------
28-
dict of str
29-
A dictionary containing the artifact information
30-
{'status': str,
31-
'message': str,
32-
'name': str,
33-
'type': str}
34-
"""
35-
artifact = Artifact(artifact_id)
36-
37-
return {'status': 'success',
38-
'message': '',
39-
'name': artifact.name,
40-
'type': artifact.artifact_type,
41-
'study_id': artifact.study.id}
42-
43-
4417
def list_commands_handler_get_req(artifact_types, exclude_analysis):
4518
"""Retrieves the commands that can process the given artifact types
4619

qiita_pet/handlers/api_proxy/tests/test_processing.py

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,11 @@
1313
from qiita_db.software import Command, Parameters
1414
from qiita_db.user import User
1515
from qiita_pet.handlers.api_proxy.processing import (
16-
process_artifact_handler_get_req, list_commands_handler_get_req,
17-
list_options_handler_get_req, workflow_handler_post_req,
18-
workflow_handler_patch_req, job_ajax_get_req)
16+
list_commands_handler_get_req, list_options_handler_get_req,
17+
workflow_handler_post_req, workflow_handler_patch_req, job_ajax_get_req)
1918

2019

2120
class TestProcessingAPIReadOnly(TestCase):
22-
def test_process_artifact_handler_get_req(self):
23-
obs = process_artifact_handler_get_req(1)
24-
exp = {'status': 'success',
25-
'message': '',
26-
'name': 'Raw data 1',
27-
'type': 'FASTQ',
28-
'study_id': 1}
29-
self.assertEqual(obs, exp)
30-
31-
obs = process_artifact_handler_get_req(2)
32-
exp = {'status': 'success',
33-
'message': '',
34-
'name': 'Demultiplexed 1',
35-
'type': 'Demultiplexed',
36-
'study_id': 1}
37-
self.assertEqual(obs, exp)
38-
3921
def test_list_commands_handler_get_req(self):
4022
obs = list_commands_handler_get_req('FASTQ', True)
4123
exp = {'status': 'success',

qiita_pet/handlers/study_handlers/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717
from .prep_template import (
1818
PrepTemplateGraphAJAX, PrepTemplateAJAX, PrepFilesHandler,
1919
NewPrepTemplateAjax, PrepTemplateSummaryAJAX)
20-
from .processing import (ProcessArtifactHandler, ListCommandsHandler,
21-
ListOptionsHandler, WorkflowHandler,
22-
WorkflowRunHandler, JobAJAX)
20+
from .processing import (ListCommandsHandler, ListOptionsHandler,
21+
WorkflowHandler, WorkflowRunHandler, JobAJAX)
2322
from .artifact import (ArtifactGraphAJAX, NewArtifactHandler,
2423
ArtifactAdminAJAX, ArtifactGetSamples, ArtifactGetInfo)
2524
from .sample_template import SampleTemplateAJAX, SampleAJAX
@@ -29,7 +28,7 @@
2928
'VAMPSHandler', 'SearchStudiesAJAX', 'PrepTemplateGraphAJAX',
3029
'ArtifactGraphAJAX', 'ArtifactAdminAJAX', 'StudyIndexHandler',
3130
'StudyBaseInfoAJAX', 'SampleTemplateAJAX', 'PrepTemplateAJAX',
32-
'NewArtifactHandler', 'PrepFilesHandler', 'ProcessArtifactHandler',
31+
'NewArtifactHandler', 'PrepFilesHandler',
3332
'ListCommandsHandler', 'ListOptionsHandler', 'SampleAJAX',
3433
'StudyDeleteAjax', 'NewPrepTemplateAjax',
3534
'DataTypesMenuAJAX', 'StudyFilesAJAX', 'PrepTemplateSummaryAJAX',

qiita_pet/handlers/study_handlers/processing.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,13 @@
1010

1111
from tornado.web import authenticated
1212

13-
from qiita_pet.handlers.util import to_int
1413
from qiita_pet.handlers.base_handlers import BaseHandler
1514
from qiita_pet.handlers.api_proxy import (
16-
list_commands_handler_get_req, process_artifact_handler_get_req,
17-
list_options_handler_get_req, workflow_handler_post_req,
18-
workflow_handler_patch_req, job_ajax_get_req,
15+
list_commands_handler_get_req, list_options_handler_get_req,
16+
workflow_handler_post_req, workflow_handler_patch_req, job_ajax_get_req,
1917
workflow_run_post_req)
2018

2119

22-
class ProcessArtifactHandler(BaseHandler):
23-
@authenticated
24-
def get(self):
25-
artifact_id = to_int(self.get_argument('artifact_id'))
26-
res = process_artifact_handler_get_req(artifact_id)
27-
res['artifact_id'] = artifact_id
28-
self.render('study_ajax/processing_artifact.html', **res)
29-
30-
3120
class ListCommandsHandler(BaseHandler):
3221
@authenticated
3322
def get(self):

qiita_pet/handlers/study_handlers/tests/test_processing.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@
1010
from qiita_pet.test.tornado_test_base import TestHandlerBase
1111

1212

13-
class ProcessArtifactHandler(TestHandlerBase):
14-
# TODO: Missing tests
15-
pass
16-
17-
1813
class ListCommandsHandler(TestHandlerBase):
1914
# TODO: Missing tests
2015
pass

qiita_pet/templates/artifact_ajax/processing_artifact.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,9 @@
400400
var sel = $('<select>').appendTo($colDiv).attr('id', 'command-sel').attr('name', 'command').addClass('form-control').attr('placeholder', 'Choose command...');
401401
sel.append($("<option>").attr('value', "").text("Choose command...").prop('disabled', true).prop('selected', true));
402402
for(var i=0; i<data.commands.length; i++) {
403-
sel.append($("<option>").attr('value', data.commands[i].id).text(data.commands[i].command));
403+
if (data.commands[i].output.length != 0) {
404+
sel.append($("<option>").attr('value', data.commands[i].id).text(data.commands[i].command));
405+
}
404406
}
405407
sel.change(function(event) {
406408
$("#cmd-opts-div").empty();

0 commit comments

Comments
 (0)