Commit Graph

3761 Commits

Author SHA1 Message Date
Chris Hill-Scott
67316df3aa Repoint footer and homepage links
Performance Platform is going away at 10am on Monday, so let’s point to
our Performance Page instead.
2021-03-12 14:44:49 +00:00
Chris Hill-Scott
4d0264d196 Switch org and service order on home page
This matches what’s on the performance page – orgs on the left, services
on the right.
2021-03-12 14:44:41 +00:00
Chris Hill-Scott
5fa6639b52 Add count of orgs and services
This uses the existing endpoint so it matches what’s on the homepage.
It will be more up-to-date than the list of services, but no-one’s going
to be adding things up to check they match exactly.
2021-03-12 14:44:32 +00:00
Chris Hill-Scott
8106d6fdf2 Limit data to last 7 days
Otherwise the page gets really long. Also matches what we have on our
dashboards by default.
2021-03-12 14:44:24 +00:00
Chris Hill-Scott
c3699e0e35 Format numbers as millions or billions
This matches the existing performance platform page, and I think is a
bit easier to read for high-level numbers where you don’t need to see
that they’re changing second-by-second.
2021-03-12 14:44:15 +00:00
Chris Hill-Scott
646075f61f Put some stuff on the page
This basically copies the same sections from the existing performance
platform page, with the frontend cobbled together from our existing
patterns.
2021-03-12 14:44:06 +00:00
Chris Hill-Scott
545f933e37 Cache the JSON in Redis
The endpoints are probably fast enough, but it seems risky to have a
public URL which causes a new query every time the page is loaded.
2021-03-12 14:43:58 +00:00
Chris Hill-Scott
25a6788d66 Use arguments rather than passing around a dict
This makes it harder to write code which will pass tests but fail in
real life.
2021-03-12 14:43:50 +00:00
Chris Hill-Scott
fce4082fff Rename to performance
This is consistent with the old performance platform URLs, which were
gov.uk/performance, and others that we have like /pricing and /features
2021-03-12 13:56:21 +00:00
Rebecca Law
3ca2840652 Rename to performance-dashboard 2021-03-12 11:17:51 +00:00
Rebecca Law
042527e74c Start to build a page to performance platform page. 2021-03-12 11:17:44 +00:00
Chris Hill-Scott
79bbd0fd98 Don’t show future financal years on org page
There’s no useful information in the page for the future financial year
because there’s no way for any of the services to have yet used
anything.

Changes this matches the change we made to the service usage page in
https://github.com/alphagov/notifications-admin/pull/3439/files
2021-03-10 15:39:06 +00:00
Chris Hill-Scott
19488aad97 Merge pull request #3826 from alphagov/add-new-rates-for-2021-financial-year
Add new free allowance rates for 2021 financial year
2021-03-10 14:41:58 +00:00
David McDonald
3e80ba4734 Fix flake8 and isort errors
Note, isort now has default behaviour of searching recursively so we no
longer need the `-rc` flag
2021-03-08 18:48:56 +00:00
Chris Hill-Scott
7013eb9696 Make get_current_financial_year timezone aware
It would have given the wrong answer for the first hour of the 2021
financial year.

This was OK before, because we didn’t need this kind of precision. But
now it could mean someone signing up in the middle of the night getting
the wrong free text message allowance, so we should fix it.
2021-03-08 17:01:04 +00:00
Chris Hill-Scott
61f605ff67 Add new rates for 2021
These are the new rates from
https://docs.google.com/document/d/1aObNQNBw3ayPMl3b_Qc5kZBdaXIAMDnBGtV-xPtFBsc/edit?ts=603f68ea#

