Commit Graph

12032 Commits

Author SHA1 Message Date
Pea Tyczynska
00a629befc Link to downloadable report for org usage
Link is sticky so that it is easy to spot even when
an org has many services.
2021-11-17 17:58:06 +00:00
Chris Hill-Scott
ccebae6c75 Merge pull request #4055 from alphagov/fix-headings-choose-account
Fix headings on choose account page
2021-11-09 16:25:37 +00:00
Chris Hill-Scott
d0cab60885 Merge pull request #4064 from alphagov/fix-autofocus-in-some-places
Fix autofocus in places where it wasn’t working
2021-11-09 15:04:41 +00:00
David McDonald
56d6b3e533 Merge pull request #4059 from alphagov/bump-utils-to-fix-non-break-space
Upgrade utils to 48.0.0
2021-11-05 15:13:48 +00:00
Chris Hill-Scott
67d7399018 Merge pull request #4047 from alphagov/reference-new-alert
Change ‘title’ to ‘reference’ when writing alert
2021-11-05 10:01:53 +00:00
Chris Hill-Scott
538bc63f98 Autofocus old and new error messages
Previously all our error messages had the class `error-message`.

Where we are using the components from GOV.UK Frontend they have the
class `govuk-error-message`.

This makes the code which jumps focus to the first error work in both
cases.
2021-11-04 17:34:42 +00:00
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
1cc63f3db1 Merge pull request #4063 from alphagov/fix-spacing-send-one-off
Fix spacing on send one-off SMS
2021-11-04 17:13:06 +00:00
Chris Hill-Scott
95be3bd199 Merge pull request #4043 from alphagov/jinja2-version3
Require the newest version of Jinja2
2021-11-04 16:45:51 +00:00
Chris Hill-Scott
7c9345e2d3 Merge pull request #4060 from alphagov/watch-frontend
Add Makefile command to watch for frontend changes
2021-11-04 16:45:10 +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
David McDonald
b014068161 Merge pull request #4062 from alphagov/fix-edit-reply-to-email-bug
Fix edit reply to email bug
2021-11-04 15:06:20 +00:00
Chris Hill-Scott
8576b4a6f0 Fix spacing on send one-off SMS
Previous the text input on the send one off SMS page was wrapped in
an element with a class of `form-group`. We overrode the spacing on this
element to make the links under the textbox move closer to the textbox,
so that visually they group together.

This was broken when we moved to GOV.UK frontend, which uses a class of
`govuk-form-group`. This commit changes the CSS to account for both
possibilities, because the send-a-one-off-letter page is still using a
textbox, not a text input, and textboxes haven’t moved to GOV.UK
Frontend yet.
2021-11-04 12:04:32 +00:00
David McDonald
c532e57751 Dry up and standardise GET test for edit email reply to address
This moves things out of the parametrization that didn't need to be
in there and also makes the test match the test below,
test_shows_delete_link_for_error_on_post_request_for_edit_email_reply_to_address,
more closely.
2021-11-04 11:28:32 +00:00
David McDonald
b4b124d681 Fix bug with reply to email addresses
https://www.pivotaltracker.com/story/show/180026726

There was a bug where if you enter an invalid email address in
to the edit reply to email address form and click save, the
form you get shown with your error message will always contain
the field to set as default the reply to and also delete. This should
not have been the case. If you make an error on the form when
changing a reply to that is already a default, then you should not
be given the chance to change it to not default, nor should you
be able to delete it.

This commit fixes that bug by making sure the additional form fields
are only shown if the reply to being changed is not the default.
2021-11-04 11:21:58 +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
Chris Hill-Scott
795fd8f91d Add Makefile command to watch for frontend changes
When editing CSS, Javascript or other assets it’s useful to not have to
run `gulp` manually to rebuild things after making changes.

This is why we have the `npm watch` script.

However for the paths to fonts to resolve properly when running locally
it needs the `NOTIFY_ENVIRONMENT` variable set to `development`. Having
to remember to do both of these steps every time is awkward.

For a one-off build of the frontend we added a command to set
`NOTIFY_ENVIRONMENT` to the appropriate value in https://github.com/alphagov/notifications-admin/pull/4049

This commit does the same thing for the watch task, by encapsulating
both steps in one `make` command.

Happy to take alternative suggestions on command naming.
2021-11-02 15:22:57 +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
David McDonald
c6b884dcef Upgrade utils to 48.0.0
Fixes a bug with non breaking spaces being removed from templates
2021-11-01 10:22:58 +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
151a61f7d3 Fix headings on choose account page
You’re supposed to see the two column layout on this page if you have
multiple categories of things to show.

We weren’t counting the ‘platform admin’ section as one of these
categories so platform admin users with only live services or only trial
mode services were inadvertenly seeing a mixture of the one column and
two column layout.

Also this logic around the headings wasn’t tested before – now it is.
2021-10-26 15:06:43 +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