Commit Graph

156 Commits

Author SHA1 Message Date
bandesz
10950bb8a6 Run on Paas 2017-01-17 11:44:42 +00:00
Imdad Ahad
59c7bc2e6f Refactor get notifications streaming including formatting 2017-01-13 11:35:27 +00:00
Chris Hill-Scott
810b613bc2 Remove nl2br Jinja filter
This was used when the code for previewing SMS templates lived in the
admin. ⌘F seems to suggest it’s not used anywhere else.
2016-12-20 11:10:38 +00:00
Martyn Inglis
994032a76f Switched off session protection
Many departments are reporting being logged out during usage of the app
This may be because they present differing IP addresses to Notify on different requests due to outbound proxies and so on
Swicthing session protection to None means and IP change won't log a user out.
2016-12-14 14:07:08 +00:00
Rebecca Law
0417fa3534 Remove unused import 2016-12-07 14:12:12 +00:00
Rebecca Law
4b5e4d2864 Added a new 400.html error page, this error page will only be used when we get an HTTPError from the api.
This was done to solve the problem of invitations expiring and the user getting a 500 error message, which says to try again.
2016-12-07 14:00:03 +00:00
Martyn Inglis
0bc48897f3 Adds statsd to the application
- statsd client from utils
- adds to logger an get same method based reporting as we do for the API.
2016-12-01 17:21:06 +00:00
Martyn Inglis
1384d2a61c Adds the request-id middleware to the admin app
- adds a request-id to each request and passes that through to the response
- this is picked up by the loggers and used to tie log events to a request
2016-11-30 16:59:47 +00:00
Chris Hill-Scott
274b2893f7 Merge pull request #979 from alphagov/4-days-scheduled
Allow a job to be scheduled any time in next 4 days
2016-11-03 10:24:07 +01:00
Chris Hill-Scott
4b0d8ec636 Use days of week, not month for scheduled jobs
Friday at 4pm is easier to understand than 14 October at 4pm, especially
when the UI you’ve used to choose this time has talked about days of the
week.
2016-10-31 09:14:05 +00:00
Leo Hemsted
f039397533 make letters error if user not logged in
also added tests for the various hiding logic points

