Commit Graph

25 Commits

Author SHA1 Message Date
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
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
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
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
Chris Hill-Scott
79314de817 Add page where users can say they want branding
At the moment branding is an undocumented feature. We get a bunch of
support tickets from teams asking its possible.

This commit:
- lets people know it’s possible, and what the options are
- is the first step towards making this process as self-service as
  possible

In some cases we will be able to infer a user’s organisation from there
email address, and Google image search their logo. So the experience for
them is that they press a button and government just sorts it out for
you (also known as "the dream").

In other cases we will have to get back to people asking for a copy of
their logo, or to find out about their service, but this is what we have
to do at the moment anyway.
2018-05-18 16:24:20 +01:00
Chris Hill-Scott
290424c4eb Put checkered background behind email branding
This will stop images which are white with a transparent background
being invisible in the admin app (and accidentally getting overwritten).
2018-03-19 13:11:32 +00:00
Chris Hill-Scott
4a1dad9a66 Hide form legend on choose reply page
The `<h1>` on this page says all the user needs to know. In research
we saw that users didn’t even read the legend, even when prompted to!
2017-11-20 16:53:11 +00:00
Chris Hill-Scott
d5edb8dbfb Track form validation errors in Google analytics
We started tracking upload errors in eb264f34b7

This has been useful.

This commit adds tracking of other form validation errors, so we can
pick up if there’s a form field that’s causing people particular
trouble.

Also had to rewrite a very old test to look for page content in a
smarter way.
2017-10-16 15:26:21 +01:00
Ken Tsang
005c8b53d7 Add org select and manage pages 2017-08-02 11:04:14 +01:00
Chris Hill-Scott
8d5af47620 Change class names for validation errors in html
Implements the class name changes detailed in:
https://github.com/alphagov/govuk_elements/pull/405
2017-04-10 14:54:27 +01:00
Chris Hill-Scott
a592898eff Make radio select work w/ new checkboxes/radios
The visual appearance of radio and checkbox form inputs changed in
GOV.UK Elements here:

https://github.com/alphagov/govuk_elements/pull/296

This was subsequently reimplemented with different markup and no
Javascript here:
https://github.com/alphagov/govuk_elements/pull/406

This has meant making the following changes to our app:
- changing the markup in our radio/checkbox macros to match the example
  markup given by GOV.UK Elements
- removing the previous Javascript file because it’s no longer needed to
  make the radios appear visual selected
- making the buttons on the scheduled job picker look like links,
  because the grey button style looked weird with the new radio buttons
2017-04-10 14:18:12 +01:00
Chris Hill-Scott
1f0fc9d26f Fix errant &nbsp; on request to go live page
There’s a good reason for having the `&nbsp;` – it stops GOV.UK Notify
being split across two lines (which could happen on a smaller viewport,
eg mobile). Gotta protect the brand.

Not good for the brand for it to be showing up in the page though 😬

This got broken as part of 3f41090a94

The label for a form should never have user-submitted content in it, so
using `safe` is fine.
2017-02-28 17:02:09 +00:00
Chris Hill-Scott
3f41090a94 Fix duplicate labels on form inputs
It’s invalid HTML to have multiple labels nested within each other. This
was happening by accident because WTForms tries to be clever – when you
put `{{ field.label }}` in a template it prints a `<label>` tag for you,
not just the text of the label. But we put our own `<label>` tags in the
HTML to have more control of them.

This commit stops WTForms being so clever.
2017-02-14 11:55:46 +00:00
Chris Hill-Scott
4ae28386a6 Always show live key, reword key labels
This is trying to resolve these confusions:

- that you’re in trial mode, which means you can’t have a live key yet (
  or you can but it wont work, which is what we used to have)
- what does simulate mean

The create key page is the right place to resolve these confusions
because it’s where users are actively reading.

This commit also removes the trial mode banner from API integration
page because this where users _aren’t_ actively reading. A whole bunch
of users weren’t seeing this banner at all.

The implementation of the disabled API key options is kinda clunky
because WTForms doesn’t have a native way of doing this.

¯\_(ツ)_/¯
2016-11-04 14:05:30 +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
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
Leo Hemsted
3c0f06a36d set value of radio input to be org id
also don't use nil, this isn't ruby
2016-08-15 10:39:34 +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
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