Commit Graph

56 Commits

Author SHA1 Message Date
Leo Hemsted
c898284c3b fix pdf download link trying to request a page count
It doesn't make sense to get a pdf for only one page - the template
preview app just returns a 400 if you try. So we shouldn't try!
2018-10-15 14:32:10 +01:00
Pea Tyczynska
291b2cf2ba Improve error handling for precompiled validation preview 2018-10-05 16:27:57 +01:00
Pea Tyczynska
e6e363ba3f Add antivirus scan to letter validation preview view 2018-10-05 16:27:57 +01:00
Pea Tyczynska
a61393a68e Test letter validation preview flow 2018-10-05 15:46:44 +01:00
Pea Tyczynska
3cdacaaf0a Introduce validation and error handling for validation preview 2018-10-05 15:46:44 +01:00
Pea Tyczynska
3be129241f Add letter validation preview functionality
- add get/post view
- create a pdf upload form
- add a template where user can upload the file
- check boundaries of the letter by calling template-preview
- display banner messages with boundaries validation result
- display pages of the document, with visible boundaries overlay
if the document did not pass validation, and without overlay
if they do pass validation
2018-10-05 15:46:44 +01:00
Alexey Bezhan
b75681dfbc Add a platform admin page to submit returned letter references
A platform admin form accepts a list of references (one per line)
received from DVLA and sends them to the API to update notification
statuses.

References we get from DVLA start with `NOTIFY00\d`, which isn't
part of the reference we store in the database, so we remove them
before sending the data to the API.

