Commit Graph

153 Commits

Author SHA1 Message Date
Chris Hill-Scott
88631a680c Sprinkle letter throughout the app
Let users create/edit/delete letter templates.

Let them upload a CSV file or send a test against a letter template.

Big assumption at the moment is that addresses only have one line, and
therefore one column in the CSV file.
2016-11-14 14:51:26 +00:00
Chris Hill-Scott
dae10429e6 Use radio button desc. pattern on go live page
Nicer than using en dashes.
2016-11-04 14:05:31 +00:00
Chris Hill-Scott
6a07b8bac2 Merge pull request #1006 from alphagov/request-to-go-live-improvements
Make certain questions on request to go live radio buttons
2016-11-04 14:05:54 +01:00
Chris Hill-Scott
82064ca4d0 Make MOU a multiple choice question not a banner
If we want someone to read something (ie that they need to have the MOU
signed), then the best way is to make them interact with it.

And if someone doesn’t have the MOU in place, then we need to know to
send them a copy. The best way of them telling us this is in this form,
rather than sending them to the generic contact form and have them
compose a message saying ‘please send me the MOU thanks’, which we
haven’t seen anyone actually do.
2016-11-01 12:23:49 +00:00
Chris Hill-Scott
84c2fcddff Add hint text for volumes questions
We’ve had some non-helpful answers to these questions, eg ‘3’.

This commit adds examples of the kind of response we’re looking for, to
help users write good answers.
2016-11-01 12:19:50 +00:00
Chris Hill-Scott
270e3c17dd Reword questions to make sense with radio buttons 2016-11-01 11:39:57 +00:00
Chris Hill-Scott
d832a9107c Use radio buttons not textboxes for multi-choice
No need to make people type when they can click, and gives us consistent
data.
2016-11-01 11:39:22 +00:00
Chris Hill-Scott
8a01e6af36 Make it say later today
Categories before:

> Now, today, tomorrow, Friday…

Categories after:

> Now, later today, tomorrow Friday…

This reduces the ambiguity of ‘now’ vs ‘today’, and keeping the word
‘later’ suggests what this features is about.

This implementation here is a bit hacky, but it works…
2016-10-31 09:14:05 +00:00
Chris Hill-Scott
a78d9d5048 Group choices for scheduling a job by day
The options for scheduling a job by time should be grouped by day,
because a long list of 96 options is not very usable.

On the server side, this commit generates label for the next 4 days in
a friendly format (ie today/tomorrow/Sunday/Monday)

The Javascript component for choosing a time was built in a kind of
old-school jQuery way, where it manipulated the elements on the page.
The complexity of introducing groups of options was just too much for
this pattern, because it involves storing a lot of state in the DOM.

This commit completely rewrites the JS to:

- read the initial options and groups from the HTML and store them
  in the object
- use Hogan to completely re-render the UI from a series of Mustache
  templates, each of which represents a state of the UI and takes the
  inital options and groups
- filter the choices to show when the today/tomorrow/… buttons are
  clicked
2016-10-31 09:14:05 +00:00
Chris Hill-Scott
324e1f9ef4 Allow a job to be scheduled any time in next 96hrs
If you want to send a job on Monday morning, you should be able to
schedule it on Friday. You shouldn’t need to work on the weekend.

96 hours is a full 4 days, so you can schedule a job at any time on
Friday for any time on Monday.

We’ve checked with the information assurance people, and they’re OK
with us holding the data for this extra amount of time.

