Commit Graph

11975 Commits

Author SHA1 Message Date
Tom Byers
2b91d1d524 Fix mis-spelling of aria-describedby
This is currently spelt incorrectly though it
seemed to work nonetheless. Can only assume this
is a common error, for this attribute or all
attribute names, so browsers work it out.

This makes the spelling match the spec:

https://www.w3.org/TR/wai-aria/#aria-describedby
2021-10-19 11:09:37 +01:00
Tom Byers
6747bd8bcf Change layout of tour pages showing service nav
They have the service navigation inside the <main>
block. This means you can't bypass it when you use
the skiplink.

This copies other layouts that inherit from
admin_template.html and sets the contents of the
'main' template block so the service navigation is
placed before the <main> tag.
2021-10-19 11:09:36 +01:00
Tom Byers
981083d465 Add vertical spacing above set channel h1
To make it match other pages which use the legend
as the h1.
2021-10-19 11:09:17 +01:00
Ben Thorner
61b8e26b9a Merge pull request #4048 from alphagov/fix-static-assets-dev
Fix broken CSS links to assets in development
2021-10-19 10:03:10 +01:00
Ben Thorner
f8d97821a2 Fix broken CSS links to assets in development
This depends on an environment variable being set when the assets
are built in a development context [1]. Otherwise, the assets get
their '/static' prefix stripped like they do for production, which
isn't compatible with serving them under '/static' in development.

[1]: 66e5022198/gulpfile.js (L37-L41)
2021-10-18 17:32:28 +01:00
Ben Thorner
66e5022198 Merge pull request #4039 from alphagov/bump-python-client-6-3-0
Bump python-client to 6.3.0
2021-10-18 11:25:20 +01:00
Chris Hill-Scott
11610b671e Merge pull request #4041 from alphagov/mou-signatory-request-to-go-live
Put details of the organisation’s MOU signatory in the go live ticket
2021-10-15 09:42:43 +01:00
Chris Hill-Scott
a94fa760cf Merge pull request #4045 from alphagov/bump-test-dependencies
Bump test dependencies
2021-10-15 09:34:47 +01:00
Chris Hill-Scott
d162d7264d Reduce scope of content assertion
This makes it clearer which part of the content we care about.
2021-10-15 09:31:48 +01:00
Chris Hill-Scott
4a57cf0f0d Use yes/no formatter in more places 2021-10-15 09:23:32 +01:00
Chris Hill-Scott
af64da8f82 Move support ticket template into its own folder
In the future this could be a place to put other support ticket content,
if we turn them into Jinja template
2021-10-15 09:23:32 +01:00
Chris Hill-Scott
12d5c4f900 Only use ‘on behalf of’ to refer to person
Since we’ve introduced the ‘on behalf of’ wording to the go live ticket
(to talk about who the agreement has been signed on behalf of) it’s
confusing to use the same terminology to talk about the organisation
for whom the agreement has been accepted.
2021-10-15 09:23:32 +01:00
Chris Hill-Scott
c670926eaf Alias some variables
This just makes the code a bit less verbose.
2021-10-15 09:23:32 +01:00
Chris Hill-Scott
98e9749771 Refactor to put yes/no/can’t tell in one place
The code is a bit easier to follow if the same output is always coming
from the same statement in the code.
2021-10-15 09:23:31 +01:00
Chris Hill-Scott
72742cf477 Move unknown organisation logic into Jinja
Human readable content like this doesn’t really belong in the model
layer, it’s more natural to have it in the presentation layer.
2021-10-15 09:23:31 +01:00
Chris Hill-Scott
eefc903b25 Move ‘can’t tell’ message to Jinja
Human readable content like this doesn’t really belong in the model
layer, it’s more natural to have it in the presentation layer.
2021-10-15 09:23:31 +01:00
Chris Hill-Scott
d76dacc41e Move ‘agreement signed’ message into Jinja
Human readable content like this doesn’t really belong in the model
layer, it’s more natural to have it in the presentation layer.
2021-10-15 09:23:31 +01:00
Chris Hill-Scott
1ab83c48e3 Move request to go live notes into template
We can make the `as_agreement_statement_for_go_live_request` method less
complex by offloading some of the content it returns to the presentation
layer.
2021-10-15 09:23:31 +01:00
Chris Hill-Scott
ec703c5998 Add details of MOU signatory to go live ticket
This will help us monitor organisations that have signed our MOU using a
shared inbox and prevent it happening in future.