The new `returned-letter` status should be treated as `delivered`
for now until we decide a way to display returned letters to users.
2018-09-07 11:13:01 +01:00
Katie Smith
6b5eaf7fff Improve number formatting on platform-admin page
Minor changes to the number formatting for the `/platform-admin` page to
- Show the complaint percentage to 2 decimal places. (The number of
complaints is often below 0.0% so 1 decimal place isn't useful)
- Format the numbers in the status boxes to use a comma as a thousands
separator.
2018-08-16 16:57:02 +01:00
Chris Hill-Scott
55054b81b5 Include test key data by default on platform admin
This is the existing behaviour. It’s broken by this issue in WTForms
2.2.1: https://github.com/wtforms/wtforms/issues/401

This commit hand-crafts the default value, because WTForms is ignoring
the `default` argument on the form object attribute.

Not really sure how this ever worked 🤔
2018-08-03 14:53:40 +01:00
Katie Smith
3bbc73dfd2 Use new platform-admin page
We had kept the original platform-admin page at `/platform-admin` and
created a new page, `/platform-admin-new` for the new platform admin
page. Now that the numbers on both pages look ok we no longer need both
pages, so can replace the original page.
2018-07-10 14:39:54 +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
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
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
Leo Hemsted
7ddad7c99e dont use has_permissions to check for platform admins
platform_admin is a separate concept to permissions, so by removing the
checks for it from the current_user.has_permissions function, we can
simplify things greatly. We already record on the user whether they're
a platform admin anyway.
2018-03-06 13:08:06 +00:00
Chris Hill-Scott
f3a0c505bd Enforce order and style of imports
Done using isort[1], with the following command:
```
isort -rc ./app ./tests
```

Adds linting to the `run_tests.sh` script to stop badly-sorted imports
getting re-introduced.

Chosen style is ‘Vertical Hanging Indent’ with trailing commas, because
I think it gives the cleanest diffs, eg:
```
from third_party import (
    lib1,
    lib2,
    lib3,
    lib4,
)
```

1. https://pypi.python.org/pypi/isort
2018-02-27 16:35:13 +00:00
Rebecca Law
4acfd4101f Add letter counts to the platform admin page.
The big number counts are based on how many messages have been delivered. For letters we are using the requested count.
2017-11-01 16:33:06 +00:00
Rebecca Law
aaeec3f7ac Remove the extra function - oops 2017-10-24 11:35:30 +01:00
Rebecca Law
7f8e935b44 Improve the performance of /platform-admin
Using a new endpoint in API to get the aggregate platform admin stats.

Relies on https://github.com/alphagov/notifications-api/pull/1332
2017-10-23 15:08:08 +01:00
Chris Waszczuk
c2a50a7c37 Merge pull request #1520 from gov-cjwaszczuk/master
Added letters info to service / admin dashboard & activity page
2017-10-03 10:40:59 +01:00
chrisw
43395bc9d9 Added letters info to service / admin dashboard & activity page 2017-10-03 10:28:34 +01:00
venusbb
33a2909a76 reverse code not seperating trial_mode_services 2017-10-02 14:26:08 +01:00
venusbb
b0e267f677 Fixed tests 2017-09-22 23:09:44 +01:00
venusbb
3a1e76ba92 Progress: passed trial_mode to /service end point 2017-09-22 15:46:52 +01:00
venusbb
2a5acd9c77 platform-admin in progress 2017-09-19 10:13:12 +01:00
venusbb
4d794a464b Add and pass notifications filter trial_mode_services 2017-09-15 14:45:57 +01:00
Chris Hill-Scott
1e1dd49312 Fix big numbers on new platform admin page
Turns out the counts were all showing as zero because the generator had
already been consumed by the time we were trying to do the stats. Making
it a list comprehension means it can’t get exhausted.
2017-07-31 11:29:04 +01:00
Chris Hill-Scott
05707a1700 Remove list of services from platform admin index
We have two new pages for live and trial services that:
- are faster loading
- are now linked to

So the list of services doesn’t need to be on the platform admin index
page any more.
2017-07-26 07:56:20 +01:00
Chris Hill-Scott
26b333512c Add separate pages to view live/trial services
We have a lot of services now. Mostly we want to look at what live
services are doing. So loading up the trial mode services every time
slows things – generating, rendering and using the page – right down.

This commit adds two new pages, one to view only live services, and one
to view trial mode services.
2017-07-26 07:56:19 +01:00
Chris Hill-Scott
6dd4ae7410 Move platform admin template into folder
This is so that we can add a few other platform admin templates
alongside it, and keep everything nicely organised.
2017-07-25 14:44:35 +01:00
Martyn Inglis
146772f22e Sort platform admin page by requested messages.
- puts services that are doing things at the top.
2017-04-25 12:54:58 +01:00
Rebecca Law
21582cadb3 Get the BooleanField working in the form. 2017-01-03 16:14:25 +00:00
Rebecca Law
2e69d3c680 Add date filter for platform admin page. 2017-01-03 10:45:06 +00:00
Rebecca Law
5572d0f25f This commit renders the platform admin page with the given start and end date query params.
Need to add a form to the page to take these params.
2016-12-28 15:23:19 +00:00
Rebecca Law
df41da4860 [WIP] Attempt at adding a form to the platform admin page is not working well for me here. But I want to commit it so I can look at it again. 2016-12-28 14:44:53 +00:00
Jenny Duckett
c88a961e04 Add option to exclude test key stats on platform admin page
This page currently includes all notifications for all services, including
those sent using a test key. Stats on all other pages exclude test key usage,
though, which can lead to confusion for admins comparing numbers between
pages. Adding the option to toggle between including and excluding test key
usage on the platform admin page gives context for this difference, and allows
admins to see live usage of the platform as well as load associated with test
key usage.
2016-12-06 12:42:27 +00:00
Leo Hemsted
08881e5bd1 add get_active_services method
* all current invocations of get_services now call get_active_services
  EXCEPT for platform admin page (where we want to see inactive services
* cleaned up parameter names and unpacking (since *params is unhelpful)
* fixed incorrect kwarg name in conftest
2016-11-16 11:08:20 +00:00
Leo Hemsted
045864f052 Merge pull request #1022 from alphagov/deactivate-services-plat-admin
Deactivate services plat admin
2016-11-16 11:07:52 +00:00
Leo Hemsted
5edb8cd086 revert platform admin statistics
was erroneously using 'requested' rather than calculating 'sending'
2016-11-15 11:12:19 +00:00
Leo Hemsted
d26f7ac441 Merge branch 'master' of github.com:alphagov/notifications-admin into deactivate-services-plat-admin 2016-11-14 17:15:05 +00:00
Imdad Ahad
ec7ec77b69 Return the email and sms stats instead of summing them 2016-11-14 14:45:41 +00:00
Leo Hemsted
defa93809a show archived label on platform admin page, and sort last 2016-11-08 15:00:44 +00:00
Chris Hill-Scott
311ae4cfa4 Sort services by newest created first
Other than which services are live it’s also interesting to know what
services are getting created on Notify. So let’s put the newest ones at
the top of the page.
2016-09-13 10:38:33 +01:00
Chris Hill-Scott
88fff50ea3 Split platform admin page into live and trial mode
It sucks having to scroll down the massive list of services just to see
which ones are live.
2016-09-13 10:38:33 +01:00
Leo Hemsted
6ad7b019ea added tests for reworked platform admin page 2016-08-24 17:39:20 +01:00
Leo Hemsted
b983f020ff remove old statistics_api_client
now unused - replaced mock fn with detailed_services too
2016-08-24 16:26:08 +01:00
Leo Hemsted
7864f9455d rewrite platform-admin page to use new non-stats endpoints
had to change because format from api is slightly different
2016-08-24 15:04:03 +01:00
Chris Hill-Scott
e988a3633a Platform admin: Highlight service in research mode
Research mode trumps live.

Copies the same style we use in the page footer.
2016-06-23 17:47:19 +01:00