mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 05:29:38 -04:00
Change the content for the delete template confirmation dialog.
As per https://www.pivotaltracker.com/story/show/170796514 we want to make the delete template confirmation dialog box more consistent and clear. The API has been updated with a new endpoint that only returns the last-used date, this date is more accurate since it goes to the ft_notification_status table, if the notification table is empty.
This commit is contained in:
@@ -279,7 +279,6 @@ def aggregate_notifications_stats(template_statistics):
|
||||
def get_dashboard_partials(service_id):
|
||||
all_statistics = template_statistics_client.get_template_statistics_for_service(service_id, limit_days=7)
|
||||
template_statistics = aggregate_template_usage(all_statistics)
|
||||
|
||||
stats = aggregate_notifications_stats(all_statistics)
|
||||
column_width, max_notifiction_count = get_column_properties(3)
|
||||
|
||||
|
||||
@@ -672,11 +672,11 @@ def delete_service_template(service_id, template_id):
|
||||
))
|
||||
|
||||
try:
|
||||
last_used_notification = template_statistics_client.get_template_statistics_for_template(
|
||||
last_used_notification = template_statistics_client.get_last_used_date_for_template(
|
||||
service_id, template['id']
|
||||
)
|
||||
message = 'This template has never been used.' if not last_used_notification else \
|
||||
'This template was last used {}.'.format(format_delta(last_used_notification['created_at']))
|
||||
'This template was last used {}.'.format(format_delta(last_used_notification))
|
||||
|
||||
except HTTPError as e:
|
||||
if e.status_code == 404:
|
||||
|
||||
Reference in New Issue
Block a user