This commit changes the choose time form from showing one radio button
for each of the next 24 hours to one for each of the next 96 hours. It
changes the labels from ‘9am’ to ‘Monday at 9am’ so it’s clear which
day you’re choosing.
2016-10-31 09:14:04 +00:00
Imdad Ahad
5ecdbb8596 Refactor to use a cleaner and lean regex 2016-10-28 10:45:05 +01:00
Imdad Ahad
1fb0e22570 Update forgotten password to allow non-gov with test 2016-10-26 14:01:01 +01:00
Imdad Ahad
1b046ab94d Update invite user form to allow non-whitelist users through 2016-10-25 18:08:20 +01:00
Imdad Ahad
a707bd546c Updates:
* Fix tests
* Add tests for new message format
2016-10-24 16:10:41 +01:00
Pete Herlihy
ae48bdef98 Made the request to go live fields mandatory 2016-10-24 15:46:22 +01:00
Imdad Ahad
0bde2d238f Fix casing and multi-line stuff 2016-10-24 13:38:55 +01:00
Pete Herlihy
7c74864dfe Added request to go live form elements 2016-10-24 12:45:45 +01:00
Rebecca Law
789ba58c2e Removed unused form.
And used session.pop to remove NEW_EMAIL from the session.
Also removed variable not being used in user_profile.
2016-10-14 14:46:31 +01:00
Chris Hill-Scott
3e42042156 Add a page to manage a service’s whitelist
Services who are in alpha or building prototypes need a way of sending
to any email address or phone number without having to sign the MOU.

This commit adds a page where they can whitelist up to 5 email addresses
and 5 phone numbers.

It uses the ‘list entry’ UI pattern from the Digital Marketplace
frontend toolkit [1] [2] [3].

I had to do some modification:
- of the Javascript, to make it work with the GOV.UK Module pattern
- of the template to make it work with WTForms
- of the content security policy, because the list entry pattern uses
  Hogan[1], which needs to use `eval()` (this should be fine if we’re
  only allowing it for scripts that we serve)
- of our SASS lint config, to allow browser-targeting mixins to come
  after normal rules (so that they can override them)

This commit also adds a new form class to validate and populate the two
whitelists. The validation is fairly rudimentary at the moment, and
doesn’t highlight which item in the list has the error, but it’s
probably good enough.

The list can only be updated all-at-once, this is how it’s possible to
remove items from the list without having to make multiple `POST`
requests.

1. 434ad30791/toolkit/templates/forms/list-entry.html
2. 434ad30791/toolkit/scss/forms/_list-entry.scss
3. 434ad30791/toolkit/javascripts/list-entry.js
4. http://twitter.github.io/hogan.js/
2016-09-29 09:27:38 +01:00
Chris Hill-Scott
68a6ceec78 Give better error message for blacklisted password
Telling the user what to do, rather than the mistake they’ve made is
usually better.
2016-09-27 11:51:12 +01:00
Chris Hill-Scott
0c704c246d Reduce minimum password length to 8 characters
We see over and over in research that people are tripped up by the 10
character requirement because it’s longer than they are used to. Most
sites require 6 or 8 characters for a password.

It goes against the CESG advice which is to not try increasing password
strength by increasing the burden on the user:

> Traditionally, organisations impose rules on the length and complexity
> of passwords. However, people then tend to use predictable strategies
> to generate passwords, so the security benefit is marginal while the
> user burden is high.

https://www.cesg.gov.uk/guidance/password-guidance-simplifying-your-approach

Instead we should be relying on:

- [x] two factor authentication
- [x] blacklisting common passwords
- [ ] locking out users after a number of failed logins (not sure this
  is working)
2016-09-26 09:29:50 +01:00
Chris Hill-Scott
225a61ddd3 Add a component for picking the time to send a job
Users need to pick a time in the next 24hrs, or send a file immediately.

Rationale for this is a bit lost in time-before-holiday, but generally:

‘Now’ and ‘later’ as the inital choices makes it really clear what
this feature is about conceptually.

The choice of times is absolute, eg ‘1pm’ not ‘in 3 hours’
2016-08-31 16:58:09 +01:00
Chris Hill-Scott
c5c693ef0b Add some explaining to the SMS sender page 2016-08-24 15:26:03 +01:00
Chris Hill-Scott
709882065f Add some explaining to the email reply to page 2016-08-24 15:26:03 +01:00
Chris Hill-Scott
1e254415d2 Text message not Sms 2016-08-22 13:30:03 +01:00
Chris Hill-Scott
6b5e64479a Add a page to set organisation and branding option
Platform admin only.

