Commit Graph

9195 Commits

Author SHA1 Message Date
Rebecca Law
40575bbb75 Rebase pytest 5 changes
Add to field in creation of notification
2020-01-10 16:06:04 +00:00
Rebecca Law
9d1f92a752 Strip the trailing comma on the first line of an address block. 2020-01-10 16:06:04 +00:00
Rebecca Law
f7b3f9b06a - Remove the trailing comma from the first line of the "to" field
- Add client_reference to the activity CSV report
- Show the recipient on the CSV report the same way as the view activity page.
2020-01-10 16:00:40 +00:00
Rebecca Law
57b4fa0397 Use splitlines instead of split 2020-01-10 16:00:40 +00:00
Rebecca Law
f8e7635a1d Show the first line of the address from the to field.
Now persisting the address to the "to" field of the Notification, after the notification has been validated.
If the letter is pending validation, then "Checking..." will appear as the identifier for the letter.
If the letter has passed validation, then the first line of the address (now persisted in the "to" field) will be displayed, with the client reference underneath.
If the letter has failed validation the "Provided as PDF" will show be displayed, which is now the initial value of the "to" field.
2020-01-10 16:00:40 +00:00
Rebecca Law
47ec4912db Merge pull request #3253 from alphagov/new-no-address-message
Added a new error message when the letter is missing an address block.
2020-01-10 15:44:47 +00:00
Katie Smith
72b02f27e9 Merge pull request #3252 from alphagov/test-refactor
Refactor conftest.py
2020-01-10 15:17:09 +00:00
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
Katie Smith
8e9b7ae368 Remove arguments from fixtures
These can't be used, since we fixtures can no longer be called as if
they were functions, so we can simply the code by removing them.
2020-01-10 12:17:56 +00:00
Katie Smith
17f72dc4cd Delete unused fixtures 2020-01-10 10:52:40 +00:00
karlchillmaid
3972a52aab Remove lead in line before table 2020-01-09 17:09:25 +00:00
Tom Byers
22abc7c5c4 Add captions to tables on cookies page 2020-01-09 17:08:02 +00:00
Tom Byers
74bb914d37 Remove line-break from cookies page paragraph 2020-01-09 16:58:23 +00:00
karlchillmaid
9639fb17ee Update description of what the cookies do
Update description of what information the cookies capture
2020-01-09 16:55:02 +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
Tom Byers
24b65cf648 Change size and layout of cookie banner buttons 2020-01-09 16:21:12 +00:00
Tom Byers
f8a51f0b3e Remove unused argument from cookie_banner macro 2020-01-09 16:12:45 +00:00
Tom Byers
07ca407343 Make 'Hide' button identify as a link
It looks like a link so its semantics should
identify it as one.

This can effect users of speech recognition
software, in scenarios where they instruct it to
click an element which looks like one thing but
the software can only identify as something else.
2020-01-09 16:12:36 +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
karlchillmaid
045597403f Update cookies content 2020-01-09 09:54:14 +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
karlchillmaid
8dd2dc22f4 Change 'we' to 'Notify'
Makes the meaning a bit clearer
2020-01-09 09:38:26 +00:00
karlchillmaid
458f308f56 Replace negative contraction
Replace negative contraction.

GDS style guide: https://www.gov.uk/guidance/style-guide/a-to-z-of-gov-uk-style#contractions
2020-01-09 09:31:32 +00:00
Tom Byers
7d31431cef Fix test description 2020-01-08 17:48:37 +00:00
Tom Byers
40ac30a96d Add hidden text to cookie banner buttons
Visual users get the context from the proximity to
the h2 but we need to provide this for others.

I've tried using `aria-describedby` to link them
to the h2 but this ends up making the h2 text the
button's description in the accessibility tree. In
Voiceover this means you only get that information
as extra context, announced a while after the
label if the VO cursor stays on the button.

We want all the information in the accessible
label so chose this approach instead.
2020-01-08 17:03:04 +00:00
Tom Byers
d045316454 Change banner content to just cover analytics
Follows discussions with @quis, @yahoopete and
@karlchillmaid.
2020-01-08 17:02:31 +00:00
Tom Byers
f156fe2e95 Hide cookie banner if no-js
Decided in discussions with @quis and @yahoopete
that users without JS available cannot
accept/reject analytics cookies so the banner has
no use.
2020-01-08 10:23:52 +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
Chris Hill-Scott
82a71c67df Make button more buttony
`role=button` for users of voice control software

`draggable=false` as per https://github.com/alphagov/govuk-frontend/pull/1020
2020-01-08 09:50:50 +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
Tom Byers
73c531f70d Improvements based on frontend feedback
Paired with @aliuk2012 on the implementation and
with a view to making the component generic enough
to be used on digital marketplace apps as well.
These changes came from that session.

They include:
- removal of an unused `data-accept-cookies`
  attribute
- removal of `govuk-!-padding-top-4` class and
  moving of associated styles into component CSS
- swapping out the `aria-label` on the parent
  element for an `aria-describedby` linked to the
  h2 to have one thing labelling the banner region
- removal of unused CSS and any already provided
  by the govuk-button class
- inclusion of @import's for styles attached to
  govuk-body and govuk-button classes
2020-01-06 16:52:03 +00:00
Tom Byers
900aa19bd3 Add JS tests for analytics & cookies JS
Includes:
- tests for the analytics interface ported from
  GOVUK Frontend Toolkit
- tests for the cookie banner that appears on all
  pages except the cookies page
- tests for the cookies page JS
- tests for the hasConsentFor function
- adding a deleteCookie helper to remove
  cookies during tests
- polyfill for insertAdjacentText

The last one is because JSDOM doesn't support
insertAdjacentText but our target browsers
do. This polyfill also includes one for
insertAdjacentHTML.
2020-01-06 13:38:34 +00:00