Commit Graph

7170 Commits

Author SHA1 Message Date
Chris Hill-Scott
b0cb9ff58e Add sent notifications page for caseworkers
The other task that caseworkers have to do (much less often than sending
messages) is look at the messages which they’ve sent. The reason for
doing this is usually to find a specific message which someone has
complained about.

This commit adds:
- a page where they can do that
- a navigation item so they can get to that page

We reckon that because this is about finding specific messages, not
reporting that it’s fine to mush all the channels (email, text, letter)
into one table.
2018-07-05 11:53:42 +01:00
Chris Hill-Scott
f7b58c844c Don’t let caseworkers download CSV files
No-one can at the moment, but when we bring the links back we should
only bring them back for users who care about reporting and management
information, ie those with the `view_activity` permission.
2018-07-05 11:53:42 +01:00
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
2855cf45c7 Style of conditional radios to match design system
Updated thickness of border and spacing to match
https://design-system.service.gov.uk/components/radios/#conditionally-revealing-content
2018-07-05 11:47:31 +01:00
Chris Hill-Scott
6452676b54 Remove show/hide behaviour from permissions form
In research we found that:
- people didn’t initially realise that the permissions expanded when the
  ‘admin’ option was selected
- not having all the options visible at once makes it hard to know what
  permissions you are (and more importantly aren’t) giving to people

This commit makes it so that:
- the options within the ‘admin’ option are always visible
- a bit of Javascript logic makes it so you can pick ‘caseworker’ and
  ‘manage service’, for example (by deselecting one when you pick the
  other)
2018-07-05 11:47:31 +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
d952b5ca3c Refactor radios for reuse
This commit splits up the radio buttons macro into a couple of different
macros which can be used independently of each other.

This makes this code easier to reuse when implementing custom radio
controls.
2018-07-05 11:47:30 +01:00
Chris Hill-Scott
39bb0ecbf7 Make permission checking a method
Having a function that takes an instance as its only argument suggests
that it should instead be a method on that instance.
2018-07-05 11:47:30 +01:00
Chris Hill-Scott
1f0003903f Refactor form classes for future reuse
There are three parts to a ‘user’ form:
- the email address
- the permissions
- the auth type setting

