Commit Graph

2717 Commits

Author SHA1 Message Date
Pea (Malgorzata Tyczynska)
53ef438a1e Merge pull request #3135 from alphagov/enforce_letter_10_page_limit
Enforce letter 10 page limit
2019-10-16 13:14:30 +01:00
Pea Tyczynska
2ed1e382b4 Move letter length check to utils repo so template-preview can use it, too
Update requirements
2019-10-10 14:25:19 +01:00
Chris Hill-Scott
7f033efc28 Fix email branding request page with only textbox
If there aren’t a range of options (normally presented as radio buttons)
to show the user on the email branding request page then we just show
the textbox. But we were still doing form validation on the radio
buttons, even though the user couldn’t see them to click them. This
stopped the user from being able to submit the form.

This commit fixes the problem by, in this specific case, pre-ticking the
‘Something else’ radio button.
2019-10-09 16:42:30 +01:00
Pea Tyczynska
c524b0bbf5 Rebase and set upload status to invalid if too many pages 2019-10-09 16:03:48 +01:00
Pea Tyczynska
12ec2870af Move letter too long banner message over from utils, also refactor 2019-10-09 16:03:47 +01:00
Pea Tyczynska
028d156dc7 Do not allow to send job of letters if letters longer than 10 pages 2019-10-09 16:03:47 +01:00
Pea Tyczynska
c690434b1f One off letter flow does not allow to send letter longer than 10 pages 2019-10-09 16:03:47 +01:00
Pea Tyczynska
0adf80f294 Do not allow to send uploaded pdf letters longer than 10 pages 2019-10-09 16:03:46 +01:00
Pea Tyczynska
579ae72abb Do not allow to send a letter template longer than 10 pages 2019-10-09 16:03:46 +01:00
Katie Smith
11543e15be Store all data about uploaded letters in the S3 metadata
We had been storing whether or not a file was valid in the S3 metadata,
but using the query string of the URL to store the original filename
and the page count. This meant that if you tried to view the preview
letter page without the query string you would see a `500`. It was
possible for this to happen if you were signed out of Notify while on
the preview page - you would be redirected back to the preview page but
without the query string, causing an error.
2019-10-08 15:34:00 +01:00
Pea (Malgorzata Tyczynska)
28c901d5b9 Merge pull request #3130 from alphagov/notification-coubt
Get notification count from api instead of getting list of notifications from api
2019-10-08 12:19:55 +01:00
karlchillmaid
c281cd64a5 Merge pull request #3127 from alphagov/update-validation-errors
Update spreadsheet validation errors
2019-10-03 14:46:27 +01:00
Chris Hill-Scott
3d2f7c3fcf Refine error messages and fix tests
Removing the word ‘duplicate’ because:
- it suggests that the whole column is the same, which it might not be
- it suggests that having duplicate column names is a problem, which is
  only true in the case of recipient columns

Reverts back to saying the column names ‘need to’ match, because we feel
it’s more instructive.
2019-10-03 14:24:28 +01:00
Chris Hill-Scott
78e57dbff9 Clear service cache for when updating org branding
Updating an organisation’s branding might now also update the branding
of services associated to that organisation. This is similar to how
updating an organisation’s type can update the organisation type for its
services.

In the latter case we already make sure to clear the cached version of
these services which is held in Redis.

This commit does the same clearing of the caches when updating an
organisation’s branding (and does a bit of refactoring to do so without
duplication of code.)
2019-10-03 12:10:53 +01:00
Chris Hill-Scott
8b9cc5f4dc Merge pull request #3134 from alphagov/relative-dates-jobs
Use relative dates for jobs on dashboard
2019-10-02 16:19:44 +01:00
Tom Byers
0543dca23d Improve description of cancel link tests 2019-10-01 14:19:06 +01:00
Tom Byers
b6b1e7682b Rename the 'clear selection' link
In response to the sensible comments here:

https://github.com/alphagov/notifications-admin/pull/3053#discussion_r329957545
2019-10-01 14:10:22 +01:00
Tom Byers
8b9c8f2f95 Fix typo in comment 2019-10-01 08:26:08 +01:00
Tom Byers
5bd1e4bb7e Move template list fixture function into helpers
This will be needed in other tests so should be
made into a helper.
2019-10-01 08:26:08 +01:00
Tom Byers
f495288034 Add tests for integration with sticky JS 2019-10-01 08:26:08 +01:00
Tom Byers
60389d7087 Add tests for templateFolderForm JS interactions 2019-10-01 08:26:08 +01:00
Tom Byers
a93a7172e2 Merge pull request #3092 from alphagov/add-js-tests-for-file-upload
Add tests for fileUpload module
2019-09-30 11:08:31 +01:00
Chris Hill-Scott
79369c38c7 Use relative dates for jobs on dashboard
For scheduled files we say ‘sending today at 5:00pm’ or ‘sending
tomorrow at 11:00am’. But once we’ve started processing these files we
say ‘Sent 27 September at 5:00pm’. This makes it sound like 27 September
is not today.

