Commit Graph

8194 Commits

Author SHA1 Message Date
Tom Byers
551f7b91f4 Test and then fix focus when module state changes
Includes tests for this.
2019-08-07 10:23:09 +01:00
Tom Byers
c11c054323 Fix option selection for keyboard users
Keyboard users select a time slot by moving to the
radio for that slot, using the arrow keys, and
selecting it by pressing 'space' or 'enter', like
a `<select>`.

We allow this by listening for 'keydown' events
from the 'enter' or 'space' keys on time slot
radios that are checked.

Browsers fire 'click' events alongside the
'keydown' event meaning it's possible for the
code that makes the selection to be run twice.

We currently guard against this by checking for
the `pageX` property of the event object,
reasoning that a click event fired by a key press
won't have a cursor position.

Most browsers we support set it to `0` but it
isn't always the case:

https://dom-event-test.glitch.me/results.html

For those browsers, the `!event.pageX` condition
resolves correctly so this works. Safari and
versions of Internet Explorer before 11 however,
set it to a positive number.

In those browsers, moving the selection between
radios using the arrow keys fired a 'click' event
which, in Safari and IE<11, was treated as a
mouse/touch event and so confirmed the selection.
This made it impossible to select a later time.

These changes replace the 'click' event on time
slots with an artifical one that tracks
mouse/trackpad clicks by listening for a
'mousedown' followed by a 'mouseup' on a time
slot. This doesn't fire on key presses so avoids
the problem.
2019-08-07 10:23:09 +01:00
Tom Byers
64c6d1fbc7 Make clicking 'Done' preserve any selection made
Clicking the 'Done' button resets the module to
its default state. 'Done' implies you've
completed your selection so this doesn't make
sense.

This changes it so any selection made will be
confirmed when 'Done' is clicked.
2019-08-07 10:23:09 +01:00
Tom Byers
5186402958 Add tests for different selection methods
Adds tests for selection by keyboard, involving
making a selection with the arrow keys and
confirming it with the space or enter keys.
2019-08-07 10:23:09 +01:00
Tom Byers
6854361375 Expand event helpers
Extends triggerEvent, allowing the creation of
different types of event, and to change the data
on its object. Also fakes the positional data
browsers add to the event object.

Also adds helpers for simulating:
- all the events for a mouse click
- the events invovled in moving the selection in a radio group
2019-08-07 10:23:09 +01:00
Tom Byers
25b2414cec Add tests for radioSelect module 2019-08-07 10:23:09 +01:00
Tom Byers
a2ec376d03 Make Hogan definition clearer in radioSelect JS
It helps the tests to know the `Hogan` variable is
actually a property of the global variable
(`window` in this case) and doesn't hurt the
readability of the script.
2019-08-07 10:23:09 +01:00
Rebecca Law
f4b65683cf Merge pull request #3078 from alphagov/change-labels
Changing the labels on the service setting page.
2019-08-07 09:15:27 +01:00
Rebecca Law
026a01a090 Changing the labels on the sevice setting page.
We added `Upload letters` to the platform admin service settings, which makes is confusing when next to `Upload documents`.
Also `User auth type editting` is a confusing label

`User auth type editting` --> `Email authentication`
`Uploading documents` --> `Send file by email`
2019-08-06 16:57:40 +01:00
Katie Smith
5e39163277 Merge pull request #3076 from alphagov/upload-letters-service-setting
Add upload letters permission to service settings page
2019-08-06 13:30:32 +01:00
Katie Smith
0882c76476 Add upload letters permission to service settings page
The upload_letters permission can only be changed by Platform Admin
users. It works in a similar way to the inbound_sms nested permission
- you only see the row in the table if you have the 'letter' permission,
but the 'letter' and 'upload_letters' are still separate permissions and
changing one does not affect the other.
2019-08-05 13:51:31 +01:00
Leo Hemsted
16da5d8243 Merge pull request #3074 from alphagov/utils-bump
utils bump
2019-08-02 14:51:35 +01:00
Leo Hemsted
1d67c82f0f utils bump
also dont use splitlines on csv data, there might be quoted newlines we dont want to split on
2019-08-02 14:34:05 +01:00
Katie Smith
e72540d3f9 Merge pull request #3065 from alphagov/rename-endpoint
Remove ft from method and url, it doesn't add any meaning.
2019-07-29 10:07:31 +01:00
Katie Smith
691a607ccf Merge pull request #3068 from alphagov/clear-service-cache-when-updating-org
Delete service cache when changing an organisation's sector
2019-07-29 10:06:40 +01:00
Katie Smith
123b769771 Change code order for Redis delete decorator
Before, the delete decorator would delete the keys from Redis and then
we made the request to api to change the data. However, it is possible
that the cache could get re-populated in between these two things
happening, and so would cache outdated data.

