Commit Graph

10472 Commits

Author SHA1 Message Date
Chris Hill-Scott
5c22bd56ce Add a tour screen once a broadcast is approved
For a training broadcast the user doesn’t get that immediate feedback
that something has happened, like they would with a real alert, or even
sending themselves a text message.

This commit adds another tour-style page which will interrupt their
journey and hopefully reinforce the message we’ve given them earlier in
the tour.

We’re adding this because we’ve found in research that users don’t have
a good grasp of the consequences and severity of emergency alerts,
versus regular text messages.
2020-09-21 09:41:19 +01:00
Chris Hill-Scott
8806734f03 Merge pull request #3633 from alphagov/focus-area-remove
Use new focus colour for remove area button
2020-09-17 13:31:19 +01:00
karlchillmaid
60a63c69ee Merge pull request #3578 from alphagov/update-sent-status-label
Update sent status label
2020-09-17 13:16:41 +01:00
Chris Hill-Scott
23e6e30092 Use new focus colour for remove area button
It already adds a black border on focus so doesn’t need the thick lower
border.
2020-09-17 12:46:45 +01:00
Chris Hill-Scott
daaa3d69a3 Make sent international status display on 2 lines
Otherwise it wraps awkwardly
2020-09-17 12:33:46 +01:00
Chris Hill-Scott
dd8ce7d5bd Merge pull request #3631 from alphagov/delete-plot-areas
Delete plot-areas.py
2020-09-17 11:41:16 +01:00
Chris Hill-Scott
8a413bec91 Merge pull request #3617 from alphagov/population-estimates
Give estimates of the number of phones in a broadcast area
2020-09-17 11:41:00 +01:00
Chris Hill-Scott
4c7180ca75 Update tests/app/broadcast_areas/test_broadcast_area.py
Co-authored-by: David McDonald <idavidmcdonald@me.com>
2020-09-17 11:09:52 +01:00
Chris Hill-Scott
ae17ff1f07 Fix significant figure round for value of 0
You can’t do `log10(0)` in maths, so we need to handle it as a special
case.
2020-09-17 11:08:36 +01:00
Chris Hill-Scott
ba9f786971 Move round_to_significant_figures into utils 2020-09-17 11:03:14 +01:00
Chris Hill-Scott
76244d8c07 Handle areas with missing data
At the moment there are some areas which have:
- a `count_of_phones` value of `None`
- no sub-areas

This is wrong, but until we fix the data the phone counting code needs
to handle this.

This commit:
- adds the `or 0` in the right place (where it will catch these areas
  with missing data)
- adds a test which checks these areas, and compares them to other kinds
  of areas
2020-09-17 11:02:22 +01:00
Tom Byers
10280eb662 Merge pull request #3630 from alphagov/fix-copy-to-clipboard-selection
Fix copy to clipboard selection
2020-09-16 15:40:03 +01:00
Tom Byers
e6b13ab6aa Merge pull request #3628 from alphagov/update-focus-style-to-govuk-frontend-3-version
Update focus style to GOVUK Frontend 3 version
2020-09-16 14:55:30 +01:00
Chris Hill-Scott
e232950d46 Add tests for the population calculations
Now that this function is split out we can unit test it to make sure
that the expected numbers are coming out of it.
2020-09-16 14:45:54 +01:00
Chris Hill-Scott
49195cb0d3 Rename constants to populations
This is a better name for the module because it’s:
- not just constants, there’s a method in here now
- only stuff to do with populations, not other kinds of constants
2020-09-16 14:45:45 +01:00
Tom Byers
308f9980d3 Fixes for focus issues on /templates page(s)
Includes:
- fixes for the cancel button, when selecting a
  template type (after clicking 'New template')
- making the folder icon black, to match the text,
  on template list items
2020-09-16 14:43:48 +01:00
Tom Byers
b525015765 Bump styles for existing GOVUK Frontend radios
We have some radios using the GOVUK Frontend
radios component in this app. They are version
2.x.x though so this bumps their styles to version
3.x.x to get the new focus style.
2020-09-16 14:00:15 +01:00
Chris Hill-Scott
3047af2c13 Refactor to make testing easier 2020-09-16 11:33:57 +01:00
Chris Hill-Scott
b9f75218d1 Add tests to ensure all areas have a count 2020-09-16 11:20:22 +01:00
Chris Hill-Scott
6b3fe3c5c5 Delete plot-areas.py
We don’t need this now that the admin app can show areas while running locally.
2020-09-16 09:11:01 +01:00
Chris Hill-Scott
6b7908fecb Don’t use single letter variable names
Better to call the variables what they are.

