Commit Graph

111 Commits

Author SHA1 Message Date
Chris Hill-Scott
be49fb73b0 Change wording of form hints on register page
We’ve seen in research that people can be reticent to give their real
phone number. Telling them that it will be used for something should
help (ie we’re not just collecting it for marketing).

This also rewords the other form hints on this page to be less computery
because we haven’t looked at them in aaaages.
2016-04-08 10:55:30 +01:00
Chris Hill-Scott
953be15d84 Make form error messages consistent
We were using a bunch of different styles for form error messages,
including:
- having the name of the field in the error, or not
- can not/cannot/can’t (GDS content styleguide recommends using
  contractions)
2016-04-04 10:44:53 +01:00
Chris Hill-Scott
eaa72074db Enhance the ‘how to do placeholders’ hint
This commit makes the ‘how to do placeholders’ box part of the tour,
with the same blue background.

It also adds some Javascript enhancement so that:
- it responds to the contents of the message template
- has a ‘show me’ link which inserts ‘Dear ((name))’ into the template
  contents textbox

We’ve found that this has helped people understnad what placeholders
are, and how to do them.
2016-04-04 09:25:41 +01:00
Rebecca Law
9a2cb60f5e Update the service name validation in the ServiceNameForm and AddServiceForm to check the email_safe version
of the name against a list of all service email_from fields.
Update find_all_service_names to find_all_service_email_from, which returns the email_from of all services.
2016-03-31 15:17:05 +01:00
Rebecca Law
1871243cc8 Check the uniqueness of the service name ignoring case.
When the service name changes the email_from changes to.
Renamed find_all_service_names to find_all_service_names_lower.
2016-03-31 10:26:03 +01:00
Rebecca Law
677237ba47 Update email_from when the service name is changed.
Update unit tests
Service name is uniqueness is not based on case.
2016-03-30 17:12:00 +01:00
Chris Hill-Scott
c138a4a5e0 Set permissions with checkboxes, not yes/no inputs
The yes/no pattern didn’t work too well, because:
- it didn’t read naturally as a question and answer
- often users left them completely unclicked if they didn’t want to set
  the permission (rather than clicking no)

This commit changes both the invite and edit user pages to use
checkboxes to set permissions. If also rewords these pages to read more
naturally, and explain what the permissions mean.

This meant changing some of the view logic around invites and
persmissions, and I ended up refactoring a bunch of it because I found
it hard to understand what was going on.
2016-03-22 17:18:43 +00:00
Nicholas Staples
4f63b68b4a merge with master 2016-03-18 12:07:50 +00:00
Nicholas Staples
8a203c0155 Valid email domains added and tests passing. 2016-03-18 12:05:50 +00:00
Adam Shimali
2792bece54 Changed registration flow to first send email verification link that
when visited sends sms code for second step of account verification.

At that second step user enters just sms code sent to users mobile
number.

Also moved dao calls that simply proxied calls to client to calling
client directly.

There is still a place where a user will be a sent a code for
verification to their email namely if they update email address.
2016-03-17 15:19:51 +00:00
Adam Shimali
164bdad4f2 Change new invite registration flow to only need
sms for verification.

This may change again soon with story to split 2 factor
pages, but for now is correct.
2016-03-14 09:43:34 +00:00
Adam Shimali
54f871dfba Only actually call api to verify code if both are present in form. 2016-03-10 14:57:29 +00:00
Nicholas Staples
6ea8491b39 Service name uniqueness handled in all cases and tests passing. 2016-03-10 14:29:31 +00:00
Adam Shimali
4c323a9a99 Added error message on template for failing to choose permissions.
For error message over ride from WTF forms radio field created
custom field.
2016-03-09 17:42:47 +00:00
Adam Shimali
208c3cbcf3 Added validation to ensure user can't invite themselves.
Refactored Invited user form into permissions and invite forms
for use in invite and edit permissions.

Added template for edit permissions.
2016-03-09 13:00:52 +00:00
Chris Hill-Scott
93b4419bb2 Store phone number as the user entered it
It’s confusing to the user to have their phone number played back to them in
a format that they didn’t enter it. We’ve seen multiple times that people enter
0781… and then don’t recognise their own phone number when it’s played back as
+44781…

The API can handle phone numbers in any format as of
https://github.com/alphagov/notifications-api/pull/134

