Commit Graph

3527 Commits

Author SHA1 Message Date
Chris Hill-Scott
d8b265b0ca Add comments to make test data clearer
It’s not clear where 103 is coming from unless you know that the code is
doing the slightly unintuitive thing of displaying the max of all return
values.
2020-10-12 14:14:12 +01:00
Chris Hill-Scott
54d4fb2a6c Allow platform admins to clear cached broadcasts
When we add a new property to the broadcast model, we need to delete any
cached broadcasts from Redis that are missing the new property. So this
adds an option to do this to the cache page in platform admin.

I’ve also tried to make it more obvious what the magic numbers in the
test fixture are doing.
2020-10-09 15:41:48 +01:00
Chris Hill-Scott
850571cb8c Recognise that broadcast messages include content
The content attribute needs to be added to the model so we can use it
later.
2020-10-09 15:41:38 +01:00
Tom Byers
fafe58a79b Merge pull request #3664 from alphagov/fix-template-controls-for-screenreaders
Fix template controls for screenreaders
2020-10-06 14:02:27 +01:00
Chris Hill-Scott
fad63117d6 Merge pull request #3658 from alphagov/use-scheduled-job-stats
Use new API endpoint for scheduled job stats
2020-10-06 12:00:38 +01:00
Chris Hill-Scott
54a5306399 Merge pull request #3660 from alphagov/fix-incorrect-processing-started-time-jobs
Fix incorrect processing started time on jobs
2020-10-06 12:00:30 +01:00
Chris Hill-Scott
eb58851e93 Explicitly test that stats endpoint isn’t called
If we know a service has no jobs, we shouldn’t check to see if it has
scheduled jobs.
2020-10-06 11:53:00 +01:00
Chris Hill-Scott
9c5dceaf81 Ensure test data uses timezone aware timestamps
This reflects what the API sends us, and means we have to do less
timezone-wrangling.
2020-10-06 11:34:08 +01:00
Leo Hemsted
8ec9fe96a9 Delete new format template cache when moving folders 2020-10-06 09:47:22 +01:00
Leo Hemsted
6eccc66115 delete template keys properly from platform admin page 2020-10-05 16:52:48 +01:00
David McDonald
389638244c Remove old tour and help arguments from sending flow
We no longer need the `start_tour` page as this has been replaced with
the new `begin_tour` page.

We also no longer need to handle the `help` argument in the
`send_test_step` or `send_one_off_step` as these no longer are
responsible for the tour and don't need to show the help text.

Worth pointing out, the new tour joins into the send one off flow. When
doing a GET `check_tour_notification`, and submitting the form shown on
this page you are POSTed to `send_notification` with `help=3`. Also for
general sending of one off notifications, the POST to
`send_notification` is done with `help=0` which is a bit of a hack to
make sure that we don't show a back link on the `view_notification` page
for when someone gets there having just sent a one off notification.
This use of `help=0` may be a candidate for a refactor in the future as
it feels like a bit of a hacky way of doing things and is therefore not
as clear to developers what is going on.

Also removes the help argument from the csv routes used here. There is
no reason that we need to ever show help for CSVs and this is leftover
code from when we used to do the tour that way.
2020-10-05 12:44:19 +01:00
David McDonald
1b310a0f8a Merge pull request #3663 from alphagov/separate-tour
Move intro to Notify tour into separate views to reduce code complexity
2020-10-05 09:53:33 +01:00
David McDonald
7b82ca5083 Remove deleting of old redis key
At this point we are no longer setting this key, nor are we reading from
it so we are able to delete it.
2020-10-02 15:21:30 +01:00
Tom Byers
87dcea779e Make footer popup forms groups & add labelling
The existing behaviour focused the form control
for each popup (radios or textbox) when opened.

This gives no indication the submit button or
cancel link have been added to the page.

These changes:
- make the parent element a region to group all
  the new content
- label the region to link it to the button that
  opened it
- add a description to the region so users know
  how to use it and that all the controls have
  been added to the page
2020-10-02 15:08:09 +01:00
David McDonald
c1f67514a2 404 for step-0 2020-10-02 14:44:17 +01:00
David McDonald
0e32df4514 Merge pull request #3639 from alphagov/use-new-redis-key
Step 2 of renaming cache keys for templates
2020-10-02 13:58:00 +01:00
David McDonald
1f900e74a9 Fix error case where the tour start page is skipped
This was causing us to key error for 'placeholders' being missing in the
session dictionary. This fixes it and sends you back to the start
2020-10-02 12:46:02 +01:00
David McDonald
ec0af6b151 Redirect user to new tour after creating a service
We leave the existing tour routes available for the moment so we don't
break the flow for anyone whilst this deploys
2020-10-02 12:46:02 +01:00
David McDonald
f0a8c97eeb Add check tour notification page
On submit of form on this page, will continue to normal sending flow
which can be shared code as there is no longer previous context needed
of where they have come from
2020-10-02 12:46:02 +01:00
David McDonald
9347c9a979 Redirect to the new check tour notification page
After the steps have been completed, redirect them to the new check tour
notification page to review their message
2020-10-02 12:46:02 +01:00
David McDonald
c2a691e6d9 Add view for filling in steps of the tour
Note, we choose to start our urls at step-1 rather than step-0 as this
is consistent when you would enter the first placeholder (excluding the
recipient) for the one off tour.