We’re changing the free allowance so we can continue to support all the
teams that use Notify. The new allowance means over 90% of teams can
still send all the text messages they need to without paying.
2021-03-08 16:59:29 +00:00
Chris Hill-Scott
9a3f2c30ef Use underscores to notate 1000s
This is easier to read than using multiplication, or nothing.
2021-03-08 16:57:57 +00:00
Chris Hill-Scott
2138ce02d9 Add NHS GP organisation type to test cases
This was missing.
2021-03-08 16:56:16 +00:00
Katie Smith
7ae4017d50 Add audit event for inviting users to a service 2021-03-08 14:34:50 +00:00
Chris Hill-Scott
bac54462db Change config structure so allowances are dated
We’re going to have different allowances next financial year. This means
that when someone adds a service, we’ll need to check which year it is,
so we can give them the right allowance.

This commit changes the config structure so that the current allowances
are explicitly assigned to the 2020/21 financial year.

It freezes the tests to the 2020/21 financial year, so they won’t start
failing automatically when next financial year comes around.
2021-03-08 14:25:26 +00:00
David McDonald
fed40326da Fix test assertion
It wasn't varying the email address seen in the header based on the two
parametrized cases. Not the end of the world, but we should make it
correct
2021-03-08 13:40:53 +00:00
Leo Hemsted
477129644d fix syntax 2021-03-05 15:05:48 +00:00
Leo Hemsted
a8c63c0483 Merge pull request #3823 from alphagov/post-to-get-user-by-email
post to get user by email
2021-03-05 14:57:12 +00:00
Leo Hemsted
4a624ace32 post to get user by email
that way we won't store any PII in logs
2021-03-05 12:43:15 +00:00
Katie Smith
0561937c13 Add an audit event when a service's broadcast permissions change
This adds an audit event to the `events` table when the broadcast
permissions for a service (the service mode, channel or provider
restriction) changes.
2021-03-04 12:09:28 +00:00
Chris Hill-Scott
a27dbd24a7 Fix the ‘revoke’ links on the API keys page
They were missing the `govuk-link--destructive` class which turns them
red, consistent with other links we use for deleting or suspending
things.
2021-03-03 15:24:38 +00:00
Tom Byers
7b67fc5f32 Fix aria on collapsed checkboxes fieldset
The fieldset that wraps the collapsible checkboxes
has an aria-describedby to make the summary its
accessible description.

This needs to point to the id of the summary but
the summary didn't have one.

These changes add the id and fix a fixture in the
tests for this module.
2021-02-25 14:00:16 +00:00
Katie Smith
82318387de Add hidden text for pills on job page
The links in the blue boxes on the job page needed hidden text so that
they work out of context. This changes the text from "10 sending" to "10
sending text messages" (with the message type hidden text).
2021-02-24 14:36:21 +00:00
Katie Smith
6512b8fad3 Add descriptive links to API keys page
The links had no descriptive text, so all read 'Revoke'. This adds
hidden text specific to the item they relate to.
2021-02-24 14:36:21 +00:00
Katie Smith
e7d6a2ea0d Add descriptive links to /service-settings/letter-contact-details
The links had no descriptive text, so all read 'Change'. This adds
hidden text specific to the item they relate to.
2021-02-24 14:36:21 +00:00
Katie Smith
4f7b08512a Add descriptive links to /service-settings/sms-senders page
The links had no descriptive text, so all read 'Change'. This adds
hidden text specific to the item they relate to.
2021-02-24 14:36:21 +00:00
Katie Smith
0416b841b3 Add descriptive links to /service-settings/email-reply-to page
The links had no descriptive text, so all read 'Change'. This adds
hidden text specific to the item they relate to.
2021-02-24 14:36:21 +00:00
Katie Smith
d7e56f6956 Stop checking for upload_document permission
All services have the `upload_document` permission now, so we don't need
to check for it on the email formatting page. This also deletes a test
which is not needed now.
2021-02-24 10:54:42 +00:00
Leo Hemsted
a85e20ed3e Merge pull request #3815 from alphagov/permissions-bug
allow caseworkers to view letter previews
2021-02-23 16:57:34 +00:00
Leo Hemsted
087f908968 allow caseworkers to view letter previews
they can already view notifications page, but the png and pdf letter
previews just 403 for them currently.
2021-02-23 16:08:03 +00:00
David McDonald
1935d5f973 Improve test name for clarity 2021-02-23 16:03:16 +00:00
David McDonald
d22a852b5e Make fixtures more DRY
Moves a commonly used fixture into
`mock_get_service_settings_page_common` so we don't need to keep writing
it every time.

