Commit Graph

2214 Commits

Author SHA1 Message Date
Chris Hill-Scott
dfcfe6a91e Add multiple ‘edit’ links for letter templates
Letter templates have (or will have) multiple different editable
regions. I think that the most intuitive way for this to work is to have
- an edit link for each of these areas
- positioned next to the thing to be edited

Again, this isn’t fully hooked up, but since no-one is using letters
live yet this is a good way of getting research feedback and pointing
towards where we want the feature to go.

Uses percentages for the positioning so that the alignment is maintained
on mobile.
2017-03-20 11:45:27 +00:00
Chris Hill-Scott
e391c7092a Call ‘send test’ ‘generate preview’ for letters
We think that sending a test for letters will mean downloading or being
emailed a PDF version of the populated template. While we haven’t
changed the app to do this yet, renaming the button is a good way to get
feedback about it from research.
2017-03-20 11:44:06 +00:00
Chris Hill-Scott
14bd05c8a5 Put actions at the top on single template page
The links to the right of the template take up valuable horizontal
space. This means that the preview of email and letter templates isn’t
as big as it could be. By making the letter preview bigger it removes
the need to click through to the PDF to see a preview.

Reuses the navigation style used on the API integration page, because I
think it damages consistency to create another new button style.
2017-03-20 11:43:17 +00:00
Chris Hill-Scott
de30558d57 Only show find as you type if enough templates
The find as you type only becomes useful once you have too many
templates to quickly scan visually on the page. I reckon that 7 is the
number where this starts becoming tricky. About 5 fit on the page
without scrolling (on my Macbook).
2017-03-20 11:42:30 +00:00
Chris Hill-Scott
04a5833d30 Autofocus the choose template search box
So you can just start typing as soon as you land on this page. Should
mean one less click, so fast for repeat use.
2017-03-20 11:41:35 +00:00
Chris Hill-Scott
f3c7a167df Add find-as-you-type on the choose template page
Not everyone knows how to use `ctrl` + `f`, and it’s not scoped to
just the list of templates.

The template you want to work with is often not the first one in the
list, but ordering by created at is useful for other reasons (mainly
around first time use).

This commit adds a find as you type control which aims to give users a
quick way of getting to the template they want to work with.
2017-03-20 11:40:19 +00:00
Chris Hill-Scott
1365265fc6 Make choose template a list of template names
When a team has lots of templates the choose template page gets very
long. It gets hard to find the template that you are looking for.

Our initial reckon was that teams would not be giving their templates
very useful names, and therefore a preview would be helpful. What we
have found is that:

- teams actually do give their templates useful names, and refer to
  these template names elsewhere

- the previews are less useful for emails and text messages, because
  they have so much content (which for emails also makes it harder to
  `ctrl` + `f` the template name)

The other problem we found was that this page presented the user with
a _lot_ of options. For each template there were 4 actions, plus the
click-to-preview action for letters, plus the ‘see previous version’
action for templates that had been edited multiple times. It was a very
busy page.

And the final problem (that we recently introduced) was that there was
no way, other than the visual cues, to know whether a template was a
letter, email, or text message.

So this commit strips back the choose template page to be very focused
on finding the right template, by only showing the template name and
type. The user can then click through to a page that shows just a single
template, and perform actions relevant to that template from that page.
2017-03-20 11:35:30 +00:00
Chris Hill-Scott
a762e8173f Merge pull request #1196 from alphagov/remove-unwanted-sass
Remove unwanted SASS
2017-03-20 11:28:09 +00:00
Chris Hill-Scott
5cfc7b1d88 Merge pull request #1194 from alphagov/40-41
40 - 41 for GOV.UK Blogs
2017-03-20 10:42:57 +00:00
Chris Hill-Scott
84ef532b9a Remove unwanted SASS
None of this SASS is used by the app any more. But we’re still shipping
it to every user. Let’s save some filesize by not doing so.
2017-03-20 10:20:09 +00:00
Chris Hill-Scott
5568da2439 Remove the ‘phone’ component
This was used on the old product page to do the graphic of three phones
showing three different messages. We don’t have this any more, so this
‘component’ is unused.

Also removes some unused imports which were a hangover from previous
versions of the product page.
2017-03-20 10:19:20 +00:00
Pete Herlihy
9990795a8e 40 - 41 for GOV.UK Blogs 2017-03-17 10:20:04 +00:00
Chris Hill-Scott
619fa61ea3 Relabel show more links on the dashboard
- ‘messages sent per month’ is a better description of what will appear
  on the page than ‘activity breakdown’
- ‘templates used by month’ instead of ‘this year’ for consistency

I think ‘usage breakdown’ still works for the remaining link – it’s more
than a monthly breakdown, it also breaks down the spend.

Doesn’t need to say ‘by month’ in the `<h1>`s themselves, because you
can see from looking at the page that it’s broken down by month.
2017-03-16 14:04:41 +00:00
Chris Hill-Scott
4a226a7a29 Show template usage broken down by month
This follows on from:
- https://github.com/alphagov/notifications-admin/pull/1094
- https://github.com/alphagov/notifications-admin/pull/1109

