Commit Graph

8202 Commits

Author SHA1 Message Date
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
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
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
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
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
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
karlchillmaid
3cb7ecd90e Update introduction 2021-10-01 15:08:41 +01:00
Chris Hill-Scott
975088308a Put media query after default CSS
Specificity means that the media query will always override, but this is
more obvious with the order this way around.
2021-09-30 15:07:22 +01:00
Chris Hill-Scott
eee4cdd0a7 Rewrite media queries to be mobile-first
Also adds height: 100% which forces the SVG to scale, rather than just
setting width which widens the viewbox.
2021-09-30 14:19:27 +01:00
Chris Hill-Scott
c63313e839 Give WebAuthn illustration a fixed size
The browser uses the `width` and `height` attributes of the image tag to
allocate space on the page for the image.

If these aren’t provided then the browser will assume the image takes up
no space, until it’s downloaded it and had a look at what the file’s
dimensions are. This causes the layout of the page to jump once the
image downloads.

`149 × 150px` is the native size of the image. But we don’t want it to
display at that size, so this commit also adds some extra CSS which
keeps it looking the same, namely:
- the full width of the 1/4 page column on desktop
- the full width of the column minus a `40px` gutter either side on
  mobile (by using `box-sizing: border-box` the `40px` of padding is
  subtracted from the 100% width, rather than added to it)
2021-09-30 14:19:27 +01:00
Chris Hill-Scott
28f26e0056 Merge pull request #4029 from alphagov/copy-clipboard-key-value-styles
Fix styles for API key value not being applied
2021-09-30 11:09:22 +01:00
Katie Smith
a54b3c9f77 Pass valid ticket type to Zendesk
The feedback endpoints use `ticket_type` to decide what to display and
whether or not a ticket should be escalated. We were using the
ticket_type as the value for the Zendesk ticket_type. However, the Zendesk
API accepts 4 values for its ticket_type and these are different from
the ticket_type values we use in our code.

This change converts the Notify ticket_type value to a valid Zendesk
ticket_type value when creating a Notify feedback ticket.
2021-09-29 10:37:01 +01:00
Katie Smith
437af32d82 Use Zendesk form for general enquiries 2021-09-29 10:30:32 +01:00
Katie Smith
e9948a0234 Use Zendesk form for branding requests
This changes the Zendesk tickets created when an email or letter
branding request is submitted to use the new Zendesk Form that was
introduced in https://github.com/alphagov/notifications-utils/pull/899
2021-09-29 10:30:32 +01:00
Chris Hill-Scott
bc5745c77b Fix styles for API key value not being applied
When the component was renamed from ‘API key’ to ‘Copy to clipboard’ the class for the thing to be copied changed from `api-key__key` to `copy-to-clipboard__value`. While the CSS was updated to reflect the change from `api-key` to `copy-to-clipboard` the change from `__key` to `__value` was not made.

Before: 4921e6d46e/app/templates/components/api-key.html
After: 85f6881a56/app/templates/components/copy-to-clipboard.html

This commit changes updates the CSS to reflect the latter change, so that the styles get applied properly.
2021-09-28 15:30:44 +01:00
Katie Smith
c76cd82a97 Merge pull request #4024 from alphagov/new-zendesk-form
Use Zendesk form for go live requests
2021-09-23 09:20:47 +01:00
Tom Byers
87f54d1e88 Replace diffDOM library with domdiff
A while ago diffDOM moved its code to use ES6
modules and started using various language
features specific to ES6. These two things
happened independently btw.

The result of this is that the version of diffDOM
suitable for our build pipeline, structured as an
immediately invoked function evocation (IIFE),
now requires polyfills of some ES6 features to
work in the older browsers we support, like IE11.

It's also worth noting that in the move to ES6
the maintainers of diffDOM have adopted a process
whereby users who need to support older browsers
now have to add polyfill code for any ES6 features
they choose to use.

This commmit proposes a move to the domdiff
library instead because:
- it runs on all javascript runtimes with no
  polyfills
- it is 2KB instead of diffDOM's 25KB

Domdiff takes a different approach to diffDOM, in
that it compares existing nodes and new nodes and
replaces the existing ones with the new ones if
there are differences. By contrast, diffDOM will
make in-place changes to nodes if there are enough
similarities. In other words, in most situations,
diffDOM won't change the node in $component
whereas domdiff will.