So there is no need to reformat the user’s phone number before storing it now.
2016-03-08 18:36:23 +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
Rebecca Law
4678a12d33 Revert the disabled email field on the register-invited-user page, the email address is not being submitted on the form when registering 2016-03-08 16:29:05 +00:00
NIcholas Staples
b78a321d90 Merge pull request #238 from alphagov/show-invite-email
Show invite email
2016-03-08 08:49:00 +00:00
Martyn Inglis
5429107f93 Removed remember me checkbox
- remember me functionality always applied.
2016-03-07 14:39:20 +00:00
Adam Shimali
569f61578e Invited user email is shown on regiser from intive page but is not
editable.
2016-03-07 11:55:18 +00:00
Nicholas Staples
b3249831cf Fix up front end so you can navigate to the edit page. 2016-03-03 15:43:53 +00:00
Nicholas Staples
e5e9db88fd Functionality_added, tests passing. 2016-03-03 14:32:19 +00:00
Nicholas Staples
9e710711cb Updated form and fixed existing tests. 2016-03-03 13:00:12 +00:00
Adam Shimali
6ba13a6513 [WIP] New user can now accept invite and will be made to
register. On succesful register and verfication they
will be added to service and forwarded to dashboard.

Nothing is done yet with the permissions requested in the
invite to the user.
2016-03-02 17:52:32 +00:00
Chris Hill-Scott
f129cc3db2 Reword the add service page
Without the preview service name we probably have to go back to communicating
a bit more on the add service page. This commit brings back the two bullet
points about where the service name will appear, and tries to tie it into the
nice words that Matt Sheret wrote for us.
2016-02-26 13:17:58 +00:00
Nicholas Staples
c959678c49 Remember me functionality added and tested.
Merge extra.

Fixed comment.
2016-02-24 17:32:15 +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
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
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
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
26adcc64c1 Updates to ‘send SMS’ page
Based on discussion with Pete.

Make the blue banner an ‘important’ banner (copied from Register to Vote, used
because it’s not as boxy and fits on the page better).

Remove the back button because you haven’t changed any data yet. If you need to
go back you can just press back or start again.

Make the filename stand out more.

Remove the ‘download example’ link. Will need to revist the best way of doing
this.

Make text messages consistently 2/3rd width.
2016-02-04 14:06:19 +00:00
Chris Hill-Scott
4280c21b23 Updates to send and check SMS pages
Adds a back button instead of a back link (more prominent, you’re likely to
go back on these pages if you’ve made a mistake)

Tweaks to wording
2016-02-04 10:59:18 +00:00
Chris Hill-Scott
394a9db3f7 Split ‘send SMS’ page into two pages
This commit just splits the existing page into two. It doesn’t do any
substantive changes to how the two parts of the page work.
2016-02-03 11:14:20 +00:00
Chris Hill-Scott
335cc160fa Fix wording 2016-02-02 15:59:41 +00:00
Adam Shimali
9e8c0b8d59 Moved mobile validation to utils module for use in csv upload as well.
This could be moved to shared utils code base at some point.
2016-02-01 16:57:40 +00:00
Nicholas Staples
62150e5596 Added fixes for forms to hide potential email philshing scams. 2016-01-28 16:36:36 +00:00
Nicholas Staples
ca8d78aee5 Fix for forgot my password. 2016-01-27 18:01:43 +00:00
Nicholas Staples
2d35f5f36a All tests passing and merged with master. 2016-01-27 16:30:33 +00:00
Nicholas Staples
6959d695d3 Working tests, hopefully all code changes done. 2016-01-27 12:22:32 +00:00
Nicholas Staples
96d38b8189 Added check for password on service change page, work in progress. 2016-01-22 16:34:36 +00:00
Chris Hill-Scott
cd38d54be7 Make ‘template type’ radio buttons not <select>
Because burn your select tags[1]

This commit hard codes the markup for the time being until I can work out how
to get WTForms outputting the markup I want.

1. https://www.youtube.com/watch?v=CUkMCQR4TpY
2016-01-22 14:51:00 +00:00
Chris Hill-Scott
9ee8610da0 Rename content to template content
WTForms sets the `id` of a `textarea` element to the variable name to which the
form control is assigned.

This conflicts with the page container, which is styled by targeting `#content`.
2016-01-22 14:51:00 +00:00
Rebecca Law
61893c5c7e Validation on key name is case insenstive 2016-01-21 16:52:01 +00:00
Rebecca Law
e7713a8b7f Added a validator so that the key name is unique per service. 2016-01-21 14:15:36 +00:00
Chris Hill-Scott
9784a9936c Add pages for create/view/revoke API keys
Copying what they’ve done on GOV.UK Pay, we should let users:
- generate as many keys as they want
- only see the key at time of creation
- give keys a name
- revoke any key at any time (this should be a one way operation)

And based on discussions with @minglis and @servingUpAces, the keys should be
used in conjunction with some kind of service ID, which gets encrypted with the
key. In other words the secret itself never gets sent over the wire.

This commit adds the UI (but not the underlying API integration) for doing the
above.
2016-01-20 16:22:23 +00:00
Nicholas Staples
75d7110642 Updated to send email through the client send_email. 2016-01-20 14:45:50 +00:00
Nicholas Staples
2cc9dc6995 Work in progress. 2016-01-20 11:46:39 +00:00
Nicholas Staples
cfb3f96b01 Mapped template actions to the api and mocked tests. 2016-01-19 15:54:12 +00:00