https://www.pivotaltracker.com/story/show/179782040
2021-10-15 09:23:30 +01:00
Chris Hill-Scott
fad3ff70f2 Add a formatter for yes/no
This is a bit neater than a bunch of repetetive ternary statements.
2021-10-15 09:23:30 +01:00
Chris Hill-Scott
f85ee3dd0a Move go live ticket content to a Jinja template
Jinja is a better language for doing complex templating. And we can use
the global Jinja scope to automatically get access to things like
`current_user` and our formatters.
2021-10-15 09:23:30 +01:00
Chris Hill-Scott
dd573fec87 Format organisation type nicely in go live requests 2021-10-15 09:23:30 +01:00
Chris Hill-Scott
ee3fb2f175 Pin importlib-metadata
We can’t use the latest version of importlib-metadata because it’s
pinned to <4.3 by the newest version of flake8.

The conflict is caused by:
    The user requested importlib-metadata==4.8.1
    click 8.0.1 depends on importlib-metadata; python_version < "3.8"
    pytest 6.2.5 depends on importlib-metadata>=0.12; python_version < "3.8"
    flake8 4.0.1 depends on importlib-metadata<4.3; python_version < "3.8"

Our `make freeze-requirements` task doesn’t catch this because it
doesn’t look at dependencies in `requirements-for-test.txt`. Therefore
it only freezes the version that `click` is specifying, which is the
latest version.

Pinning the version in `requirements.in` gets around this.
2021-10-13 15:59:35 +01:00
Ben Thorner
c54c9e54ed Bump python-client to 6.3.0 2021-10-13 15:46:32 +01:00
pyup-bot
29bfb227ee Update flake8-bugbear from 21.4.3 to 21.9.2 2021-10-13 13:03:39 +01:00
pyup-bot
919c530023 Update flake8 from 3.9.2 to 4.0.1 2021-10-13 13:03:39 +01:00
pyup-bot
ecb123ca8d Update beautifulsoup4 from 4.9.3 to 4.10.0 2021-10-13 13:03:39 +01:00
pyup-bot
3deaba91c3 Update pytest-xdist from 2.2.1 to 2.4.0 2021-10-13 13:03:39 +01:00
pyup-bot
a82b2979be Update pytest from 6.2.4 to 6.2.5 2021-10-13 13:03:39 +01:00
pyup-bot
9c52576872 Update isort from 5.8.0 to 5.9.3 2021-10-13 13:03:39 +01:00
Chris Hill-Scott
84195d36af Merge pull request #4030 from alphagov/update-privacy-page
Update Privacy page content
2021-10-13 12:36:06 +01:00
karlchillmaid
d87f70c5f3 Revert ‘every’ to ‘any’ 2021-10-13 12:24:11 +01:00
karlchillmaid
a1258114a5 Change ‘last updated’ date 2021-10-13 12:24:10 +01:00
karlchillmaid
ed5e50d542 Update initialisation of ‘UK’ 2021-10-13 12:24:10 +01:00
karlchillmaid
a22b834532 Update Privacy page content 2021-10-13 12:24:10 +01:00
Chris Hill-Scott
e457ccdf02 Merge pull request #4042 from alphagov/bump-werkzeug-v2.0.2
Bump Werkzeug to version 2.0.2
2021-10-13 12:10:43 +01:00
Chris Hill-Scott
c3bbc427e2 Check that user isn’t signed in before registering
Previously this test asserted on `current_user.is_authenticated`. That
isn’t possible now because the object imported into tests isn’t the same
one the app is using.