It depends on:
- [ ] https://github.com/alphagov/notifications-api/pull/829

A year is too long. Month-by-month is a better timeframe for making
decisions or seeing patterns in your usage.
2017-03-16 14:04:37 +00:00
Chris Hill-Scott
f2d0f75fce Only show back to service link if you have service
It doesn’t make sense to show the back to service link if, for example,
you are in the onboarding flow and haven’t created a service yet.
2017-03-15 14:26:04 +00:00
Chris Hill-Scott
9045b1a8c6 Merge pull request #1190 from alphagov/38-40
38-40 with Tax appeal tribunal and Data Publishing
2017-03-15 11:47:16 +00:00
Chris Hill-Scott
c5bd763953 Merge pull request #1189 from alphagov/dont-expire-csrf
Make CSRF tokens last as long as the session
2017-03-15 11:47:08 +00:00
Chris Hill-Scott
24b4b91e05 Merge pull request #1187 from alphagov/back-to-service
Add back to service link
2017-03-15 11:46:58 +00:00
Chris Hill-Scott
d889e674f0 Merge pull request #1186 from alphagov/quis-patch-1
🖨
2017-03-15 11:46:50 +00:00
Chris Hill-Scott
8fad5bf3c5 Merge pull request #1182 from alphagov/arrest-atypical-autocomplete
Stop Chrome mixing up phone no. and email address
2017-03-15 11:46:37 +00:00
Pete Herlihy
8df4f6b3f0 38-40 with Tax appeal tribunal and Data Publishing 2017-03-15 11:31:33 +00:00
Chris Hill-Scott
5ab5a8a57f Make CSRF tokens last as long as the session
If you’re filling out a form then it should be possible to submit it for
as long as you’re logged in. We keep you logged in for quite a long time
now. This is partly for people using assistive tech, who might be slower
to fill in forms, and partly for people who get distracted in the middle
of a task and come back to it later.

The expiry on our CSRF tokens was more aggressive (3600 seconds – 1
hour) than our sessions. This commit sets the CSRF tokens to not expire,
so in effect they last as long as the session.

Also tweaks the config to have CSRF on locally (to replicate production
more closely) and only disable it for tests (because it’s a pain to
grab the tokens in tests).
2017-03-15 11:16:58 +00:00
Imdad Ahad
fc8bbc5d6f Add more logging for getting next page logic 2017-03-15 10:29:38 +00:00
Chris Hill-Scott
51d736178c Add back to service link
When we moved the ‘Switch service’ link out of the nav on non-service
pages it removed any obvious way of getting back to your service on a
page that doesn’t have the service navigation (the non-obvious way is to
click ‘GOV.UK Notify’ in the black bar).

So this commit adds a ‘Back to service’ link which does the same thing
as clicking ‘GOV.UK Notify’ (tries to send you to your last-used
service, sends you to the list of services if it can’t).
2017-03-14 14:51:28 +00:00
Chris Hill-Scott
4e0ef92415 🖨
f5166bec79/app/notify_client/service_api_client.py (L143)
2017-03-14 13:03:03 +00:00
Imdad Ahad
276a072a54 Add logging for streaming contents 2017-03-13 14:53:19 +00:00
Chris Hill-Scott
33b15cdec6 Stop Chrome mixing up phone no. and email address
We keep seeing Chrome:

- autofilling the sign in form with a phone number in the email box
- autofilling the register form with an email address in the phone
  number box

This is because Chrome tries to autofill what it considers to be a
_login_. It detects a login as being:

- a password field
- preceded by a text input field

On the sign in page the password field is preceded by a field which is
supposed to receive an email address. On the register page the password
field is preceded by a field that’s supposed to receive a phone number.
I suspect that this is why it’s missing the two up.

The solution to this seems to be to defeat Chrome trying to be clever,
and make it autocomplete based on the `name` of the fields instead (we
name them sensibly, e.g. `email_address`, `phone_number`). The way to
defeat it seems to be sticking a dummy `input` right before the password
field on the register page. This dummy input is hidden from the page and
from screenreaders, so a user should never know it’s there. but Chrome
will autofill it anyway, with whatever wrong value it wants to.
2017-03-13 11:54:49 +00:00
Chris Hill-Scott
72fa3713e8 Make example text message template priority
The tour teaches you how Notify works by letting you do a thing and then
showing you the effect of the thing you’ve just done – a text message on
your phone.

This is not as effective if you don’t get the text message quickly. It
breaks the association you make between what you’ve done on the computer
and what’s happening on your phone.

Slow text message delivery can happen if you’re doing a big job. We can
get around this by making your text message use the priority queue.

