Commit Graph

182 Commits

Author SHA1 Message Date
Chris Hill-Scott
ab150d876d Stop letting people enter empty SMS senders
This shouldn’t be deployed until we’ve migrated the database to default
to GOVUK.
2017-05-19 22:42:17 +01:00
Chris Hill-Scott
3efae3a57f Call letter subjects ‘main heading’
This is a term that one of our research participants used to describe
the big bold text that starts each letter. I think it’s quite a nice
plain english term for it.

Also changes the formatting guidance to use the word heading instead of
title, for consistency.
2017-05-11 12:10:37 +01:00
Chris Hill-Scott
c373e3771a Make label for key type grammatically correct
Wasn’t changed when we changed the options. 

Matches the ‘Name for this key’ label on the field above.
2017-04-26 13:21:27 +01:00
Chris Hill-Scott
61470391bf Add platform admin setting for letter branding
Does two main things:
- defines what ‘brands’ we support, in terms of the ID that DVLA use
- adds a form to choose which branding a service uses (currently
  platform admin only, like email branding)

By doing this we will be able to (with some more work) preview and send
letters with a variety of different branding.

Story: https://www.pivotaltracker.com/story/show/143506905
2017-04-24 10:25:36 +01:00
Chris Hill-Scott
2f900d55c5 Explain contact details changes apply all letters
This is different to how editing most parts of a letter works, so we
should make it explicit.
2017-04-03 10:53:18 +01:00
Chris Hill-Scott
dfcfe6a91e Add multiple ‘edit’ links for letter templates
Letter templates have (or will have) multiple different editable
regions. I think that the most intuitive way for this to work is to have
- an edit link for each of these areas
- positioned next to the thing to be edited

Again, this isn’t fully hooked up, but since no-one is using letters
live yet this is a good way of getting research feedback and pointing
towards where we want the feature to go.

Uses percentages for the positioning so that the alignment is maintained
on mobile.
2017-03-20 11:45:27 +00:00
Chris Hill-Scott
f3c7a167df Add find-as-you-type on the choose template page
Not everyone knows how to use `ctrl` + `f`, and it’s not scoped to
just the list of templates.

The template you want to work with is often not the first one in the
list, but ordering by created at is useful for other reasons (mainly
around first time use).

This commit adds a find as you type control which aims to give users a
quick way of getting to the template they want to work with.
2017-03-20 11:40:19 +00:00
Chris Hill-Scott
f54689a2b7 Merge pull request #1168 from alphagov/contact-letter-block
add letter_contact_block edit fields
2017-03-06 11:11:54 +00:00
Chris Hill-Scott
3dabd39c41 Add better error if user goes over line limit
Don’t make people count the number of lines themselves.
2017-03-03 16:30:18 +00:00
Leo Hemsted
5c3588445e add letter_contact_block edit fields
no actual template functionality yet - just the ability for services
that have letters enabled to edit a 10 line block that will go on the
top right hand side of their letters with contact information
2017-03-03 16:18:59 +00:00
Chris Hill-Scott
43a922638b Merge email, text message + letter templates pages
Right now we have separate pages for email and text message templates.
In the future we will also have a separate page for letter templates.

This commit changes Notify to only have one page for all templates.

What is the problem?
---

The left-hand navigation is getting quite crowded, at 8 items for a
service that can send letters. Research suggests that the number of
objects an average human can hold in working memory is 7 ± 2 [1]. So
we’re at the limit of how many items the navigation should have.

In the future we will need to search/sort/filter templates by attributes
other than type, for example:
- show me the ‘confirmation’ templates
- show me the most recently used templates
- show me all templates containing the placeholder `((ref_no))`

These are hypothetical for now, but these needs (or others) may become
real in the future. At this point pre-filtering the list of templates
by type would restrict what searches a user could do. So by making this
change now we’re in a better position to iterate the design in the
future.

What’s the change?
---

This commit replaces the ‘Email templates’, ‘Text message templates’ and
‘Letter templates’ pages with one page called ‘Templates’.

This new templates page shows all the templates for the service, sorted
by most recently created first (as before).

To add a new template there is a new page with a form asking you what
kind of template you want to create. This is necessary because in the
past we knew what kind of template you wanted to create based on the
kind you were looking at.

What’s the impact of this change on new users?
---

This change alters the onboarding process slightly. We still want to
take people through the empty templates page from the call-to-action on
the dashboard because it helps them understand that to send a message
using Notify you need a template. But because we don’t have separate
pages for emails/text messages we will have to send users through the
extra step of choosing what kind of template to create. This is a bit
clunkier on first use but:

- it still gets the point across
- it takes them through the actual flow they will be using to create new
  templates in the future (ie they’re learning how to use Notify, not
  just being taken through a special onboarding route)

I’m not too worried about this change in terms of the experience for new
users. Furthermore, by making it now we get to validate whether it’s
causing any problems in the lab research booked for next week.

What’s the impact of this change on current services?
---

Looking at the top 15 services by number of templates[2], most are using
either text messages or emails. So this change would not have a
significant impact on these services because the page will not get any
longer. In other words we wouldn’t be making it worse for them.

Those services who do use both are not using as many templates. The
worst-case scenario is SSCS, who have 16 templates, evenly split between
email and text messages. So they would go from having 8 templates per
page to 16, which is still less than half the number that HMPO or
Digital Marketplace are managing.

References
---

1. https://en.wikipedia.org/wiki/The_Magical_Number_Seven,_Plus_or_Minus_Two

2. Template usage by service

