Commit Graph

2259 Commits

Author SHA1 Message Date
Chris Hill-Scott
57ad1a0f7c Don’t send caseworkers back to template page
Caseworkers skip the template page in their message sending journey.
Instead they go straight from picking a template to the first step of
sending. So the ‘Back’ link should send them straight back to the
picking a template page, skipping the individual template page (which
they don’t have permission to view).
2018-07-05 11:53:42 +01:00
Chris Hill-Scott
7c849dccb7 Redirect caseworking users off dashboard
They don’t have permission to see it; their home page is the list of
templates.
2018-07-05 11:53:42 +01:00
Chris Hill-Scott
84de1c5625 Let caseworkers send one off messages
The main task that we think ‘caseworker’ users do is send one off
messages.

So this commit:
- makes sure users who don’t have the `view_activity` permission (ie
  not ‘admin’ users) can still send messages
- adds navigation so that these users have a place to go from which to
  start the process of sending a one off message
2018-07-05 11:53:42 +01:00
Chris Hill-Scott
f4d2958d58 Allow setting of caseworking on a user
This commit changes the form that the user sees when inviting or editing
another user, if the service has the ‘caseworking’ permission set.

This will allow creating a new type of user, one who only has the
`send_messages` permission, without the `view_activity` permission.

We are doing this because we think there are a number of services with a
lot of users who don’t need to see the dashboard, or the other team
members, and that we can make a simpler interface for these users.
2018-07-05 11:47:30 +01:00
Chris Hill-Scott
650f4cc3d8 Add platform admin button to enable caseworking
Eventually the ability to have the caseworking view for your service
will be self-service. But while we’re still building it only we should
be able to enable it, for our own testing purposes.

So this commit adds platform admin functionality to switch the feature
on and off for our services.
2018-07-05 11:47:29 +01:00
Chris Hill-Scott
c2dbc1934f Allow callbacks to be removed
We’ve had a user who’s said:

> Seems configured callbacks cannot be removed once they’re set as the
> fields have a presence check. Is that intentional?

This means it’s not working as they expect. Rather than have to go and
change stuff in the database for them, let’s make it work as they’d
expect.

Only lets you clear the form if you remove both the token and the URL.
2018-07-05 11:41:43 +01:00
Chris Hill-Scott
239a43127d Merge pull request #2137 from alphagov/save-same-service-name
Don’t error if a user keeps same service name
2018-07-05 11:01:48 +01:00
Katie Smith
b27d29805b Raise error if getting complaints page with invalid page param
If the `page` parameter passed to the `platform-admin/complaints`
pageis not an integer, we should return a `404` error page.
2018-07-04 10:38:46 +01:00
Katie Smith
6c27a17e1e Paginate complaints page
The API now returns paginated complaint data, so the
`/platform-admin/complaints` page can now be paginated.
2018-07-03 11:09:33 +01:00
Chris Hill-Scott
d86291cb7a Don’t error if a user keeps same service name
Sometimes a user will hit the green button without actually changing
the service name (we saw this in a usability testing session).

Currently this gives an error saying ‘service name already in use’,
which is technically true (it’s in use by the current service) but
practically just annoying.

This commit adds some logic to silently ignore such requests.
2018-07-02 11:00:02 +01:00
Katie Smith
ca16bef7f7 Add PlatformStatsAPIClient
In API, the endpoint for the new platform admin stats page has been
moved to a platform stats blueprint. This means we now need a platform
stats client.
2018-06-29 15:31:41 +01:00
Katie Smith
d9aeac4dca Add new platform admin page
Added a new platform admin page, at '/plaform-admin-new' which shows
different data. This no longer offers the option to filter by test-key,
only by date, and also gives a more detailed break-down of the
notifications and failures sent with a normal / research key.

The existing platform admin stats page ('/platform-admin') has not been
deleted yet so that both pages can be compared.
2018-06-29 15:31:40 +01:00
Katie Smith
7a40ad6ac0 Add new methods to Service and Complaint api clients
* Added a new method to the ComplaintApiClient to get the total
complaints by date range from the API.
* Added a new method to the ServiceAPIClient to get the new platform
admin stats data from the API.
2018-06-29 15:31:40 +01:00
Leo Hemsted
e81f302084 handle 405 METHOD NOT ALLOWEDs
(show the "something went wrong" error page).

