Commit Graph

4816 Commits

Author SHA1 Message Date
Tom Byers
4ca5a8b986 Merge pull request #2770 from alphagov/announce-selection-count-to-assistive-tech
Announce selection count to assistive tech
2019-02-22 11:02:44 +00:00
karlchillmaid
5d66ef46a6 Merge pull request #2796 from alphagov/update-new-template-titles
To keep the H1 titles of new templates consistent with the sticky menu options:

* change `Add email template` to `New email template`
* change `Add text message template` to `New text message template`
* change default letter template name `Untitled` to `New letter template`
2019-02-21 21:18:45 +00:00
Tom Byers
9b180472d2 Fix selection counter on smaller screens 2019-02-21 13:27:18 +00:00
Tom Byers
14553dcfd0 Give context to 'Cancel' and 'Clear' links
Links need to work in isolation from their context
in the page.

This is an attempt at doing that. The one for
'Cancel' is still not ideal but 'Clear selection'
gives more information than 'Clear' about what it
does.

Also adds a 'href' attribute to the link, without
which its accessible role isn't recognised.
2019-02-21 13:27:18 +00:00
Tom Byers
2d85469cd0 Move 'Clear' link out of 'aria-hidden' region 2019-02-21 13:27:18 +00:00
Tom Byers
15104e9d25 Re-position live-region to remove duplication
Adding a visually hidden live-region creates
duplication in the HTML. End result for users of
screen readers are that you get the same text read
out twice.

This adds `aria-hidden` to hide the visible
version and re-positions the live-region one next
to it. That means the live-region text appears in
the same place in the document order as the
visible one so things are announced as expected.
2019-02-21 13:27:18 +00:00
Tom Byers
050a513cf5 Update a11y API when selection count changes
Inserts a hidden live region to ensure changes to
the count are announced.

The live region is hidden because it needs to be
in the initial markup of the page. The visual
counter is part of a larger region which is
inserted/removed from the DOM.

See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions
2019-02-21 13:26:14 +00:00
Tom Byers
a8cac953d7 Deal with lost focus when selection cleared
This was missed out of the work on improving focus
on the templates page.

When you clear the current selection, the 'clear'
link disappears so focus needs to be sent
somewhere.
2019-02-21 13:26:14 +00:00
karlchillmaid
66048034c1 Change Add to New
Change `Add` to `New` for template H1
2019-02-21 12:02:21 +00:00
karlchillmaid
895713f7a9 Updated default letter template name
To keep the H1/titles of new templates consistent with the sticky menu options.

Updated default letter template name from `Untitled` to `New letter template`
2019-02-21 10:51:01 +00:00
Alexey Bezhan
261d90ca4d Add edit_folder_permissions permission
Admin part of alphagov/notifications-api#2356
Adds Folder permissions switch to the platform admin part of service
settings page.
2019-02-20 16:45:12 +00:00
Alexey Bezhan
000d6c3a48 Replace platform admin service setting buttons with forms
Most of the existing platform admin buttons on the service settings
page used to issue GET requests to switch service settings. This
means they weren't protected by CSRF. On top of that as our number
of service permissions increases over time a lot of buttons on the
page made it hard to work with.

To fix these issues we replace most of the buttons with rows in the
platform admin settings table. Each setting has a 'Change' link that
leads to a page with an On/Off switch form.

This removes "research mode" switch completely since we're planning
to deprecate it in the future and we don't expect to switch any new
services into research mode at the moment.

Most service permissions are now handled by a shared endpoint that
is parameterized with the permission name. Some permissions that
require some additional logic before they can be toggled (like document
upload, which requires setting a contact address) have separate
initial endpoints that redirect to `set_service_permission`.

