Commit Graph

11166 Commits

Author SHA1 Message Date
Katie Smith
d563cc8432 Change wording for hidden text on job page
To use the singular for the total message box.
2021-02-26 14:55:14 +00:00
Tom Byers
7b67fc5f32 Fix aria on collapsed checkboxes fieldset
The fieldset that wraps the collapsible checkboxes
has an aria-describedby to make the summary its
accessible description.

This needs to point to the id of the summary but
the summary didn't have one.

These changes add the id and fix a fixture in the
tests for this module.
2021-02-25 14:00:16 +00:00
Katie Smith
82318387de Add hidden text for pills on job page
The links in the blue boxes on the job page needed hidden text so that
they work out of context. This changes the text from "10 sending" to "10
sending text messages" (with the message type hidden text).
2021-02-24 14:36:21 +00:00
Katie Smith
6512b8fad3 Add descriptive links to API keys page
The links had no descriptive text, so all read 'Revoke'. This adds
hidden text specific to the item they relate to.
2021-02-24 14:36:21 +00:00
Katie Smith
e7d6a2ea0d Add descriptive links to /service-settings/letter-contact-details
The links had no descriptive text, so all read 'Change'. This adds
hidden text specific to the item they relate to.
2021-02-24 14:36:21 +00:00
Katie Smith
4f7b08512a Add descriptive links to /service-settings/sms-senders page
The links had no descriptive text, so all read 'Change'. This adds
hidden text specific to the item they relate to.
2021-02-24 14:36:21 +00:00
Katie Smith
0416b841b3 Add descriptive links to /service-settings/email-reply-to page
The links had no descriptive text, so all read 'Change'. This adds
hidden text specific to the item they relate to.
2021-02-24 14:36:21 +00:00
Katie Smith
1f9ea4a72f Stop adding required attribute to WTForm fields
WTForms now renders the `required` attribute if there is a validator
such as `DataRequired`. This was flagged in an accessibility audit as
being unnecessary since it doesn't conform to the Design System
recommendations, which state that "all form fields are considered
mandatory when navigating a government service unless otherwise denoted
by the word ‘(optional)’."

This uses the approach here https://github.com/wtforms/wtforms/pull/361
to overwrite the `render_field` method.
2021-02-24 14:36:21 +00:00
Katie Smith
a2147e9c84 Merge pull request #3814 from alphagov/bin-old-upload-document-stuff
Stop checking for upload_document permission
2021-02-24 11:01:34 +00:00
Katie Smith
d7e56f6956 Stop checking for upload_document permission
All services have the `upload_document` permission now, so we don't need
to check for it on the email formatting page. This also deletes a test
which is not needed now.
2021-02-24 10:54:42 +00:00
Katie Smith
cc06d3bbd8 Merge pull request #3812 from alphagov/new-inset-text-macro
Use the GOVUK Frontend inset text component instead of <aside>
2021-02-24 10:51:35 +00:00
Leo Hemsted
a85e20ed3e Merge pull request #3815 from alphagov/permissions-bug
allow caseworkers to view letter previews
2021-02-23 16:57:34 +00:00
David McDonald
0776a95942 Merge pull request #3794 from alphagov/broadcast-service-settings
Broadcast service settings
2021-02-23 16:26:12 +00:00
Leo Hemsted
087f908968 allow caseworkers to view letter previews
they can already view notifications page, but the png and pdf letter
previews just 403 for them currently.
2021-02-23 16:08:03 +00:00
David McDonald
1935d5f973 Improve test name for clarity 2021-02-23 16:03:16 +00:00
David McDonald
d22a852b5e Make fixtures more DRY
Moves a commonly used fixture into
`mock_get_service_settings_page_common` so we don't need to keep writing
it every time.

Note, we may be able to do similar in the future with

- single_reply_to_email_address
- single_letter_contact_block
- single_sms_sender

but need a bit more thought about fixing tests that would fail due to
this change and need tweaks to the order of their arguments.
2021-02-23 16:03:15 +00:00
David McDonald
f8f3d44511 Add form to set service broadcast account type
Note, no option at the moment to set the service broadcast account type
as None, or back to without the broadcast permission. This has been done
for speed of development given the chance of us needing this is very
low. We can add it later if we need to.
2021-02-23 16:03:14 +00:00
David McDonald
6837b76d44 Remove existing broadcast permission form
This will be replaced by a new form that has it's own template, route
etc as it will vary quite a lot from the existing service permission
form.
2021-02-23 16:03:13 +00:00
David McDonald
67d07e4135 Remove option to put service live if broadcast service
Whether a service is live or not will be controlled from the broadcast
service settings page once a service is given the broadcast permission
2021-02-23 16:03:12 +00:00
Ben Thorner
5a7132e9c9 Merge pull request #3811 from alphagov/refresh-dev-tasks
Simplify README and consolidate scripts
2021-02-23 15:01:11 +00:00
Katie Smith
792860085e Get rid of unecessary <div> and use the correct gutter class
* We don't need the inset text to be inside `<div>` tags because the
component adds its own
* Replaced `bottom-gutter` with `govuk-!-margin-bottom-6` since this
change will be needed across the app at some point.
2021-02-23 13:16:25 +00:00
Katie Smith
9ee2c3946a Use inset-text component for template formatting partials
This adds spacing classes from the design system where necessary to keep
the spacing looking the same.