Service name                           | Template count | Template types
---------------------------------------|----------------|---------------
Her Majesty's Passport Office          |             40 | sms
Digital Marketplace                    |             40 | email
GovWifi-Staging                        |             19 | sms
GovWifi                                |             18 | sms
Digital Apprenticeship Service         |             16 | email
SSCS                                   |             16 | both
Crown Commercial Service MI Collection |             15 | email
Help with Prison Visits                |             12 | both
Digital Future                         |             12 | email
Export Licensing Service               |             11 | email
Civil Money Claims                     |              9 | both
DVLA Drivers Medical Service           |              9 | sms
GOV.UK Notify                          |              8 | both
Manage your benefit overpayments       |              8 | both
Tax Renewals                           |              8 | both
2017-03-01 15:17:06 +00:00
Chris Hill-Scott
e909bce928 Make long SMS sender name error accurate
`<=11` not `< 11`
2017-02-27 15:56:58 +00:00
Chris Hill-Scott
d18334100e Remove HTML entity from permission choice
Not sure why we had a non-breaking space in here because it didn’t wrap
onto two lines anyway. And it wasn’t working because it was showing up
encoded, rather than as a raw entity.
2017-02-23 10:50:28 +00:00
Leo Hemsted
9046ec3bbc ensure emails still accept emoji 2017-02-17 10:39:52 +00:00
Leo Hemsted
41fa158635 error when users put non-GSM chars in a sms template
additionally, this moves the formatted_list jinja macro into a python
function, so that it can be called from the form validator
2017-02-17 10:39:52 +00:00
Rebecca Law
cf3a933b1e Updated error message is the code is not the right size or data type.
Updated two_factor to error is the user account is locked (locked = over 10 failed_login_count)
2017-02-15 14:56:22 +00:00
Chris Hill-Scott
d2680fe885 Require email address for reporting problems
If you report a problem we want to be able to get back to you to find
out more information, or to update you on the status of a fix. So it
shouldn’t be possible to report a problem without providing an email
address.

This commit makes `email_address` a required field when `ticket_type` is
problem.

This requires a bit of fiddling with the tests which weren’t expecting
to have to provide an email address. So the tests now either:
- pass an email address
- check for an error when they don’t pass an email address
2017-02-02 15:18:41 +00:00
Chris Hill-Scott
438868257f Triage tickets based on time of day and services
TL;DR, as much as possible we should work out how to prioritise tickets
and not put that burden on the user. However, there are some cases where
we can’t.

In business hours all tickets are high priority, ie we will at least
acknowledge them within 30 mins.

If we are not in business hours then we need to know if a ticket is
serious enough to get someone out of bed. Only the user can tell us
this, but we can give them some examples to help them decide.

In addition, out-of-hours tickets are only a priority if the user has
live services. Normally we can determine this and do the
priority-setting in the background.

If they can’t log in then we can’t determine what services they have. So
in this case they will need to use the emergency email address, which
only users with live services will have.

The logic for this gets fairly complex. It might be to easier to
understand what’s going on by walking through the test cases, which are
a bit more declarative.

N.B. Deskpro’s ‘urgency’ is descending, eg 10 is the most urgent and 1
is the least.
2017-02-02 15:18:40 +00:00
Chris Hill-Scott
a43112db88 Rename form class
It’s not just feedback now. Support is what we’re calling the whole
feature.
2017-02-02 15:18:40 +00:00
Chris Hill-Scott
1df3c11ae9 Split support into two pages
The kind of communications we’re getting at the moment can broadly be
broken down into:
- problems
- questions and feedback

We will need to triage problems differently, because they could
potentially be urgent/severe/emergency/P1/whatever language we use.
Questions or feedback will never be P1.

Two reasons for making the user categorise their tickets themselves:

- Outside of hours we can’t get someone out of bed in order to decide if
  a ticket is a problem or just feedback

- We can tailor the subsequent pages to whether it’s a problem or
  feedback (eg showing a link to the status page if the user is having
  a problem)

This commit let’s users make the choice with a pair of radio buttons.

It also cleans up a bunch of the tests and parameterizes them so we’re
testing the flow for both ticket types.
2017-02-02 15:18:40 +00:00
Rebecca Law
d0c762325d remove comment 2017-01-19 09:50:27 +00:00
Rebecca Law
b372ab7ba1 Change the selectField on the edit template form to a radio field.
It's more stylish
2017-01-19 09:35:34 +00:00
Rebecca Law
babafd8dc9 Change the drop down to read Use priority queue? yes|no 2017-01-18 16:03:30 +00:00
Rebecca Law
3dfb3806d2 Add a selectField to edit and create templates that is only visible for platform admins that makes the template a priority template.
There is a check that the template can not be created as priority if the user is not a platform admin.
There is a check that the template can not change the `priority` unless they are a platform admin.
2017-01-18 15:11:34 +00:00
Chris Hill-Scott
559433c5d2 Add remaining endpoints for PDFs and PNGs
Right now we can show what a letter template looks like as a PDF or PNG.

This commit completes the work so this is also possible when:

- showing a template with the placeholders replaced
- showing any version of a template

Also removes dependency on `Exception().message`, which was deprecated
in Python 2.6. See
97f82d565f
for full details.
2017-01-04 15:45:59 +00:00
Rebecca Law
21582cadb3 Get the BooleanField working in the form. 2017-01-03 16:14:25 +00:00
Rebecca Law
2e69d3c680 Add date filter for platform admin page. 2017-01-03 10:45:06 +00:00
Rebecca Law
5572d0f25f This commit renders the platform admin page with the given start and end date query params.
Need to add a form to the page to take these params.
2016-12-28 15:23:19 +00:00
Rebecca Law
df41da4860 [WIP] Attempt at adding a form to the platform admin page is not working well for me here. But I want to commit it so I can look at it again. 2016-12-28 14:44:53 +00:00
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