Commit Graph

255 Commits

Author SHA1 Message Date
Chris Hill-Scott
3d45f5b9c3 Add tooltip to ‘Templates’ in breadcrumb
Because sometimes we show it truncated to ‘T…’
2019-02-07 11:05:47 +00:00
Chris Hill-Scott
88ad982bf7 Improve display of folder path when deeply nested
It’s a bit rudimentary to only show the current place in the hierarchy
and the parent. You lose a sense of how deep you are.

But we can’t just show the full path, because it can be arbitrarily
long. So what this commit does is show the full path, but truncates the
display of any items. Further-up than the current folder or its parent.

This also helps disambiguate between folders and templates, because
folders are always shown with the folder icon.

This probably won’t affect many teams, because we don’t anticipate a lot
of deep nesting.
2019-02-01 10:28:29 +00:00
Tom Byers
c66caaf047 Add stop point for stick-to-bottom folder controls 2019-01-23 16:55:18 +00:00
Chris Hill-Scott
72c60ea9a4 Merge pull request #2658 from alphagov/sticky-footer-edit
Use sticky footer on edit template page
2019-01-16 11:26:53 +00:00
Chris Hill-Scott
feabcbc7bf Fix display of perm. failure on notifications page
It had too much whitespace because it was accidentally being given the
wrong class.

This commit undoes the change that caused it (which was while working on
letters) and beefs up our tests for email and text messages (so if this
happened again the tests would catch it).
2019-01-15 13:51:32 +00:00
Chris Hill-Scott
0df88f923c Refactor sticky button into component 2019-01-14 15:05:08 +00:00
Chris Hill-Scott
5c4ff09d48 Treat permanent failure for letters the same as cancelled 2019-01-14 10:16:01 +00:00
Chris Hill-Scott
989875294b Make technical failure letters show up on the activity page 2019-01-11 16:55:37 +00:00
Pea Tyczynska
dcc590ec96 Cancelled notifications do not show as failures on dashboard stats
Also update tests after we no longer show cancelled letters
2019-01-10 15:27:04 +00:00
Katie Smith
bb7e9726d3 Stop showing validation-failed letters as cancelled in table
Changed the table for displaying all notifications to show letters which
have the status of 'validation-failed' as 'Validation failed' instead of
'Cancelled'.

The individual notification page for a letter which has failed
validation has not been changed since this already has a description
(letter has content outside the printable area).
2019-01-09 13:10:36 +00:00
Chris Hill-Scott
206a7806d4 Allow users to navigate folders when copying
We already have a pattern for navigation folders and searching for
templates – let’s use it for the copy page too. And I reckon we can
represent services as folders if the user has multiple services they
could copy a template from.
2019-01-08 12:21:32 +00:00
Chris Hill-Scott
4aa4970fc9 Add grey lines to visually show level of nesting
Uses some CSS to draw some grey lines to show which radios descend from
which.

I don’t feel like the intentation is enough, and it looks a bit messy
because the circles of the radio buttons don’t have straight edges
easily suggest visual alignment.

Copies the design from conditionally revealing content in the design
system:
https://design-system.service.gov.uk/components/radios/#conditionally-revealing-content

Implementation is done with pseudo elements, because borders can’t be
positionned exactly enough.
2019-01-04 15:15:59 +00:00
Tom Byers
33800c5f27 Add styles for nested lists of radios
Assumes lists that are descendants of a radio
control should be indented at the same amount as
their label text.
2019-01-04 11:59:25 +00:00
Katie Smith
3cf36c592f Change move folder form to not have default radio btn and to show hint
Updated the move folder form to add a hint for the radio button for the
current folder saying 'current folder'. This hint does not get shown if
you are viewing all folders (so you are not inside a folder).

Also stopped a default radio button from being selected on the form.
2019-01-03 16:51:47 +00:00
Tom Byers
3c4a186a25 Display the template folders nested on the move template/folder form
Before, all the folders were displayed in a list which was ordered but
not nested. This changes the move form to nest the template folders.
2019-01-03 16:51:47 +00:00
Chris Hill-Scott
ee1c8ccf53 Don’t put folder icon on templates ‘folder’
After showing this to a few people the consensus seems to be that
‘Templates’ isn’t itself a folder. Therefore it shouldn’t have a folder
icon.

This has the advantage of disambiguating between being in a folder:
> [screenshot]

