Skip to content

Commit

Permalink
Merge pull request #3196 from antgonza/2022.04-GUI-review
Browse files Browse the repository at this point in the history
updates after GUI review
  • Loading branch information
charles-cowart authored Apr 15, 2022
2 parents c8090cd + d265b05 commit 688bf74
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
9 changes: 6 additions & 3 deletions qiita_db/metadata_template/prep_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,12 +809,15 @@ def _get_predecessors(workflow, node):

# 2.
pt_dt = self.data_type()
pt_artifact = self.artifact.artifact_type
workflows = [wk for wk in qdb.software.DefaultWorkflow.iter()
if pt_dt in wk.data_type]
if wk.artifact_type == pt_artifact and
pt_dt in wk.data_type]
if not workflows:
# raises option a.
raise ValueError(f'This preparation data type: "{pt_dt}" does not '
'have valid workflows')
msg = (f'This preparation data type: "{pt_dt}" and/or artifact '
f'type "{pt_artifact}" does not have valid workflows')
raise ValueError(msg)
missing_artifacts = dict()
for wk in workflows:
missing_artifacts[wk] = dict()
Expand Down
5 changes: 3 additions & 2 deletions qiita_db/metadata_template/test/test_prep_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -1417,8 +1417,9 @@ def test_artifact_setter(self):
qdb.sql_connection.perform_as_transaction(
'UPDATE qiita.default_workflow SET artifact_type_id = 10 WHERE '
'default_workflow_id = 1')
with self.assertRaisesRegex(ValueError, 'taxa_summary is not part of '
'this preparation and cannot be applied'):
with self.assertRaisesRegex(ValueError, 'This preparation data type: '
'"16S" and/or artifact type "FASTQ" does '
'not have valid workflows'):
pt.add_default_workflow(qdb.user.User('[email protected]'))

# cleaning
Expand Down
2 changes: 1 addition & 1 deletion qiita_pet/handlers/qiita_redbiom.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def _redbiom_metadata_search(self, query, contexts):
'The query ("%s") did not work and may be malformed. Please '
'check the search help for more information on the queries.'
% query)
if not message:
if not message and redbiom_samples:
study_artifacts = defaultdict(lambda: defaultdict(list))
for ctx in contexts:
# redbiom.fetch.data_from_samples returns a biom, which we
Expand Down
2 changes: 1 addition & 1 deletion qiita_pet/templates/analysis_selected.html
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ <h4 class="modal-title" id="myModalLabel">Processed Data {{pid}}</h4>
{% end %}
</table>
<hr>
<h4>Metadata Selection <small>Common fields for all studies are preselected</small></h4>
<h4>Metadata Selection <small>Common fields for all studies are preselected. Click to view/add unique fields from each dataset.</small></h4>
<table border="0" style="width: 100%;">
<tr>
<td style="width: 50%;">
Expand Down
2 changes: 1 addition & 1 deletion qiita_pet/templates/study_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
{% if editable %}
<a class="btn btn-default btn-block" href="{% raw qiita_config.portal_dir %}/study/upload/{{study_info['study_id']}}"><span class="glyphicon glyphicon-upload"></span> Upload Files</a>
<button class="btn btn-default btn-block" onclick="populate_main_div('{% raw qiita_config.portal_dir %}/study/new_prep_template/', { study_id: {{study_info['study_id']}} })" id="add-new-preparation-btn"><span class="glyphicon glyphicon-plus-sign"></span> Add New Preparation</button>
<button class="btn btn-default btn-block" onclick="populate_main_div('{% raw qiita_config.portal_dir %}/study/analyses/', { study_id: {{study_info['study_id']}} })" id="analyses-btn"><span class="glyphicon glyphicon-info-sign"></span> Analyses using artifacts from this Study</button>
<button class="btn btn-default btn-block" onclick="populate_main_div('{% raw qiita_config.portal_dir %}/study/analyses/', { study_id: {{study_info['study_id']}} })" id="analyses-btn"><span class="glyphicon glyphicon-info-sign"></span> Derived Analyses </button>
{% end %}
{% if study_info['show_biom_download_button'] %}
<a class="btn btn-default btn-block" href="{% raw qiita_config.portal_dir %}/download_study_bioms/{{study_info['study_id']}}"><span class="glyphicon glyphicon-download-alt"></span> All QIIME maps and BIOMs</a>
Expand Down

0 comments on commit 688bf74

Please sign in to comment.