Commit Graph

12014 Commits

Author SHA1 Message Date
Chris Hill-Scott
e3089af1ef Add test coverage for configuration of autofocus
This commits adds test coverage for ther HTML in several of the forms
which had broken autofocus.

It means that if we make changes to the HTML which triggers autofocus in
the future it should be more obvious that something is depending on the
attributes being added/removed.
2021-11-04 17:34:41 +00:00
Chris Hill-Scott
edd2a04c7a Make autofocus work on all form elements which ask for it
In 674c27a693 we updated the autofocus
Javascript to be compatible with GOV.UK Frontend textboxes, which have
the `data-module` attribute set on the `input` element, rather than on
a wrapper element.

However we still have some `<textarea>`s and `<input>`s which haven’t
moved to GOV.UK Frontend and therefore aren’t getting picked up by the
Javascript which is supposed to focus them.

This commit makes the Javascript work with both kinds of textbox, which
is needed until we move entirely to GOV.UK Frontend.
2021-11-04 16:26:12 +00:00
Tom Byers
1c2b65356f Merge pull request #4053 from alphagov/area-list-items-high-contrast-fixes
Replace 'x' psuedo element with SVG
2021-11-03 11:49:50 +00:00
Katie Smith
3e19874329 Merge pull request #4061 from alphagov/python39
Update app to use Python 3.9
2021-11-03 10:54:28 +00:00
Tom Byers
21999f152a Remove extra group from remove SVG
The SVG used for the 'X' in the remove area button
has 2 <g> (group) elements, one wrapping
everything and one wrapping the two lines that
make the cross. The first <g> isn't needed and
means that the SVG ends up with 2 accessible
names:
1. the <svg> element gets named with the text from
   the <title> because of it's aria-labelledby
   attribute referencing it
2. the first <g> gets named with the text from
   the <title> because the algorithm that gets the
   name looks for any descendent <title>s

This removes the first <g> so only the accessible
name for the <svg> gets announced.
2021-11-03 10:33:10 +00:00
Katie Smith
6b24b3072c Fix failing test with new Python version
This test is now failing due to the combination of both Werkzeug having
had a major version bump in a previous PR and the Python version
changing. Calling `current_service` is now giving an error when trying
to get the `service` from the `_request_ctx_stack` because
`_request_ctx_stack` has no `service` attribute. There was no error
before, so it appears some underlying behaviour has changed. I've fixed
the test by changing the setup, but there is no effect on production
code - when the app is running `load_service_before_request` is called
before every request.
2021-11-03 09:47:17 +00:00
Katie Smith
fdfdb9e498 Update runtime.txt and README.md to Python 3.9 2021-11-02 16:09:56 +00:00
Katie Smith
2ad5712467 Freeze requirements
This is the results of running `make freeze-requirements` with the
Python version set to 3.9.
2021-11-02 15:58:52 +00:00
Tom Byers
7e2bd45c73 Stop 'remove' button depression when active
Noticed by @quis in
https://github.com/alphagov/notifications-admin/pull/4053#issuecomment-957702649

The 'top' position from the GOVUK Frontend button
styles is overriding our 'top' position.

This adds some extra CSS to repeat the 'top'
position in the :active state.
2021-11-02 15:11:43 +00:00
Tom Byers
b1ab167e1d Tweak spacing, size and hover state when focused
The size and position of the 'X' has deviated a
bit from the design intentions of the original.

The original shared the x-height of the area text
and has positioned to be vertically and
horizontally centered.

These changes assume an x-height of 11px and use
flexbox to center the new 'X' horizontally and
vertically.

This also tweaks the visual state when focused and
then hovered so matches other buttons without
breaking the design.
2021-11-02 11:51:54 +00:00
Tom Byers
c34fd4de6e Make remove ('x') links buttons
The text never had underlines like our other
link-button components so always looked like
buttons. If they look like buttons, they should
act like them too and have those semantics.

This give them a role of button and uses the class
and data attribute for the button component from
GOVUK Frontend to make them work like one.