…and being in a subfolder:
> [screenshot]
2018-12-07 11:12:32 +00:00
Chris Hill-Scott
d81af78977 Merge pull request #2559 from alphagov/template-js
Template folder form smart JS
2018-12-05 16:36:12 +00:00
Katie Smith
429a23934d Display cancelled letters show as failed
In the long term, we don't want to show cancelled letters. But for now,
this changes cancelled letters to display in the same way that letters
with a status of permanent-failure, since we are currently giving
letters that we want to cancel the status of permanent failure.
2018-12-05 11:03:59 +00:00
Leo Hemsted
17cc262ea3 preserve previous state on form error
the html now contains a `data-prev-state` attribute which contains the
previous state, taken from the `operation` value in the form data (from
the submit button). This is used to seed the `currentState` of the
templateFolderForm. If not specified (or 'unknown', because the user
hit enter last time round), then set it to nothingSelectedButtons.
2018-12-04 16:41:47 +00:00
Chris Hill-Scott
82d8207612 Refactor template list logic into one place
The Jinja template for the ‘choose templates’ page is now pulling in
data from a lot of diparate places in order to work out what to show. As
we add more logic about what to show (in order to make the live search
work) it’s going to get harder to have all this logic in the Jinja
template.

This commit refactors it back into Python where we have more language
features for managing complex logic.

It’s a bit weird to call this file a model, in that it’s dealing with
some presentational logic, rather than just data. Conceptually it’s more
like a view model[1].

1. https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel
2018-11-23 14:00:40 +00:00
Chris Hill-Scott
d3e7557058 Link current level in hierarchy from manage folder
Because that’s the page you come directly back from.
2018-11-19 11:28:36 +00:00
Chris Hill-Scott
d49622c5dc Style folder hierarchy in headings
This makes the display of folders in the `<h1>` look like the prototype.

It alters the behaviour we’ve initially built here by only ever showing
a maximum of two levels of hierarchy (the current folders and its
parent).
2018-11-19 10:50:03 +00:00
Pea Tyczynska
a43e6a8885 Make deletion confirmation banner messages consistent across our app
Also introduce a way to provide context to a banner / flash message
that will be displayed in plain font style.
2018-11-16 11:05:52 +00:00
Chris Hill-Scott
6c4b6774aa Label folders to show what’s in them
It feels like a solid reckon that knowing what’s in a folder before you
click on it will help you navigate around.

However, what do you show in a folder if you’re filtering by template
type? We think that:
- if you’re not filtering you should see all folders, even empty ones
- if you’re filtering you should only see folders that will get you to
  relevant templates

This matches what happens when you filter templates, we don’t ‘grey out’
the non-email templates, we hide them completely.

The logic then extends to how we describe the contents of a folder, ie
we won’t count its subfolders if they don’t contain templates of the
type we’re looking for. This means that however you see the folder
described (eg ‘3 templates, 1 folder’) will match what you see when you
click into it.
2018-11-13 11:10:21 +00:00
Chris Hill-Scott
cdb5b47c4d Post to the API when moving folders and templates
This commit adds logic to:
- take the list of selected folders and templates
- split it into two lists (of folders and templates)
- `POST` that data to the API, to effect the movement of said folders
  and templates

I’ve tried to architect it in such a way that we can easily add more
template ‘operations’ in the future, as we add more forms to the choose
template page.
2018-11-12 08:37:46 +00:00
Chris Hill-Scott
2743216519 Show form elements for templates and folders
This commit adds:
- checkboxes to let you select a template or folder
- radio buttons to let you select where to move those template(s) and/or
  folder(s) to

It only does the `get` part of this work; handling the `post` and
calling API will be done in a subsequent commit.
2018-11-12 08:37:46 +00:00
Katie Smith
3431996860 Add required argument to function 2018-10-30 07:56:27 +00:00
Chris Hill-Scott
f1a9761ea1 Show letters that fail validation as cancelled
At the moment we show precompiled letters that have failed the
validation as having been sent. This is confusing.

We should communicate it as having been cancelled (rather than failed),
with the implication being that Notify has come along and cancelled the
letter before printing it. I think this is conceptually what makes the
most sense.