also catch any other werkzeug http exceptions and show an appropriate
template, if it exists
2018-06-22 18:07:18 +01:00
Leo Hemsted
ad8e95302c fix pete's broken tests 2018-06-15 16:27:17 +01:00
Katie Smith
33277ce3e2 Make a contact_link required when turning upload_document permission on
When a platform admin user clicks on the button to add the
'upload_document' permission to a service, they should be taken to the
page to add a contact_link if the service does not already have one.
2018-06-12 10:21:24 +01:00
Katie Smith
8a559aceb5 Display contact link on service settings page
The contact link for the service now gets displayed on the service
settings page if the service has the 'upload_document' permission. There
are no changes to the appearance of the service settings page if a
service does not have the 'upload_document' permission.
2018-06-12 10:21:24 +01:00
Katie Smith
02988c224b Merge pull request #2100 from alphagov/contact-url-page
Add page to change a service's contact link
2018-06-12 10:20:51 +01:00
Katie Smith
e1d4181be3 Add page to change a service's contact link
Added a page which lets users with the 'manage_service' permission change the
contact link for their service. There are no links to this page yet
since only services using document download will need to set a contact
link.
2018-06-11 10:36:18 +01:00
Chris Hill-Scott
4b37ca4021 Don’t duplicate columns in example spreadsheet
If a template has a placeholder like `((email address))` then the sample
spreadsheet and CSV file have the email column twice.

Trying to upload this spreadsheet will result in a ‘duplicate column’
error.

This commit fixes it so that the column will only appear once.
2018-06-08 13:28:02 +01:00
Chris Hill-Scott
1fc4e1657d Merge pull request #2108 from alphagov/no-redact-letters
Don’t let people redact letter templates
2018-06-08 10:20:27 +01:00
Chris Hill-Scott
8137f9c3a6 Don’t let people redact letter templates
It doesn’t work, so we shouldn’t show the link.
2018-06-07 13:43:34 +01:00
Chris Hill-Scott
ea6620083b Persist original file name when previewing row 2018-06-07 11:03:09 +01:00
Chris Hill-Scott
e74d408953 Allow users to preview all letters in trial mode
If you’re in trial mode you can’t send letters for real. But you can
still upload a spreadsheet with multiple rows, and there’s no reason why
you shouldn’t be able to explore how Notify populate the letter for each
row of the spreadsheet (since this is something we let you do when you
can send the messages for real).
2018-06-07 11:03:09 +01:00
Rebecca Law
2bece35aba Docker is using a different version of pytest, and assert_called_once is newly introduced. 2018-06-06 15:46:18 +01:00
Rebecca Law
84445d154d When someone complains about an email from the platform we get a callback from SES.
A new platform admin page Email complaints has been added to surface those complaints.
Eventually the complaints will be visible to the services so they can remove the email address from their mailing list.

Next thing to implement is "x email complaints" warning on the platform admin summary page.
2018-06-06 15:22:48 +01:00
Rebecca Law
6bdb8b7210 Rename the method for usage and update the tests. 2018-05-29 15:31:40 +01:00
Katie Smith
58cc1604a7 Bump utils and sanitise header values
Updated notifications-utils. This brings in
- the renamed character sanitization classes
- the change to allow unicode in letter addresses (this lets us delete
a test that is no longer relevant)

Also replaced non-ascii characters in headers. This fixes a bug where
non-ascii characters in a CSV filename were causing errors since the
filename is also used in the header.
2018-05-25 10:34:47 +01:00
Pete Herlihy
3459f74110 Merge pull request #2093 from alphagov/privacy-page
Privacy page
2018-05-23 15:42:18 +01:00
Pete Herlihy
aa8992c7b9 Testing that the privacy page exists 2018-05-23 14:36:36 +01:00
Rebecca Law
cd09c391e8 Letter have multliple rates, the agregate number was not taking that into account for the usage page. 2018-05-22 17:37:48 +01:00
Chris Hill-Scott
79314de817 Add page where users can say they want branding
At the moment branding is an undocumented feature. We get a bunch of
support tickets from teams asking its possible.

This commit:
- lets people know it’s possible, and what the options are
- is the first step towards making this process as self-service as
  possible

In some cases we will be able to infer a user’s organisation from there
email address, and Google image search their logo. So the experience for
them is that they press a button and government just sorts it out for
you (also known as "the dream").

