Commit Graph

870 Commits

Author SHA1 Message Date
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
Chris Hill-Scott
6b4ede629c Use correct HTML 5 input types
These give devices a hint (although don’t mandate them) to use a numeric keypad,
or a keypad with the `@` symbol visible when entering phone numbers or email
addresses.
2016-02-17 10:42:14 +00:00
Chris Hill-Scott
2124821e00 Don’t allow autocomplete on register page
This is a potential attack vector which was highlighted by the pen test.

Setting autocomplete to `nope` (or any random string) is the most comprehensive
way of telling browsers not to autocomplete a form according to:
https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion
2016-02-17 10:41:03 +00:00
Rebecca Law
e5dbd4a077 Merge pull request #178 from alphagov/import-fix
Fix missing import
2016-02-17 10:20:58 +00:00
Adam Shimali
787fa457b5 Fix missing import 2016-02-17 09:51:54 +00:00
NIcholas Staples
78fe2b463a Merge pull request #176 from alphagov/styleguide-updates
Updates to styleguide
2016-02-15 12:00:44 +00:00
Chris Hill-Scott
41f09e2934 Merge pull request #175 from alphagov/fix_cookie_2025_bug
Fix for bug of cookie expiry.
2016-02-15 11:53:20 +00:00
Chris Hill-Scott
0d86be0feb Don’t show styleguide on live environment
Its audience is people working on the product, not the end users.
2016-02-15 11:48:04 +00:00
Nicholas Staples
2d4d88f9de Fix for bug of cookie expiry. 2016-02-15 11:43:16 +00:00
Chris Hill-Scott
10a92258a4 Make page heading a link to preview
Mainly because it looks good when this page is printed and stuck on the wall.
2016-02-15 11:41:46 +00:00
Chris Hill-Scott
97304a6681 Remove ‘info’ banner type
We’re not using this banner type anywhere any more
2016-02-15 11:37:40 +00:00
Chris Hill-Scott
3ee09d03bd General updates to styleguide
More complete examples of:
- tables
- SMS messages
2016-02-15 11:37:08 +00:00
NIcholas Staples
5928c3bb2c Merge pull request #174 from alphagov/clear-cookie-on-sign-out
Use session.clear()  sign-out.
2016-02-12 16:01:31 +00:00
Rebecca Law
035d4152fd Use session.clear() sign-out.
NOTE: you can not test that the session is cleared out by checking the session cookie does not exist on the index page,
because ItsDangerousSession will create a new session when it hits the index page. The unit test confirms that the session has been cleared.
2016-02-12 15:06:54 +00:00
Rebecca Law
8d1cd930ef Merge pull request #170 from alphagov/main-is-main
Use <main> element in semantically appropriate way
2016-02-12 09:49:11 +00:00
Rebecca Law
db16e2583e Merge pull request #171 from alphagov/add-cachebusting-for-assets
Make URLs for assets cache-proof
2016-02-12 09:48:38 +00:00
Rebecca Law
8d6c61f3ad Merge pull request #172 from alphagov/upgrade_notifications_python_client
notifications-python_client upgraded to 0.2.5
2016-02-12 09:46:15 +00:00
Rebecca Law
8e85dae7fd Merge pull request #173 from alphagov/invalid_validation_code_fails
Fix error with invalid token causing an error.
2016-02-12 09:45:44 +00:00
Nicholas Staples
737e490276 Fix error with invalid token causing an error. 2016-02-11 16:23:41 +00:00
Nicholas Staples
92b0d74a25 Tests fixed. 2016-02-11 16:04:50 +00:00