Skip to content

Commit b64d327

Browse files
committed
Correctly show warnings
The current behaviour doesn't expect warnings to be an object, and so just shows '[object Object]' instead of the warning. This commit fixes it so that warnings are shown in a table like errors.
1 parent d3f1c3f commit b64d327

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

lib/importer/templates/review.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,13 @@ <h1 class="govuk-heading-l">Review your data</h1>
8080
<p class="govuk-body">
8181
<ul class="govuk-list govuk-list--bullet">
8282
{% for idx, warning in results.warnings %}
83-
<li>Row {{ idx }}: {{ warning }}</li>
83+
{% for e in warning %}
84+
<tr class="govuk-table__row">
85+
<td class="govuk-table__cell"> {{idx}} </td>
86+
<td class="govuk-table__cell"> {{e.field}} </td>
87+
<td class="govuk-table__cell"> {{e.message}} </td>
88+
</tr>
89+
{% endfor %}
8490
{% endfor %}
8591
</ul>
8692
</p>

prototypes/basic/app/views/review.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,13 @@ <h1 class="govuk-heading-l">Review your data</h1>
8080
<p class="govuk-body">
8181
<ul class="govuk-list govuk-list--bullet">
8282
{% for idx, warning in results.warnings %}
83-
<li>Row {{ idx }}: {{ warning }}</li>
83+
{% for e in warning %}
84+
<tr class="govuk-table__row">
85+
<td class="govuk-table__cell"> {{idx}} </td>
86+
<td class="govuk-table__cell"> {{e.field}} </td>
87+
<td class="govuk-table__cell"> {{e.message}} </td>
88+
</tr>
89+
{% endfor %}
8490
{% endfor %}
8591
</ul>
8692
</p>

0 commit comments

Comments
 (0)