In other cases we will have to get back to people asking for a copy of
their logo, or to find out about their service, but this is what we have
to do at the moment anyway.
2018-05-18 16:24:20 +01:00
Leo Hemsted
3097fb75ee fix usage page sms rate calculation
usage page used to make the assumption that the first row of the usage
stats would always be SMS. This now isn't always the case, so make sure
when working out the rate, it only looks at sms rows. Specifically, it
takes the rate from the first stats row. This makes a big assumption
that all the rows will have the same rate per financial year.
2018-05-17 10:40:48 +01:00
Rebecca Law
c721c40ec7 Ignore temporary endpoint in navigation test 2018-05-16 13:23:49 +01:00
Chris Hill-Scott
7b759963b7 Merge pull request #2073 from alphagov/back-to-only-authed
Only show ‘back to service name’ link if signed in
2018-05-14 15:36:16 +01:00
Chris Hill-Scott
fc87ec70a7 Merge pull request #2072 from alphagov/test-domains
Check that all domains in our lists are valid
2018-05-14 15:36:07 +01:00
Chris Hill-Scott
e5c1c68942 Merge pull request #2074 from alphagov/sign-in-for-agreement
Let people choose which agreement to download if signed in
2018-05-14 15:35:57 +01:00
Chris Hill-Scott
3a471e2f61 Stop overwriting S3 metadata with empty filename
When you upload a CSV the check page takes the file name from the URL
and writes it to the S3 metadata for that file.

This also happens when you go to the .png version of this page.

The .png version of the page doesn’t have the filename in the URL. So it
re-writes the S3 metadata with an empty filename.

This means that all letter jobs sent recently have no file names. This
commit fixes this problem.
2018-05-10 17:01:03 +01:00
Chris Hill-Scott
f9421789d0 Only show ‘back to service name’ link if signed in
When you’re not signed in you can still have a service in your session.
But there’s no point trying to get to its dashboard until you’re signed
in – you’ll just be sent back to the ‘sign in’ page.
2018-05-09 15:32:46 +01:00
Leo Hemsted
5f4d9a60da Merge pull request #2075 from alphagov/statistics-endpoint
use service statistics endpoint instead of detailed service
2018-05-09 14:46:56 +01:00
Leo Hemsted
78a6f86043 use service statistics endpoint instead of detailed service
we're not actually looking at the detailed service aspects - just
the stats. We're doing this in three places:

* dashboard
* notification activity page
* when checking jobs to see if we're over the daily limit

change these places to use a new api endpoint (service/id/statistics),
which hopefully be a little more performant, and will definitely be a
little more organised - moving away from generic endpoints with loads
of optional parameters.

We still need the detailed endpoints for the platform admin page tho.

Depends on https://github.com/alphagov/notifications-api/pull/1865
2018-05-09 14:00:24 +01:00
Chris Hill-Scott
220e11ccdd Customise download page if agreement signed
If the user’s organisation has already signed the agreement we shouldn’t
give them the instructions for how to sign it.
2018-05-09 13:44:33 +01:00
Chris Hill-Scott
dc6d66daba Make people sign in to get the agreement
Currently we have a bunch of users who aren’t signed in asking us for
the agreement.

This is bad because:
- it’s slower (for them) than just being able to download it
- it creates work for us

We can’t just offer the agreement to anyone, but we can offer to it to
anyone who’s signed in because we now let people self-select which
version to download when we can’t tell which one to give them.
2018-05-09 13:41:51 +01:00
Chris Hill-Scott
947b67ee1a Let people choose which agreement to download
If we don’t know whether people belong to a crown organisation we should
give them the option of self-selecting, because they might themselves
know.

This commit adds a new version of the ‘agreement’ page which gives
people exactly that choice. It doesn’t link to it yet.
2018-05-09 13:40:21 +01:00
Chris Hill-Scott
952a83f23a Merge pull request #2068 from alphagov/2fa-input
Improve 2fa code input
2018-05-08 16:53:54 +01:00
Chris Hill-Scott
060b93c4d4 Check that all domains in our lists are valid
Since we have too many to add individual tests every time we add a new
one now.
2018-05-08 15:25:41 +01:00
Chris Hill-Scott
3aa688d1e5 Merge pull request #2071 from alphagov/public-agreement
Add URLs to download the agreement without login
2018-05-08 14:56:47 +01:00
Chris Hill-Scott
771f916630 Add URLs to download the agreement without login
So that we can share these URLs in an email we’re sending out.
2018-05-08 14:49:06 +01:00
Chris Hill-Scott
0e1e5ccecc Merge pull request #2070 from alphagov/manheadschool
Adding mansheadschool to the whitelist of domains
2018-05-08 14:29:53 +01:00
Pete Herlihy
bb7973f753 Adding a test for mansheadschool whitelisting domain 2018-05-08 11:42:04 +01:00