Commit Graph

133 Commits

Author SHA1 Message Date
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
Rebecca Law
009c117452 Upgrade requirements.
With the upgrade of pep8 to 1.7.0 module imports are required to be at the top of the file,
meaning I had to add a noqa line to some of the init files. Are those init files wrong or is pep8 too strict.
2016-04-21 09:30:33 +01:00
Rebecca Law
1fe5ae0371 This pull request removes the need for the req and pay in the claims JWT.
Use the new version of the notifications-python-client. This version no longer adds the req and pay to the claims of the jwt.

The change is backward compatible so an older client that sends a JWT with the extra claims will pass authentication.
Once all the clients have been updated to not include the extra claims some updates to exclude them from the method signatures will happen as well.

The documentation has been updated to reflect this change.

https://www.pivotaltracker.com/story/show/116971293
2016-04-15 11:04:35 +01:00
Chris Hill-Scott
b1d0547bb2 Merge pull request #447 from alphagov/remove-human-timestamps
Remove human-friendly timestamps from activity page
2016-04-14 14:10:52 +01:00
Chris Hill-Scott
cadc700712 Remove human-friendly timestamps from activity page
This fix introduced by e6490e1 did not fix anything.

So lets remove the ‘3 days ago’ thing completely and just say the date
and time instead.
2016-04-14 13:47:53 +01:00
Chris Hill-Scott
b157da24cb Merge pull request #445 from alphagov/different-human-timestamp-module
Use a different module for doing nice timestamps
2016-04-14 13:00:20 +01:00
Nicholas Staples
3865c722fc Updated notifications_utils version and associated code. Added email subject formatting for placeholders. 2016-04-14 12:00:55 +01:00
Chris Hill-Scott
e6490e18d1 Use a different module for doing nice timestamps
There is a bug in Babel[1] which means that it throws an exception if
it can’t find the locale it wants to use.

This is not a problem when developing locally, because OS X comes with
lots of locales. The AWS machines, however, only have one locale, which
is not the one that Babel is looking for. Hence the ‘Activity’ page
doesn’t work.

This commit changes to using Humanize[2] instead, which is much less
vast and hopefully less hungry in its requirements.

That’s a morning we won’t get back…

1. https://github.com/python-babel/babel/issues/137
2. https://pypi.python.org/pypi/humanize
2016-04-14 11:39:43 +01:00
Nicholas Staples
33cc90488c Fix template delete links.
Fix bug with 'current_service' not available for non service urls.

Code review adjustment.

Static code check.
2016-04-13 16:57:16 +01:00
Chris Hill-Scott
1a6bb37171 Tidy up the ‘Activity’ table
This table had a lot of columns, which meant that some of them became
very narrow, wrapping the text awkwardly.

This commit groups some of the data into a chunk, which occupies the
first column.
2016-04-13 16:17:09 +01:00
Adam Shimali
159fe60c1a Template statistics now surfaced on dashboard.
Job list removed.

Template statistics retrieved at same time as
notification stats.
2016-04-05 11:47:24 +01:00
Nicholas Staples
c31c55666b Added current_service to flask context and template context.
Fix all tests and conflicts.

Removed comment line.
2016-04-04 17:01:20 +01:00
Nicholas Staples
48daac7b94 Merging conflict with two_factor.py
Fixed merge mistake with two_factor.py.
2016-03-30 10:11:06 +01:00
Nicholas Staples
f3689cc113 Functionality added and all tests working.
Update correct use of permissions form.
2016-03-23 10:56:14 +00:00
Rebecca Law
a1ef676fab Merge branch 'master' into platform-admin
Conflicts:
	app/main/views/send.py
2016-03-21 12:18:44 +00:00
Chris Hill-Scott
2d74c89ef2 Merge pull request #306 from alphagov/add-ga
Add Google Analytics
2016-03-21 09:58:12 +00:00
Rebecca Law
402f55be23 Merge branch 'master' into platform-admin
Conflicts:
	app/__init__.py
	app/main/views/add_service.py
	app/main/views/jobs.py
	app/templates/main_nav.html
	tests/app/main/views/test_dashboard.py
	tests/conftest.py
2016-03-18 16:32:10 +00:00
Rebecca Law
13d9acf7dd Completion of the platform admin user story. 2016-03-18 16:20:37 +00:00
Chris Hill-Scott
0cda624657 Add Google Analytics
https://www.pivotaltracker.com/story/show/115861923

Makes some changes to the content security policy, to allow
the Google Analytics JS and trakcing image to be loaded,
copied from @alexmuller’s excellent work on GOV.UK:

https://gdstechnology.blog.gov.uk/2015/02/12/experimenting-with-content-security-policy-on-gov-uk/
https://github.com/alphagov/frontend/pull/733
2016-03-18 15:06:37 +00:00
Nicholas Staples
3d08eb624b Merge with new master. 2016-03-18 10:16:14 +00:00
Martyn Inglis
61e810fd52 Make dev run script align with prod run scripts
- we don't pass ENV into create_app anymore
2016-03-18 08:56:55 +00:00
minglis
f6ee5dc8c6 Merge pull request #292 from alphagov/update-config-for-staging-live
Start aligning Admin app with config styles used elsewhere
2016-03-17 15:42:57 +00:00
Rebecca Law
643d047705 Fix division by zero 2016-03-17 14:40:08 +00:00
Martyn Inglis
2473b09beb Start aligning Admin app with config styles used elsewhere
- no config overrides - now all set in environment
- use different files for staging and live too allow for differently named env variables
- updates to run_app and run_tests scripts to set correct environment (test/development) so correct config picked up
- use environment file on deployed environments to pick correct config
2016-03-17 13:45:59 +00:00