Commit Graph

61 Commits

Author SHA1 Message Date
Jonathan Bobel
bbc03d2ddb Deleting instead of commenting out 2023-07-14 10:39:12 -04:00
Jonathan Bobel
1da906279f Removed links to the sticky javascript, but didn't remove altogether 2023-07-12 15:43:21 -04:00
Jonathan Bobel
86cf2ab836 Fixing the issue of the template area buttons not working 2023-06-15 15:15:37 -04:00
Jonathan Bobel
e0d2d74067 Update dashboard and template flow (#514)
* Updated header and footer
* Moved files around and updated gulpfile to correct the build process when it goes to production
* Updated fonts
* Adjusted grid templating
* Adding images to assets
* Updated account pages, dashboard, and pages in message sending flow
* Updated the styling for the landing pages in the account section once logged in
2023-06-08 13:12:00 -04:00
Tom Byers
87dcea779e Make footer popup forms groups & add labelling
The existing behaviour focused the form control
for each popup (radios or textbox) when opened.

This gives no indication the submit button or
cancel link have been added to the page.

These changes:
- make the parent element a region to group all
  the new content
- label the region to link it to the button that
  opened it
- add a description to the region so users know
  how to use it and that all the controls have
  been added to the page
2020-10-02 15:08:09 +01:00
Tom Byers
5819b5da2d Change context for cancel link
Every other control refers to the group name so
the cancel link should too.
2020-10-01 13:30:44 +01:00
Tom Byers
099b42b31e Make all control buttons aria-expanded=false
Suggested by the Digital Accessibility Centre in
their report. Giving these buttons
aria-expanded=false indicates:
- they control a section on the page
- that section is collapsed (and so clicking the
  button will open it)
2020-10-01 11:51:50 +01:00
Tom Byers
4b28846c6b Make selection summary (counter) more detailed 2020-09-18 12:10:32 +01:00
Tom Byers
0933485995 Add context to 'Move' button on /templates
Includes adding an extra parameter to the
page_footer component.
2020-08-25 20:52:21 +01:00
Pea Tyczynska
36c1ffa7be New template button takes user to new template page
for all services that only allow sending one type of notifications
2020-08-14 17:15:45 +01:00
Pea Tyczynska
bdfc0adcc0 New template button creates new template for broadcast services 2020-08-14 17:13:57 +01:00
Tom Byers
346c4aa7f3 Update links in JavaScript 2020-02-25 10:47:30 +00:00
Tom Byers
5b306dde4d Revert "Convert all links to govuk frontend" 2020-02-24 11:56:38 +00:00
Tom Byers
c094f31b2b Update links in JavaScript 2020-02-20 09:11:26 +00:00
Katie Smith
2cbfaf1b6f Update the buttons on template folder form 2020-02-17 08:05:05 +00:00
Tom Byers
c1b8fb7531 Replace all visually-hidden classes
These have been replaced:

https://design-system.service.gov.uk/get-started/updating-your-code/#helper-class-names
2019-11-27 14:15:32 +00:00
Tom Byers
e09d510ab8 Revert "Replace govuk template with govuk frontend components - rewrite" 2019-11-26 12:14:09 +00:00
Tom Byers
2bd7ce8cf6 Replace all visually-hidden classes
These have been replaced:

https://design-system.service.gov.uk/get-started/updating-your-code/#helper-class-names
2019-11-25 11:43:30 +00:00
Tom Byers
e02f94f238 Revert "Replace govuk template with govuk frontend components" 2019-11-25 10:37:35 +00:00
Tom Byers
c3b2d3c521 Replace all visually-hidden classes
These have been replaced:

https://design-system.service.gov.uk/get-started/updating-your-code/#helper-class-names
2019-11-22 17:45:45 +00:00
Tom Byers
d0b6f844ce Move focus of legends to their fieldsets
When testing with the JAWS screenreader, we found
a bug around getting it to announce the name of a
fieldset when we ask the user to select from it.

Bug on pivotal:

https://www.pivotaltracker.com/story/show/165565088

The flows for adding a new template and moving a
template/folder both need the user to select an
option from a radio group. When we add the radio
group to the UI, we need to move focus to it so
the user is in the right place to choose an
option.

The expectation of the original code was that
focusing the field set's legend would work like
focusing the heading of a section of content and
announce the label of it. This didn't happen with
JAWS. This tries to achieve the same by focusing
the whole fieldset instead.

When doing this we also hide the focus style, to
follow the convention for this across www.gov.uk.
2019-10-01 08:26:08 +01:00
Tom Byers
5ba2bd66e0 Revert "Merge pull request #2855 from alphagov/revert-2843-stop-sticky-overlapping-focus"
This reverts commit 0f9969989a, reversing
changes made to 42e3770e65.
2019-03-25 15:58:23 +00:00
Tom Byers
4e7e934e25 Revert "Prevent sticky controls overlapping focus" 2019-03-18 16:38:49 +00:00
Tom Byers
3b0fd4a92c Make controls re-render only when state changed
Adds a guard around all calls to `.render()` after
the first one (which sets the initial state) to
prevent DOM manipulation when not needed.

The original behaviour meant the action buttons
were re-rendered when items from the list of
templates/folders were selected/deselected, even
if the state hadn't changed. This meant, in some
cases, focus was shifted to the buttons when you
were still selecting/deselecting.
2019-03-18 11:25:26 +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
03a2b28269 Corrected: Add to new folder button
Corrected: Add to new folder button
2019-02-20 14:58:14 +00:00
Tom Byers
4c477d08a6 Put shift in focus after change to state
Moving focus before letting the sticky JS set the
position of sticky elements means focus is shifted
to them when they are still in the page. This
causes the browser to scroll so the focused
elements are visible.

This moves when focus is set to after the sticky
JS has set position therefore avoiding the issue.
2019-02-11 15:24:09 +00:00
Tom Byers
693ddadbc4 Deal with focus state following cancelation
Follows pattern from dialogs whereby focus returns
to the button/link that fired the dialog when it
closes.
2019-02-11 15:24:09 +00:00
Tom Byers
d633bdbb6d Tidy up JS code for focusing & associated html
Makes sure the tabindex we add for focusing is
removed.

Also removes the outer fieldset from the radios
for new templates. We don't wrap form buttons in
fieldsets anywhere else and it doesn't add any
useful semantics to the form.
2019-02-11 15:24:09 +00:00
Tom Byers
2b2641b039 Use JS for applying focus & add styling for it
Adds some extra styles so <fieldset>'s show as
focused when they are.

Also includes replacement of `overflow: hidden` on
sticky elements with a clearfix. hiding overflow
clips the outline and the clearfix can be used for
containing any floats instead. (I'm assuming that's
why it was set here.)
2019-02-11 15:24:09 +00:00
Chris Hill-Scott
ca6529dcdb Update app/assets/javascripts/templateFolderForm.js
Use native `Array.indexOf` instead.

Co-Authored-By: tombye <tombaromba@gmail.com>
2019-02-04 15:17:27 +00:00
Tom Byers
0e55521d8f $.inArray returns the same value as Array.indexOf 2019-02-04 14:56:18 +00:00
Tom Byers
7ef32a6bd9 Replace native Array.includes with jQuery version
This was failing with a 'Object doesn't have
method' error on IE11. Assume Babel wasn't
polyfilling Array.includes so reverting to jQuery
version for now.
2019-02-04 11:23:41 +00:00
Tom Byers
c89ad9635b Fix switch between modes and scrolling on adjust
The templateFolderForm JS was setting the mode to
'dialog' but not back when the state was changed
back to a normal sticky element. This caused
adjustments and scrolling when no adjustment
needed to be accommodated.

There were also problems with adjustForResize. It
was manipulating the same flag that resizing the
window did and returned a value never used.
2019-01-30 19:12:14 +00:00
Tom Byers
f4d9c37940 Move setting of sticky mode out of recalculate
The `recalculate` method currently does three
things:
1. sync's the internal store with the DOM
2. updates the saved positional and dimensional
data from the new DOM
3. allows the mode to be set

The problem with using it as the way to set the
mode is that, every call to it is effectively
setting the mode but this isn't always the
intention.

This splits off setting the mode so other modules
have to explicity set it and those that don't
intend to can just call `recalculate` to notify of
DOM changes.
2019-01-30 11:45:24 +00:00
Leo Hemsted
d5e95af446 make classes in folder dialog states consistent
make sure the class is applied to a child element, so that `$el.find`
will always find something for `js-will-stick-at-bottom-when-scrolling`.

Also, clean up code by treating all stickies on the template folder
form as dialogs - they all are after all all dialogs - modals that
expect your attention on top of the main page content.
2019-01-25 16:47:49 +00:00
Tom Byers
59b02e0fe0 Change when folder controls become sticky
The controls for the template folders are all
present in the page when it loads. The
templateFolderForm JS filters them so you only see
the one you need to for the thing you're trying to
do.

This changes when the controls are made sticky so
it happens after the templateFolderForm JS has
performed its filtering.
2019-01-23 16:55:18 +00:00
Tom Byers
a6a7057d64 Deal with elements no longer in the DOM
Instead of keeping references to nodes detached
from the DOM, remove them from the store.
Likewise, add node appended to the DOM.

This includes code to 'clean' DOM nodes when
removed. This is important because nodes can
retain classes and styles. If they are re-attached
in future this can cause problems with how the
state of the element is determined.
2019-01-23 16:55:18 +00:00
Tom Byers
03e38dfdef Add mode for grouping sticky elements as a dialog
We want a mode for when a single task is shared
between all sticky elements on the page and that
task has the highest priority on the page. In that
case:
- they should stack together into a single block,
  attached to the top/bottom of the viewport
- that block should adjust to the vertical space
  available

This should also adjust to the height of the
viewport, dropping whatever elements that don't
fit back into the page flow. When this happens, we
scroll the page so all the parts of the dialog are
seen together at the start of the task.
2019-01-23 16:55:12 +00:00
Tom Byers
c0706b9cef Split move_to forms into separate sticky elements 2019-01-23 15:30:28 +00:00
Chris Hill-Scott
a9baa36005 Hide ‘nothing selected’ if nothing to select
It’s doesn’t make sense to show the state if the state can’t change.
This is especially true when you’re in a brand new, empty service.
2019-01-03 11:16:56 +00:00
Leo Hemsted
1bcee4c1b0 render if currentState is defined
(this fixes bug where on error, it would show all states)
2018-12-19 15:25:43 +00:00
Tom Byers
f6a6de41aa Merge pull request #2590 from alphagov/fix-sticky-init
Fix issues with JS for sticky elements
2018-12-17 13:29:19 +00:00
Tom Byers
030701ab1b Make folder controls update sticky JS on change
Also removes a call the `render` method which
duplicates one already made by the
`selectActionButtons` method on load.
2018-12-14 16:33:00 +00:00
Chris Hill-Scott
ce86604a49 Only trigger clear/cancel buttons on certain keys
It’s annoying having these buttons triggered by the tab or command keys.
2018-12-10 17:32:36 +00:00
Chris Hill-Scott
0c71ca0f0e Move cancel buttons alongside submit buttons
This is better because it saves vertical space for the contents of the
pop-up menu.

This commit also adds some padding to the cancel and clear buttons, to
make them easier targets to hit.
2018-12-10 17:11:01 +00:00