Skip to content

Commit

Permalink
show whitespace with dot in sample error
Browse files Browse the repository at this point in the history
  • Loading branch information
nitin-ebi committed Jun 14, 2024
1 parent cc3c483 commit fb5c454
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
16 changes: 10 additions & 6 deletions eva_sub_cli/jinja_templates/sample_name_check.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@

{% macro sample_name_check_report(validation_results) -%}
{% set results = validation_results.get('sample_check', {}) %}
{% macro format_error(error) %}
{{ error | replace(' ', '•') }}
{% endmacro %}

{% for analysis, results_for_analysis in results.get('results_per_analysis', {}).items() %}
{% if results_for_analysis.get('difference') %}
{% set expand_icon = "▶" %}
Expand Down Expand Up @@ -33,21 +37,21 @@

<div id="metadata-{{ loop.index0 }}" class="description no-show">
<div class="error-description"><strong>All Errors For Category - Samples described in the metadata but not in the VCF files:</strong></div>
<ul>
<ol>
{% for error in results_for_analysis.get('more_metadata_submitted_files') %}
<li>{{ error }}</li>
<li>{{ format_error(error) }}</li>
{% endfor %}
</ul>
</ol>
<a href="#" onclick="toggleSampleAllErrorsList('metadata-{{ loop.index0 }}'); return false;">Hide</a>
</div>

<div id="vcf-{{ loop.index0 }}" class="description no-show">
<div class="error-description"><strong>All Errors For Category - Samples in the VCF files but not described in the metadata:</strong></div>
<ul>
<ol>
{% for error in results_for_analysis.get('more_submitted_files_metadata') %}
<li>{{ error }}</li>
<li>{{ format_error(error) }}</li>
{% endfor %}
</ul>
</ol>
<a href="#" onclick="toggleSampleAllErrorsList('vcf-{{ loop.index0 }}'); return false;">Hide</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion tests/resources/validation_reports/expected_report.html

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions tests/test_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@
},
'Analysis C': {
'difference': True,
'more_metadata_submitted_files': ['SampleC1', 'SampleC2', 'SampleC3', 'SampleC4'],
'more_metadata_submitted_files': ['SampleC1 ', ' SampleC2', 'SampleC3', 'SampleC4'],
'more_per_submitted_files_metadata': {},
'more_submitted_files_metadata': ['C1Sample', 'C2Sample', 'C3Sample', 'C4Sample']
'more_submitted_files_metadata': ['C1Sample ', ' C2Sample', 'C3Sample', 'C4Sample']
}
}
},
Expand Down

0 comments on commit fb5c454

Please sign in to comment.