Commit Graph

361 Commits

Author SHA1 Message Date
Chris Hill-Scott
f9f8b6e99c Merge pull request #2750 from alphagov/embiggen-all-the-things
Embiggen all the things
2019-02-13 14:45:57 +00:00
Chris Hill-Scott
f2604494f0 Fix hover colour for ‘Switch service’ link 2019-02-13 13:32:31 +00:00
Chris Hill-Scott
1e82b6f8b3 Use pseudo elements not borders
This is the technique that GOV.UK Frontend uses to make clickable areas
of buttons bigger.

See: 47407edcb5/src/components/button/_button.scss (L89)
2019-02-13 13:28:32 +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
1f2cb07deb Make hit area bigger on settings ‘change’ links
Bigger hit areas are generally better (cf Fitt’s law[1]), as long as
they’re not ambiguous.

This commit enlarges the hit area of the edit links (using a border) so
they fill the same vertical space as the smallest possible row (going
to the full height might look weird because some of these rows get very
tall).
2019-02-11 13:12:34 +00:00
Chris Hill-Scott
1117984f5a Make hit area bigger on team members ‘edit’ links
Bigger hit areas are generally better (cf Fitt’s law[1]), as long as
they’re not ambiguous.

This commit enlarges the hit area of the edit links (using a border) so
they fill the same vertical space as the row they sit in.
2019-02-11 13:00:24 +00:00
Chris Hill-Scott
980fc249d8 Stop flicker when hovering postage on precompiled
We were removing the border to ‘unfold’ the corner of the page. This was
causing the size of the element to shrink.

This meant that it you hovered the bottom 1px of the element it would
cycle in and out of the hover state as fast as the browser could render
it.

This commit fixes that by making the border transparent, rather than
removing it.
2019-02-08 16:44:37 +00:00
Chris Hill-Scott
6824eeebf5 Allow people to see the full precompiled letter
Sometimes people print stuff under where we’re folding the letter. It’s
annoying to not be able to see it.

This commit adds a little detail where, once you’ve sent the letter
you can unfolds the corner to see what’s underneath.

It’s better that we do this for all letters for discoverability.
2019-02-07 16:19:13 +00:00
Chris Hill-Scott
cd70355db8 Display postage everywhere we display a letter
To avoid the problem of having confusing defaults, the postage is now
set explicitly on every template.

Putting the postage ‘inside’ the letter template makes the interaction
for changing it consistent with how other parts of the template are
added.

Plus everyone loves skeumorphism.
2019-02-06 14:37:16 +00:00
Chris Hill-Scott
93df30d2df Normalise spacing of template breadcrumb heading
Removes the magic numbers, makes it visually look like it’s in the same
position as the 36px type size headings.
2019-02-01 12:22:36 +00:00
Chris Hill-Scott
e0d1f8e8ff Wrap, don’t truncate display of folder name in H1
This commit applies a carefully selected blend of `white-space`,
`display` and `background-position` to ensure that:
- you can always see the full name of the current folder in the heading
  (which is useful because people might have mutiple folders with the
  same name, differentiated by some king of suffix)
- the clickable are of a single folder or template in the list is 100%
  width, for the biggest possible hit area
- the name of a folder or template wraps underneath the folder icon (ie
  the folder icon is treated like a normal character, not like a bullet
  point)
2019-02-01 10:40:30 +00:00
Chris Hill-Scott
88ad982bf7 Improve display of folder path when deeply nested
It’s a bit rudimentary to only show the current place in the hierarchy
and the parent. You lose a sense of how deep you are.

But we can’t just show the full path, because it can be arbitrarily
long. So what this commit does is show the full path, but truncates the
display of any items. Further-up than the current folder or its parent.

This also helps disambiguate between folders and templates, because
folders are always shown with the folder icon.

This probably won’t affect many teams, because we don’t anticipate a lot
of deep nesting.
2019-02-01 10:28:29 +00:00
Tom Byers
707c426b9a Remove padding between stickys when stacked 2019-01-30 14:59:30 +00:00
Chris Hill-Scott
7f202b026f Fix jumpy right position of selected items counter
The negative right margin counteracts the sticky footer being wider than
its containing column. This is only the case when it’s actually sticky.
2019-01-29 09:30:06 +00:00
Tom Byers
a9b7a0d887 Add box shadow by JS
When mode === 'dialog', sticky elements are
stacked so we need to apply the box shadow to the
top (when sticking to the bottom edge) and bottom
(when sticking to the top edge) elements in the
stack.

