Commit Graph

9773 Commits

Author SHA1 Message Date
David McDonald
ba80d5b7cd Introduce abstraction for s3 metadata
S3 metadata only supports ascii characters. Whenever we save data to it
we need to make sure we encode it to save it and then decode it to
display it again to users. This abstraction will act as the place for
that decoding to happen so the rest of the code in our views doesn't
need to care about the encoding abstraction.
2020-05-18 16:13:31 +01:00
Chris Hill-Scott
e79ea0e383 Merge pull request #3439 from alphagov/previous-financial-years
Show 2 previous financial years on usage page
2020-05-11 15:15:00 +01:00
Chris Hill-Scott
be86832867 Merge pull request #3438 from alphagov/update-public-support-page
Update content
2020-05-11 15:14:52 +01:00
Chris Hill-Scott
8215022725 Show 2 previous financial years on usage page
From a question on cross-government Slack:

> re the Usage tab - currently it shows 3 financial years - last year,
> this year and next year. is it possible to replace the "next year" tab
> with something more useful? its always going to be blank! I was
> thinking it would be good to have 2 financial years ago, 1 financial
> year ago and this financial year.

This seems like a reasonable idea, and is something we’ve talked about
before. The original intention[1] was that seeing your (unchanged) free
allowance for next year would be useful, but that doesn’t really seem to
be a user need.

***

1. See https://github.com/alphagov/notifications-admin/pull/1094
   > so that you can check what your SMS allowance is going to be before
   > you actually get into it
2020-05-07 16:50:19 +01:00
karlchillmaid
f4f9cf3fdd Revert change 2020-05-07 16:42:32 +01:00
karlchillmaid
d5e02df97f Update content
Update descriptions of pages and services. Shorten one of the link titles.
2020-05-07 16:38:13 +01:00
Chris Hill-Scott
77b7e4b8ea Merge pull request #3436 from alphagov/limit-search-50
Don’t show pagination links when searching
2020-05-07 10:09:58 +01:00
Chris Hill-Scott
8655e519aa Change logic around to be clearer
Think this is a clearer expression of what the intent it.
2020-05-07 09:50:03 +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
b14e097291 Merge pull request #3433 from alphagov/pyup-scheduled-update-2020-05-04
Scheduled weekly dependency update for week 18
2020-05-07 08:22:05 +01:00
Chris Hill-Scott
aa9ba0f52a Freeze requirements 2020-05-07 08:13:28 +01:00
Chris Hill-Scott
f30187b529 Don’t show pagination links when searching
The search form makes a post request, so that phone numbers and email
addresses don’t show up in logs or browser history.

At most the API will return 50 results, with some pagination links. We
can’t easily give you links to click in the admin app, because links can
only perform get requests.

Because the value of seeing more than 50 results feels quite low (users
will probably make their search more specific before scrolling through
all 50) let’s just show a message saying only the first 50 results are
displayed.
2020-05-06 17:33:19 +01:00
David McDonald
7d9340d76c Merge pull request #3435 from alphagov/fix-letter-job-downloads
Fix bug with letter job CSV downloads
2020-05-06 14:51:32 +01:00
David McDonald
b6935a3c6c Fix bug with letter job CSV downloads
We were throwing an exception when instantiating a LetterImageTemplate
as we weren't giving it all the arguments it needed.

 Now we give it all the correct parameters and add a
test for the method. Ideally we would add a unit test for the flask
route for downloading a letter job CSV (which is currently lacking) but
I did the minimal to be confident I've fixed the bug as I think this
whole code may be fresh for a bit of a rewrite according to Chris.

Original error:
```
File "/Users/davidmcdonald/.virtualenvs/notifications-admin/lib/python3.6/site-packages/notifications_utils/template.py", line 669, in __init__
    raise TypeError('image_url is required')
TypeError: image_url is required
```
2020-05-06 14:44:37 +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
Katie Smith
0955060c20 Merge pull request #3431 from alphagov/email-auth-interstitial
Add interstitial page before using email auth token
2020-05-05 09:27:19 +01:00
Chris Hill-Scott
3e6d9a564b Add interstitial page before using email auth token
Some email clients will pre-fetch links in emails to check whether
they’re safe. This has the unfortunate side effect of claiming the token
that’s in the link.

Long term, we don’t want to let the link be used multiple times, because
this reduces how secure it is (eg someone with access to your browser
history could re-use the link even if you’d signed out).

Instead, this commit adds an extra page which is served when the user
clicks the link from the email. This page includes a form which submits
to the actual URL that uses the token, thereby not claiming the token as
soon as the page is loaded.

For convenience, this page also includes some Javascript which clicks
the link on the user’s behalf. If the user has Javascript turned off
they will see the link and can click it themselves. This is going on the
assumption that whatever the email clients are doing when prefetching
the link doesn’t involve running any Javascript.

This Javascript is inlined so that:
- it is run as fast as possible
- it’s more resilient – even if our assets domain is unreachable or the
  connection is interrupted, it will still run
2020-05-04 15:53:27 +01:00
Chris Hill-Scott
fe6dad2752 Merge pull request #3432 from alphagov/add-use-endpoint
Add a second URL for the email auth endpoint
2020-05-04 15:45:51 +01:00
pyup-bot
47cb769003 Update pytz from 2019.3 to 2020.1 2020-05-04 14:49:07 +01:00
Chris Hill-Scott
ae2f8f9887 Add a second URL for the email auth endpoint
We’re going to add an interstitial page that redirects to this new URL.
But we don’t want that redirect to 404 while the change is deploying,
because some boxes will have the new URL and some won’t. So let’s deploy
the new URL to all the boxes first, then the redirect page can safely
take over the new one.