"Archive", "Suspend" and "Resume" actions are kept as buttons since
they display a confirmation banner (which is a CSRF-protected form)
and they're not easily represented as an On/Off switch.
2019-02-20 16:45:12 +00:00
Alexey Bezhan
75fd2d4ffc Add a new boolean radios fields and change forms to use it
This adds a new OnOffField class that implements a boolean field
that is rendered as two On / Off radio buttons. This allows us to
avoid comparing 'on' and 'off' string values in the views since
the field takes care of transforming form data into python booleans.

This also adds a form class that can be used for any single On / Off
switch forms (e.g. service permissions).
2019-02-20 16:45:12 +00:00
karlchillmaid
884734a1b2 Updated button content
Updated button content
2019-02-20 15:05:08 +00:00
karlchillmaid
03a2b28269 Corrected: Add to new folder button
Corrected: Add to new folder button
2019-02-20 14:58:14 +00:00
karlchillmaid
aaacf69fdc Updated new template menu content
Updated new template menu content to make it consistent with the `New template` button and `Copy an existing template` page
2019-02-20 14:39:40 +00:00
Chris Hill-Scott
d0c7895a0d Mark agreement signed by Wiltshire 2019-02-20 13:31:37 +00:00
Chris Hill-Scott
9616d0dc2d Merge pull request #2772 from alphagov/branding-spec
Add spec for email/letter branding
2019-02-20 11:30:20 +00:00
Chris Hill-Scott
1e4e149f03 Merge pull request #2788 from alphagov/northtyneside.gov.uk
Mark agreement signed by North Tyneside council
2019-02-20 10:32:01 +00:00
Chris Hill-Scott
d3b8e3e4ea Let users who can edit templates request branding
Because they can see the button, but currently get a `403`…
2019-02-20 10:19:24 +00:00
Chris Hill-Scott
afb61bb038 Mark agreement signed by North Tyneside council 2019-02-19 16:49:08 +00:00
Leo Hemsted
c261c41475 Merge pull request #2769 from alphagov/delete-redis-button
Clear redis cache page
2019-02-19 16:20:55 +00:00
Katie Smith
2f4e933b65 Merge pull request #2773 from alphagov/letter-branding-preview
Add preview pane for letter branding
2019-02-19 14:05:21 +00:00
karlchillmaid
2659db4ad0 Merge pull request #2775 from alphagov/updated-message-statuses
Update message status descriptions to match the documentation.
2019-02-19 13:37:51 +00:00
Leo Hemsted
bfefb115ed move choices from form to view
so that when updating, you don't have to update two separate places
2019-02-19 11:35:34 +00:00
Chris Hill-Scott
032cbf9a17 Flag go live requests from DWP
It’s not enough to check that they’ve signed the agreement. We have to
make sure we inform them every time a service wants to go live.
2019-02-19 11:18:50 +00:00
Katie Smith
d904c7e5c5 Show letter branding preview when selecting a brand
This adds a preview pane which is visible when updating a letter brand.