also added new logged_in_client in conftest - so you dont need to
patch all those stupid API calls for get user and get service
2016-10-27 16:46:51 +01:00
Leo Hemsted
3058a7122e log exceptions in the admin app
(we weren't previously logging anything on error!)
2016-10-19 11:54:51 +01:00
Leo Hemsted
bd07aa97a7 remove monotonic as a dependency
"On Python 3.3 or newer, monotonic will be an alias of time.monotonic from the standard library"
2016-10-19 10:39:22 +01:00
Chris Hill-Scott
1fccc524a1 Remove documentation pages
These are out of date now and potentially misleading.

Adds a new error page for HTTP `410 GONE`. Looks like the 404 page, but
returns the appropriate error code to be a good web citizen.
2016-10-10 15:58:11 +01:00
Chris Hill-Scott
e095d6024c Revert "Remove Google Analytics"
This reverts commit f31170f5a2.
2016-10-05 10:55:04 +01:00
Chris Hill-Scott
f31170f5a2 Remove Google Analytics
Reverts https://github.com/alphagov/notifications-admin/pull/306

We’re not looking at the data from Analytics, so shouldn’t be collecting
it just in case.

<sup>Brought to you by the fun police.</sup>
2016-09-30 09:23:00 +01:00
Chris Hill-Scott
48891babc4 Add log of notifications to API integration page
Now that we’ve removed simulated notifications from the dashboard and
activity pages they’re not visible anywhere in the app.

While they should’t be visible to non-technical users, developers have
a real need for Notify to confirm that their code is doing what they
expect. This is needed especially when they’re just getting started with
Notify.

There’s no way of seeing this info from the API either, because a key
can only get notifications created with a key of that type.

It doesn’t make sense to make this a ‘mode’ of the dashboard or activity
because the information about notifications that developers need is
also different. So this commit adds up to 50 of the most recent
notifications sent via the API to the page that developers use as their
‘home’ page.

This also lets us explain the 7 days thing to developers via the
empty slate state of this area of the page.
2016-09-29 09:28:04 +01:00
Chris Hill-Scott
3e42042156 Add a page to manage a service’s whitelist
Services who are in alpha or building prototypes need a way of sending
to any email address or phone number without having to sign the MOU.

This commit adds a page where they can whitelist up to 5 email addresses
and 5 phone numbers.

It uses the ‘list entry’ UI pattern from the Digital Marketplace
frontend toolkit [1] [2] [3].

I had to do some modification:
- of the Javascript, to make it work with the GOV.UK Module pattern
- of the template to make it work with WTForms
- of the content security policy, because the list entry pattern uses
  Hogan[1], which needs to use `eval()` (this should be fine if we’re
  only allowing it for scripts that we serve)
- of our SASS lint config, to allow browser-targeting mixins to come
  after normal rules (so that they can override them)

This commit also adds a new form class to validate and populate the two
whitelists. The validation is fairly rudimentary at the moment, and
doesn’t highlight which item in the list has the error, but it’s
probably good enough.

The list can only be updated all-at-once, this is how it’s possible to
remove items from the list without having to make multiple `POST`
requests.

1. 434ad30791/toolkit/templates/forms/list-entry.html
2. 434ad30791/toolkit/scss/forms/_list-entry.scss
3. 434ad30791/toolkit/javascripts/list-entry.js
4. http://twitter.github.io/hogan.js/
2016-09-29 09:27:38 +01:00
Chris Hill-Scott
e9d230b9a4 Always show created time for sending state
When a notification is in `created` or `sending` the thing you care
about is how long it’s been sitting there.
2016-09-13 10:37:38 +01:00
Chris Hill-Scott
17d5af1a6e Show delivery time even for failed notifications
We reckon it’s probably still useful.
2016-09-13 10:37:38 +01:00
Chris Hill-Scott
2d7ed4d34f Fix overlapping text on tables of notifications
This commit changes the tables of notifications from 3 columns to two
columns. This is so the text has more room, so it doesn’t start
overlapping.

It also makes sure that if the recipient gets really long that it will
be cut off with an ellipsis, rather than overlapping…

I hypothesize that if a notification fails you probably don’t care when
it failed, just that it failed.
2016-09-13 10:37:38 +01:00
Chris Hill-Scott
3d8d160d3e Always use 12h times
The GOV.UK content style guide says:

> - 5:30pm (not 1730hrs)
> - midnight (not 00:00)
> - midday (not 12 noon, noon or 12pm)

This commit changes all times to be 12h not 24h, and adds a special case
for when a time is exactly 12:00am or 12:00pm.
2016-08-31 16:58:34 +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
fc14a800b5 remove print 2016-08-16 14:55:23 +01:00
Leo Hemsted
fb510d2522 only set organisation on GET and add allowed fields to service client
we were overwriting it before validating the form for POST, so lost info
2016-08-12 12:37:18 +01:00
Chris Hill-Scott
6b5e64479a Add a page to set organisation and branding option
Platform admin only.

Adds radio buttons to choose one of:
- three hard-coded branding options
- organisations from a list provided by the API
2016-08-12 10:31:43 +01:00
Chris Hill-Scott
45ae43d987 Include ‘created’ in ‘sending’ bucket
The difference between created and sending isn’t something a user should
have to care about. So this commit:
- counts created and sending as the same thing
- displays and notifications which have a status of created as sending
2016-08-05 10:59:49 +01:00
Martyn Inglis
47b8955a9a Fix import order so that configs work 2016-07-29 10:21:58 +01:00
Martyn Inglis
37167473b3 New property for environment 2016-07-29 10:21:26 +01:00
Martyn Inglis
4222027184 Updated config to be string based not class based and removed old style live/staging files. 2016-07-29 10:21:26 +01:00
Leo Hemsted
6ff77c995e add tests for service_api_client 2016-07-21 17:32:28 +01:00
Leo Hemsted
4451a8634d add detailed flag to GET service api client
returns current (past 7 days) notification stats as well as service info
2016-07-20 14:12:22 +01:00
Leo Hemsted
743a9d05d1 Merge pull request #794 from alphagov/refactior
Rename api_client to service_api_client
2016-07-19 13:26:34 +01:00
Leo Hemsted
1cd2841c17 rename api_client to service_api_client 2016-07-15 15:23:23 +01:00
Chris Hill-Scott
d380eaf060 Allow images to be served from live domain
Currently images in our email template are hardcoded to be served from
the live domain[1].

In order for the admin app, running locally or in preview/staging, to be
able to load these images when previewing an email template, the CSP
headers need to allow this domain.

Also splits the header string up using string literal concatenation[2]
so that it’s easier to read.

1. https://notifications.service.gov.uk
2. https://docs.python.org/3/reference/lexical_analysis.html#string-literal-concatenation
2016-07-12 16:46:46 +01:00
Chris Hill-Scott
5f67560b1e Link to failure reasons from job/activity pages
If something has failed and you don’t know why, you should be able to
find out why. Let’s try adding a link to the page explaining why, so
it’s not just buried in the footer.
2016-07-11 14:01:42 +01:00
Chris Hill-Scott
f9a9048579 Make ‘temporary failure’ error less cryptic
‘Phone number doesn’t exist’ as opposed to ‘Permanent failure’ has
tested well because it talks in terms of things people understand.

We should do the same for ‘Temporary failure’, because users are
unclear:
- why this is happening
- if it’s temporary, is Notify going to retry it (it’s not)

We think that ‘Phone/inbox not currently accepting messages’ answers
makes these things clearer.

I’ve reworded it slightly to:

- ‘Inbox not accepting messages right now’
- ‘Phone not accepting messages right now’
2016-07-11 11:18:01 +01:00
Chris Hill-Scott
c31762265c Colour code notification statuses
Makes the table easier to scan.

Delivered stays as before.

Sending is greyed out.

All other statuses are failure, and stand out by being red and bold.
2016-06-09 11:36:22 +01:00
Chris Hill-Scott
b1852f4b78 Make permanent failure status more human
Replace with ‘Phone number doesn’t exist’ or ‘Email address doesn’t’
exist.
2016-06-09 11:36:21 +01:00
Martyn Inglis
c9297459e2 Research mode
- adds a new link on service settings page to switch service into/out of research mode
- platform admin only
- shows an indicator in the footer
2016-06-01 16:07:43 +01:00
Chris Hill-Scott
b84d06bd68 Move parameters out of the …_message components
This commit refactors the `email_message` and `sms_message` UI components to
take fewer parameters.

`name`, `edit_link` and anything to do with versions are identical for both
text and email messages so I’ve moved them to the pages where you choose a
template or see the versions.

This commit also tidies up the wording and styling of the template history
stuff.
2016-05-27 11:08:40 +01:00
Chris Hill-Scott
16d83faa72 Put uploaded files on the dashboard
This commit depends on and uses the data returned by:
- [x] https://github.com/alphagov/notifications-api/pull/345
- [x] https://github.com/alphagov/notifications-api/pull/347
- [x] https://github.com/alphagov/notifications-admin/pull/612

It puts the last 5 jobs on the dashboard. This should be changed to all the jobs
from the last 7 days when that parameter is available.

It also:
- links to the jobs page
- makes the numbers on the jobs page consistent with the dashboard
- makes the numbers on an individual job consistent with the appearance of the
  dashboard
2016-05-26 09:00:00 +01:00
Nicholas Staples
83f25cd89b Beautify the template version links and template link page. 2016-05-20 13:58:16 +01:00
Rebecca Law
37327dfbb0 Add a filter to format notification status to a readible label. 2016-05-18 09:54:50 +01:00
Martyn Inglis
e54c309594 Convert timezones using pytz. 2016-05-17 14:00:40 +01:00
Martyn Inglis
af59ecb379 Record start of request so we can time all requests 2016-05-12 13:56:14 +01:00
Martyn Inglis
6699442f6b Added provider management pages in.
- see priority
- change priority
2016-05-11 09:43:55 +01:00
Chris Hill-Scott
50427ecd3f Add a page to show delivery rates week-by-week
Implements
https://github.com/alphagov/notifications-api/pull/286

Will always show weeks as Monday to Sunday.
2016-05-05 10:56:20 +01:00
Nicholas Staples
e1f3975c9a Times from api are now formatted to the british time. 2016-05-03 10:55:37 +01:00
Adam Shimali
7c1867fde6 Record login including remembered user login events to the api based of flask login
signals.
2016-04-27 16:39:17 +01:00