Commit Graph

3564 Commits

Author SHA1 Message Date
Chris Hill-Scott
217e975ae9 Clean up unused SCSS in SMS message component
Things we don’t do with SMS messages any more:
- put paragraphs in them (we use `<br>` tags instead, to allow for
  multiple linebreaks)
- pick them using radio buttons
- render the template’s name as part of the template
- render the phone number that the message will be sent from as part of
  the template
2017-05-24 14:18:23 +01:00
Chris Hill-Scott
3dc530e741 Merge pull request #1287 from alphagov/error-on-row
Error on row
2017-05-24 10:13:46 +01:00
Chris Hill-Scott
5c4d3b02b8 Merge pull request #1282 from alphagov/show-errors-first
Show spreadsheet before template if there’s errors
2017-05-23 14:39:10 +01:00
Chris Hill-Scott
a9b15ced40 Merge pull request #1279 from alphagov/placeholders-in-contact-block
Enable placeholders in letter contact block
2017-05-23 14:39:00 +01:00
Chris Hill-Scott
f425c5756d Make sure row numbers stay vertically aligned
Just looks tidier.
2017-05-23 14:36:27 +01:00
Chris Hill-Scott
a0cc792222 Make row numbers bold
They’re headings, not part of the data.
2017-05-23 14:36:26 +01:00
Chris Hill-Scott
ad5fc9a583 Put error flag on whole row
We’ve seen people miss errors if they’re in the right-hand columns of
the spreadsheet because people’s eyes scan down the left edge of the
table.
2017-05-23 14:33:22 +01:00
Chris Hill-Scott
1c1c5bd758 Merge pull request #1285 from alphagov/from-always-set
Use GOVUK as fallback SMS sender
2017-05-23 13:55:35 +01:00
Chris Hill-Scott
616fec9d77 Remove 40604 as fallback
We should just be using whatever is in the database. Should not be
merged until the DB migration is done.
2017-05-23 13:36:48 +01:00
Chris Hill-Scott
eab15f252b Merge pull request #1284 from alphagov/validate-sms-sender
Stop letting people enter empty SMS senders
2017-05-23 12:55:14 +01:00
Chris Hill-Scott
1aebb10fe9 Merge pull request #1277 from alphagov/send-test-page-per-thing
Show one field at a time on send yourself a test
2017-05-23 12:45:24 +01:00
Chris Hill-Scott
1d76b22bc0 Add extra tests to make sure that the form is safe
Previous implementations of this functionality mutated the base form
class, which broke a bunch of stuff.

I want to make sure that getting this form for one placeholder doesn’t
change other forms that have already been instantiated for other
placeholders.

Mutation is scary.
2017-05-22 12:12:22 +01:00
Chris Hill-Scott
cd7c27925c Check that users can’t skip steps in send test
Because we put the step in the URL, users could:
- skip ahead to a later step
- navigate to a step which doesn’t exist (ie an index greater than the
  number of placeholders)

This commit adds some checks to do the sensible thing in the unlikely
event that either of these situations occur.
2017-05-22 12:12:22 +01:00
Chris Hill-Scott
c8a64aeb19 Clean up unused test fixtures
The combination of `service_one` and `logged_in_client` takes care of
most of the permissions stuff.
2017-05-22 12:12:22 +01:00
Chris Hill-Scott
5da24288f2 Remove unused import 2017-05-22 10:52:41 +01:00
Chris Hill-Scott
e7896f283a Cache letter page count on send yourself test
Calculating the number of pages in a letter is quite slow. And the send
yourself a test pages need to load _fast_. Since filling in placeholders
is very unlikely to change the number of pages in the resultant letter,
it’s pretty safe to cache that count, and makes the subsequent pages
load a lot faster.
2017-05-22 10:52:06 +01:00
Chris Hill-Scott
16c7d17329 Unfill current placeholder if revisiting page
If we don’t do this then you can’t see where in the composed message
the value for your placeholder will appear.
2017-05-22 10:51:39 +01:00
Chris Hill-Scott
7169a7fbf8 Focus form field on send yourself a test
People are going to hammer through this form _fast_, so not making them
click into the form field on every page load is a nice enhancement.

Reuses the code written to do this on the page where you enter your
verification code.
2017-05-22 10:51:13 +01:00
Chris Hill-Scott
3106ea0e15 Make send yourself a test form stay at top of page
You might need to scroll this page quite a lot to see where a
placeholder appears in your template – especially if you have a long
email or letter.