The new URL is going to be `post` not `get` because that feels more
HTTP-y, so we need to make sure that’s part of this change too.
2020-05-04 14:09:01 +01:00
Chris Hill-Scott
0f3e0409db Merge pull request #3430 from alphagov/validate-international-uploaded-letters
Tell template preview whether an uploaded letter can be sent internationally
2020-05-04 12:40:13 +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
4cf218f5c8 Add error messages for bad international addresses
Template preview started putting these in the metadata of the S3 object
in this pull request: https://github.com/alphagov/notifications-template-preview/pull/445

Specific error key is defined here:
800b48fce5/app/precompiled.py (L558)
2020-05-04 10:14:16 +01:00
Chris Hill-Scott
53724dacd1 Tell template preview whether a letter can be sent internationally
If a service has permission to send international letters then the admin
app should tell template preview, so that template preview knows what
rules to apply when it’s validating the address of the letter.

We don’t need to wait for template preview to start looking at this
query string argument – it will just ignore it for now.
2020-05-01 15:43:54 +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
4892b2db77 Merge pull request #3425 from alphagov/tidy-up-platform-admin
Tidy up the platform admin pages
2020-04-30 14:42:55 +01:00
Chris Hill-Scott
dde7397f92 Merge pull request #3429 from alphagov/dependabot/npm_and_yarn/jquery-3.5.0
Bump jquery from 3.4.1 to 3.5.0
2020-04-30 14:42:46 +01:00
Chris Hill-Scott
3ac97bc92d Merge pull request #3428 from alphagov/tabular-inbound
Use tabular numbers for dashboard banner counts
2020-04-30 09:43:20 +01:00
dependabot[bot]
6b31d37fbd Bump jquery from 3.4.1 to 3.5.0
Bumps [jquery](https://github.com/jquery/jquery) from 3.4.1 to 3.5.0.
- [Release notes](https://github.com/jquery/jquery/releases)
- [Commits](https://github.com/jquery/jquery/compare/3.4.1...3.5.0)

Signed-off-by: dependabot[bot] <support@github.com>
2020-04-29 22:56:45 +00: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
84dbae6e39 Use tabular numbers for dashboard banner counts
We use tabular (not lining) figures everywhere else that we display counts, so that they don’t shift around as the AJAX updates the numbers.

There’s a good explanation of the difference here: https://www.fonts.com/content/learning/fontology/level-3/numbers/proportional-vs-tabular-figures
2020-04-29 15:17:12 +01:00
Chris Hill-Scott
5e953c22da Merge pull request #3427 from alphagov/pyup-scheduled-update-2020-04-27
Scheduled weekly dependency update for week 17
2020-04-29 11:58:37 +01:00
Chris Hill-Scott
4e1fa30793 Freeze requirements 2020-04-29 11:51:08 +01:00
pyup-bot
ee41d157c7 Update eventlet from 0.25.1 to 0.25.2 2020-04-29 11:46:36 +01:00
pyup-bot
9a62d1e583 Update pyexcel from 0.5.15 to 0.6.0 2020-04-29 11:46:36 +01:00
pyup-bot
bee5b7bf52 Update flask from 1.1.1 to 1.1.2 2020-04-29 11:46:35 +01:00
pyup-bot
d6e369befa Update humanize from 2.2.0 to 2.4.0 2020-04-29 11:46:34 +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
51bcf05f6e Merge pull request #3420 from alphagov/search-letters
Let users search for letters
2020-04-28 10:13:36 +01:00
Chris Hill-Scott
832445774b Add postal address row errors
Context:
- postal addresses can be made from any of the 7 address lines now, and
  the postcode can be in any one of the 7
- we can put errors across a whole row now, not just on individual cells

This commit put errors to do with the postal address as a whole across
the whole row now, rather than tying them to any one cell.
2020-04-27 16:47:50 +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
b2118057ef Merge pull request #3426 from alphagov/update-utils-large-frag-count
Update utils to the latest version
2020-04-27 16:41:58 +01:00
Rebecca Law
347209f5c0 Fix typo 2020-04-27 13:52:37 +01:00
Rebecca Law
8c7495ea45 Update the pricing page 2020-04-27 13:51:29 +01:00
Chris Hill-Scott
c835674df2 Add test case for searching by letter type 2020-04-27 12:49:57 +01:00
Chris Hill-Scott
b01bc17dbb Remove search_bar_visible test param
It’s always `True` now, so we can just `assert True` instead.
2020-04-27 12:47:30 +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
Pea M. Tyczynska
33786fc3d9 Merge pull request #3423 from alphagov/update-healthcheck-page
Update _status page - remove references to Travis
2020-04-24 14:37:41 +01:00
Chris Hill-Scott
f79527bfd9 Merge pull request #3413 from alphagov/delay-initial-ajax-call
Delay the initial AJAX call by 2 seconds
2020-04-24 12:06:19 +01:00
Pea Tyczynska
652b627312 Update healthcheck page and remove all travis references from the repository 2020-04-24 11:54:26 +01:00