From what I can see, we need the version of
`nth-child` that supports targeting by selector.
As of this date, support for this is only in
Safari:

https://caniuse.com/#feat=css-nth-child-of

Until we can use this version of `nth-child`, we
need to use JS to apply the styles.
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
Chris Hill-Scott
f5321346c4 Add left padding to nested radios
This makes them align horizontally with the label of their parent, so
that the layout is a bit calmer.
2019-01-04 15:30:39 +00:00
Chris Hill-Scott
3be03072a7 Reflect expanded scope of radio SASS file 2019-01-04 15:15:59 +00:00
Chris Hill-Scott
4aa4970fc9 Add grey lines to visually show level of nesting
Uses some CSS to draw some grey lines to show which radios descend from
which.

I don’t feel like the intentation is enough, and it looks a bit messy
because the circles of the radio buttons don’t have straight edges
easily suggest visual alignment.

Copies the design from conditionally revealing content in the design
system:
https://design-system.service.gov.uk/components/radios/#conditionally-revealing-content

Implementation is done with pseudo elements, because borders can’t be
positionned exactly enough.
2019-01-04 15:15:59 +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
Chris Hill-Scott
4b305376f7 Add counter of selected templates and folders
Being able to see how many things you have selected gives you positive
feedback that reinforces that what you’ve done has been recognised. It
helps you understand the implications of your actions (ie you see ‘3
selected’ before you press the ‘Move’ button). And it gives you an
escape hatch the get out of the state you’re in by providing the ‘Clear’
button.

We also found in prototyping that having a ‘Nothing selected’ message
helps draws people’s attention to the checkboxes when they first
encounter the folders feature.

This commit implements the counter and the cancel button. It tries to
follow the existing patterns for this module.
2018-12-10 16:53:12 +00:00
Chris Hill-Scott
ee1c8ccf53 Don’t put folder icon on templates ‘folder’
After showing this to a few people the consensus seems to be that
‘Templates’ isn’t itself a folder. Therefore it shouldn’t have a folder
icon.

This has the advantage of disambiguating between being in a folder:
> [screenshot]

…and being in a subfolder:
> [screenshot]
2018-12-07 11:12:32 +00:00
Chris Hill-Scott
9a884a38d7 Add PNG versions of the folder icons for IE8 users
IE8 doesn’t support SVG images as CSS backgrounds. We still have users
on IE8, as I saw yesterday.

This commit adds fallback PNG images for these users. The images are
rendered at 1x (because no-one is using IE8 on a retina screen) and
have been run through `pngcrush -brute` for the smallest possible file
size.
2018-12-07 10:32:08 +00:00
Chris Hill-Scott
b0f89f7fe9 Style cancel link and make it keyboard navigable
So that it looks and behaves like a normal link.
2018-12-05 16:47:45 +00:00
Chris Hill-Scott
5db1de3bbb Style the manage folder link
Right-aligned so it lines up with the right edge of the page.

Moved down so its baseline aligns with the folder title.

In a narrower column so there’s more space for the folder title.
2018-12-05 16:37:48 +00:00
Chris Hill-Scott
76e8a8f4ed Space out the buttons in the sticky footer 2018-12-05 16:37:47 +00:00
Katie Smith
5406efa0cc Add link to cancel letters
Added a link to cancel letters from the letter notification pages if the
letter is still able to be cancelled. Clicking on this link will show a
confirmation box, and will then cancel the letter if the user confirms.
2018-12-05 11:12:05 +00:00
Chris Hill-Scott
7d20846d94 Render selected links with box shadow not outline
Because there’s a mystery 2px gap between the outline and the element in
Firefox.
2018-11-26 11:33:27 +00:00
Chris Hill-Scott
adcd699712 Maintain full width for items without a path 2018-11-26 10:56:48 +00:00
Chris Hill-Scott
ecdd605bca Allow wrapping within folder/template names
It takes up a lot of vertical space if folders and templates can only
break on the path separator (the `/`).
2018-11-23 14:38:47 +00:00
Chris Hill-Scott
28ef6910a3 Hide templates and folders not at current level
Things in subfolders need to be in the page so we can search for them.
But the default view should be only the things are the current level.
So we can use CSS to hide items that are below the current level.
2018-11-23 14:34:25 +00:00
Chris Hill-Scott
148492a635 Put all nested items on page
So that the live search can filter things, they need to be on the page
when it loads. We want to make search work across folders, so all the
things in subfolders need to be in the page.