Also re-orders the statement to avoid adding to a negative number.
2020-09-16 08:46:59 +01:00
Chris Hill-Scott
ce35200453 Rename variable to be clearer
Better name than `population`, and
`smartphone_ownership_for_area_by_age_range` matches with
`SMARTPHONE_OWNERSHIP_BY_AGE_RANGE`
2020-09-16 08:46:59 +01:00
Tom Byers
ebb84fcf08 Fix focus styles for user-list-edit-link 2020-09-15 17:20:58 +01:00
Tom Byers
32b2f617f1 Fix links to files in dashboard table
Includes fixes for the grey text they overlap,
when the adjacent link is focused.
2020-09-15 17:19:28 +01:00
Tom Byers
6ca5745ad5 Fix focus style for link on product page 2020-09-15 17:15:41 +01:00
Tom Byers
efc09e68ea Fix focus style for task list link 2020-09-15 17:15:41 +01:00
Tom Byers
9c55477512 Fix focus style for pill links
Includes changes for:
- pills as page navigation
- pills as separate items
- big number links
2020-09-15 17:15:41 +01:00
Tom Byers
2f5ecdb1fa Fix org navigation links focus styles 2020-09-15 17:15:41 +01:00
Tom Byers
322dab8415 Fix focus style on 'show more' links 2020-09-15 17:15:41 +01:00
Tom Byers
ec67bb2819 Fix focus styles for table links 2020-09-15 17:15:41 +01:00
Tom Byers
1a086c0631 Fix focus style on prev/next links
It has a hover colour so needs the focus colour
re-defined.

The `overflow: hidden` was clipping the black
underline of the focus style on the prev/next
links. This assumes it was only there to contain
the 2 floating links so replaces it with a
clearfix, which does the same without clipping the
underline.
2020-09-15 17:10:41 +01:00
Tom Byers
2f4fddfeff Update focus styles helper to latest version 2020-09-15 17:10:41 +01:00
Tom Byers
c1a6a38f68 Set core focus styles for links
- add new focus style to `govuk-link` class
- do the same for `govuk-link--destructive` class
2020-09-15 17:10:11 +01:00
Tom Byers
1190148168 Update form inputs to new focus style 2020-09-15 17:09:14 +01:00
Tom Byers
816ac484d9 Update footer links to new focus style
Updates based on the changes in:

https://github.com/alphagov/govuk-frontend/pull/1321
2020-09-15 17:09:14 +01:00
Tom Byers
2b6d07d358 Add new focus style to buttons
Updates based on the changes in:

https://github.com/alphagov/govuk-frontend/pull/1315
2020-09-15 17:09:14 +01:00
Tom Byers
0c9229bfad Update links, and things that look like links
Updates, and hacks, based on the changes in:

https://github.com/alphagov/govuk-frontend/pull/1309/files
2020-09-15 17:09:14 +01:00
Tom Byers
b4d985e071 Rewrite test descriptions
They originals didn't explain what the tests do.

We could test the contents of the range but that
would be testing the Range API, rather than our
use of it.

The tests test how we use that API for these
scenarios so their descriptions should say this.
2020-09-15 17:07:01 +01:00
Tom Byers
956f5d4c3e Make copy to clipboard work with prefixes
The prefix was being included in the selection
copied.
2020-09-15 17:04:03 +01:00
Leo Hemsted
c2e737b323 Merge pull request #3618 from alphagov/fix-broadcast-area-count
generate library summary in python
2020-09-14 16:47:36 +01:00
Chris Hill-Scott
8ea3f0141c Give estimates of the number of phones in a broadcast area
We need to give people a better feel for the consequences of
broadcasting an alert. We’ve seen in research that some users will
assume it is subscription based, or opt-in, rather than going to every
phone in the area.

