mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-09 17:19:48 -04:00
Put error flag on whole row
We’ve seen people miss errors if they’re in the right-hand columns of the spreadsheet because people’s eyes scan down the left edge of the table.
This commit is contained in:
@@ -73,9 +73,9 @@
|
|||||||
</th>
|
</th>
|
||||||
{%- endmacro %}
|
{%- endmacro %}
|
||||||
|
|
||||||
{% macro index_field(text) -%}
|
{% macro index_field(text=None) -%}
|
||||||
<td class="table-field-index">
|
<td class="table-field-index">
|
||||||
<span>{{ text }}</span>
|
{{ text if text != None else caller() }}
|
||||||
</td>
|
</td>
|
||||||
{%- endmacro %}
|
{%- endmacro %}
|
||||||
|
|
||||||
|
|||||||
@@ -191,11 +191,15 @@
|
|||||||
'<span class="visually-hidden">Row in file</span><span aria-hidden="true">1</span>'|safe
|
'<span class="visually-hidden">Row in file</span><span aria-hidden="true">1</span>'|safe
|
||||||
] + recipients.column_headers
|
] + recipients.column_headers
|
||||||
) %}
|
) %}
|
||||||
{{ index_field(item.index + 2) }}
|
{% call index_field() %}
|
||||||
|
<span class="{% if item.index in recipients.rows_with_errors %}table-field-error{% endif %}">
|
||||||
|
{{ item.index + 2 }}
|
||||||
|
</span>
|
||||||
|
{% endcall %}
|
||||||
{% for column in recipients.column_headers %}
|
{% for column in recipients.column_headers %}
|
||||||
{% if item['columns'][column].error and not recipients.missing_column_headers %}
|
{% if item['columns'][column].error and not recipients.missing_column_headers %}
|
||||||
{% call field() %}
|
{% call field() %}
|
||||||
<span class="table-field-error">
|
<span>
|
||||||
<span class="table-field-error-label">{{ item['columns'][column].error }}</span>
|
<span class="table-field-error-label">{{ item['columns'][column].error }}</span>
|
||||||
{{ item['columns'][column].data if item['columns'][column].data != None }}
|
{{ item['columns'][column].data if item['columns'][column].data != None }}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ def test_upload_valid_csv_shows_file_contents(
|
|||||||
assert response.status_code == 200
|
assert response.status_code == 200
|
||||||
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
|
||||||
for index, cell in enumerate([
|
for index, cell in enumerate([
|
||||||
'<td class="table-field-index"> <span>2</span> </td>',
|
'<td class="table-field-index"> <span class=""> 2 </span> </td>',
|
||||||
'<td class="table-field-center-aligned "> <div class=""> 07700900986 </div> </td>',
|
'<td class="table-field-center-aligned "> <div class=""> 07700900986 </div> </td>',
|
||||||
'<td class="table-field-center-aligned "> <div class=""> Jo </div> </td>',
|
'<td class="table-field-center-aligned "> <div class=""> Jo </div> </td>',
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user