They also need the full path appending to them, so that you can tell
which ones are in which folders.

This won’t show items that are in a folder above the one you’re
currently in – my reckon is that when you’re narrowing down by clicking
into a folder that you only want to search for things in that folder.
2018-11-23 14:31:05 +00:00
Chris Hill-Scott
b317bd7a0b Put download PDF in footer
This makes its positioning consistent with the previous page in the
one-off sending journey.

It gives us more space to put information about the status of the letter
above the preview of the letter.
2018-11-22 12:36:29 +00:00
Chris Hill-Scott
0ed66828fc Merge pull request #2526 from alphagov/stick-email-status
Stick email status to bottom of screen
2018-11-22 12:31:14 +00:00
Chris Hill-Scott
c7118a80e2 Stick email status to bottom of screen
We’ve moved away from using the expand/collapse pattern on the page
where you click ‘send’. Instead we’re putting the send button in the
sticky footer.

So it’s a bit jarring to still have the expand/collapse on the page you
see after you’ve sent an email. This commit replaces it with the sticky
footer as well.

This is only relevant for emails because:

1. Text messages are generally short enough to fit on the screen
2. We don’t show the status of letters because they don’t really change
2018-11-22 10:20:39 +00:00
Chris Hill-Scott
65389b0bb5 Merge pull request #2513 from alphagov/empty-folder-message
Improve the empty folder state
2018-11-20 13:50:53 +00:00
Chris Hill-Scott
32c36bf70b Make the empty folder state more useful
Currently if there’s nothing in a folder you just get an empty page.
This looks a bit broken, or like the page hasn’t finished loading.

This commit adds a message to the page to show that it’s intentionally
blank.

The message is contextual based on type of template, because there might
be templates in the current folder, even if you can’t see them at the
moment (because you’re filtering).
2018-11-20 12:29:38 +00:00
Chris Hill-Scott
9bd91ed60a Style spacing for sticky footers
Sticky footers need slightly different spacing to sticky headers so they
look balanced. They can’t just inherit the same spacing.
2018-11-19 15:24:02 +00:00
Chris Hill-Scott
d3e7557058 Link current level in hierarchy from manage folder
Because that’s the page you come directly back from.
2018-11-19 11:28:36 +00:00
Chris Hill-Scott
d49622c5dc Style folder hierarchy in headings
This makes the display of folders in the `<h1>` look like the prototype.

It alters the behaviour we’ve initially built here by only ever showing
a maximum of two levels of hierarchy (the current folders and its
parent).
2018-11-19 10:50:03 +00:00
Tom Byers
d1805e7fc0 Merge pull request #2469 from alphagov/make-current-sticky-js-generic
Allow our sticky navs to stick to bottom as well as top
2018-11-15 09:59:37 +00:00
Tom Byers
8411598390 Remove transition if element is stuck onload
Fade-in and out for sticky elements should only be
when they move from being in-page to stuck from a
user interaction.
2018-11-14 10:25:08 +00:00
Chris Hill-Scott
807396f8b9 Add comment to explain combining of flex and float
Just so no-one thinks it’s redundant and removes it.
2018-11-13 14:22:48 +00:00
Chris Hill-Scott
a82ce7de1f Fix folder navigation in IE 10
IE10 doesn’t support flexbox. We can work around this using floats.

I think the flexbox will override it, so will be ignored by newer
browsers.
2018-11-13 14:01:19 +00:00
Chris Hill-Scott
07dd59f5b6 Add folder icons to template list
To make it easier to identify what is a folder.
2018-11-12 11:53:37 +00:00
Chris Hill-Scott
fb339a08a8 Refactor CSS to better use inherited naming 2018-11-12 11:53:37 +00:00
Chris Hill-Scott
55fa85d79b Fix copypaste error 2018-11-12 09:54:25 +00:00
Chris Hill-Scott
2743216519 Show form elements for templates and folders
This commit adds:
- checkboxes to let you select a template or folder
- radio buttons to let you select where to move those template(s) and/or
  folder(s) to

It only does the `get` part of this work; handling the `post` and
calling API will be done in a subsequent commit.
2018-11-12 08:37:46 +00:00