Commit Graph

10476 Commits

Author SHA1 Message Date
Tom Byers
704de9ebf3 Add tests for various different counter states 2020-09-18 12:10:32 +01:00
Tom Byers
2f18e4b2f0 Update test helper that generates checkboxes
It was using GOVUK Elements HTML and we have since
moved to GOVUK Frontend.
2020-09-18 11:50:32 +01:00
Tom Byers
b19330ae1e Merge pull request #3634 from alphagov/add-announcements-to-live-search
Add announcements to live search
2020-09-18 11:31:06 +01:00
Tom Byers
43935457d8 Change live-search so it announces results
If there is a search term when the page loads, a
statement about the results is added to the
searchbox label.

All subsequent searches are announced via an aria
live-region.
2020-09-17 14:38:40 +01:00
Tom Byers
3719479356 Add tests for live-search announcements 2020-09-17 14:38:40 +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