These changes include a fair amount of styles to
override those the govuk-button class brings in.
I've tried to mark those ones to at least make
that obvious.
2021-11-02 11:51:53 +00:00
Tom Byers
9d59edb3ce Replace 'x' psuedo element with SVG
The current link button for removing an area is
created using a psuedo element with an 'x' as
content.

The inline box for the 'x' overlapped its parent.
This is visible in high contrast mode, breaking the
parent's border. Despite existing in CSS, the 'x'
is also announced by screen readers, which is not
what we want.

This changes it to be an inline SVG with a role of
image. It doesn't require as large an inline box
so doesn't cause visual issues in high contrast
modes. It also means we can set it's label similar to
how you would an image's alt text, giving us
control over what is announced by screen readers.

This commit also includes some extra CSS,
targeting high contrast modes, giving the
link button the following when viewed in those
modes:
- a complete border so it is
  distinguishable from the list item
- a focus style
2021-11-02 11:51:44 +00:00
Tom Byers
82eaf4e40c Merge pull request #4058 from alphagov/update-accessibility-statement
Bump due dates on accessiblity statement
2021-10-29 10:27:13 +01:00
Tom Byers
b61b15d5b9 Bump due dates on accessiblity statement
Work prepping the interface that will be used for
emergency alerts for its accessibility audit has
taken priority so the issues in this statement
will need to be worked on later than we expected
when we originally set the dates for them to be
fixed.

This moves the work forward to be started after
the emergency alerts work is complete.
2021-10-28 11:44:16 +01:00
Chris Hill-Scott
f803bf468f Merge pull request #4052 from alphagov/broadcast-event-field
Prefer `event` to `reference` when referring to an alert
2021-10-28 10:43:44 +01:00
Chris Hill-Scott
bc06b47a92 Delete unexpected test case 2021-10-28 10:31:02 +01:00
Chris Hill-Scott
ca3d696bc1 Delete unexpected test case 2021-10-28 10:24:41 +01:00
Chris Hill-Scott
cd86035588 :Use more realistic test data 2021-10-28 10:24:40 +01:00
Chris Hill-Scott
1334538cad Prefer cap_event to reference when referring to an alert
`reference` isn’t very human-friendly – the Environment Agency just
supply a UUID in this field.