I reckon that the most effective way to communicate this is to put some
numbers next to the areas, to give people an idea of how many people
will get alerted.

We can estimate how many phones are in an area by:
- taking the population of all electoral wards in that area
- multiplying it by the percentage of people who own an internet
  connected phone[1]

The Office for National Statistics publish both these datasets.

The number of people who own an intenet connected phone varies a lot by
age. Since the population data for each ward is broken down by age we
can factor this in. Simplified, the calculation looks like this:
- take the _Abbey_ ward of _Barking and Dagenham_
- in this ward there are 26 people aged 80
- 40% of people over 65 have an internet-connected phone
- therefore 10 of these 80-year-olds would be likely to receive a
  broadcast
- (repeat for all other ages)

These numbers won’t be exact, but should be enough to give people a feel
for the severity of what they’re about to do. We can see if they acheive
this aim in user research.

1. This is a proxy for the number of people who are likely to have a 4G
   capable phone, because only 4G capable phones will be receiving
   broadcasts to begin with
2020-09-14 16:26:09 +01:00
Leo Hemsted
ef0564f046 generate library summary in python
much simpler than sqlite.

also remove oxford commas

Co-authored-by: Chris Hill-Scott <me@quis.cc>
2020-09-14 15:25:04 +01:00
Chris Hill-Scott
48a432943f Merge pull request #3627 from alphagov/increase-minimum-polygon-threshold
Increase threshold for minimum polygon size
2020-09-14 13:20:36 +01:00
Chris Hill-Scott
858d1ee197 Increase threshold for minimum polygon size
We filter out very small polygons from the original data to remove
glitches. These glitches are caused by trying to subtract the water from
a polygon that includes some land and some water, but using two
different definitions or resolutions of mean high water line.

If we don’t do this then we end up with a bunch of very small polygons
which lie far outside the understood area of a place, causing large
overspill.

We need to increase the threshold for this process because we’re still
seeing this problem around Bristol and Norwich.

This does mean we lose a few very small polygons in places like Shetland
and the Scilly Isles, but not in such a way that we would avoid
broadcasting to them (because they’d still be caught by the
simplification and overspill).
2020-09-14 11:32:02 +01:00
Tom Byers
54e553aad4 Merge pull request #3625 from alphagov/fix-aria-on-jobs-page-2nd-attempt
Fix aria on jobs page 2nd attempt
2020-09-11 14:46:37 +01:00
Tom Byers
9cba1e17e0 Merge pull request #3619 from alphagov/add-context-to-letter-template-links
Give links context on letter template page
2020-09-11 14:07:25 +01:00
David McDonald
44cd904720 Merge pull request #3626 from alphagov/security-update
Remove reference to special category data cant be sent
2020-09-11 12:36:19 +01:00
David McDonald
5b5c240b05 Remove reference to special category data cant be sent
Supposedly this is old and is no longer accurate
2020-09-11 12:27:11 +01:00
Tom Byers
51033d57fb Make jobs notification partial a role of region
Previously attempted in this commit by changing
the element to a <section>:

e815a73233

This broke the updateContent.js, that polls the
JSON endpoint for the partial and updates its
content with changes sent back. From what I could
tell, it broke it because the JS that does the
update gets the diff between the current partial
and the one sent in JSON and applies it to the
current one.

If the notification hasn't completed before the
page loads, the partial added to the page has a
<div> wrapping it, to initalise the
updateContent.js JS. This means the diff ends up
being between elements with a different level of
hierarchy:

Element 1:

  <div data-module="update-content">
    <div class="ajax-block-container">
    ...
    </div>
  </div>

Element 2:
  <div class="ajax-block-container">
  ...
  </div>

This seems to work OK when the partial
is a <div>, I assume because it's the same type of
element as the wrapper, but not when it's a
<section>:

Element 1:

  <div data-module="update-content">
    <section class="ajax-block-container">
    ...
    </section>
  </div>

Element 2:
  <section class="ajax-block-container">
  ...
  </section>

Because of all this, it's easier to just give it
the role of 'region'.
2020-09-10 23:12:29 +01:00
Tom Byers
ddf54d5ce3 Give selected pill item an id 2020-09-10 23:11:13 +01:00