This commit makes the dates shown on the dashboard consistent, by saying
‘today’ and ‘yesterday’ instead of absolute dates.
2019-09-27 13:20:13 +01:00
Pea Tyczynska
9058b13ff2 Get notification count from api instead of list of notifications
when checking if job can be cancelled. This makes query lighter,
less likely to fall over if job is large and removes
pagination bug.
2019-09-24 19:07:20 +01:00
Chris Hill-Scott
98240b4780 Fix test 2019-09-23 13:22:29 +01:00
Rebecca Law
18e3eb6b32 Update tests for content changes. 2019-09-23 13:22:28 +01:00
karlchillmaid
c3d806dd50 Replace haven't with have not 2019-09-23 13:22:28 +01:00
karlchillmaid
3e45b0f738 Replace haven't with have not 2019-09-23 13:22:28 +01:00
karlchillmaid
74e9b343fd Replace haven't with have not 2019-09-23 13:22:28 +01:00
karlchillmaid
5b616a0734 Replace haven't with have not 2019-09-23 13:22:28 +01:00
karlchillmaid
852699e3e8 Replace hasn't with has not 2019-09-23 13:22:26 +01:00
karlchillmaid
8539d6fc66 Replace doesn't with does not 2019-09-23 13:22:17 +01:00
karlchillmaid
8dd58afe72 Replace doesn't with does not 2019-09-23 13:22:16 +01:00
karlchillmaid
7d2ce2889f Replace couldn't with could not 2019-09-23 13:22:16 +01:00
karlchillmaid
7f93cac07d Replace isn't with is not 2019-09-23 13:22:16 +01:00
karlchillmaid
98aa956738 Replace isn't with is not 2019-09-23 13:22:16 +01:00
karlchillmaid
0926d6ce25 Replace won't with will not 2019-09-23 13:22:00 +01:00
karlchillmaid
0835d1679a Replace can't with cannot 2019-09-23 13:21:08 +01:00
karlchillmaid
1e03a2668b Replace can't with cannot 2019-09-23 13:21:08 +01:00
karlchillmaid
4728d810f1 Replace can't with cannot 2019-09-23 13:21:07 +01:00
karlchillmaid
a9583b51f3 Replace can't with cannot 2019-09-23 13:20:26 +01:00
karlchillmaid
7a18700353 Replace can't with cannot 2019-09-23 13:20:26 +01:00
karlchillmaid
680a99afad Replace can't with cannot 2019-09-23 13:20:25 +01:00
karlchillmaid
5e8e6cdeda Replace can't with cannot 2019-09-23 13:20:25 +01:00
karlchillmaid
508ac04aa6 Replace negative contractions 2019-09-23 13:20:25 +01:00
Chris Hill-Scott
68c9147fec Merge pull request #3119 from alphagov/retire-old-static-content
Retire old static content pages
2019-09-23 13:19:01 +01:00
Chris Hill-Scott
bda2f41aac Merge pull request #3125 from alphagov/faster-tests
Create the app once per run, not once per test
2019-09-20 10:33:44 +01:00
Chris Hill-Scott
1a353d90eb Create the app once per run, not once per test
Turns out our tests spent a lot of time recreating the app for each test
case, which is quite intense.

This commit makes the fixture sessions level, so the app is only created
once per test session, not once per test function.

This cuts down the time taken to run the test suite to about 50 seconds.

It also makes the tests more parallelizable. Before this change going
from 4 to 8 processes made the tests slower. Now it cuts them down from
about 50 seconds to about 35 seconds[1]. So this commit also lets Pytest
choose the best number of processes to run, since on my machine it
chooses 8, which is the fastest.

Overall this means the

1. With a 2.2GHz quad-core Intel Core i7 processor on a 2015 MacBook Pro
2019-09-18 15:58:25 +01:00
Chris Hill-Scott
afcdedf598 Allow elaboration when ‘something else’ is chosen
Letting people input a bit of free text should reduce the amount of back
and forth we have to do over support tickets when setting up someone’s
branding.

If something else is the only option then we don’t show the radio button
at all and have just the free text input on the page (not behind a
progressive disclosure).
2019-09-16 11:18:22 +01:00
Chris Hill-Scott
6d0d10e8de Only show relevant choices of email branding
Users who work in local government can’t have GOV.UK branding on their
emails. And only those working for Companies House (for example) can
request the Companies House branding.

This commit adds:
- new choices of email branding, which offer the name of the branding,
  rather than the style
- logic to filter this list to only the applicable options, based on
  what we know about the user, service and organisation

This is a change from the previous approach which put the onus on users
to figure out the style of branding they wanted, when we might already
know that a lot of the options weren’t available to them, or would be
inconsistent with the branding of other services in their organisation.
2019-09-16 11:03:52 +01:00