Commit Graph

8960 Commits

Author SHA1 Message Date
Rebecca Law
70276cb526 Added a new error message when the letter is mising an address block.
Before deploying a change to template-preview to return a validation error for letters that are missing the address block, we need to add the new erorr message to admin.

Some content changes have been made to other messages.
The format of the message has changed.
2020-01-10 14:42:56 +00:00
Pea M. Tyczynska
b3380ad7b5 Merge pull request #3250 from alphagov/fix-re-upload-button
Fix exception in track-error js module that broke our re-upload button
2020-01-09 16:36:44 +00:00
Pea Tyczynska
a2220f6929 Fix exception in track-error js module that broke our re-upload button 2020-01-09 16:08:44 +00:00
Katie Smith
9c62615acb Merge pull request #3248 from alphagov/pytest-5
Upgrade Pytest to version 5.3.2
2020-01-09 14:44:20 +00:00
Katie Smith
1c23784767 Pytest 5 🎉
Also updates the Pytest command in `run_tests.sh` to remove junit,
which we stopped using.
2020-01-09 09:50:37 +00:00
Katie Smith
0ec086cd24 Use fixtures for templates in a Pytest 5 compatible way 2020-01-09 09:48:16 +00:00
Katie Smith
9e3f21cd39 Stop calling mock_get_notications as if it's a function
By creating a new function in conftest.py, `create_notifications`, which
can be used instead.
2020-01-09 09:48:16 +00:00
Katie Smith
68983a21d2 Use fixtures for callbacks in a Pytest 5 compatible way 2020-01-09 09:48:16 +00:00
Katie Smith
a3978f8a5f Use fixtures that get services in Pytest 5 compatible way 2020-01-09 09:48:16 +00:00
Katie Smith
f93df53ed3 Stop calling more fixtures as functions
This commits stops calling more fixtures as if they were functions in
order to reduce the number of errors with Pytest 5.
2020-01-09 09:48:16 +00:00
Katie Smith
a602ce5937 Stop calling mock_get_no_api_keys and api_keys_mock like functions 2020-01-09 09:48:16 +00:00
Chris Hill-Scott
c270895c7f Merge pull request #3235 from alphagov/job-page-for-expired-jobs
Customise the job page for jobs whose notifications have been purged
2020-01-09 09:46:19 +00:00
Chris Hill-Scott
5bf29495ae Merge pull request #3242 from alphagov/fix-incorrect-assertion
Fix incorrect assertion for letter job CSV link
2020-01-08 09:57:26 +00:00
karlchillmaid
91d39b3fdf Merge pull request #3246 from alphagov/update-roadmap
Update roadmap content
2020-01-07 15:38:36 +00:00
karlchillmaid
c889801f4f Update content 2020-01-07 15:32:12 +00:00
karlchillmaid
adededcf21 Update content 2020-01-07 15:18:03 +00:00
karlchillmaid
ee9c36c102 Update roadmap content 2020-01-07 15:03:13 +00:00
Tom Byers
aca999a94c Merge pull request #3245 from alphagov/remove-govuk-template-compatibility-flag
Remove govuk_template compatibility flag
2020-01-07 14:03:40 +00:00
Leo Hemsted
ac9517f8a7 Merge pull request #3244 from alphagov/func-tests-fix
functional tests email reply to flakiness
2020-01-07 13:55:33 +00:00
Tom Byers
d939c19222 Remove govuk_template compatibility flag
We removed govuk_template when we moved to the
GOVUK Frontend template.njk for our base layout.

The flag was originally turned on under the
assumption that the global CSS govuk_template adds
would be present in our cascade. It fixes issues
that CSS causes with the GOVUK Frontend CSS
further down.

This was mostly wrong, as we did remove the
govuk_template code, but our situation is a bit
different because when we removed it, we copied
across some global styles it introduces to prevent
problems with our own CSS.

One of the side-effects of turning on this flag
was that the Transport font was not being applied.