The Environment Agency also populate the `<event>`` field with some
human readable text, for example:

> 013 Issue Severe Flood Warning EA

(013 is an ‘area code’ which will be meaningful to the Flood Warning Service team)

This commit changes the frontend to display the value of the `cap_event`
field, if it’s present, which is where the API stores the value of the
`<event>` field from the original CAP XML.

***

Depends on:
- [x] https://github.com/alphagov/notifications-api/pull/3344/files
2021-10-28 10:24:32 +01:00
Chris Hill-Scott
673d6debbe Merge pull request #4057 from alphagov/bump-utils-47.0.1
Bump utils to 47.0.1
2021-10-28 10:22:50 +01:00
Chris Hill-Scott
873cfaf7a0 Bump utils to 47.0.1
Changes:
https://github.com/alphagov/notifications-utils/compare/46.1.0...47.0.1

The breaking change is due to the removal of ZendeskClient.create_ticket
which this app is no longer using.

> Although this is a breaking change to the ZendeskClient, nothing is
> using the code that was deleted.

— https://github.com/alphagov/notifications-utils/pull/902#discussion_r720095133
2021-10-28 09:33:03 +01:00
Chris Hill-Scott
a3c787dfba Merge pull request #4056 from alphagov/refactor-branding-request-ticket
Refactor branding request ticket into template
2021-10-27 11:07:08 +01:00
Chris Hill-Scott
e675500ac2 Move branding info from model
This was an awkward property to have in a model class because
- it’s presentation not data about the object
- it munged together data from a different object, so it wasn’t well
  encapsulated

This commit moves the logic to the template, where it can reference the
`Organisation` and `User` models directly.
2021-10-26 18:14:09 +01:00
Chris Hill-Scott
a145c501ab Use Jinja template for branding request tickets
Following the pattern established by
https://github.com/alphagov/notifications-admin/pull/4041/files
this commit move the ticket message from a Python f-string to a proper
templating language.
2021-10-26 18:14:09 +01:00
Chris Hill-Scott
2308dad0d2 Merge pull request #4051 from alphagov/non-flask-dependencies
Update some non-controversial dependencies
2021-10-21 11:23:05 +01:00
Leo Hemsted
9a576caf66 Merge pull request #4050 from alphagov/message-status-url-fix
fix link in delivery status page
2021-10-20 15:23:45 +01:00
Chris Hill-Scott
a583999725 Freeze requirements 2021-10-20 15:02:53 +01:00
pyup-bot
908bea2163 Update pytz from 2021.1 to 2021.3 2021-10-20 14:50:12 +01:00
pyup-bot
15099fe680 Update humanize from 3.6.0 to 3.12.0 2021-10-20 14:50:12 +01:00
pyup-bot
a7205af257 Update pyexcel-xls from 0.6.2 to 0.7.0 2021-10-20 14:50:12 +01:00
pyup-bot
d374dcc10e Update pyexcel-io from 0.6.4 to 0.6.5 2021-10-20 14:50:12 +01:00
pyup-bot
7d3ac30d58 Update pyexcel from 0.6.6 to 0.6.7 2021-10-20 14:49:42 +01:00
Leo Hemsted
5e36061df6 fix link in delivery status page 2021-10-20 11:39:05 +01:00
Tom Byers
b8745e7b18 Merge pull request #4038 from alphagov/fix-small-issues
Fix small accessibility issues with alerts pages
2021-10-19 11:26:22 +01:00
Ben Thorner
1959128736 Merge pull request #4049 from alphagov/fix-dev-assets-again
Fix static assets in development (again)
2021-10-19 11:21:32 +01:00
Tom Byers
0987787df6 Give map attribution links an underline
Makes them identifiable as links based on
something other than just colour.
2021-10-19 11:09:40 +01:00
Tom Byers
b968c0299e Change map key items from list to paragraphs
I recently found that there is a problem with the
overuse of lists online for sequences of content
that don't need to be in a list. I think that's
what we're doing with our map key.

The problem is large enough that browsers include
heuristics to determine if lists should be
presented as such to the accessibility API (and so
to assistive tech' like screen readers). This
thread contains more details:

https://twitter.com/cookiecrook/status/1337226933822603270

Based on the metric described in the thread:

'If all of the styles that make it “list-like”
have been removed, it’s no longer relevant to
convey it as a list.'

...or

'if a sighted user doesn’t need to know it’s a
list, why would a screen reader user need to know
or want to know?'

Based on that, I think the items in our map key
should be paragraphs, not items in a list.

Also, they read really well as sentences when
announced by a screen reader, partly because of
the extra (hidden) info @quis added to them.
This also doesn't change their visual appearance.
2021-10-19 11:09:39 +01:00
Tom Byers
87eb06f2ce Remove region role from live-search status
The Siteimprove accessibility testing tool raised
an issue with our having a div with role=region in
the page that was:
- empty
- with no label

The status has a role of 'region' which makes it a
generic landmark. This means that, unlike <nav>
or <footer>, users don't get any hint of its
purpose from its HTML tag. If we did want this,
we'd have to give it a label to explain that.

I don't think we do want those things. I think
it's more of a sentence that sits between the
searchbox and the results, just saying how many
are there.

That being the case, we should just remove the
role. It's also what design system do with their
character count, which is similar:

https://design-system.service.gov.uk/components/character-count/

Unlike that component, I don't think we need to
use aria-describedby to set the status as the
description of the searchbox because it describes
the results, not the search term.
2021-10-19 11:09:38 +01:00
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
1869f9a53a Fix static assets in development (again)
Previous attempt: https://github.com/alphagov/notifications-admin/pull/4048

The problem with the previous attempt is that the assets built on
CI become part of the build artefact used for production [1]. This
switches back to my original approach of using environment.sh, but
with a technique to cope with it being absent on CI. I've tested it
works with and without an environment.sh file.

Note that "npm install" is fine to be on a separate line, since a
non-zero exit code will always cause "make" to stop.

[1]: https://github.com/alphagov/notifications-aws/blob/master/concourse/templates/admin.yml.j2#L47
2021-10-19 11:08: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