Also note, we expect a service to allow international sms by default
when it is first created but we keep the check for if the service does
just in case they visit this tour later on.
2020-10-02 12:46:02 +01:00
David McDonald
2ba7224a42 Add view for new tour start page
This will replace the current tour start page
2020-10-02 12:46:02 +01:00
Tom Byers
5819b5da2d Change context for cancel link
Every other control refers to the group name so
the cancel link should too.
2020-10-01 13:30:44 +01:00
Tom Byers
099b42b31e Make all control buttons aria-expanded=false
Suggested by the Digital Accessibility Centre in
their report. Giving these buttons
aria-expanded=false indicates:
- they control a section on the page
- that section is collapsed (and so clicking the
  button will open it)
2020-10-01 11:51:50 +01:00
Chris Hill-Scott
a98e3534b2 Give email preview page a sensible page title
It’s derived from the subject line of the email now as of
https://github.com/alphagov/notifications-utils/pull/793
2020-09-30 11:29:13 +01:00
Chris Hill-Scott
5c2469b24e Refactor to use shared date comparison function
This means we don’t have to repeatedly do timezone conversions or string
to datetime conversions in our business logic.
2020-09-29 13:38:00 +01:00
Chris Hill-Scott
76f83f7d2a Merge pull request #3652 from alphagov/updated-bristol-boundaries
Update local authority district GeoJSON to bring in fixes for Bristol
2020-09-29 13:32:32 +01:00
Pea M. Tyczynska
f4f2e5d13a Merge pull request #3622 from alphagov/searchbox-make-autofocus-optional
Autofocus off by default on live-search
2020-09-29 10:58:00 +01:00
Chris Hill-Scott
86ec9430a2 Fix incorrect processing started time on jobs
We were doing the UTC to BST conversion twice, meaning the job was shown
as being started 2 hours later than UTC, and 1 hour later than actual
BST.
2020-09-28 14:53:42 +01:00
Chris Hill-Scott
ef6681b69b Use new API endpoint for scheduled job stats
Depends on:
- [ ] https://github.com/alphagov/notifications-api/pull/2984
2020-09-28 14:28:23 +01:00
Leo Hemsted
65e32f8e5a Merge pull request #3650 from alphagov/broadcast-org-always-on
Broadcast org always on
2020-09-28 12:59:19 +01:00
Chris Hill-Scott
8da0aa7736 Format big numbers correctly when numbers too big
Comma should be used as the thousands separator. Code can be simplified
by using macro to pluralise.
2020-09-26 14:50:47 +01:00
Chris Hill-Scott
9afd305c6d Update test to new limit 2020-09-25 18:24:38 +01:00
Leo Hemsted
626b1c4211 enable broadcast org in all environments
This organisation is defined in the config file. It's hard coded to a
UUID as defined in the api db migration 0331_add_broadcast_org.
2020-09-25 13:42:13 +01:00
Chris Hill-Scott
04e53c72b3 Update shapes to bring in fixes for Bristol
I emailed the Geography team at the ONS:

> Hi geography team,
>
> I work on GOV.UK Notify, which is a service run by Government Digital Service (part of the Cabinet Office). I was given your email address by [redacted] who’s been helping answer some of my questions on the cross-government Slack.
>
> We’re using some of the boundary datasets from the Open Geography Portal, and mostly they’ve been excellent.
>
> In the abstract, the problem we’re trying to solve is, given a point outside an area, what is the minimum distance to a point within that area. So, for example, if a crow was somewhere in Cardiff, what’s the shortest distance it would have to fly to reach somewhere in the Bristol local authority district?
>
> We’ve noticed some problems with the data that means our calculations would be wrong. We’ve noticed this around Torquay, Norwich and Bristol. Here are some screenshots of Bristol, from the generalised and full resolution boundaries:
>
> The artefacts I’ve highlighted are closer to Cardiff than any actual part of the land area of Bristol. They are either:
> - in the sea
> - land that’s part of North Somerset
>
> I suspect that this is being caused by the process of clipping the actual region of Bristol (which, unusually, extends into the water) to the mean high water line.
>
> I’ve worked around this by filtering out any polygons that are smaller than ~7,500m². It’s a bit hacky because parts of the Scilly Isles start disappearing. That’s not a problem for what I’m working on, but it would be nice to not need the hack.
>
> So my questions would be:
>
> - Is there a better way to remove these artefacts than filtering by area?
> - Is there a plan to remove these artefacts from the data in future releases?
>
> Thanks in advance,
> Chris

They emailed back to say:

> Hi Chris
>
> Thank you for your enquiry.
>
> We  have completed the amendments to the LAD MAY 2020 BFC and BGC boundaries as mentioned so you should be able to download them from the portal now.
>
> Hope this helps.
>
> Kind regards
> [redacted]