Because of this, I've had to change the
updateContent.js code to cache the data-key
attribute's value so we don't lose access to it by
overwrite the $component variable with a different
jQuery selection.
2021-09-22 12:05:47 +01:00
Katie Smith
d41185db5f Delete unused template
`delete.html` hasn't been used since e89f89bd11
2021-09-22 12:00:05 +01:00
Katie Smith
39c26f5bfb Create go-live support tickets using the new way
The new way of creating support tickets can be seen in
[notifications-utils](https://github.com/alphagov/notifications-utils/pull/899).

This changes tickets created when making a request to go live to use
the new way, while other tickets stay the same for now.

The go live tags have been removed. Some of these had become
unneccessary since you can't make the request to go live unless they are
true (e.g. `notify_go_live_email_reply_to`). Others will always get
added by a Zendesk macro when the ticket is replied to, so we don't need
to add them here.
2021-09-22 12:00:05 +01:00
Ben Thorner
41f44c51fe Fix showing service type radios on error
The radio buttons to select the type of service - central, etc. -
are only shown if we can't infer the type based on the user's email
/ default organisation. However, the code to render the page in the
error case didn't accommodate this, nor did it show the version of
the page for adding a local government service.

This fixes the bug by DRYing-up the logic to render the pages. I've
not added a test for this for a couple of reasons:

- It's not a critical bug: no one has complained about it and it
doesn't block the user from adding service.

- It's unlikely to reoccur because the bug involved writing _more_
code than was necessary.

- It's not trivial to test this due to the 3 versions of the page
involved - these are tested for the happy path.
2021-09-16 12:07:03 +01:00
Leo Hemsted
9e915703fd fix contact list bst bug
the api returns UTC timestamps, we should keep them as UTC timestamps
until the very last moment, and only convert them into BST when we know
we want to return to a user (ie: in contact-list.html and other places
like that)
2021-09-15 15:12:13 +01:00
Leo Hemsted
a96bfdb16e remove server-side error messages for webauthn
since we are hard-coding a generic error message on the front-end, we
have no need to do anything on the back end. This is also nice as it
standardises the two flows to behave more like each other (rather than
previously where one would `flash` an error message and the other would
return CBOR for the js to decode).

Note that the register flow returns 400 while the auth flow returns 403.
The js for both just checks `response.ok` so will handle both. The JS
completely discards any body returned if the status isn't 200 now.
2021-09-15 11:43:41 +01:00
Leo Hemsted
2c55f4d0ce hard-code html error message for errorBanner
turns out that we're only using errorBanner with a static message, and
it's also full of rich html content. This means that it's probably
better to put it in the html templates with other content, rather than
hidden away in js files if we can help it.

Since there are two places, had to dupe the error message but i think
that's fine as i don't anticipate this error message being used in
significantly more places.

making it a string is a bit gross and means we don't get nice syntax
highlighting on it, but as it needs to be passed in to a jinja macro
that's the way it has to go unfortunately.
2021-09-14 18:43:27 +01:00
Leo Hemsted
b7e50fc638 redirect non logged in users
previously it'd show an error because non logged in users don't have the
can_use_webauthn attribute. now we can just bounce them to the sign-in
page
2021-09-14 18:43:26 +01:00
Leo Hemsted
0b27d7e0a9 show error message in banner rather than an alert
the banner is a nicer user experience, and consistent with how we
display errors elsewhere in notify. For now pass through the error
message from JS, but we'll probably want to change that since the erorr
messages themselves are often a bit cryptic and unhelpful
2021-09-14 18:43:26 +01:00
Leo Hemsted
c96a1dc0b7 add new error banner module for showing users js errors
this ensures it's reusable by other components, and easier to unit test
by isolating the separate concerns

note: this is not in Modules since that's designed for classes that are
then bound to an element in the DOM as indicated by a data-module
attribute. This will just live at the window.GOVUK level since we want
there to only ever be one `.banner-dangerous` warning.
2021-09-14 18:43:25 +01:00
Pea Tyczynska
c42fc071b5 Merge pull request #4020 from alphagov/update-service-name-hint-text
Add additional instructions for the service name
2021-09-14 12:18:46 +01:00