Show 2 previous financial years on usage page

From a question on cross-government Slack:

> re the Usage tab - currently it shows 3 financial years - last year,
> this year and next year. is it possible to replace the "next year" tab
> with something more useful? its always going to be blank! I was
> thinking it would be good to have 2 financial years ago, 1 financial
> year ago and this financial year.

This seems like a reasonable idea, and is something we’ve talked about
before. The original intention[1] was that seeing your (unchanged) free
allowance for next year would be useful, but that doesn’t really seem to
be a user need.

***

1. See https://github.com/alphagov/notifications-admin/pull/1094
   > so that you can check what your SMS allowance is going to be before
   > you actually get into it
This commit is contained in:
Chris Hill-Scott
2020-05-07 16:36:50 +01:00
parent 77b7e4b8ea
commit 8215022725
3 changed files with 13 additions and 13 deletions

View File

@@ -142,8 +142,8 @@ def usage(service_id):
selected_year=year,
years=get_tuples_of_financial_years(
partial(url_for, '.usage', service_id=service_id),
start=current_financial_year - 1,
end=current_financial_year + 1,
start=current_financial_year - 2,
end=current_financial_year,
),
**calculate_usage(yearly_usage,
free_sms_allowance)
@@ -483,5 +483,5 @@ def get_tuples_of_financial_years(
partial_url(year=year),
'{} to {}'.format(year, year + 1),
)
for year in range(start, end + 1)
for year in reversed(range(start, end + 1))
)