mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-26 17:24:23 -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 = [
|
filters = [
|
||||||
# key, label, option
|
# key, label, option
|
||||||
('requested', 'processed', 'sending,delivered,failed'),
|
('requested', 'total', 'sending,delivered,failed'),
|
||||||
('sending', 'sending', 'sending'),
|
('sending', 'sending', 'sending'),
|
||||||
('delivered', 'delivered', 'delivered'),
|
('delivered', 'delivered', 'delivered'),
|
||||||
('failed', 'failed', 'failed'),
|
('failed', 'failed', 'failed'),
|
||||||
@@ -287,8 +287,8 @@ def _get_job_counts(job, help_argument):
|
|||||||
count
|
count
|
||||||
) for label, query_param, count in [
|
) for label, query_param, count in [
|
||||||
[
|
[
|
||||||
'Processed', '',
|
'total', '',
|
||||||
job.get('notifications_sent', 0)
|
job.get('notification_count', 0)
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'Sending', 'sending',
|
'Sending', 'sending',
|
||||||
@@ -299,12 +299,12 @@ def _get_job_counts(job, help_argument):
|
|||||||
)
|
)
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'Delivered', 'delivered',
|
'delivered', 'delivered',
|
||||||
job.get('notifications_delivered', 0)
|
job.get('notifications_delivered', 0)
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'Failed', 'failed',
|
'failed', 'failed',
|
||||||
job.get('notifications_failed')
|
job.get('notifications_failed', 0)
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ def test_should_show_updates_for_one_job_as_json(
|
|||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"status_argument, expected_api_call", [
|
"status_argument, expected_api_call", [
|
||||||
(
|
(
|
||||||
'processed',
|
'',
|
||||||
['sending', 'delivered', 'failed', 'temporary-failure', 'permanent-failure', 'technical-failure']
|
['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)
|
ret = get_status_filters({'id': 'foo'}, 'sms', STATISTICS)
|
||||||
|
|
||||||
assert {label: count for label, _option, _link, count in ret} == {
|
assert {label: count for label, _option, _link, count in ret} == {
|
||||||
'processed': 6,
|
'total': 6,
|
||||||
'sending': 3,
|
'sending': 3,
|
||||||
'failed': 2,
|
'failed': 2,
|
||||||
'delivered': 1
|
'delivered': 1
|
||||||
@@ -347,7 +347,7 @@ def test_get_status_filters_in_right_order(app_):
|
|||||||
ret = get_status_filters({'id': 'foo'}, 'sms', STATISTICS)
|
ret = get_status_filters({'id': 'foo'}, 'sms', STATISTICS)
|
||||||
|
|
||||||
assert [label for label, _option, _link, _count in ret] == [
|
assert [label for label, _option, _link, _count in ret] == [
|
||||||
'processed', 'sending', 'delivered', 'failed'
|
'total', 'sending', 'delivered', 'failed'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user