Commit Graph

113 Commits

Author SHA1 Message Date
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
Chris Hill-Scott
d04bde5486 Add API client for notification statistic
Adds a client for the endpoints added in
67c4bd2263
2016-03-17 13:15:41 +00:00
Nicholas Staples
0411238dd9 Add in anchor link, and update link in notification history. 2016-03-17 10:59:47 +00:00
Rebecca Law
b28fbc16d7 A platform admin user is able to see a list of all services.
Each service on the list is linked to the dashboard page of the service.
The platform admin user can see/edit templates, see/invite users, see/edit service settings.
The platform admin user can not send messages, see/edit api keys and developer docs.
2016-03-17 10:46:47 +00:00
Nicholas Staples
b0ca855ba8 Notification history page added and pagination, tests all working. 2016-03-16 16:57:10 +00:00
Rebecca Law
f63a85d003 Fix bug in error handlers.
Correct spelling error
2016-03-11 10:16:06 +00:00
Rebecca Law
735ca07dee Handle HTTPError from API and routing errors from flask.
Removed catching the HTTPError where applicable.
2016-03-10 14:56:47 +00:00
Rebecca Law
f6d98b63ea Refactored register_errorhandlers so that it handles HTTPError
Remove most cases where we catch HTTPError
2016-03-10 11:53:29 +00:00
Chris Hill-Scott
eb3734f1d1 Give the user better error messages for CSV files
Makes uses of the additions to utils in https://github.com/alphagov/notifications-utils/pull/9

This commit strips out a lot of the complex stuff that the views and templates
in this app were doing. There is now a cleaner separation of concerns:

- utils returns the number and type of errors in the csv
- `get_errors_for_csv` helper in this app maps the number and type of errors
  onto human-friendly error messages
- the view and template just doing the glueing-together of all the pieces

This is (hopefully) easier to understand, definitely makes the component
parts easier to test in isolation, and makes it easier to give more specific
error messages.
2016-03-08 18:36:22 +00:00
Martyn Inglis
76ccb99666 Fixed up the health check page 2016-03-03 16:41:21 +00:00
NIcholas Staples
0e663e044f Merge pull request #226 from alphagov/real-data-on-job-page
Put real data on job page
2016-03-03 14:27:10 +00:00
Chris Hill-Scott
d9073862fa Put data from job on job page
The main change is showing the finished time if the job is finished, rather
than the start time.
2016-03-03 11:38:38 +00:00
Chris Hill-Scott
a4a93116be Put real notifications on job page 2016-03-03 11:38:38 +00:00
Nicholas Staples
1f2fe2a1e4 Fixed up client for permission setting. All tests passing. 2016-03-03 10:24:49 +00:00
Adam Shimali
d11f88c6ff Login flash message set to default rather than dangerous class 2016-03-02 16:29:39 +00:00
Martyn Inglis
7b5e8061e2 Slight (bad) hack to ensure that the ticks appear on the manage user page
- changes imports for utils from broken version on previous branch
2016-03-01 10:45:13 +00:00
Martyn Inglis
f0b5ac9ceb Merge branch 'master' of github.com:alphagov/notifications-admin 2016-03-01 09:57:52 +00:00
Martyn Inglis
d0d2d24b66 Changed import path for python client 2016-03-01 09:57:45 +00:00
Nicholas Staples
58351a094c Merge with master. 2016-02-29 14:59:15 +00:00
Nicholas Staples
48943527ec API keys hooked up and working. All tests passing. 2016-02-29 14:57:07 +00:00
Adam Shimali
0de80bba97 [WIP] Invite user form now submits data to api. 2016-02-26 13:07:35 +00:00