This was observed in the pilot research session yesterday.
2017-03-09 10:30:19 +00:00
imdadahad
2391410435 Merge pull request #1170 from alphagov/feat-add-who-updated-providers
Show who updated providers and provider history data
2017-03-08 16:43:07 +00:00
Leo Hemsted
deb959e835 welsh assembly emails - foo@assembly.wales 2017-03-08 14:08:57 +00:00
Imdad Ahad
3d258b929d Use page footer for back link 2017-03-08 09:57:03 +00:00
Chris Hill-Scott
500e7a38db Merge pull request #1178 from alphagov/fix-html-showing-up-breaking-change
Fix HTML showing up on breaking change page
2017-03-07 16:09:42 +00:00
Chris Hill-Scott
7e185f67b1 Fix HTML showing up on breaking change page
The breaking change page temporarily holds the changes in hidden inputs
on the page. The messages content it gets from the `.content` property
on the subject. This is raw and not transformed in any way, so fine.

For the subject it gets the value from the `.subject` attribute on the
template. For email templates, this will be transformed to highlight
placeholders with `<span class='placeholder'>…`. This means that when
the change is confirmed, it’s this encoded version that gets sent to the
API. Which is bad, because we then save `<span class='placeholder'>` in
the database.

This commit changes the page to look at the `._subject` attribute
instead, which is the internal, untransformed version of the subject.
2017-03-07 15:11:37 +00:00
Chris Hill-Scott
30667786db Merge pull request #1177 from alphagov/33-38
33- 38
2017-03-07 12:04:47 +00:00
Pete Herlihy
d60de8559f Updated unique org count to 23 (reality) 2017-03-07 11:51:34 +00:00
Pete Herlihy
2483a4a280 Updated service and org count to latest figures
Added:
GOV.UK Surveys
Delta News
London Dial A Ride
Home Office Reporting
2017-03-07 11:43:06 +00:00
Chris Hill-Scott
c51c954efc Merge pull request #1176 from alphagov/fix-support-loop
Fix infinite loop in support flow
2017-03-07 10:38:58 +00:00
Chris Hill-Scott
56a282f2a0 Fix infinite loop in support flow
The support flow was using `yes` and `no` to mean emergency/not
emergency. But not in all places – in one place it was using
`True`/`False` instead.

We were treating anything other than `yes`/`no` as a non-answer, which
means ask the question again. Because of the `True`/`False` thing, there
was no way of the user providing a valid `yes`/`no` answer. Which means
that we just kept asking them the question again and again and they got
stuck in a loop.
2017-03-07 09:44:21 +00:00
Chris Hill-Scott
494b6958b5 Make ‘by month’ heading bold on usage
So that it has the same visual weight as the other headings of the same
level (ie ‘Emails’ and ‘Text messages’).
2017-03-06 14:56:41 +00:00
Chris Hill-Scott
5081d83c19 Fix count of columns on breaking change page
For some reason we were rebuilding `new_template` as a dictionary,
without the `placeholders` attribute. This meant that we were never
actually counting the placeholders, just counting the length of `None`
and adding 1 to it.

So this commit fixes that, beefs up the tests, and makes sure that
everything is pluralised properly.
2017-03-06 13:17:37 +00:00
Chris Hill-Scott
536d091d85 Fix HTML showing up on the breaking change page
41fa158635 added a proper Jinja filter
for formatting lists, which was better than the previous macro-based
solution.

It didn’t, however, account for HTML properly. It  did the default Jinja
thing of escaping everything. Since we render lists of placeholders
by putting HTML before and after each item, this didn’t work (the HTML
got escaped and appeared on the page).

So this commit does the escaping of HTML outside Jinja, in the
user-submitted bits of the input only, then passes the whole thing
through as a `Markup` instance which doesn’t get escaped by Jinja.
2017-03-06 13:17:36 +00:00
Chris Hill-Scott
b669e55dba Add hint to letter contact details input
Important for users to know about this limit.

Think it got dropped in all the merging somewhere.
2017-03-06 11:28:56 +00:00
Chris Hill-Scott
f54689a2b7 Merge pull request #1168 from alphagov/contact-letter-block
add letter_contact_block edit fields
2017-03-06 11:11:54 +00:00
Chris Hill-Scott
e9d5cc62b5 Merge pull request #1171 from alphagov/button-spacing-mobile-fix
Fix button spacing on mobile
2017-03-06 10:57:00 +00:00
Chris Hill-Scott
b3bb3aaf02 Merge pull request #1163 from alphagov/unified-template-page
Merge email, text message and letter templates pages
2017-03-06 10:42:08 +00:00
Leo Hemsted
1cacd92411 Merge pull request #1153 from alphagov/forget-me
Remove remember me cookie
2017-03-06 09:39:52 +00:00
Chris Hill-Scott
92a51c3a6c Pass contact block through to letter Template
So that it appears in letter previews…
2017-03-03 16:53:24 +00:00
Chris Hill-Scott
3dabd39c41 Add better error if user goes over line limit
Don’t make people count the number of lines themselves.
2017-03-03 16:30:18 +00:00
Chris Hill-Scott
63f52391fe Restrict letter template guidance to reasonable line length 2017-03-03 16:21:08 +00:00
Chris Hill-Scott
68113e764f Add guidance about the contact block 2017-03-03 16:21:08 +00:00