Removing reports column and adjusting tests

This commit is contained in:
Jonathan Bobel
2024-08-08 14:42:15 -04:00
parent e7e3bac36c
commit c778ad092b
3 changed files with 4 additions and 31 deletions

View File

@@ -111,8 +111,8 @@ def format_datetime_scheduled_notification(date):
def format_datetime_table(date):
# example: Sent on 03-18-2024 at 04:53 PM, intended for datetimes in tables
return "Sent on {} at {}".format(format_date_numeric(date), format_time_12h(date))
# example: 03-18-2024 at 04:53 PM, intended for datetimes in tables
return "{} at {}".format(format_date_numeric(date), format_time_12h(date))
def format_time_12h(date):

View File

@@ -68,7 +68,6 @@
<th data-sortable scope="col" class="table-field-heading"><span>Template</span></th>
<th data-sortable scope="col" class="table-field-heading"><span>Job status</span></th>
<th data-sortable scope="col" class="table-field-heading"><span># of Recipients</span></th>
<th data-sortable scope="col" class="table-field-heading"><span>Report</span></th>
</tr>
</thead>
<tbody>
@@ -83,18 +82,11 @@
</a>
</td>
<td class="table-field template">{{ job.template_name }}</td>
<td class="table-field time-sent">
<td class="table-field time-sent">Sent on
{{ (job.processing_finished if job.processing_finished else job.processing_started
if job.processing_started else job.created_at)|format_datetime_table }}
</td>
<td class="table-field count-of-recipients">{{ job.notification_count }}</td>
<td class="table-field report">
{% if job.time_left != "Data no longer available" %}
<a href="{{ job.download_link }}"><img src="{{ url_for('static', filename='img/material-icons/file_download.svg') }}" alt="File Download Icon"></a>
{% elif job %}
<span>N/A</span>
{% endif %}
</td>
</tr>
{% endif %}
{% endfor %}
@@ -117,7 +109,6 @@
<th data-sortable scope="col" role="columnheader" class="table-field-heading"><span>Job status</span></th>
<th data-sortable scope="col" role="columnheader" class="table-field-heading"><span>Sender</span></th>
<th data-sortable scope="col" role="columnheader" class="table-field-heading"><span># of Recipients</span></th>
<th data-sortable scope="col" role="columnheader" class="table-field-heading"><span>Report</span></th>
</tr>
</thead>
<tbody>
@@ -131,20 +122,12 @@
</a>
</td>
<td class="table-field template">{{ job.template_name }}</td>
<td class="table-field time-sent">
<td class="table-field time-sent">Sent on
{{ (job.processing_finished if job.processing_finished else job.processing_started
if job.processing_started else job.created_at)|format_datetime_table }}
</td>
<td class="table-field sender">{{ job.created_by.name }}</td>
<td class="table-field count-of-recipients">{{ job.notification_count }}</td>
<td class="table-field report">
{% if job.time_left != "Data no longer available" %}
<a class="usa-link file-list-filename" href="{{ job.download_link }}">Download</a>
<span class="usa-hint">{{ job.time_left }}</span>
{% elif job %}
<span>{{ job.time_left }}</span>
{% endif %}
</td>
</tr>
{% endfor %}
{% else %}

View File

@@ -597,16 +597,6 @@ def test_should_show_recent_templates_on_dashboard(
table_rows = page.find_all("tbody")[0].find_all("tr")
assert len(table_rows) == 2
assert "two" in table_rows[0].find_all("td")[0].text
assert "Email template" in table_rows[0].find_all("td")[0].text
assert "200" in table_rows[0].find_all("td")[1].text
assert "one" in table_rows[1].find_all("td")[0].text
assert "Text message template" in table_rows[1].find_all("td")[0].text
assert "100" in table_rows[1].find_all("td")[1].text
@pytest.mark.parametrize(
"stats",