If JavaScript is enabled, the preview pane shows on the set-letter-branding
page, and submitting the form saves updates the letter brand for a service
immediately. If Javascript is not enabled, there is a separate 'Preview email
branding' page which shows a preview of the brand and has a 'Save' button on it.
2019-02-19 10:44:51 +00:00
Katie Smith
44781e3b69 Change preview pane JS to preview letters as well as emails 2019-02-19 10:44:51 +00:00
Katie Smith
83c10149bd Rename 'email-branding-preview' CSS styles to 'branding-preview'
Renamed since the same styling will be used for previewing letters.
2019-02-19 10:44:51 +00:00
Pete Herlihy
a89ad81cdc Adding judicialappointments.digital to the email domains 2019-02-19 10:23:52 +00:00
Chris Hill-Scott
f0af083892 Mark agreement signed by Torridge District Council 2019-02-19 10:12:09 +00:00
Chris Hill-Scott
877556c2d7 Mark agreement signed by Oxford City Council 2019-02-18 16:08:01 +00:00
karlchillmaid
d4516f3f4d Remove 'pending' status 2019-02-18 13:57:01 +00:00
Chris Hill-Scott
61b8e10fc0 Merge pull request #2765 from alphagov/folder-after-delete-template
Return to a template’s folder after deleting it
2019-02-18 13:22:27 +00:00
Pete Herlihy
ffa5cb6a1c Added Southwark council agreement 2019-02-18 12:14:14 +00:00
Leo Hemsted
b062a5a13f make banner green (default) instead of red (dangerous) 2019-02-18 12:09:14 +00:00
Pea (Malgorzata Tyczynska)
cdbbdda730 Merge pull request #2771 from alphagov/update_passowrds_blacklist
Update common passwords blacklist
2019-02-18 11:02:40 +00:00
Chris Hill-Scott
24ba4235d1 Mark agreement signed by 3 councils
- Antrim and Newtonabbey
- Runneymede
- East Riding of Yorkshire
2019-02-18 10:12:22 +00:00
karlchillmaid
9450787c95 Removed API statuses
Removed API statuses. Added a link to documentation.
2019-02-15 17:12:28 +00:00
karlchillmaid
f362cebd88 Correct headings 2019-02-15 16:59:41 +00:00
karlchillmaid
c3be75e7f7 Fix typo
Fix typo
2019-02-15 16:54:15 +00:00
karlchillmaid
ca10c86cbf Update message state descriptions
Update message state descriptions to match the agreed versions in the API documentation.

Added API states for letters too.
2019-02-15 16:49:45 +00:00
Chris Hill-Scott
567a38367d Add spec for email/letter branding 2019-02-15 14:57:37 +00:00
Pea Tyczynska
3f6e0b6631 Update common passwords blacklist
I did the update following instructions from this commit:
https://github.com/alphagov/notifications-admin/
commit/136662bd309d986a9b7c3e0ee76588612c1ab761

Password repositiories I used were:
darkweb2017-top10000.txt
probable-v2-top12000.txt
twitter-banned.txt
2019-02-15 13:43:46 +00:00
Leo Hemsted
89bfdf27ce add tests 2019-02-15 11:44:09 +00:00
Leo Hemsted
1dcba53daf add clear cache platform admin page
a form that allows you to clear entries from the cache for all of
either users, services or templates. It'll tell you the largest amount
of keys deleted, since there are multiple keys associated with each
model.
2019-02-15 11:44:08 +00:00
Leo Hemsted
f6513613d3 bump utils to bring in redis changes
also set redis url locally to be localhost. redis is disabled by
default so this won't do anything unless you set REDIS_ENABLED=1 as an
environment variable
2019-02-15 11:44:08 +00:00
Leo Hemsted
f6367f2278 move (non-api) clients (inc redis) from app/__init__.py to extensions
when clients are defined in app/__init__.py, it increases the chance of 
cyclical imports. By moving module level client singletons out to a 
separate extensions file, we stop cyclical imports, but keep the same 
code flow - the clients are still initialised in `create_app` in 
`__init__.py`.

The redis client in particular is no longer separate - previously redis 
was set up on the `NotifyAdminAPIClient` base class, but now there's one 
singleton in `app.extensions`. This was done so that we can access redis 
from outside of the existing clients.
2019-02-15 11:44:08 +00:00
Chris Hill-Scott
51e56614c0 Merge pull request #2767 from alphagov/barnsley
Signed contract from Barnsley
2019-02-15 10:12:10 +00:00
Katie Smith
862d077f66 Removed links to add_template_by_type_endpoint
The endpoint was removed, but was still linked to in a couple of
places. Some old links were no longer needed, so have been removed.

We do still need a link to `add_template_by_type` on the 'Choose reply'
page - this page is used to allow to let someone pick a template to
reply to inbound SMS with. Since the link only appears if they have no
SMS templates, we now link to `.choose_template` with the templates and
folders form already opened at the option to add a template.
2019-02-15 08:06:06 +00:00