Commit Graph

470 Commits

Author SHA1 Message Date
David McDonald
511ed6daf0 make freeze requirements 2020-09-01 16:46:25 +01:00
David McDonald
06c844b7cb make freeze requirements 2020-08-18 09:55:52 +01:00
David McDonald
e95908a04b Bump utils to bring in accessibility fix 2020-08-14 16:16:13 +01:00
Chris Hill-Scott
969e7a6dbd Show how a broadcast will overspill selected area
Broadcasting is not a precise technology, because:
- cell towers are directional
- their range varies depending on whether they are 2, 3, 4, or 5G
  (the higher the bandwidth the shorter the range)
- in urban areas the towers are more densely packed, so a phone is
  likely to have a greater choice of tower to connect to, and will
  favour a closer one (which has a stronger signal)
- topography and even weather can affect the range of a tower

So it’s good for us to visually indicate that the broadcast is not as
precise as the boundaries of the area, because it gives the person
sending the message an indication of how the technology works.

At the same time we have a restriction on the number of polygons we
think and area can have, so we’ve done some work to make versions of
polygons which are simplified and buffered (see
https://github.com/alphagov/notifications-utils/pull/769 for context).

Serendipitously, the simplified and buffered polygons are larger and
smoother than the detailed polygons we’ve got from the GeoJSON files. So
they naturally give the impression of covering an area which is wider
and less precise.

So this commit takes those simple polygons and uses them to render the
blue fill. This makes the blue fill extend outside the black stroke,
which is still using the detailed polygons direct from the GeoJSON.
2020-08-13 11:20:49 +01:00
Toby Lorne
4ba157ae8a deps: bump notifications-utils to 41
Signed-off-by: Toby Lorne <toby.lornewelch-richards@digital.cabinet-office.gov.uk>
2020-08-12 16:11:38 +01:00
David McDonald
b872db3032 freeze requirements 2020-08-04 12:13:35 +01:00
Katie Smith
a1b9644290 Bump eventlet
dnspython had been changed from 1.16.0 to 2.0.0 in a previous commit,
but this was not compatible with eventlet 0.25.2. This bumps eventlet to
a later version, which has the effect of downgrading dnspython again.
2020-07-31 10:38:44 +01:00
Katie Smith
0304edd7a2 Bump utils to 40.6.0
This brings in validation for invalid characters in address lines.
2020-07-31 08:51:07 +01:00
David McDonald
4ee15c94c4 Bump gds metrics to 0.2.2 to bring in bug fix
https://github.com/alphagov/gds_metrics_python/blob/master/CHANGELOG.md#021

This will mean that if an exception is thrown in any `before_request`
functions that run before the gds metrics `before_request` function,
then we will no longer throw an uncaught exception.

Note, this could still be the case (and has been seen in production) as
`init_app(application)` in `create_app` in `init.py` can indeed throw
exceptions, for example when it can't find the current service. We could
move our init app for gds metrics further up if we wanted to to further
counter this.
2020-07-08 16:26:28 +01:00
Chris Hill-Scott
255be194a6 Merge pull request #3500 from alphagov/choose-broadcast-area-flow
Add flow for choosing an area to broadcast to
2020-07-08 14:14:57 +01:00
Chris Hill-Scott
18d464d4f0 Add some views for selecting broadcast areas
These are just so we have some pages to click through for now. They
don’t use real templates, or any of the broadcast stuff from the
database.

But I think it’s useful to get some skeleton pages in first so that we
can see the map etc working in production, then build on that, without
having to do it all in one mega PR.

For that reason there are two short term things I’ve done in this commit
which should be revisited soon:
- no tests for the endpoints
- data about which areas are selected is stored in the session
2020-07-08 10:27:42 +01:00
David McDonald
96470dbd1f make freeze requirements 2020-07-06 16:00:05 +01:00
Chris Hill-Scott
c4458efa21 Bump utils to 40.2.1
Brings in:
- re-usable `SerialisedModel`
- speed improvements to processing CSVs against email templates

I chose not to rename `JSONModel` or `ModelList` to keep the diff nice
and small.
2020-07-06 09:39:54 +01:00
Chris Hill-Scott
98eb3c61f6 Merge pull request #3498 from alphagov/add-broadcast-template
Allow adding broadcast templates
2020-07-06 09:06:16 +01:00
Chris Hill-Scott
724e8d1838 Make it possible to preview a broadcast template
At the moment this won’t look like much, but it will let us do an
end-to-end run of adding a broadcast template.

At the moment all you can do with a broadcast template is edit it, so
there’s no ‘Send’ link on the page.
2020-07-01 17:49:55 +01:00
David McDonald
d4ed909d0f Revert "Revert "Statsd to prometheus"" 2020-07-01 13:27:12 +01:00
David McDonald
5fb58260e2 Revert "Statsd to prometheus" 2020-07-01 10:00:39 +01:00
David McDonald
e260110d60 Merge pull request #3495 from alphagov/statsd-to-prometheus
Statsd to prometheus
2020-06-30 15:37:40 +01:00
David McDonald
043e6ac69c Add GDS metrics package to admin app
Follows the code from the API
2020-06-30 14:24:34 +01:00
Chris Hill-Scott
7d6802b415 Freeze requirements 2020-06-30 13:50:05 +01:00
Chris Hill-Scott
5335729c31 Import request cache from utils
We’ve making the request cache shared code now so we can remove it from
this app and refer to the version in utils instead.

Delete unused module
2020-06-22 09:39:32 +01:00
Leo Hemsted
fb820306da bump utils 2020-06-18 16:06:18 +01:00
David McDonald
ec0ebd57a9 make freeze requirements 2020-06-18 11:40:49 +01:00
Chris Hill-Scott
f20726a042 Bump utils to 39.4.6 2020-06-16 09:58:07 +01:00
Chris Hill-Scott
c2f851e8de Bump utils to 39.4.5
Changes:
https://github.com/alphagov/notifications-utils/compare/39.4.3...39.4.5
2020-06-15 12:13:30 +01:00
Chris Hill-Scott
b7429fe8a9 Bump utils to 39.4.3
Brings in a bug fix for when a personalisation value is an empty list.
2020-06-09 10:37:16 +01:00
Chris Hill-Scott
18f3f0a7ae Freeze requirements 2020-05-28 10:47:52 +01:00
Chris Hill-Scott
67be9d98c9 Bump utils to 39.4.2 2020-05-27 15:27:30 +01:00
Chris Hill-Scott
9da843ceff Bump utils to 39.4.1 2020-05-26 13:37:04 +01:00
Chris Hill-Scott
d828c1c481 Bump utils to 39.4.0
Adds delivery estimates for letters posted to Europe or the rest of the
world.
2020-05-26 13:37:03 +01:00
Chris Hill-Scott
b2ad7ff3cb Replace format_recipient with PostalAddress.as_single_line
We’ve refactored the code to display an address on a single line with
commas into utils now.
2020-05-21 14:20:18 +01:00
Chris Hill-Scott
064b1eb05a Bump utils to 39.2.0
This will start loggin Zendesk ticket IDs when people use the support
pages.
2020-05-18 11:08:54 +01:00
Chris Hill-Scott
73fe640c9c Bump utils to 39.1.0
Allows letters to be previewed with international postage
2020-05-15 15:37:35 +01:00
Chris Hill-Scott
6782c21031 Merge pull request #3434 from alphagov/bump-utils-39.0.1
Bump utils to 39.0.1
2020-05-07 08:22:13 +01:00
Chris Hill-Scott
aa9ba0f52a Freeze requirements 2020-05-07 08:13:28 +01:00
Chris Hill-Scott
f7dcd68dbe Bump utils to 39.0.1
Fixes a bug with address validation.
2020-05-06 10:23:54 +01:00
Chris Hill-Scott
e5fa413f45 Bump PyExcel to 0.6.1
0.6.0 has been withdrawn because it contained a bug (which wouldn’t
affect us). But we can’t use it now because pip can’t find it to
install. So needs upgrading to the next version now.
2020-05-04 11:53:43 +01:00
Chris Hill-Scott
0ef076f59e Merge pull request #3416 from alphagov/validate-3-lines-csv
Allow all the new address goodness in spreadsheets
2020-05-01 15:37:08 +01:00
Chris Hill-Scott
06108de0f7 Allow international addresses in spreadsheets
For services with permission, they can now put international addresses
into their spreadsheets without getting a postcode error.

This also means they can start using address line 7 instead of postcode,
since it doesn’t make sense to put a country in a field called
‘postcode’. But this will be undocumented to start with, because we’re
not giving any real users the permission.

It does now mean that the number of possible placeholders (7 + postcode)
is greater than the number of allowed placeholders (7), so we have to
account for that in the one-off address flow where we’re populating the
placeholders automatically. We’re sticking with 6 + postcode here for
backwards compatibility.
2020-04-29 16:19:57 +01:00
Chris Hill-Scott
4e1fa30793 Freeze requirements 2020-04-29 11:51:08 +01:00
Chris Hill-Scott
5f0cfc4070 Merge pull request #3424 from alphagov/bump-wtforms
Bump WTForms to 2.3.1
2020-04-29 11:31:59 +01:00
Chris Hill-Scott
f5649d72c9 Explain 3 required address columns
Our rules about address columns are relaxing, so that none of them are
mandatory any more. Instead you just need any 3 of the 7 to make a valid
address.

This commit updates our error messaging to reflect that.
2020-04-27 16:47:49 +01:00
Rebecca Law
48a49f24f0 Update utils to the latest version
The validation for the text message character count has been updated from 612 to 918.

The pricing page still needs to be updated.
2020-04-27 10:27:43 +01:00
Chris Hill-Scott
65bb72ef2f Bump WTForms to 2.3.1
This involves three changes which broke our code.

To validate email addresses, the optional dependency `email-validator`
must be installed<sup>1</sup>. But since we don’t use WTForms’ email
validation, we shouldn’t need to subclass it – it can just be its own
self contained thing. Then we don’t need to add the extra dependency.

When rendering textareas, and extra `\r\n` is inserted at the beginning
<sup>2</sup>. Browsers will strip this when displaying the textbox and
submitting the form, but some of our tests need updating to account for
this.

The error message for when you don’t choose an option from some radio
buttons has now changed. Rather than just accepting WTForms’ new
message, this commit makes the error messages like the examples from
the Design System<sup>3</sup>. By default it will say ‘Select an
option’, but by passing in an extra parameter (`thing`) it can be
customised to be more specific, for example ‘Select a type of
organisation’.

***

1. https://github.com/wtforms/wtforms/pull/429
2. https://github.com/wtforms/wtforms/issues/238
3. https://design-system.service.gov.uk/components/radios/#error-messages
2020-04-23 12:57:10 +01:00
Chris Hill-Scott
8faffad508 Pin WTForms to current version
Version 2.3.0 contains a number of breaking changes which we can address
later.
2020-04-22 16:40:56 +01:00
Chris Hill-Scott
0d92664fc8 Fix preview of text messages on activity page
Also beefs up the tests a bit so we can be more confident that the right
thing is getting displayed.

Depends on:
- [ ] https://github.com/alphagov/notifications-utils/pull/725
2020-04-22 16:10:40 +01:00
Chris Hill-Scott
202d4cdb5a Merge pull request #3414 from alphagov/moj-bank-holidays
Remove hard-coded bank holidays
2020-04-17 11:04:27 +01:00
Chris Hill-Scott
e68f9c6db9 Remove hard-coded bank holidays
Looks like someone in the Ministry of Justice has made a nice little
Python package of them.

I’ve configured it to use the cached holidays that come with the
package, rather than going to the GOV.UK website every time we start the
app. This should be more reliable, and means we’ll only get updates when
we do a version bump (PyUp should keep an eye on this for us).
2020-04-16 15:06:54 +01:00
Chris Hill-Scott
88734bb74f Bump utils to bring in recent changes to Template classes
The main things we have to account for are:
- `WithSubjectTemplate` has gone
- every template dictionary must have `template_type` set
2020-04-15 17:58:57 +01:00
Leo Hemsted
671d0872c2 fix letter notification status around UTC/BST
timezones grr blah blah blah
2020-04-14 09:52:13 +01:00