From the user’s point of view any letters that show up as cancelled
probably need to be fixed and resent, so it makes sense to group them
with the same name.
2018-10-29 12:13:33 +00:00
Chris Hill-Scott
bbb4b87cac Show count of cancelled letters on dashboard 2018-10-29 11:51:43 +00:00
Chris Hill-Scott
c01d761a3c Show if a letter has been cancelled
At the moment we are manually cancelling letters for people when they
ask us to. Once’s we’ve done this there is no indication that it’s
happened except for the date going red on the list of letters.

This commit adds some error messaging and styling to show when a letter
is cancelled.

Letting people cancel their own letters will be a future enhancement.
2018-10-29 11:51:41 +00:00
Chris Hill-Scott
6b6a19eb2d Merge pull request #2369 from alphagov/align-pending
Format ‘pending’ messages the same as ‘sending’
2018-10-11 11:21:56 +01:00
Chris Hill-Scott
0d0d95a75a Format ‘pending’ messages the same as ‘sending’
For reasons I don’t understand some of our text messages get marked as `pending`. Since we don’t account for this in the front end they don’t get displayed quite right (the vertical position of the text is too high). This commit adds the pending `state` to the `if` statement so the text is properly aligned.
2018-10-11 11:08:32 +01:00
Pea Tyczynska
3be129241f Add letter validation preview functionality
- add get/post view
- create a pdf upload form
- add a template where user can upload the file
- check boundaries of the letter by calling template-preview
- display banner messages with boundaries validation result
- display pages of the document, with visible boundaries overlay
if the document did not pass validation, and without overlay
if they do pass validation
2018-10-05 15:46:44 +01:00
Chris Hill-Scott
351a3dc4f3 Merge pull request #2314 from alphagov/validate-rtgl
Don’t trigger HTML5 validation on any form
2018-10-01 14:18:16 +01:00
Chris Hill-Scott
c2ef522986 Make task list read better for screen readers
This duplicates how the task list pattern is coded in the GOV.UK
Prototype kit[1]. It adds ARIA attributes and the use of a
semantically-meaningful element (`<strong>`) to give more information to
screen reader users.

1. https://govuk-prototype-kit.herokuapp.com/docs/templates/task-list
2018-09-25 10:31:40 +01:00
Chris Hill-Scott
d9da219b7e Use a macro for form tags
This will stop us repeatedly forgetting to add `novalidate` and
`autocomplete='off'` to our forms (which is how most of them are set
up).

It uses sensible defaults, based on how we most-commonly configure
forms:
- most of our forms are `post`ed (but this can be overridden)
- `autocomplete` should only be enabled where it makes sense, otherwise
  it’s more annoying than useful (but this can be overriden)
- we should never be using HTML5 form validation because our own error
  styles and messages are better
2018-09-19 12:43:15 +01:00
Chris Hill-Scott
7010c0fbd5 Remove annoyances from email branding forms 2018-09-06 15:50:54 +01:00
Chris Hill-Scott
86ad77e545 Add question about research consent
Since GDPR came into effect it’s less clear about whether we can
contact teams for user research purposes.

If we make people opt-in (or not) we know we’re safe to contact them (or
not).

Since we mostly care about how services are using Notify for real (ie
live services) or services that are considering adopting it (ie those
who have contacted us with a question) it feels like the go-live process
is the most appropriate place to collect this consent.
2018-08-30 15:31:46 +01:00
Chris Hill-Scott
fbd2102832 Use task list pattern for request to go live
We’ve found a significant property of users (about 25%) who request to
go live aren’t completing all the items on the checklist.

In 1 of 6 (17%) of the usability testing sessions we did on this process
we saw someone skip straight past the checklist page because of big
green button syndrome. While 1 in 6 people would normally be a small
number[1] in the context of a usability testing session, it’s enough to
cause a big workload for our team (assuming it is the sole cause of
people not completing the items on the checklist).

The initial reason for using the tick cross pattern for the checklist
was:
- it was coherent with the rest of Notify
- the task list pattern didn’t have a way of showing that something
  still needed doing – it put more visual emphasis on the things
  the user had already done

There’s been some interesting discussion on the GOV.UK Design System
backlog about users failing to complete items in the task list. A few
people have tried different patterns for communicating that items in the
task list still need ‘completing’.

So this commit:
- adds a task list pattern
- uses the task list pattern for the request to go live checklist

The task list is adapted from the one in the design system in that:
- the ‘completed’ label has a black, not blue background (because Notify
  often uses blocks of blue to indicate something that’s clickable)
