Skip to content

Commit

Permalink
fix SelectedSamplesHandler.get
Browse files Browse the repository at this point in the history
  • Loading branch information
antgonza committed Jul 1, 2022
1 parent 0022064 commit 2ed031e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
6 changes: 3 additions & 3 deletions qiita_db/software.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ class Command(qdb.base.QiitaObject):
-------------
create
exists
get_commands_by_input_type(cls, artifact_types, active_only=True,
get_html_generator(cls, artifact_type):
get_validator(cls, artifact_type):
get_commands_by_input_type
get_html_generator
get_validator
See Also
--------
Expand Down
14 changes: 8 additions & 6 deletions qiita_pet/handlers/analysis_handlers/listing_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,15 @@ def get(self):

# finding common metadata fields
metadata = analysis.metadata_categories
common = []
common = {'sample': set(), 'prep': set()}
for i, (_, m) in enumerate(metadata.items()):
if i == 0:
common = {'sample': set(m['sample']), 'prep': set(m['prep'])}
else:
common['sample'] = common['sample'] & set(m['sample'])
common['prep'] = common['prep'] & set(m['prep'])
svals = set(m['sample'])
pvals = set(m['prep'])
if i != 0:
svals = common['sample'] & svals
pvals = common['prep'] & pvals
common['sample'] = svals
common['prep'] = pvals

self.render("analysis_selected.html", sel_data=sel_data,
proc_info=proc_data_info, metadata=metadata, common=common)
9 changes: 2 additions & 7 deletions qiita_pet/templates/analysis_selected.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,8 @@
$('#clear-button').on('click', clear);
{% if sel_data %}$('#no-selected').hide(){% end %}

{% if 'common' in locals() %}
var common_sample_fields = {% raw list(common['sample']) %};
var common_prep_fields = {% raw list(common['prep']) %};
{% else %}
var common_sample_fields = [];
var common_prep_fields = [];
{% end %}
var common_sample_fields = {% raw list(common['sample']) %};
var common_prep_fields = {% raw list(common['prep']) %};

$.each($(".chosen-select"), function (_, element){
var is_sample = element.id.startsWith('sample-metadata');
Expand Down

0 comments on commit 2ed031e

Please sign in to comment.