One of the things I’m trying to stop happening so much is a lot of
scrolling back and forth. This would happen if you were scrolling down
to see the placeholder, then back up to fill in its value.

So this commit makes the textbox ‘sticky’, ie it always stays at the top
of the viewport, even when you scroll down. This lets you see the
placeholder and the textbox side by side, no matter how long the
template is.

The code to do this mostly comes from the GOV.UK Frontend Toolkit
(documented here: d9489a9870/docs/javascript.md (stick-at-top-when-scrolling)).
I had to add some extra CSS to make it look good when it overlaps the
content of the page, which the GOV.UK Frontend Toolkit implementation
doesn’t really anticipate.
2017-05-22 10:50:41 +01:00
Chris Hill-Scott
8c03feb334 Show one field at a time on send yourself a test
The send yourself a test feature is useful for two things:
- constructing an email/text message/letter without uploading a CSV file
- seeing what the thing your going to send will look like (either by
  getting it in your inbox or downloading the PDF)
- learning the concept of placeholders, ie understanding they’re thing
  that gets populated with _stuff_

The problem we’re seeing is that the current UI breaks when a template
has a lot of placeholders. This is especially apparent with letter
templates, which have a minimum of 7 placeholders by virtue of the
address.

The idea behind having the form fields side-by-side was to help people
understand the relationship between their spreadsheet columns and the
placeholders. But this means that the page was doing a lot of work,
trying to teach:
- replacement of placeholders
- link between placeholders and spreadsheet columns

The latter is better explained by the example spreadsheet shown on the
upload page. So it can safely be removed from the send yourself a test
page – in other words the fields don’t need to be shown side by side.

Showing them one-at-a-time works well because:
- it’s really obvious, even on first use, what the page is asking you to
  do
- as your step through each placeholder, you see the message build up
  with the data you’ve entered – you’re learning how replacement of
  placeholders works by repetition

This also means adding a matching endpoint for viewing each step of
making the test letter as a PDF/PNG because we can’t reuse the view of
the template without any placeholders filled any more.
2017-05-22 10:50:10 +01:00
Chris Hill-Scott
ab150d876d Stop letting people enter empty SMS senders
This shouldn’t be deployed until we’ve migrated the database to default
to GOVUK.
2017-05-19 22:42:17 +01:00
Chris Hill-Scott
cc2e0fd1cb Show spreadsheet before template if there’s errors
It’s easier to work out what the errors are in your file if you can
see the big red error message right next to the contents of your file.

When users get errors they tend to go back and forth between the error
message and the view of the file, not the message and the template
preview.
2017-05-19 10:16:47 +01:00
Chris Hill-Scott
eb7b8631b6 Merge pull request #1281 from alphagov/50-51
50-51 for Care to Learn (DfE)
2017-05-18 15:36:53 +01:00
Pete Herlihy
af052d08ce 50-51 for Care to Learn (DfE) 2017-05-18 14:17:56 +01:00
Chris Hill-Scott
8accf7127f Enable placeholders in letter contact block
Depends on:
- [x] https://github.com/alphagov/notifications-api/pull/950
- [x] https://github.com/alphagov/notifications-template-preview/pull/18
- [x] https://github.com/alphagov/notifications-utils/pull/161
- [ ] https://github.com/alphagov/notifications-utils/pull/164
2017-05-18 11:03:39 +01:00
minglis
5d7606f64b Merge pull request #1278 from alphagov/removing-placeholders-non-breaking
Make removing placeholders a non-breaking change
2017-05-18 10:54:23 +01:00
minglis
b16e5a2f13 Merge pull request #1276 from alphagov/remove-unused-elements-css
Remove unused Elements SASS
2017-05-18 10:54:01 +01:00
minglis
d8fa3497c6 Merge pull request #1280 from alphagov/bump-service-count
Bumped service count
2017-05-18 10:53:25 +01:00
Martyn Inglis
543c9742d3 Bumped service count 2017-05-18 10:41:03 +01:00
minglis
8b3b1b06eb Merge pull request #1274 from alphagov/48-49
48-49 (and 28-29) for Public Health England
2017-05-18 10:39:57 +01:00
Chris Hill-Scott
42ebc44b83 Make removing placeholders a non-breaking change
The CSV upload route has always quietly ignored excess personalisation.
We changed the API to do the same here:
https://github.com/alphagov/notifications-api/pull/853

