Commit Graph

501 Commits

Author SHA1 Message Date
Chris Hill-Scott
77aba35c49 Add an ‘add logo’ button
Because some people don’t know they can put their own logo on letters:

> The HM Government Logo is at the top of the letter and we can't see
> a way of putting the [organisation] logo on

> We are intending to use the letter template feature for the first time
> and wondered whether the branding is configurable or whether the HM
> Government header is the standard default.

> Can we replace HM Government logo with our own in the letter? IF yes,
> then how?

> I don't seem to be able to set the branding on the letters to be
> [organisation]. it's always HM government. Is there something that
> needs enabling for this account?

No-one actually wants the HM Government logo (no-one is sending real
letters using it). So we should leave the space blank and put a button
there prompting people to add their own logo.
2019-02-13 15:12:36 +00:00
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
bfdca62f2d Move ‘change postage’ link
So it aligns with how we’re displaying postage on the template.
2019-02-06 14:37:16 +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
ab8244ec5d Move ‘edit’ contact block link button
The contact block fills from the bottom upwards. So if it only has a few
lines then the ‘Edit’ link button sits quite far away from where the
text appears in the letter. This commit moves the link button to bottom
align with the contact block, so it’s always in close visual proximity.
2019-02-06 14:37:15 +00:00
Pea Tyczynska
e85678fa69 Add link to edit postage to view_template page 2019-02-04 14:45:33 +00:00
Chris Hill-Scott
7632e6b9d3 Merge pull request #2717 from alphagov/sticky-footer-new-buttons
Make ‘Add new’ buttons sticky on more pages
2019-02-01 15:27:09 +00:00
Chris Hill-Scott
afdc749e36 Make ‘Add new’ buttons sticky on more pages
For consistency with the template management page.
2019-02-01 14:25:35 +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
Tom Byers
33800c5f27 Add styles for nested lists of radios
Assumes lists that are descendants of a radio
control should be indented at the same amount as
their label text.
2019-01-04 11:59:25 +00:00
Chris Hill-Scott
bf75fec5ae Remove unused CSS
This is from when we used to show the email logos inside the label of
the radio buttons.

Changing the CSS will also change its hash, will will cache-bust
CloudFront. Which is why I’m doing this now.
2018-12-21 12:42:08 +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
7fa377ab76 Fix spacing on upload link when not inside sticky
We adjust the spacing under the textbox when doing the send one off
flow. This was based on the assumption that there would always be a
sticky header in the send one off flow.

This assumption is no longer true, so this commit implements the same
spacing in an independent way.
2018-12-07 11:45:40 +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
5df1978c62 Merge pull request #2529 from alphagov/download-pdf-footer
Put download PDF link in the sticky footer on the sent letter page
2018-11-22 13:23:10 +00:00
Chris Hill-Scott
fe5112a4c3 Merge pull request #2528 from alphagov/dont-wrap-users
Don’t wrap users onto multiple lines
2018-11-22 13:23:02 +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
8b84bf27e3 Don’t wrap users onto multiple lines
It looks cleaner to truncate instead. You can always see the full email
address by clicking into ‘edit’.
2018-11-22 10:44:09 +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