Skip to content

Commit

Permalink
[#1117] Fix validation modals and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Bjwebb authored and robredpath committed Jun 7, 2019
1 parent abc4de6 commit 1b63e48
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
26 changes: 18 additions & 8 deletions cove_360/templates/cove_360/explore.html
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ <h3 class="panel-title panel-title-explore">
<br>
<p class="explanation">&nbsp;{% trans "There are some <strong>validation errors</strong> in your data, please check them in the table(s) below." %}</p>
<br>
{% with validation_errors=validation_errors_grouped.required %}
{% with validation_errors=validation_errors_grouped.required error_prefix='required-' %}
{% if validation_errors %}
<div class="panel panel-default">
<div class="panel-heading">
Expand All @@ -165,9 +165,14 @@ <h4>Missing Fields</h4>
{% include "validation_table.html" %}
</div>
</div>
{% for error_json, values in validation_errors %}
{% with error=error_json|json_decode %}
{% cove_modal_errors className="validation-errors-"|concat:error_prefix|concat:forloop.counter modalTitle=error.message errorList=values file_type=file_type full_table=True %}
{% endwith %}
{% endfor %}
{% endif %}
{% endwith %}
{% with validation_errors=validation_errors_grouped.format %}
{% with validation_errors=validation_errors_grouped.format error_prefix='format-' %}
{% if validation_errors %}
<div class="panel panel-default">
<div class="panel-heading">
Expand All @@ -178,9 +183,14 @@ <h4>Incorrect Formats</h4>
{% include "validation_table.html" %}
</div>
</div>
{% for error_json, values in validation_errors %}
{% with error=error_json|json_decode %}
{% cove_modal_errors className="validation-errors-"|concat:error_prefix|concat:forloop.counter modalTitle=error.message errorList=values file_type=file_type full_table=True %}
{% endwith %}
{% endfor %}
{% endif %}
{% endwith %}
{% with validation_errors=validation_errors_grouped.other %}
{% with validation_errors=validation_errors_grouped.other error_prefix='other-' %}
{% if validation_errors %}
<div class="panel panel-default">
<div class="panel-heading">
Expand All @@ -191,17 +201,17 @@ <h4>Other</h4>
{% include "validation_table.html" %}
</div>
</div>
{% for error_json, values in validation_errors %}
{% with error=error_json|json_decode %}
{% cove_modal_errors className="validation-errors-"|concat:error_prefix|concat:forloop.counter modalTitle=error.message errorList=values file_type=file_type full_table=True %}
{% endwith %}
{% endfor %}
{% endif %}
{% endwith %}
{% endif %}
</div>
</div>
</div>
{% for error_json, values in validation_errors %}
{% with error=error_json|json_decode %}
{% cove_modal_errors className="validation-errors-"|concat:forloop.counter modalTitle=error.message errorList=values file_type=file_type full_table=True %}
{% endwith %}
{% endfor %}
{% endblock validation %}

{% block quality_accuracy %}
Expand Down
2 changes: 1 addition & 1 deletion cove_360/tests_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def server_url(request, live_server):
'individual awards ranging from £152,505 (lowest) to £178,990 (highest)',
'Convert to Spreadsheet',
'Invalid against Schema 15 Errors',
'There are some validation errors in your data, please check them in the table below',
'There are some validation errors in your data, please check them in the table(s) below',
'Non-unique ID Values',
'Grant identifiers: 2',
'Funder organisation identifiers: 1',
Expand Down

0 comments on commit 1b63e48

Please sign in to comment.