This means that removing a placeholder from a template is never a
breaking change, because the data that you were providing to populate it
is now just ignored.

So we don’t need to show the interstitial page in this case.
2017-05-17 13:10:23 +01:00
Chris Hill-Scott
c32dbae8e9 Remove icons
We don’t use them anywhere, and removing this include should save a bit
of file size in the compiled CSS.
2017-05-17 08:56:11 +01:00
Chris Hill-Scott
fe5343e2c6 Remove duplicate include
This file is included again two lines below.
2017-05-17 08:55:50 +01:00
Chris Hill-Scott
78093f82d9 Merge pull request #1275 from alphagov/fix-page-count-bug
Fix argument order bug with page count
2017-05-16 11:44:17 +01:00
Chris Hill-Scott
d9f5884e3d Fix argument order bug with page count 2017-05-16 11:43:19 +01:00
Chris Hill-Scott
9820f0db49 Merge remote-tracking branch 'origin/print-test' 2017-05-16 11:23:09 +01:00
Chris Hill-Scott
c43b8efbab Merge remote-tracking branch 'origin/rearrange-send-page' 2017-05-16 11:22:57 +01:00
Chris Hill-Scott
09a5065a78 Merge remote-tracking branch 'origin/main-heading' 2017-05-16 11:22:48 +01:00
Chris Hill-Scott
11394bce8e Merge remote-tracking branch 'origin/all-pages-everywhere' 2017-05-16 11:22:33 +01:00
Chris Hill-Scott
24817de387 Merge remote-tracking branch 'origin/spreadsheet-error-tweaks' 2017-05-16 11:22:19 +01:00
Chris Hill-Scott
41e952a0f5 Merge remote-tracking branch 'origin/hide-table-send-test' 2017-05-16 11:22:02 +01:00
Chris Hill-Scott
0a770297cb Merge remote-tracking branch 'origin/prototype-deploy' 2017-05-16 11:21:30 +01:00
Chris Hill-Scott
acae449ab9 Show all pages of a letter everywhere
Right now showing all the pages in full is the only way we have of
showing a letter that makes sense to our users. Maybe in the future we
show some kind of truncated version, but the end of the first page is
not a good place to truncate the letter.

This commit just extracts the code for showing multiple pages from the
template view, refactors it for reuse, and includes it in the send
views.
2017-05-16 11:09:34 +01:00
Pete Herlihy
300faf664e 48-49 (and 28-29) for Public Health England 2017-05-15 13:14:30 +01:00
Chris Hill-Scott
7074d82d5f Make download into a normal button
It’s the primary action on this page. We use big, bold links for lists
of links, eg services, templates.
2017-05-11 12:57:25 +01:00
Chris Hill-Scott
59350e0c00 Rename ‘generate preview’
‘Print a test letter’ seems to be closer to what people’s expectations
of what this feature does are.

The word ‘generate’ sounded too much like something the system was
doing, rather than something you, the user, were doing.
2017-05-11 12:55:22 +01:00
Chris Hill-Scott
1df601c14d Move the template preview to the bottom
Having to scroll past the template preview is fine for a short text
message, but annoying and confusing for a long letter. We even have
people completely missing what the page is for, because they don’t go
all the way to the bottom.

This change makes more sense now that we have a page for previewing a
template (not one long page with all the templates). You’re already
pretty confident that you’re using the right template on this page. It’s
just there as a double-check, and to help people understand where the
columns in the example file are coming from.
2017-05-11 12:23:28 +01:00
Chris Hill-Scott
5d0904ca36 Make the file type info take less space
It doesn’t need to be a bullet point for each format. We tested this in
research with DWP staff yesterday and it didn’t cause any problems. I
also think it’s nicer for the UI to tell you what you need to do, rather
than tell you what it can “accept”.
2017-05-11 12:21:49 +01:00
Chris Hill-Scott
3efae3a57f Call letter subjects ‘main heading’
This is a term that one of our research participants used to describe
the big bold text that starts each letter. I think it’s quite a nice
plain english term for it.

Also changes the formatting guidance to use the word heading instead of
title, for consistency.
2017-05-11 12:10:37 +01:00
Chris Hill-Scott
d37f7b6bc5 Don’t repeat _your file_ at start of paragraph
Looks weird, like we’re telling you two contradictory things. Doesn’t
scan well.
2017-05-11 11:33:25 +01:00