This commit brings in the files they’ve updated. We still have to do
some filtering (but now at a higher resolution) because they haven’t
fixed Norwich yet. I’ll email them  separately about that.
2020-09-25 12:24:23 +01:00
Chris Hill-Scott
eb4a7907a4 Make estimated phone count clearer
We’ve had some feedback from user research that difference between
‘will get alert’ and ‘likely to get alert’ is not clear, and it’s hard
to tell if the latter is inclusive of the former. This leads people to
question the validity of these numbers, which is important, because an
the estimate should give you some idea of the impact of what you’re
about to do.

This commit reformats the number as a range, for example 1,000 to 2,000
phones.

If the range is small, eg 40,000,000 to 40,800,000 then this suggests
a false level of accuracy. So instead we just give one number and say
it’s an estimate, eg ‘40,000,000 phones estimated’
2020-09-24 15:53:07 +01:00
Leo Hemsted
c7ef7d5083 Merge pull request #3643 from alphagov/broadcast-org
move service to broadcast org when broadcasting is enabled
2020-09-24 13:13:34 +01:00
Tom Byers
6cf7017ff5 Add tests for changes to label 2020-09-24 13:10:55 +01:00
Chris Hill-Scott
cc456fa718 Merge pull request #3642 from alphagov/live-broadcast-tag
Show an indication that a broadcast service is live
2020-09-23 15:32:33 +01:00
Chris Hill-Scott
9becb2b817 Merge pull request #3641 from alphagov/area-suggestions
Suggest previously-used areas when adding new area
2020-09-23 15:00:21 +01:00
Chris Hill-Scott
c8f0664bf7 Show an indication that a broadcast service is live
We want it to be very clear whether you’re in live or training mode
because:
- you may be switching back and forth between them
- doing something in live mode when you think you’re in training mode
  would have… consequences

By adding a label next to the service name you’ll will have some
indication, on every page, which mode you are in.

Style of the label is based on the ‘Tag’ component from the Design
System:
https://design-system.service.gov.uk/components/tag/#showing-multiple-statuses
2020-09-23 13:05:07 +01:00
David McDonald
fe93e42197 Merge pull request #3638 from alphagov/redis-key-change
Step 1 of renaming cache keys for templates
2020-09-23 12:19:13 +01:00
Tom Byers
27f7e873f1 Merge pull request #3645 from alphagov/fix-focus-on-table
Make only the scrollable table focusable
2020-09-23 11:32:04 +01:00
Chris Hill-Scott
dcd48f99dd Merge pull request #3632 from alphagov/training-broadcast-approved
Add a tour screen once a broadcast is approved
2020-09-23 11:07:03 +01:00
Tom Byers
cf07d79024 Make difference between table frames obvious
...by naming the attributes related to
accessibility.

Also includes tests for this.
2020-09-23 10:33:58 +01:00
Tom Byers
6ab85c4c78 Merge pull request #3637 from alphagov/make-table-focusable
Make table focusable
2020-09-23 09:36:17 +01:00
Leo Hemsted
93d1137474 move service to broadcast org when broadcasting is enabled
we want to keep track of all broadcast services across govt easily. As
such, when broadcasting is enabled for a service, we've decided we're
going to add the service to a special broadcasting organisation.

This organisation is defined in the config file. It's hard coded for
production, if you want to test locally, you should set
BROADCAST_ORGANISATION_ID in your local environment.
2020-09-22 18:18:00 +01:00
Chris Hill-Scott
f50ef84c0d Suggest previously-used areas when adding new area
If you’re adding another area to your broadcast it’s likely to be close
to one of the areas you’ve already added.

But we make you start by choosing a library, then you have to find the
local authority again from the long list. This is clunky, and it
interrupts the task the user is trying to complete.

We thought about redirecting you somewhere deep into the hierarchy,
perhaps by sending you to either:
- the parent of the last area you’d chosen
- the common ancestor of all the areas you’d chosen

This approach would however mean you’d need a way to navigate back up
the hierarchy if we’d dropped you in the wrong place. And we don’t have
a pattern for that at the moment.

So instead this commit adds some ‘shortcuts’ to the chose library page,
giving you a choice of all the parents of the areas you’ve currently
selected. In most cases this will be one (unitary authority) or two
(county and district) choices, but it will scale to adding areas from
multiple different authorities.

It does mean an extra click compared to the redirect approach, but this
is still fewer, easier clicks compared to now.

This meant a couple of under-the-hood changes:
- making `BroadcastArea`s hashable so it’s possible to do
  `set([BroadcastArea(…), BroadcastArea(…), BroadcastArea(…)])`
- making `BroadcastArea`s aware of which library they live in, so we can
  link to the correct _Choose area_ page
2020-09-22 17:33:04 +01:00
Tom Byers
a75cde039f Merge pull request #3624 from alphagov/add-accessible-letter-specification
Add accessible letter specification
2020-09-22 16:36:15 +01:00
Chris Hill-Scott
2d64306e88 Link to specification page, not PDF directly 2020-09-22 15:49:38 +01:00