Commit Graph

889 Commits

Author SHA1 Message Date
Martyn Inglis
8247f3d568 Added subject to client calls for templates 2016-02-24 09:23:38 +00:00
NIcholas Staples
96e7239064 Merge pull request #192 from alphagov/get-user-by-email
Admin uses correct endpoint for getting user by email address.
2016-02-23 13:19:55 +00:00
Adam Shimali
d6f88f79e2 Admin uses correct endpoint for getting user by email address. 2016-02-23 12:47:48 +00:00
Chris Hill-Scott
3a11cb9044 Merge pull request #191 from alphagov/last-minute-fixes
Last minute fixes
2016-02-23 11:54:04 +00:00
Chris Hill-Scott
31b60730d3 Put banner on the choose sms template page 2016-02-23 11:49:47 +00:00
Chris Hill-Scott
9db0fff428 Bring back the tip banners 2016-02-23 11:32:33 +00:00
Chris Hill-Scott
db5aa0e092 Add banner back on send sms page 2016-02-23 11:24:40 +00:00
Chris Hill-Scott
2202994fdc Fix GOV.UK template images 2016-02-23 10:56:48 +00:00
NIcholas Staples
38545d728a Merge pull request #190 from alphagov/upload-form-csrf-fix
Fix missing CSRF token on send SMS page
2016-02-23 09:22:00 +00:00
Chris Hill-Scott
0d12714401 Automatically focus the first form field error
Because we’re not showing a summary of error messages screen reader users might
take a while to discover that there’s an error on the page. Since the only
real action on a page with errors is to correct them this commit adds some
Javascript to send focus straight to the first error message on a page.
2016-02-23 07:29:51 +00:00
Chris Hill-Scott
16fbfe49a3 Fix missing CSRF token on send SMS page
As part of https://github.com/alphagov/notifications-admin/pull/187 the file
upload pattern was changed to auto-submit once a file had been picked. The
form that was submitted was, however, missing a CSRF token, as well as a submit
button for non-JS users.

This commit makes the file upload pattern self-contained, so that it will always
include a form with a CSRF token in a hidden input and a submit button, which is
then hidden when Javascript loads.
2016-02-23 07:29:50 +00:00
minglis
7280e90c26 Merge pull request #189 from alphagov/job-metadata
Add count of rows in csv file as a notification count.
2016-02-22 15:37:57 +00:00
Adam Shimali
6c56f9be31 Add count of rows in csv file as a notification count. 2016-02-22 14:53:37 +00:00
minglis
e03b970039 Merge pull request #187 from alphagov/invite-users
Add pages to invite, edit, and delete users
2016-02-22 14:13:39 +00:00
Chris Hill-Scott
97a3bf9225 Remove the ‘manage templates’ page
The ‘manage templates’ page was almost identical to the ‘send text messages’
page.

This commit consolidates them into one and makes them all hang together.

Part of this means tweaks to the javascript so that files upload as soon as
you’ve chosen them.
2016-02-22 13:39:02 +00:00
Chris Hill-Scott
bf3f6d7d3e Fix users page for research
For the lab sessions, users should just see themselves as the only user, not
all the fake users (it might confuse them).
2016-02-22 13:39:02 +00:00
Chris Hill-Scott
65dc7578e5 Updates to styleguide
Brings in changes to the email message and table patterns.
2016-02-22 13:39:02 +00:00
Chris Hill-Scott
f6fe61d10d Compress GOV.UK Template assets
While looking at front end performance I noticed that the GOV.UK Template CSS
and Javascript files weren’t being minified, so were being served with (for
example) lots of comments still in the code.

This changes the Gulp task from simply copying the files to also minfiying them,
where appropriate.
2016-02-22 13:39:02 +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
Chris Hill-Scott
17b99c9bf2 Add pages to invite, edit, and delete users
This takes the original prototype version of this page, and, using the same
fake data (ie nothing is wired up):
- adds an invite users page
- adds an edit (and delete) user page

Both these pages allow the user to set another user’s permissions.

This commit adds images for the ticks and crosses, so we have control over their
appearance.
2016-02-22 13:39:02 +00:00
Adam Shimali
a86be302ce Merge pull request #186 from alphagov/email-templates
Email templates
2016-02-22 13:34:45 +00:00
Martyn Inglis
d7bfab3bff Merge branch 'email-templates' of github.com:alphagov/notifications-admin into email-templates
Conflicts:
	tests/app/main/views/test_add_service.py
2016-02-22 13:31:19 +00:00
Chris Hill-Scott
9d38cd98b0 Preview service name when adding a new service
This commit adds a new page, which appears after a user enters the name for
their new service. It shows how the service name will appear in emails and
text messages.

This means that the new service is not created until after they have confirmed
that the name is appropriate in context.

This has also involved:
- visual changes to the ‘email template’ pattern, which wasn’t very refined
  before
- removing a bunch of words from the enter service name page, because most users
  don’t read them, and we reckon that showing a preview is a better way of
  getting them to understand what is meant by service name

Still to do:
- validating the the generated email address for a service is unique (on the
  API) side
- having the API return the generated email address, rather than determining it
  in the admin app
2016-02-22 13:20:53 +00:00
Adam Shimali
9464f37397 Merge pull request #188 from alphagov/send_verify_code_fix
Fix bug with send_verify_code not including the to field.
2016-02-22 12:38:50 +00:00
Nicholas Staples
980c01e10c Fix bug with send_verify_code not including the to field. 2016-02-22 12:33:59 +00:00
Adam Shimali
b4ddcaa9b1 Merge pull request #185 from alphagov/user_permission
User permissions added with test.
2016-02-22 10:36:50 +00:00
Adam Shimali
a1d9194193 Merge pull request #184 from alphagov/user-sms-email-code-endpoints
Updated the api_client call to send_verify_code
2016-02-22 10:27:10 +00:00
Martyn Inglis
599e483d82 Merge branch 'email-templates' of github.com:alphagov/notifications-admin into email-templates
Conflicts:
	app/main/views/index.py
