Commit Graph

906 Commits

Author SHA1 Message Date
Adam Shimali
602d505dc7 Merge pull request #196 from alphagov/get-users-for-service
Get users for service
2016-02-24 17:41:45 +00:00
Adam Shimali
53f704b8ed Merge pull request #195 from alphagov/remember_me_sign_on
Remember me functionality added and tested.
2016-02-24 17:36:40 +00:00
Rebecca Law
658a53422b Verify mock is called in the test 2016-02-24 17:32:15 +00:00
Nicholas Staples
c959678c49 Remember me functionality added and tested.
Merge extra.

Fixed comment.
2016-02-24 17:32:15 +00:00
Rebecca Law
2905d11fe4 Get users for service to show on the manage team page.
Calls api endpoint /service/<service_id>/users to retrieve all users associated with the service
2016-02-24 17:32:15 +00:00
Adam Shimali
bcf21f5ab2 Merge pull request #193 from alphagov/email-templates-part-2
Allow creation and editing of email templates
2016-02-24 17:27:51 +00:00
Adam Shimali
97cebe4511 Skip any boto related teset 2016-02-24 17:21:44 +00:00
Adam Shimali
2989f62252 Remove more mocks 2016-02-24 16:52:55 +00:00
Adam Shimali
588248deb0 Remove some mocks 2016-02-24 16:52:02 +00:00
Rebecca Law
ff5a20b817 Add mock_get_service to unit test 2016-02-24 16:40:39 +00:00
Rebecca Law
1d5bbd0d85 Set python version to 3.5 from 3.4 2016-02-24 16:27:17 +00:00
Rebecca Law
d24cea904b Bump the version of notifications-python-client 2016-02-24 16:24:50 +00:00
Adam Shimali
ed18a24594 Fix requirements for new utils 2016-02-24 16:10:42 +00:00
Chris Hill-Scott
bc1899e8c0 Make email pattern work in new context
The email pattern looked a bit shonky when displayed in a narrower column. This
commit fixes it by making the email’s metadata (eg subject, from) into a table,
which it sort of is. This means that it is more flexible about the size of
container in which it sits.
2016-02-24 09:23:38 +00:00
Chris Hill-Scott
1e46922876 Make send the send flow generic
This commit parameterises all methods in the send view so that they can send
either emails or SMS messages.

It works out what kind of message it is sending from the `template_type`
property of the template object.

This means that the `Template` util class needs to know about these properties,
which means that this commit depends on:
https://github.com/alphagov/notifications-utils/pull/2

This commit does _not_ add tests for sending emails. The existing tests for
sending SMS still pass, but actually sending emails is outside the scope of
this story.
2016-02-24 09:23:38 +00:00
Chris Hill-Scott
aaa6317371 Rename SMS to send
Because this view is no longer just for sending SMS messages, it and its
associated tests should be renamed, so `send_sms.py` becomes `send.py`, etc.
2016-02-24 09:23:38 +00:00
Chris Hill-Scott
c6de605311 Add basic flow for adding email _or_ sms templates
Templates now have:
- a type (email or sms)
- a subject (if they are email templates)

We don’t want two completely separate view files for email and SMS, because they
would have an enormous amount of repetition.

So this commit adds
- different templates for SMS and email templates
- different form objects for SMS and email templates

…and wires them up.
2016-02-24 09:23:38 +00:00
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