This commit breaks them up into abstract classes so that they can be
composed more flexibly in future commits.
2018-07-05 11:47:29 +01:00
Chris Hill-Scott
a220ab7877 Encapsulate view_activity logic within the form
This means that:
- we don’t have to manually set it after processing the form
- we can set it dynamically based on some other attribute later on
2018-07-05 11:47:29 +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
7397e808a8 Make expected behaviour clear in else case
It feels a bit slippery having an `if`/`elif` with no else; I think that
adding this comment makes the code clearer.
2018-07-05 11:41:43 +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
97d40028de Merge pull request #2142 from alphagov/pyup-update-pytest-3.6.2-to-3.6.3
Update pytest to 3.6.3
2018-07-05 11:02:48 +01:00
Chris Hill-Scott
e9fbf14f10 Merge pull request #2138 from alphagov/bump-utils-accessible-letters
Bump utils to make letters screenreader-accessible
2018-07-05 11:01:55 +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
pyup-bot
a90a04200f Update pytest from 3.6.2 to 3.6.3 2018-07-04 23:44:06 +01:00
Katie Smith
9cff9ca801 Merge pull request #2141 from alphagov/paginate-complaints-page
Paginate complaints page
2018-07-04 15:46:19 +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
Katie Smith
f5bb2efc72 Merge pull request #2130 from alphagov/new-platform-admin-stats
Add new platform admin stats page
2018-07-03 08:57:47 +01:00
Rebecca Law
87e8f91b06 Merge pull request #2140 from alphagov/increase-page-size
Try increasing the page size
2018-07-02 15:58:15 +01:00
Chris Hill-Scott
1312641240 Merge pull request #2139 from alphagov/cabinetoffice
Add alternative cabinet office domain name
2018-07-02 15:52:06 +01:00
Rebecca Law
05caa102f0 Increasing the page size to see if we get more rows back the downloaded csv. 2018-07-02 15:48:00 +01:00
Chris Hill-Scott
6cc6b9d4da Add alternative cabinet office domain name 2018-07-02 14:26:12 +01:00
Chris Hill-Scott
34abfa0390 Bump utils to make letters screenreader-accessible
Brings in:
- [ ] https://github.com/alphagov/notifications-utils/pull/497
2018-07-02 13:54:56 +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
9c5fd5f23c Validate date format on new platform admin page
Check that the format of the dates entered is in the `YYYY-MM-DD` as
specified and show an error message if it is not. If the date was not in
the specified format, there would be no error message but the content of
the page would change which was misleading.
2018-06-29 15:31:41 +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
Chris Hill-Scott
aba9cf0ff3 Merge pull request #2135 from alphagov/sch.uk
Adding sch.uk to the email domain list...
2018-06-29 15:05:36 +01:00
Pete Herlihy
f829725d80 Adding sch.uk to the email domain list...
The DfE (Department for Education) has allocated every school in the country a domain name of the form of: www.schoolname.county.sch.uk.
2018-06-29 13:49:54 +01:00
Chris Hill-Scott
199c3cb923 Merge pull request #2134 from alphagov/pyup-update-pytz-2018.4-to-2018.5
Update pytz to 2018.5
2018-06-29 09:46:13 +01:00
Chris Hill-Scott
89d5674c12 Merge pull request #2133 from alphagov/ofgem.gov.uk
Mark agreement signed by Ofgem
2018-06-29 09:42:37 +01:00
pyup-bot
fd3043b45a Update pytz from 2018.4 to 2018.5 2018-06-29 08:34:52 +01:00
Chris Hill-Scott
9cc5fd4713 Mark agreement signed by Ofgem 2018-06-28 17:15:14 +01:00
Chris Hill-Scott
a9e27b5619 Merge pull request #2132 from alphagov/hr
Add guidance about horizontal lines
2018-06-28 16:14:18 +01:00
Chris Hill-Scott
adf1493fb5 Add guidance about horizontal lines
We’ve supported this for a while but don’t tell anyone how to do it.

This commit also alters the spacing of things so the description groups
better with the example.
2018-06-28 16:06:04 +01:00
Chris Hill-Scott
418a744283 Merge pull request #2129 from alphagov/gov.scot
Mark agreement signed by Scottish Government
2018-06-28 14:38:45 +01:00
Chris Hill-Scott
e86b4ca34e Merge pull request #2131 from alphagov/🙀
Fix untypographic apostrophe
2018-06-28 11:51:03 +01:00
Chris Hill-Scott
276047b1d6 Fix untypographic apostrophe 2018-06-28 10:53:27 +01:00
Chris Hill-Scott
61e0e7e24e Merge pull request #2117 from alphagov/bump-utils-autolink-sms
Bump utils to link URLs in text message previews
2018-06-28 09:32:29 +01:00
Chris Hill-Scott
22bffe779d Bump utils to link URLs in text message previews 2018-06-28 09:18:17 +01:00
Rebecca Law
8deef9ada9 Merge pull request #2127 from alphagov/download-activity
Add the download activity link for notifications
2018-06-27 14:57:33 +01:00
Sakis
f8eb6c9437 Merge pull request #2128 from alphagov/gunicorn-accesslog
Remove GUNICORN_CMD_ARGS before we start our app
2018-06-25 17:07:09 +01:00
Rebecca Law
472f87b325 Fix order of imports 2018-06-25 16:57:49 +01:00
Chris Hill-Scott
18b20574e1 Mark agreement signed by Scottish Government
We have it for the whole organisation now.
2018-06-25 16:48:03 +01:00