A different proxy for whether the user is signed in is whether they have
a user id in their session, because we set this every time they sign in:
ff32e73d9b/app/models/user.py (L162)
2021-10-13 11:31:27 +01:00
Chris Hill-Scott
c2d9a56ff4 Bump Werkzeug to version 2.0.2
This is the newest version.

Pyup is complaining about vulnerabilities in version 1.0.1, specifically
> Werkzeug version 2.0.2 improves the security of the debugger cookies.
> "SameSite" attribute is set to "Strict" instead of "None", and the
> secure flag is added when on HTTPS.

Previously we were using whatever version of Werkzeug that Flask
specified this pins it to get rid of the vulnerability without having to
upgrade everything at once.

This requires a few changes to tests which were relying on importing
`session` and `current_user` from Flask. Previously it seemed that
importing these in the tests referred to the same object that was being
used in the app. This appears to no longer be the case. This commit
works around that by:
- using a context manager to get the contents of the session, like we
  already do in most tests
- asserting that the mock which logs the user in is being called with
  the right values, rather than looking at the state of the
  `current_user` object (which was probably giving false certainty
  anyway)
2021-10-12 10:39:19 +01:00
Chris Hill-Scott
ff32e73d9b Merge pull request #4037 from alphagov/move-tour-end
Move end of tour route into `tour.py`
2021-10-07 10:51:19 +01:00
Chris Hill-Scott
1cc087b8de Move end of tour route into tour.py
In https://github.com/alphagov/notifications-admin/pull/3663/files we
made specific routes for sending the ‘tour’ text message, rather than
sharing the ‘one-off’ routes in `send.py`.

This commit moves the final route in the tour journey into `tour.py` as
well, which is where I expected to find it when I was looking for it
just now.
2021-10-06 13:57:03 +01:00
Tom Byers
1c68e4bb43 Merge pull request #4036 from alphagov/better-messages-alpha-how-to-pay
Update the How to pay page
2021-10-05 15:11:24 +01:00
karlchillmaid
2949f2b61c Remove contact us link 2021-10-05 12:55:06 +01:00
karlchillmaid
67b8c7166f Add introduction 2021-10-05 12:54:14 +01:00
karlchillmaid
8bed53e6d1 Merge pull request #4031 from alphagov/better-messages-alpha-sprint-2
Update introduction
2021-10-05 12:22:16 +01:00
Katie Smith
aeb3db583e Merge pull request #4035 from alphagov/no-webauthn-🤖s
Ensure only logged in users can see /webauthn/register
2021-10-05 11:47:47 +01:00
Katie Smith
5885110360 Ensure only logged in users can see /webauthn/register
There are no links to the `webauthn_begin_register` route - you are only
taken there if you are logged in and have clicked to register a key.
However, we have seen this route being crawled by bots making a GET
request which gives a `500` status code error because there isn't a
logged in current_user. For consistency, this also adds teh decorator to
the POST route.
2021-10-05 11:38:12 +01:00
karlchillmaid
825d4ecf96 Close <a> tag 2021-10-05 10:31:29 +01:00
Chris Hill-Scott
64c16cccb1 Merge pull request #4033 from alphagov/isort-no-rc
Remove deprecated command line flag to `isort`
2021-10-05 09:18:56 +01:00
Chris Hill-Scott
5c94aa004e Remove deprecated command line flag to isort
> Prior to version 5.0.0, isort wouldn't automatically traverse directories. The --recursive option was necessary to tell it to do so. In 5.0.0 directories are automatically traversed for all Python files, and as such this option is no longer necessary and should simply be removed.

— https://github.com/PyCQA/isort/blob/main/docs/upgrade_guides/5.0.0.md#--recursive-or--rc

***

We moved to version `> 5.0.0` of isort in March 2021: https://github.com/alphagov/notifications-admin/pull/3828/files
2021-10-04 14:58:29 +01:00
karlchillmaid
3cb7ecd90e Update introduction 2021-10-01 15:08:41 +01:00