Adds radio buttons to choose one of:
- three hard-coded branding options
- organisations from a list provided by the API
2016-08-12 10:31:43 +01:00
Chris Hill-Scott
e82cb21ecc Talk about trial mode on API keys page
When you make a ‘normal’ API key it won’t work as described until your
serivce is live.

We should make this clear at the point at which you choose this key.
2016-08-10 17:04:22 +01:00
Leo Hemsted
630b5df552 Save api_key.key_type from radio buttons 2016-07-06 15:10:36 +01:00
Chris Hill-Scott
7fcd56dc02 Add radio buttons for choosing the API key type
Best-guess wording for what the labels and question should be.

Adds a macro for rendering radio buttons from a WTForms field.
2016-07-06 10:12:20 +01:00
Adam Shimali
1efd8506db Can remove sms sender. 2016-07-01 16:32:21 +01:00
Adam Shimali
3bfcf0f8b3 Users can set a value that appears as the sender of a text message.
It can be up to eleven characters alpha numeric, no special characters
allowed.
2016-07-01 14:22:25 +01:00
Chris Hill-Scott
a6219ecda2 Merge pull request #711 from alphagov/template-guidance
Give users more help about what to put in their templates
2016-06-20 16:23:22 +01:00
Chris Hill-Scott
eed554ebb8 Give the textbox on edit template a better label
‘Message content’ is very much _our_ name for the thing. ‘Message’ is
more human-friendly.
2016-06-20 14:04:36 +01:00
Chris Hill-Scott
e44d9895ce Tidy up ‘change service name’ page
- Make service name repopulate in textbox
- More spacing between sections of the page
2016-06-20 13:33:29 +01:00
Adam Shimali
18a0b94d98 Admin app settings to save reply to email address for service. 2016-05-16 13:10:51 +01:00
Martyn Inglis
6699442f6b Added provider management pages in.
- see priority
- change priority
2016-05-11 09:43:55 +01:00
Chris Hill-Scott
45241d6232 Put a form on the request to go live page
This commit:
- moves things around a bit on the request to go live page
- sticks a textbox in there

So when someone click the big green button, we will get a support ticket
that looks something like:
```
From Test User <test@user.gov.uk> on behalf of Test Service
(6ce466d0-fd6a-11e5-82f5-e0accb9d11a6)

---

We’ll send about 1000 text messages in the first month, and then 10,000
text messages per month after that. Usage of our service is about 50%
higher in March, at the end of the tax year.
```
2016-04-26 14:45:50 +01:00
Nicholas Staples
da536bbd2e Feedback page working with all tests passing.
Updated to include team id.

Give Feedback -> Give feedback
2016-04-20 10:17:09 +01:00
Chris Hill-Scott
1bf4d00e19 Make subject a textarea
In order for subject lines to have their fields highlighted they have to
be textboxes. This is because the highlighting script only works with
textboxes that don’t scroll, either horizontally, vertically, or be
keying through them.
2016-04-14 14:51:58 +01:00
Nicholas Staples
3865c722fc Updated notifications_utils version and associated code. Added email subject formatting for placeholders. 2016-04-14 12:00:55 +01:00
Chris Hill-Scott
a2263f959e Merge pull request #422 from alphagov/commas-in-placeholders
Don’t allow commas in placeholders
2016-04-12 10:06:08 +01:00
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
dfd8540b54 Don’t allow commas in placeholders
> If a user tries to save a template containing something like
> ((name,date)) we should give a validation error.

This is because it causes havoc with the column headers in CSV files.

https://www.pivotaltracker.com/story/show/117043389
2016-04-08 07:46:14 +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