2016-02-19 17:28:15 +00:00
Chris Hill-Scott
73deae9bff Preview service name when adding a new service
This commit adds a new page, which appears after a user enters the name for
their new service. It shows how the service name will appear in emails and
text messages.

This means that the new service is not created until after they have confirmed
that the name is appropriate in context.

This has also involved:
- visual changes to the ‘email template’ pattern, which wasn’t very refined
  before
- removing a bunch of words from the enter service name page, because most users
  don’t read them, and we reckon that showing a preview is a better way of
  getting them to understand what is meant by service name

Still to do:
- validating the the generated email address for a service is unique (on the
  API) side
- having the API return the generated email address, rather than determining it
  in the admin app
2016-02-19 16:38:46 +00:00
Martyn Inglis
6616182ab3 Slight changes to match new API features:
- get user now throws a 404 so handle that
- making a service now needs one user not many to create
2016-02-19 16:38:08 +00:00
Nicholas Staples
32e37d89fb User permissions added with test. 2016-02-19 16:38:04 +00:00
Rebecca Law
cffd66c62e Updated the api_client call to send_verify_code
The api has now has an user/<user_id>/email-code and user/<user_id>/sms-code
This commit requires an update to the python-client. Make sure the PR for that version has been merged first and the tag push using scripts/push_tag.sh
2016-02-19 16:08:44 +00:00
NIcholas Staples
f761afa76e Merge pull request #182 from alphagov/prefil-placeholders
Prefil placeholders
2016-02-19 09:37:08 +00:00
Chris Hill-Scott
5af03b28f3 Remove the weird table from the send SMS page
It was weird.
2016-02-18 17:33:43 +00:00
Chris Hill-Scott
8123359eb2 Prefill placeholders for test message
If you want to send yourself a test message from a template that has
placeholders you can’t, at the moment.

Rather than forcing you to upload a CSV, we should prefil the data, and then
you only need to upload a CSV if you want to customise it.
2016-02-18 17:32:32 +00:00
Rebecca Law
cfef82bfaa Merge pull request #181 from alphagov/test-text
Add flow for sending yourself a text message
2016-02-18 17:19:05 +00:00
Chris Hill-Scott
a5945969c9 Add tests for new routes 2016-02-18 17:03:32 +00:00
Chris Hill-Scott
eec56c2778 Add flow for sending yourself a text message
This commit adds a shortcut, which (in the background) does the creation and
uploading of a CSV file for you.

This enables users to send themselves a test message without having to fiddle
about with CSV files.
2016-02-18 15:59:57 +00:00
Chris Hill-Scott
2a9f9dcc57 Add a hint about how to use placeholders
Since placeholders (almost) work now, it’s worth telling people what the syntax
is.

This commit also removes the ‘template type’ picker, since you can only create
SMS templates at the moment. This will be revisited when we start looking at how
you add an email template.
2016-02-18 15:57:09 +00:00
Rebecca Law
3dea04d0c0 Merge pull request #180 from alphagov/use-template-util
Use Template util to replace, highlight and validate CSV files
2016-02-18 15:56:25 +00:00
Chris Hill-Scott
29dc039786 Skip initial space when parsing CSVs 2016-02-18 15:50:28 +00:00
Chris Hill-Scott
426a23decd Add a hint about how to use placeholders
Since placeholders (almost) work now, it’s worth telling people what the syntax
is.

This commit also removes the ‘template type’ picker, since you can only create
SMS templates at the moment. This will be revisited when we start looking at how
you add an email template.
2016-02-18 15:23:14 +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
efb2140bbb Check CSV files match the template
This commit adds a first stab at checking whether a CSV file has the right
data to fill the placeholders.

The UI is very much first bash, but I’d like to get this merged and see how it
feels. The main thing is that we’ve got all the bit in place now to do this
logic.
2016-02-18 15:07:14 +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
NIcholas Staples
b7c226e2a8 Merge pull request #179 from alphagov/npm-govuk-template
Install GOV.UK Template with NPM
2016-02-17 14:43:12 +00:00
Chris Hill-Scott
7ecc3a4821 Install GOV.UK Template with NPM
Since https://github.com/alphagov/govuk_template/pull/193 the Jinja version of
the GOV.UK Template is published with a `package.json`. This means
- we can consume it via NPM
- so we can get rid of Bower

Which is what this commit does.
2016-02-17 14:27:05 +00:00
NIcholas Staples
23e38bfb6e Merge pull request #177 from alphagov/easier-registration
Make registration and forgot password pages better
2016-02-17 11:05:17 +00:00
Chris Hill-Scott
e0e445c520 Stop enumeration of email addresses via forgot pw
https://www.pivotaltracker.com/story/show/113840073

Previously the forgot password page would give an error if you entered an email
address which didn’t belong to an account.

This would allow a potential attacker to know which email addresses were
registered.

This commit changes the response to always be the same, whether or not the email
address exists.

Also, this is a good read about the dangers of asserting whether a mocked method
was called: http://engineeringblog.yelp.com/2015/02/assert_called_once-threat-or-menace.html
2016-02-17 10:42:15 +00:00
Chris Hill-Scott
6a39c8e187 Use typographic quotes
http://smartquotesforsmartpeople.com
2016-02-17 10:42:14 +00:00