Note, we may be able to do similar in the future with

- single_reply_to_email_address
- single_letter_contact_block
- single_sms_sender

but need a bit more thought about fixing tests that would fail due to
this change and need tweaks to the order of their arguments.
2021-02-23 16:03:15 +00:00
David McDonald
f8f3d44511 Add form to set service broadcast account type
Note, no option at the moment to set the service broadcast account type
as None, or back to without the broadcast permission. This has been done
for speed of development given the chance of us needing this is very
low. We can add it later if we need to.
2021-02-23 16:03:14 +00:00
David McDonald
6837b76d44 Remove existing broadcast permission form
This will be replaced by a new form that has it's own template, route
etc as it will vary quite a lot from the existing service permission
form.
2021-02-23 16:03:13 +00:00
David McDonald
67d07e4135 Remove option to put service live if broadcast service
Whether a service is live or not will be controlled from the broadcast
service settings page once a service is given the broadcast permission
2021-02-23 16:03:12 +00:00
Chris Hill-Scott
f55a8bf4b8 Add library of test areas
This is a temporary addition so we can test out some functionality.
2021-02-19 11:35:51 +00:00
Ben Thorner
5c2cdf6250 Remove redundant import of Mock and ANY
It's conventional to use the "mocker" fixture to access these.
2021-02-17 09:34:34 +00:00
Ben Thorner
00cc67f813 Inline duplicate service fixture with test
Similarly to the previous commit, this fixture is only used once,
so can benefit from being inline with its test.
2021-02-17 09:34:33 +00:00
Ben Thorner
52a5da4d17 Handle exception is org name already exists
Previously this would return a 500 error, as the 400 exception was
not handled from the API [1]. Note that:

- We tend to rely on exception messages to identify the error that
occurred [2][3], with services being a notable deviation [4]. I've
used the exception message approach, as this is more granular and
broadly consistent with the rest of the app.

- There is already code to cover this scenario when a user changes
the name of an existing organisation or service, but the mechanism
is different [5][6]. It makes sense to just get any error from the
call to try and create the organisation.

- The API mock is based on one for services [7], but I've chosen to
have it inline with the test, since we're unlikely to reuse it, and
it's clearer to have the test setup as part of the test.

[1]: 8f99da525d/app/organisation/rest.py (L34-L47)
[2]: 70b606a2d4/app/main/views/manage_users.py (L166)
[3]: 70b606a2d4/app/main/views/templates.py (L499)
[4]: 70b606a2d4/app/main/views/add_service.py (L30)
[5]: 70b606a2d4/app/main/views/service_settings.py (L102-L104)
[6]: 70b606a2d4/app/main/views/organisations.py (L264-L266)
[7]: 0abc143147/tests/conftest.py (L590-L606)
2021-02-17 09:34:30 +00:00
Pea Tyczynska
47f20ae438 Change content following content review 2021-02-16 15:20:15 +00:00
Pea Tyczynska
5a342b2a39 Test that only platform admins can update org notes 2021-02-16 14:46:14 +00:00
Pea Tyczynska
d7596f81fb Add screen reader suffixes on all org settings
So screen reader users have consistent experience.
2021-02-16 14:46:14 +00:00
Pea Tyczynska
741beeb903 Add test case for when organisation notes do not change 2021-02-16 14:46:14 +00:00
Pea Tyczynska
eb9e6e2c71 Update organisation billing details 2021-02-16 14:46:13 +00:00
Pea Tyczynska
36c72bb4cc View edit organisation billing details page 2021-02-16 14:46:13 +00:00