Commit Graph

94 Commits

Author SHA1 Message Date
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
Chris Hill-Scott
fd54eeaeb7 Inline images in CSS
Because this commit’s parent added a few new images, we are now serving at
least a handful of images, therefore a few additional HTTP requests. It’s better
to combine multiple HTTP requests into one for performance reasons (up to a
point).

This commit adds an extra step to the preprocessing of SASS files which takes
any images it finds, base64 encodes them and inlines them into the distributed
CSS files.

It also modifies the content security policy to allow inline images.
2016-02-22 13:39:02 +00:00
Nicholas Staples
32e37d89fb User permissions added with test. 2016-02-19 16:38:04 +00:00
Chris Hill-Scott
45cacd82d3 Validate CSVs fully
This commit extends the existing function to validate each row’s phone number
to also validate that all the required data is present.

It does this using the checking that the `Template` class can do when given
a template and a `dict` of values.
2016-02-18 15:07:15 +00:00
Chris Hill-Scott
2d55bb7ae2 Use Template to replace/highlight placeholders
This commit brings in the `Template` util, added here:
https://github.com/alphagov/notifications-utils/pull/1

It also does a fair bit of tidying up, which I’ve unfortunately squashed into
this one massive commit. The main change is moving 404 handling into the
templates dao, so that every view isn’t littered with `try: … except(HTTPError)`.

It also adds new features, in a prototypy sort of way, which are:
- download a prefilled example CSV
- show all the columns for your template on the 'check' page
2016-02-18 15:07:14 +00:00
Chris Hill-Scott
2f0cc99610 Make URLs for assets cache-proof
https://www.pivotaltracker.com/story/show/113448149

This commit adds a query string to assets URLs which is generated from a hash
of the file contents. When asset files are changed they will now be served from
a different URL, which means they wont be loaded from browser cache.

This is similar to how GOV.UK template adds its version number as a querystring
parameter for its assets.

This is mostly copied from Digital Marketplace utils:
https://github.com/alphagov/digitalmarketplace-utils/pull/102

They have it in a shared codebase, we only have one frontend app so don’t need
to do that.

Usage in a template:
``` jinja
{{ asset_fingerprinter.get_url('stylesheets/application.css') }}
```

Output:
```
static/stylesheets/application.css?418e6f4a6cdf1142e45c072ed3e1c90a
```
2016-02-10 16:00:29 +00:00
Chris Hill-Scott
7e8046be47 Add syntax highlighting to code examples in docs
Uses the Pygments[1] package.

1. http://pygments.org/
2016-02-09 10:33:49 +00:00
Nicholas Staples
7fc1db9d19 Update error handlers to include appropriate headers. 2016-02-02 16:50:13 +00:00
Nicholas Staples
7d4c2045bc Added cache control header to response. 2016-02-02 14:02:10 +00:00
Chris Hill-Scott
3135f6c510 Use different colours for each environment
https://www.pivotaltracker.com/story/show/112786779

> There's an emerging convention on admin apps, to have a red strip atop the
> page, also to have a different colour for preview environment... so let's
> adopt that and see how it feels. Red for prod and gold for preview.

This commit adds config so that:
- yellow locally
- orange on preview and staging
- red on live

It will not actually work until each AWS environment uses the right config, but
can be tested locally by setting the environment variable manually, eg:
`export HEADER_COLOUR='#F47738'`
2016-02-01 15:35:19 +00:00
Nicholas Staples
bed1116587 Status update added. 2016-01-29 14:41:07 +00:00
Adam Shimali
0995cd2e3c Uploading csv creates job via api 2016-01-29 10:30:02 +00:00
Nicholas Staples
6959d695d3 Working tests, hopefully all code changes done. 2016-01-27 12:22:32 +00:00
Rebecca Law
90fca93308 Implementation of api key pages.
Revoke page will show the correct key name
Show api keys shows a well formatted expiry date
Fix tests for api key endpoints.
2016-01-21 12:28:05 +00:00
Rebecca Law
41c775cd68 Created api_key_api_client.
Implementation of create, revoke and show api keys for service.
These calls work, however we still need to fix the tests.
2016-01-20 17:32:55 +00:00
Adam Shimali
b5cdf86b40 User registration now creates user via api.
Verification flow is still to be completed.

Foreign key constraint on verify codes to user table removed.
2016-01-19 22:49:46 +00:00
Martyn Inglis
fb77052585 Merge branch 'master' of github.com:alphagov/notifications-admin 2016-01-19 15:44:26 +00:00
Martyn Inglis
a74c78ebd5 Reorded the inits - so logging gets done first 2016-01-19 15:44:12 +00:00
Martyn Inglis
19ea0de766 Reorderd to override from env over credstash over config 2016-01-19 15:01:45 +00:00
Nicholas Staples
a9fead0d82 Merge with master. 2016-01-19 09:49:01 +00:00