It also replaces the `<aside>` elements with a `<div>` on the edit
template pages. The accessibility audit noted that these were inside a
`<main>` element, so screen readers may not be able to navigate the
elements correctly.
2021-02-23 13:02:50 +00:00
Katie Smith
79a0a14b38 Copy inset-text component from GOV.UK Frontend 2021-02-23 13:02:50 +00:00
Katie Smith
ac794dbc5b Add Sass for GOV.UK Frontend inset-text 2021-02-23 13:02:50 +00:00
David McDonald
22c0c0493c Merge pull request #3813 from alphagov/bump-pyyaml
Rerun freeze-requirements
2021-02-23 12:00:12 +00:00
David McDonald
5d3054ba7a Rerun freeze-requirements
This importantly upgrades pyyaml which has a security bug in 5.3.1

Note, strangely, I had to delete the requirements.txt file and rerun to
get these requirements to upgrade, otherwise it kept them in place
(maybe some piptools caching stuff not calculating things if it doesn't
think it has been asked to change them).
2021-02-23 11:51:09 +00:00
Ben Thorner
86929df84e Remove other unused rules in Makefile
These aren't referenced anywhere. Some are repeated in other rules,
and if necessary it should be easy to type the commands.
2021-02-22 17:21:01 +00:00
Ben Thorner
423b4c7812 Revise final sections of the README
This makes a few additional changes to curb the length of this file,
by moving length documentation (the picture is large) into a separate
file, where other documentation could go. It also corrects the section
on requirements, and attempts to make it more concise.
2021-02-22 17:19:46 +00:00
Ben Thorner
864f4bef66 Revise README to be similar to API app
This restructures the sections based on what we agreed for the API
repo.
2021-02-22 17:19:30 +00:00
Ben Thorner
c1cbd9c34a Remove redundant parts of the README
These aren't specific to this repo, and are covered more generally
in the Wiki [1]. Note that:

- The claim about needing multiple Python versions is not true.
- The NPM instructions should be covered by the "make bootstrap".
- The version of Node/NPM is covered by installing the latest one.

[1]: https://github.com/alphagov/notifications-manuals/wiki/Getting-Started
2021-02-22 17:04:41 +00:00
Ben Thorner
ff035bfe8e Revise section on setup
This is now closer to the recently revised README for the API repo.
2021-02-22 16:56:09 +00:00
Ben Thorner
c7423bc8ca Swap FLASK_DEBUG for FLASK_ENV
This achieves the same thing and gets rid of the warning about being
in a production environment when the app starts up.
2021-02-22 16:54:56 +00:00
Ben Thorner
dfb767d57e Move bootstrap tasks into the Makefile
This is more consistent with how we run all other tasks. Note that
the virtual env setup is not generally applicable, and developers
of this repo should follow the guidance in the README.
2021-02-22 16:53:54 +00:00
Ben Thorner
f6cdf999fe Remove unused files in scripts/ 2021-02-22 16:48:16 +00:00
Ben Thorner
8704f4dfdd Revise section about AWS setup
This is covered in Wiki in more detail. Note that only parts of the
app itself (vs the API app) require these credentials.
2021-02-22 16:44:13 +00:00
Ben Thorner
b2ae52fa11 Remove section about virtualenv
This is covered generically in the Wiki [1].

[1]: https://github.com/alphagov/notifications-manuals/wiki/Getting-Started#development-environment
2021-02-22 16:42:23 +00:00
Ben Thorner
36a806e8bf Switch to 'make' for running app processes
These are simple enough that they don't need their own scripts.
2021-02-22 16:41:30 +00:00
Ben Thorner
2af1d6f159 iRemove redundant Docker tasks
Nothing and no one uses these.
2021-02-22 16:38:27 +00:00
Tom Byers
df7a7dba79 Merge pull request #3807 from alphagov/remove-duplicate-id-from-scrollable-table
Remove id from table used for the row numbers
2021-02-19 14:31:34 +00:00
Chris Hill-Scott
c47b861814 Merge pull request #3808 from alphagov/add-test-area
Add library of test areas
2021-02-19 12:19:01 +00:00
Chris Hill-Scott
f55a8bf4b8 Add library of test areas
This is a temporary addition so we can test out some functionality.
2021-02-19 11:35:51 +00:00
Tom Byers
4dcdb83e44 Remove id from table used for the row numbers
The fullscreenTable component has 2 layers to the
table you see onscreen:
1. the actual data table
2. a clone, with only the first column showing,
   that sits on top so the row numbers stay in
   place while you scroll

Table 1. has an id attribute on its caption. The
region wrapping it has an aria-describedby
attribute with the id as its value. This makes the
caption the description for the region.

This isn't needed for the clone and
makes the HTML invalid because ids should be
unique.