- it adds an explicit ‘not complete’ label which is visually not
  filled in (sort of how ticked/unticket radio buttons work)

1. With the caveat that looking only at task completion, or quantifying
   qualitative not good practices and the intention here is to show that
   the numbers are close enough to say that they could be symptomatic of
   the same problem. Leisa Reichelt’s Mind the Product talk is good on
   this https://vimeo.com/284015765
2018-08-29 11:29:43 +01:00
Tom Byers
47798b218c Make live-search into a component 2018-08-22 17:42:04 +01:00
Chris Hill-Scott
6501105768 Refactor to not repeat lots of Jinja code 2018-08-22 16:31:05 +01:00
Chris Hill-Scott
b73e42650d Refactor hex colour preview Javascript
This commit improves the code that previews a hex colour when setting up
or changing an email branding.

Specifically it:
- refactors the Javascript to conform to our patterns (module pattern,
  preprocessed with Gulp)
- makes the code work when there are multiple colour previews on one
  page

It also does some visual prettifying, because I couldn’t help myself…
2018-08-22 16:31:05 +01:00
Tom Byers
f6642aa6e3 Remove branding_radios macro
No longer used by any template so remove.

(It'll still be in the history if we need it.)
2018-08-14 14:18:16 +01:00
Katie Smith
979fd9bbe4 Allow service contact details to be phone number, email or url
Service contact details are needed if the upload document permission is
enabled - this used to be a link but services can now choose to use a
link, email address or phone number. The form to add or change service
contact details now gives these options and validates the data according
to the type of contact details provided.

When validating phone numbers we can't use the existing validation
because we want to allow landlines too, so there is a basic check that
the phone number is the right length and doesn't include certain
characters.
2018-08-13 10:33:39 +01:00
Chris Hill-Scott
3bd62c2aef Offer link to upload
‘Upload recipients’ and ‘Send to one recipient’ have always been
slightly clunky phrases.

Now that basic view jumps straight into the ‘Send to one recipient’
flow there’s no way for users to get to the ‘Upload recipients’ flow.

By adding a link to it from the ‘Send to one recipient’ flow it’s
possible for users of basic view to access it.

But we don’t want to introduce too much inconsistency between basic view
and admin view because users will be migrating from one to another. They
might also be talking to their manager, who wouldn’t be able to tell
them where to click if they were looking at two completely different
interfaces.

This also means that we can keep the left-hand navigation in basic view
nice and simple with the two options (‘Templates’ and ‘Sent messages’),
rather than trying to introduce something like ‘Send one message’ and
‘Send lots of messages’ later on.
2018-08-09 11:56:13 +01:00
Chris Hill-Scott
a35ce8eb89 Add Jinja macro for a row on the settings page
Often we show/hide these rows based on what permissions a service has.
This commits refactors that check into a reusable macro, rather than
having to write the same `if` statements all the time.
2018-07-10 11:44:40 +01:00
Chris Hill-Scott
883f51b823 Fix page title on sent messages 2018-07-05 11:53:42 +01:00
Chris Hill-Scott
6452676b54 Remove show/hide behaviour from permissions form
In research we found that:
- people didn’t initially realise that the permissions expanded when the
  ‘admin’ option was selected
- not having all the options visible at once makes it hard to know what
  permissions you are (and more importantly aren’t) giving to people

This commit makes it so that:
- the options within the ‘admin’ option are always visible
- a bit of Javascript logic makes it so you can pick ‘caseworker’ and
  ‘manage service’, for example (by deselecting one when you pick the
  other)
2018-07-05 11:47:31 +01:00
Chris Hill-Scott
f4d2958d58 Allow setting of caseworking on a user
This commit changes the form that the user sees when inviting or editing
another user, if the service has the ‘caseworking’ permission set.

This will allow creating a new type of user, one who only has the
`send_messages` permission, without the `view_activity` permission.

We are doing this because we think there are a number of services with a
lot of users who don’t need to see the dashboard, or the other team
members, and that we can make a simpler interface for these users.
2018-07-05 11:47:30 +01:00
Chris Hill-Scott
d952b5ca3c Refactor radios for reuse
This commit splits up the radio buttons macro into a couple of different
macros which can be used independently of each other.

This makes this code easier to reuse when implementing custom radio
controls.
2018-07-05 11:47:30 +01:00