mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-24 09:21:06 -04:00
Change ‘processed’ to ‘total’
Processed is not an easy to understand thing, and the overlap with sending/delivered/failed is not easy to intuit. ‘Total’ is a much easier concept to grasp (it relates directly to your file), and it’s less distracting because it doesn’t change.
This commit is contained in:
@@ -250,7 +250,7 @@ def get_status_filters(service, message_type, statistics):
|
||||
|
||||
filters = [
|
||||
# key, label, option
|
||||
('requested', 'processed', 'sending,delivered,failed'),
|
||||
('requested', 'total', 'sending,delivered,failed'),
|
||||
('sending', 'sending', 'sending'),
|
||||
('delivered', 'delivered', 'delivered'),
|
||||
('failed', 'failed', 'failed'),
|
||||
@@ -287,8 +287,8 @@ def _get_job_counts(job, help_argument):
|
||||
count
|
||||
) for label, query_param, count in [
|
||||
[
|
||||
'Processed', '',
|
||||
job.get('notifications_sent', 0)
|
||||
'total', '',
|
||||
job.get('notification_count', 0)
|
||||
],
|
||||
[
|
||||
'Sending', 'sending',
|
||||
@@ -299,12 +299,12 @@ def _get_job_counts(job, help_argument):
|
||||
)
|
||||
],
|
||||
[
|
||||
'Delivered', 'delivered',
|
||||
'delivered', 'delivered',
|
||||
job.get('notifications_delivered', 0)
|
||||
],
|
||||
[
|
||||
'Failed', 'failed',
|
||||
job.get('notifications_failed')
|
||||
'failed', 'failed',
|
||||
job.get('notifications_failed', 0)
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
@@ -179,7 +179,7 @@ def test_should_show_updates_for_one_job_as_json(
|
||||
@pytest.mark.parametrize(
|
||||
"status_argument, expected_api_call", [
|
||||
(
|
||||
'processed',
|
||||
'',
|
||||
['sending', 'delivered', 'failed', 'temporary-failure', 'permanent-failure', 'technical-failure']
|
||||
),
|
||||
(
|
||||
@@ -335,7 +335,7 @@ def test_get_status_filters_calculates_stats(app_):
|
||||
ret = get_status_filters({'id': 'foo'}, 'sms', STATISTICS)
|
||||
|
||||
assert {label: count for label, _option, _link, count in ret} == {
|
||||
'processed': 6,
|
||||
'total': 6,
|
||||
'sending': 3,
|
||||
'failed': 2,
|
||||
'delivered': 1
|
||||
@@ -347,7 +347,7 @@ def test_get_status_filters_in_right_order(app_):
|
||||
ret = get_status_filters({'id': 'foo'}, 'sms', STATISTICS)
|
||||
|
||||
assert [label for label, _option, _link, _count in ret] == [
|
||||
'processed', 'sending', 'delivered', 'failed'
|
||||
'total', 'sending', 'delivered', 'failed'
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user