Commit Graph

9752 Commits

Author SHA1 Message Date
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
Chris Hill-Scott
986f2752e0 Let users search for letters
Like we have search by email address or phone number, finding an
individual letter is a common task. At the moment users are having to
click through pages and pages of letters to find the one they’re looking
for.

Users of the API will also be able to search by reference, same as for
emails and text messages. But we only show this hint text to users who
have some API keys.
2020-04-23 16:44:41 +01:00
Chris Hill-Scott
ae8dd8e8cd Tidy up the platform admin pages
This commit does two things:
- brings the ‘All organisations’ page back within the platform admin
  part of the site (because it’s hard to find otherwise)
- makes the layouts of all the pages within platform admin a bit closer
  to the service-specific pages in terms of heading sizes, spacing, etc
  so that moving between them doesn’t feel so jumpy
2020-04-23 13:50:36 +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
bc4f2166cd Merge pull request #3422 from alphagov/fix-sms-preview-activity
Fix preview of text messages on activity page
2020-04-23 11:30:28 +01:00
Chris Hill-Scott
79b32a11ce Add comments to explain where fixture data comes from
https://github.com/alphagov/notifications-admin/pull/3422#discussion_r413120404
2020-04-23 10:12:02 +01:00
Katie Smith
77f90da5c5 Merge pull request #3421 from alphagov/archive-user-error-msg
Show error when user cannot be archived
2020-04-23 08:57:04 +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
Katie Smith
407c6d264c Fix assertion in test
When using `with pytest.raises...` any assertions inside the `with`
statement that occur below the line that raises the exception don't get
called. It's not possible to check the response status_code / location
in this test because an exception is raised before the response is
returned.
2020-04-22 16:31:59 +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
Katie Smith
ffdcda02bf Show error when user cannot be archived
A user can't be archived if they are the only member of their service
with `manage_settings` permission. `notifications-api` returns a `400`
and an error message if that is the case, however this PR to remove the
`400` error handler
https://github.com/alphagov/notifications-admin/pull/3320 stopped the
error message from showing. This meant that instead of seeing a message
about why a user couldn't be archived, we would just show a `500` error
page instead. This change checks the response from `notifications-api`
and shows an error banner with a message if the user can't be archived.
2020-04-21 18:35:36 +01:00
David McDonald
f91aba212d Merge pull request #3419 from alphagov/sms-sender-length
Reduce min sender length from 4 to 3
2020-04-21 14:53:52 +01:00
David McDonald
9f557dd086 Reduce min sender length from 4 to 3
This is now supported at the network and aggregator level
2020-04-21 12:51:54 +01:00
Chris Hill-Scott
52e966337d Merge pull request #3418 from alphagov/fix-letter-branding-preview
Fix letter branding preview
2020-04-21 11:35:45 +01:00
Chris Hill-Scott
e56c2d28b0 Fix letter branding preview
Template preview requires `template_type` to be passed in now.
2020-04-21 11:21:02 +01:00
Chris Hill-Scott
788edc46f2 Merge pull request #3415 from alphagov/normalise-2fa-code-input
Allow spaces and dashes in the two factor code
2020-04-21 10:14:19 +01:00
Chris Hill-Scott
0f686a7b3a Merge pull request #3411 from alphagov/whole-row-errors
Show errors that aren’t specific to a single spreadsheet column across the whole table row
2020-04-20 12:59:11 +01:00
Chris Hill-Scott
c36e75b3db Add test for message too long error
This didn’t seem to be tested anywhere before. We want to make sure it
works in the same sort of way as the message is empty error, which is
tested.
2020-04-20 12:35:59 +01:00
Chris Hill-Scott
b0cf36e1c7 Allow spaces and dashes in the two factor code
I noticed when using the dication software that saying ‘one two three
four five’ got dictated as `123 45`. This tripped the validation,
because the space character isn’t a digit.

So this commit normalises out spaces (and other spacing characters like
dashes and underscores) before validating the code and sending it to the
API.

I can also imagine that some people might like to space out the code to
make it easier to transcribe (like you might do with a credit card
number).
2020-04-17 16:16:52 +01:00
Chris Hill-Scott
e2d1401b54 Show error across the whole row
Errors with messages being too long or empty aren’t specific to a single
cell of the uploaded spreadsheet, they’re the results of combining all
the cells with the template.

Previously we could only show errors against a specific cell. This
commit makes it possible to add a super-row which spans all the cells,
into which we can put errors.

The index (header) column then spans both these rows, to show that they
are both associated with the same row of input.

Depends on:
- [x] https://github.com/alphagov/notifications-utils/pull/719
2020-04-17 11:06:34 +01:00
Chris Hill-Scott
f37137cdb3 Convert list table to mapping table
A list table takes a list of input, and assumes one row of output. In
order to show errors that span multiple rows we need to output two rows
for one item of input.

The list table inherits from the mapping table; using the mapping table
directly gives us the flexibility we need.
2020-04-17 11:06:33 +01:00
Chris Hill-Scott
8ce1497fc0 Make test more specific
Tests that just assert some content `in` the whole page are tricky to
debug, and make it harder to be sure that said content is showing up in
the right place, with the right markup and styling.
2020-04-17 11:06:33 +01:00