This changes the order to send the api request first. We then always
delete the specified keys from Redis. Changing the order of the code in
the decorator changes the order in which the cache keys get deleted, so
the tests have been updated.
2019-07-26 16:29:50 +01:00
Katie Smith
ccad068a48 Change when 'has-jobs-<>' cache key gets set
We should set the cache after the job has been created, in case there
was an HTTP error when creating the job.
2019-07-26 16:26:20 +01:00
Katie Smith
dc1c73c647 Delete service cache when changing an organisation's sector
When we change an organisation's sector we now also change the sector of
all its services, so we need to delete those services from Redis.
2019-07-26 16:26:20 +01:00
Pea (Malgorzata Tyczynska)
eb7504bc0d Merge pull request #3067 from alphagov/new_org_types_part_2
Delete references to 'nhs' generic organisation type
2019-07-26 11:49:15 +01:00
karlchillmaid
d4d8ad7126 Merge pull request #3071 from alphagov/update-change-h1
Update 'Change' heading
2019-07-25 14:20:57 +01:00
karlchillmaid
0c9ea62636 Update 'Change' h1 2019-07-25 13:51:57 +01:00
karlchillmaid
92343aa45e Update change links and headings (#3064)
* Update Settings titles
* Update Change links on settings
* Update Team members Change link
* Update Settings pages headings
2019-07-25 11:52:13 +01:00
Chris Hill-Scott
719d001db1 Merge pull request #3070 from alphagov/team-member-not-user
Say ‘team member’ not ‘user’
2019-07-25 11:19:47 +01:00
Chris Hill-Scott
77ef59f5cb Update app/templates/views/edit-user-permissions.html 2019-07-25 10:45:58 +01:00
Chris Hill-Scott
b87e1b7426 Say ‘team member’ not ‘user’
This is currently inconsistent with the language we use everywhere else.
2019-07-25 10:30:35 +01:00
karlchillmaid
b21d7297c3 Merge pull request #3058 from alphagov/content-updates-july
Settings content updates
2019-07-24 14:17:21 +01:00
Rebecca Law
cc29764d43 Update unit test for the content changes. 2019-07-24 12:03:30 +01:00
karlchillmaid
eb166c60cf Update contact us link content 2019-07-24 12:00:41 +01:00
karlchillmaid
db5bf977ee Add full stop 2019-07-24 12:00:41 +01:00
karlchillmaid
749ce73d78 Update content 2019-07-24 11:58:43 +01:00
karlchillmaid
3e179e49eb Update text message setting name
Update text message setting name for `Start text messages with service name`
2019-07-24 11:58:43 +01:00
karlchillmaid
71cbc787de Update page title and header 2019-07-24 11:58:43 +01:00
karlchillmaid
c35802f4e7 Add full stop 2019-07-24 11:58:43 +01:00
karlchillmaid
cf11b3e3c8 Change 'info' to 'information' 2019-07-24 11:58:43 +01:00
karlchillmaid
59bb156881 Remove example
Removed `eg ‘{service name}: This is an example message’ – the content is already self explanatory
2019-07-24 11:58:42 +01:00
karlchillmaid
8a323479d8 Remove quote marks 2019-07-24 11:58:42 +01:00
karlchillmaid
7e26d8a5cd Remove quote marks 2019-07-24 11:58:42 +01:00
karlchillmaid
d0a0b17f7b Update trial mode content 2019-07-24 11:58:42 +01:00
Chris Hill-Scott
45ae5b1782 Merge pull request #3041 from alphagov/delete-letter-contact
Let users delete letter contact blocks
2019-07-24 10:47:48 +01:00
Katie Smith
18903e63c6 Merge pull request #3063 from alphagov/new-report
Add new report to show monthly notification stats for each service
2019-07-23 11:44:55 +01:00
Katie Smith
9dc13f1d8e Add new report to show monthly notification stats for each service
This report will be used by the engagement team. There is a form to give
a start and end date for the report, and the form is then downloaded
as a CSV file when the form is submitted.
2019-07-23 11:32:28 +01:00
Pea Tyczynska
c8bad44db4 Delete references to NHS generic organisation type 2019-07-22 15:59:31 +01:00
Pea (Malgorzata Tyczynska)
1bd5ff1dfc Merge pull request #3057 from alphagov/new_org_types_part_1
Introduce new org types
2019-07-22 15:56:31 +01:00
Rebecca Law
e0bcad77f5 Remove ft from method name and url, it doesn't add any meaning. 2019-07-22 14:34:15 +01:00
Chris Hill-Scott
82d3bfcc85 Merge pull request #3062 from alphagov/settings-spacing
Even out the spacing on the settings page
2019-07-22 12:09:21 +01:00
Chris Hill-Scott
06bb0e997e Merge pull request #3056 from alphagov/spellcheck-email
Set autocomplete and spellcheck attributes on email field
2019-07-22 12:09:14 +01:00
Chris Hill-Scott
44d5dc44d3 Allow deleting default letter contact blocks
It’s possible to delete default letter contact blocks because there is a
fallback – having a blank letter contact block. This is different to SMS
senders and reply to addresses.

For this to make sense it also means:
- adding the ‘blank’ letter contact block to the list of letter contact
  blocks
- having a way of setting the default back to being blank
2019-07-22 11:57:11 +01:00
Chris Hill-Scott
17bf06d04c Let users delete letter contact blocks
Because they can delete email reply to addresses and text message
senders.
2019-07-22 11:57:11 +01:00
Chris Hill-Scott
c1a5383a3f Even out the spacing on the settings page
This makes the spacing above and below each heading on the settings
page consistent.
2019-07-22 11:37:15 +01:00
Chris Hill-Scott
bb99ff27c9 Merge pull request #3060 from alphagov/agreement-new-content
Data sharing and financial agreement content
2019-07-19 16:43:16 +01:00