mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 07:46:23 -04:00
Don’t show the download until the job is complete
The CSV report isn’t very useful until it has all the rows from your original file. So we shouldn’t show you the link until all notifications have been created. Until this point, it’s useful to know how much longer you need to wait, so this commit adds a percentage count of how much of the file has been processed.
This commit is contained in:
@@ -312,6 +312,9 @@ def _get_job_counts(job, help_argument):
|
||||
def get_job_partials(job):
|
||||
filter_args = _parse_filter_args(request.args)
|
||||
_set_status_filters(filter_args)
|
||||
notifications = notification_api_client.get_notifications_for_service(
|
||||
job['service'], job['id'], status=filter_args.get('status')
|
||||
)
|
||||
return {
|
||||
'counts': render_template(
|
||||
'partials/jobs/count.html',
|
||||
@@ -321,9 +324,9 @@ def get_job_partials(job):
|
||||
),
|
||||
'notifications': render_template(
|
||||
'partials/jobs/notifications.html',
|
||||
notifications=notification_api_client.get_notifications_for_service(
|
||||
job['service'], job['id'], status=filter_args.get('status')
|
||||
)['notifications'],
|
||||
notifications=notifications['notifications'],
|
||||
more_than_one_page=bool(notifications.get('links', {}).get('next')),
|
||||
percentage_complete=(job['notifications_sent'] / job['notification_count'] * 100),
|
||||
download_link=url_for(
|
||||
'.view_job_csv',
|
||||
service_id=current_service['id'],
|
||||
|
||||
Reference in New Issue
Block a user