This removes the id from the cloned table.
2021-02-18 15:08:27 +00:00
Ben Thorner
b4b1fd641c Merge pull request #3805 from alphagov/retry-pyup-07
Fix issues with dependencies and upgrade them
2021-02-17 11:51:50 +00:00
Ben Thorner
1c1dd8c96f Merge pull request #3796 from alphagov/handle-duplicate-org
Handle exception is org name already exists
2021-02-17 09:58:11 +00:00
Ben Thorner
5c2cdf6250 Remove redundant import of Mock and ANY
It's conventional to use the "mocker" fixture to access these.
2021-02-17 09:34:34 +00:00
Ben Thorner
00cc67f813 Inline duplicate service fixture with test
Similarly to the previous commit, this fixture is only used once,
so can benefit from being inline with its test.
2021-02-17 09:34:33 +00:00
Ben Thorner
52a5da4d17 Handle exception is org name already exists
Previously this would return a 500 error, as the 400 exception was
not handled from the API [1]. Note that:

- We tend to rely on exception messages to identify the error that
occurred [2][3], with services being a notable deviation [4]. I've
used the exception message approach, as this is more granular and
broadly consistent with the rest of the app.

- There is already code to cover this scenario when a user changes
the name of an existing organisation or service, but the mechanism
is different [5][6]. It makes sense to just get any error from the
call to try and create the organisation.

- The API mock is based on one for services [7], but I've chosen to
have it inline with the test, since we're unlikely to reuse it, and
it's clearer to have the test setup as part of the test.

[1]: 8f99da525d/app/organisation/rest.py (L34-L47)
[2]: 70b606a2d4/app/main/views/manage_users.py (L166)
[3]: 70b606a2d4/app/main/views/templates.py (L499)
[4]: 70b606a2d4/app/main/views/add_service.py (L30)
[5]: 70b606a2d4/app/main/views/service_settings.py (L102-L104)
[6]: 70b606a2d4/app/main/views/organisations.py (L264-L266)
[7]: 0abc143147/tests/conftest.py (L590-L606)
2021-02-17 09:34:30 +00:00
Ben Thorner
765c8ddbe2 Keep test dependencies as-is for now
These are leading to multiple failures:

- flake8 fails with various issues
- isort fails with various issues
- pytest fails on a couple of 2FA tests

While we can and should upgrade these dependencies, the priority is
fixing the build so that we can do this reliably.
2021-02-16 18:09:52 +00:00
Ben Thorner
5d946c9d0b Run 'make freeze-requirements' to fix install errors
This downgrades various packages so they are mutually compatible
and "pip install -r requirements.txt" succeeds.

This downgrades to pyyaml 5.3.1, despite it having a security issue,
in order to fix the build for the time being. This also downgrades
dnspython, due to a suspected issue with eventlet [1], which caused
the admin app to start failing with errors like this:

  File "/home/vcap/deps/0/python/lib/python3.6/site-packages/urllib3/connectionpool.py", line 1010, in _validate_conn
    conn.connect()
  File "/home/vcap/deps/0/python/lib/python3.6/site-packages/urllib3/connection.py", line 394, in connect
    cert_reqs=resolve_cert_reqs(self.cert_reqs),
  File "/home/vcap/deps/0/python/lib/python3.6/site-packages/urllib3/util/ssl_.py", line 303, in create_urllib3_context
    context.options |= options
  File "/home/vcap/deps/0/python/lib/python3.6/ssl.py", line 465, in options
    super(SSLContext, SSLContext).options.__set__(self, value)
  File "/home/vcap/deps/0/python/lib/python3.6/ssl.py", line 465, in options
    super(SSLContext, SSLContext).options.__set__(self, value)
  File "/home/vcap/deps/0/python/lib/python3.6/ssl.py", line 465, in options
    super(SSLContext, SSLContext).options.__set__(self, value)
  [Previous line repeated 280 more times]
  RecursionError: maximum recursion depth exceeded while calling a Python object

[1]: https://github.com/eventlet/eventlet/pull/684
2021-02-16 18:09:51 +00:00
Ben Thorner
627e4e41ab Stop locking non-test dependencies twice
Currently we have a situation where we're not running tests against
new versions of dependencies, as requirements_for_test.txt is not
being kept in-sync with requirements.txt by pyup. Deploys are only
working because Concourse silently ignores version issues.

From a deployment log:

awscli 1.18.211 has requirement PyYAML<5.4,>=3.10; python_version != "3.4", but you'll have pyyaml 5.4 which is incompatible.

This switches to a single requirements file for test dependencies,
in order to keep it in-sync with requirements.txt i.e. we run our
tests against the same versions of dependencies that we deploy with,
and the build fails if we try to use package versions that are not
mutually compatible, as this example PR shows [1].

ERROR: Cannot install -r requirements_for_test.txt (line 17), -r requirements_for_test.txt (line 198) and pyyaml==5.4.1 because these package versions have conflicting dependencies.

We shouldn't need to have fine-grained locking on test dependencies,
beyond those we want to list manually in the file.

[1]: https://github.com/alphagov/notifications-admin/pull/3804
2021-02-16 18:09:47 +00:00