This turns the flag off again, which replaces the
font, and hard-codes in the fix having this flag
would have brought in: a darker colour for link
text when focused.
2020-01-07 12:55:21 +00:00
Leo Hemsted
e5b2d81d22 increase reply to address validation timeout on preview
Celery/SQS underperforms in low-traffic environments. Tasks will sit on
celery queues for several seconds before getting picked up if they're
the only thing on the queue. This is observable in our test environments
like preview and staging, but we've got enough load on production that
this isn't an issue.

When we validate reply to email addresses, we expect a delivery receipt
to have been processed within 45 seconds of the button being pressed. On
preview, we often observe times over that, possibly due to the several
queues involved in sending an email and processing its receipt. So, to
ensure that functional tests can pass (when we don't really care how
fast things are, just that the flow doesn't break), bump this timeout up
to 120 seconds on preview. The functional tests were waiting for 120
seconds for the reply to address to be validated anyway.
2020-01-07 12:03:32 +00:00
Leo Hemsted
91adadfed0 dont reassign os.environ
os.environ is an `environ` object, not a dict. by only interacting with
it through builtin functions we can ensure it remains properly
accessible to third party libraries which might interact with it in
different ways.

See https://github.com/alphagov/notifications-api/commit/d2441466 for
more detail
2020-01-07 12:03:30 +00:00
Tom Byers
39ec952c45 Merge pull request #3243 from alphagov/turn-on-compatibility-mode-for-govuk-frontend
Turn on compatibility mode for GOVUK Frontend
2020-01-07 11:01:24 +00:00
Tom Byers
024812b49a Turn on compatibility mode for GOVUK Frontend
Automatically fixes a load of known issues that
arise when you use GOVUK Frontend at the same time
as GOVUK Frontend Toolkit, GOVUK Template and
GOVUK Elements.
2020-01-07 10:00:08 +00:00
Chris Hill-Scott
1bb0b6b2f1 Fix incorrect assertion for letter job CSV link
The statement `page.select('[download=download]')` was returning an
empty list because the link on the page has an empty `download`
attribute, rather than it being set to the string `download`.

This commit:
- updates the assertion to find the element on the page
- makes the test more specific by checking where the link goes to, not
  just its exists or lack thereof
2020-01-06 12:56:43 +00:00
Tom Byers
b7af288be2 Merge pull request #3241 from alphagov/fix-logo-svg-fallback-image
Send asset path to Header component
2020-01-06 11:56:17 +00:00
Tom Byers
6726ad31b9 Add test for SVG fallback image path
It's the only resource that uses the `asset_path`
template variable in `template.njk` so this checks
that works as expected.

From feedback on the associated pull request:

https://github.com/alphagov/notifications-admin/pull/3241#issuecomment-571102394
2020-01-06 11:40:12 +00:00
Tom Byers
b822914e23 Send asset path to Header component
The SVG fallback image for the GOV.UK logo starts
its path as '/assets/images' by default unless you
send in an alternative root.

This sends in our static asset host root to stop
the image 404'ing on browsers that load it.
2020-01-06 10:55:47 +00:00
Chris Hill-Scott
d22bf29529 Merge pull request #3239 from alphagov/lazy-load-letter-previews
Lazy load letter previews
2020-01-03 16:21:59 +00:00
Chris Hill-Scott
d21449c235 Lazy load letter previews
Brings in:
- [x] https://github.com/alphagov/notifications-utils/pull/687
2020-01-03 15:58:51 +00:00
Chris Hill-Scott
93d2d47f4e Don’t show blue boxes once notifications have gone
You can click the blue boxes to filter the list of notifications. Once
the notifications have gone there’s nothing to filter, so we should just
show the numbers but without them being clickable.
2020-01-03 15:15:25 +00:00
Chris Hill-Scott
9446b35e3b Add a more accurate missing notifications message
Notifications could be missing because:
- none have been created yet
- they’ve been deleted

This commit adds separate error messages for each case, rather than a
less helpful generic one.
2020-01-03 15:14:37 +00:00
Chris Hill-Scott
d2f976c8ee Don’t show progress once notifications are gone
We work out how complete a job’s processing is by looking at how many
notifications have been created.

Later, we deleted all the notifications, according to the data retention
schedule. This makes it look like the job has gone back to 0% processed.

This commit accounts for this by not showing the % complete message once
a finished job has had its notifications deleted.
2020-01-03 15:12:45 +00:00
Chris Hill-Scott
e3b1813ed7 Add a test for the no notifications message
This wasn’t tested before.
2020-01-03 15:12:28 +00:00
Chris Hill-Scott
d11305741f Merge pull request #3237 from alphagov/returned-pdf-letters
Handle precompiled letters in returned letters list
2020-01-03 10:04:17 +00:00
Tom Byers
54a5f1d22c Merge pull request #3181 from alphagov/update-footer-links
Update footer links
2020-01-02 15:15:37 +00:00
Chris Hill-Scott
5ea02119f4 Handle precompiled via in returned letters list
Precompiled letters sent via the API don’t have:
- a template
- a filename

Which means in the list of returned letters we just show ‘None’. This
commit changes this to ‘Provided as PDF’, which is how we talk about
precompiled letters elsewhere (for example in the template statistics on
the dashboard).
2020-01-02 11:30:51 +00:00
Chris Hill-Scott
f0fe532b46 Pass uploaded file name into test data 2020-01-02 11:29:01 +00:00
Chris Hill-Scott
d3dd6a31e3 Merge pull request #3236 from alphagov/returned-letters-tweaks
Returned letters tweaks
2020-01-02 10:22:51 +00:00
Chris Hill-Scott
07f2ffca25 Add govuk-link class
So it’s one less link we have to do when moving to Design System.

Co-Authored-By: Tom Byers <tombaromba@gmail.com>
2020-01-02 10:08:18 +00:00
Chris Hill-Scott
317aa53b6a Don’t specify that routes are GET only
> By default a route only answers to `GET` requests

https://flask.palletsprojects.com/en/1.1.x/quickstart/#http-methods
2019-12-31 14:49:51 +00:00
Chris Hill-Scott
7059e475c1 Make URLs consistent/hackable
We do `/things` and `/things/<thing_id>` elsewhere; let’s be consistent
here.

Means you don’t have to remember the word ‘summary’.
2019-12-31 14:44:15 +00:00
Chris Hill-Scott
227fca6263 Make appearance of ‘empty’ table rows even
Our table rows take up 65px vertical space.

We also have things that look like rows that say:
- there are no rows
- there are more rows than can be shown on screen

This commit makes them appear the same height.
2019-12-31 14:40:17 +00:00
Chris Hill-Scott
3b7dc05dd6 Add a page for each report
It’s useful to get some kind of preview of the report before you
download it.

And if there’s only a few letters in there then you might not even need
to download it at all.

For teams with lots of letters we don’t want the page to load too slowly
so let’s cap the number of displayed items to 50, same as previewing
a spreadsheet.
2019-12-31 14:39:12 +00:00
Chris Hill-Scott
9c3315f194 Add field headings to table
Headings are good for accessibility. They also are what adds the grey
border to the top of the first row in the table.
2019-12-31 14:38:32 +00:00
Chris Hill-Scott
57ca75f5bc Add download attribute to link
This forces the file to download, rather than open in the user’s
browser. We do this in other places where we let people download CSV and
PDF files.
2019-12-31 14:37:50 +00:00
Chris Hill-Scott
8bcfb2fcde Use file list pattern for list of files
This means the page has the same appearance as other lists of stuff like
the notifications page.
2019-12-31 14:37:19 +00:00
Chris Hill-Scott
fae18f3008 Put CSV extension on filename
This follows our pattern for other downloadable reports, and gives
people who know/care about stuff like file types some indication of what
they’re about to download.
2019-12-31 14:36:38 +00:00
Tom Byers
59e40d4c3c Make dashboard test more specific
It was picking up the 'Get started' text from the
new link in the footer.
2019-12-31 10:29:56 +00:00
Tom Byers
0375af3441 Revert "Turn off 'Get started' link when signed out"
This reverts commit 6b27a9e7a3.
2019-12-31 10:02:45 +00:00