mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 22:40:31 -04:00
Make jobs filterable by notification status
We can filter all notifications by status already. This commit reuses the same code to filter the notifications for a job by status. This means that, visually we can show the count on a job the same as we do for all notifications, which is similar to how we show the counts on the dashboard, so hopefully it feels like a bit more of a solid thing. This also applies to CSV downloads and AJAX updates, which will inherit any filtering that their parent page has applied.
This commit is contained in:
@@ -1,30 +1,16 @@
|
||||
{% from "components/big-number.html" import big_number %}
|
||||
{% from "components/pill.html" import pill %}
|
||||
|
||||
<div
|
||||
{% if not finished %}
|
||||
data-module="update-content"
|
||||
data-resource="{{url_for(".view_job_updates", service_id=current_service.id, job_id=job.id)}}"
|
||||
data-resource="{{url_for(".view_job_updates", service_id=current_service.id, job_id=job.id, status=status, help=request.args.get('help', 0))}}"
|
||||
data-key="counts"
|
||||
aria-live="polite"
|
||||
{% endif %}
|
||||
>
|
||||
|
||||
<ul class="grid-row job-totals">
|
||||
<li class="column-one-quarter">
|
||||
{{ big_number(
|
||||
job.get('notifications_sent', 0) - job.get('notifications_delivered', 0) - job.get('notifications_failed', 0), 'sending'
|
||||
)}}
|
||||
</li>
|
||||
<li class="column-one-quarter">
|
||||
{{ big_number(
|
||||
job.get('notifications_delivered', 0), 'delivered'
|
||||
)}}
|
||||
</li>
|
||||
<li class="column-one-quarter">
|
||||
{{ big_number(
|
||||
job.notifications_failed, 'failed'
|
||||
)}}
|
||||
</li>
|
||||
</ul>
|
||||
<div class="bottom-gutter">
|
||||
{{ pill('Status', counts, status) }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
{% from "components/table.html" import list_table, field, right_aligned_field_heading, date_field, row_heading %}
|
||||
|
||||
<div
|
||||
class='dashboard-table'
|
||||
{% if notifications %}
|
||||
class='dashboard-table'
|
||||
{% endif %}
|
||||
{% if not finished %}
|
||||
data-module="update-content"
|
||||
data-resource="{{url_for(".view_job_updates", service_id=current_service.id, job_id=job.id)}}"
|
||||
data-resource="{{url_for(".view_job_updates", service_id=current_service.id, job_id=job.id, status=request.args.get('status'), help=request.args.get('help'))}}"
|
||||
data-key="notifications"
|
||||
aria-live="polite"
|
||||
{% endif %}
|
||||
@@ -12,7 +14,7 @@
|
||||
|
||||
{% if notifications %}
|
||||
<p class="bottom-gutter">
|
||||
<a href="{{ request.url }}?&download=csv" download="download" class="heading-small">Download as a CSV file</a>
|
||||
<a href="{{ url_for('.view_job_csv', service_id=current_service.id, job_id=job.id, status=status) }}" download="download" class="heading-small">Download as a CSV file</a>
|
||||
 
|
||||
Delivery information is available for 7 days
|
||||
</p>
|
||||
@@ -22,7 +24,7 @@
|
||||
notifications,
|
||||
caption=uploaded_file_name,
|
||||
caption_visible=False,
|
||||
empty_message="No messages to show yet",
|
||||
empty_message="No messages to show",
|
||||
field_headings=[
|
||||
'Recipient',
|
||||
'Time',
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<div
|
||||
{% if not finished %}
|
||||
data-module="update-content"
|
||||
data-resource="{{url_for(".view_job_updates", service_id=current_service.id, job_id=job.id)}}"
|
||||
data-resource="{{url_for(".view_job_updates", service_id=current_service.id, job_id=job.id, status=status, help=request.args.get('help', 0))}}"
|
||||
data-key="status"
|
||||
aria-live="polite"
|
||||
{% endif %}
|
||||
>
|
||||
<p class='heading-small'>
|
||||
<p class='heading-small bottom-gutter'>
|
||||
Uploaded by {{ job.created_by.name }} on {{ job.created_at|format_datetime_short }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user