Commit Graph

12003 Commits

Author SHA1 Message Date
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
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
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