Commit Graph

237 Commits

Author SHA1 Message Date
Chris Hill-Scott
bc0c620fa1 Delete spacer.png
Depends on:
- [ ] https://github.com/alphagov/notifications-utils/pull/63
- [ ] https://github.com/alphagov/notifications-api/pull/587

The utils fix needs to be deployed to live on the API before this can be merged/deployed
2016-08-08 12:00:00 +01:00
Chris Hill-Scott
aed10f711c Add spacer image for email template
Forgot to include this before.

The template expects it in `./images` but it should probably live in
`./images/email-template`.

This commit puts it in both places; we can clean up later.
2016-08-08 11:12:01 +01:00
Chris Hill-Scott
d0ac61403a Merge pull request #837 from alphagov/add-crests
Add department crests for email sub branding
2016-08-08 10:27:30 +01:00
Chris Hill-Scott
940815b33c Tighten up spacing around download link 2016-08-05 10:59:49 +01:00
Chris Hill-Scott
b9a69def00 Revert "Stop AJAX updater consuming ever-increasing memory" 2016-08-04 12:06:04 +01:00
Chris Hill-Scott
776299c26f Add department crests for email sub branding
We need to host these images somewhere. Let’s start off doing it in
the admin app, like we do for other email assets.

Eventually we should have a CDN in front of this.

Images lifted from
76ff2e0b6d/app/assets/images/crests
2016-08-03 14:42:13 +01:00
Chris Hill-Scott
ec724ce417 Stop AJAX updater consuming ever-increasing memory
The pages with AJAX on were feeling quite sluggish, and it felt like
they were making the whole browser slow down.

Looking at the performance stuff in Chrome, the number of DOM nodes was
going up and up, which is weird because the number of things on the page
wasn’t changing. This was causing the page to consume more and more
memory in order to store all these nodes.

This is kinda beyond my understanding, but I tried a few things and it
looks like the browser was having a hard time garbage collecting the
temporary bits of DOM used to update the page.

By assinging these bits of DOM to variables before using them it seems
that the browser has an easier time cleaning them up.
2016-08-03 10:29:25 +01:00
Chris Hill-Scott
f22b61b9f4 Add beta banner to homepage
Because the homepage of the app is discoverable to the public, it makes
“gives the wrong impression” for it not to have a beta banner.
2016-07-28 09:08:15 +01:00
Chris Hill-Scott
1c8c86bd1c Merge pull request #781 from alphagov/template-previews
Adds previews of email templates
2016-07-15 10:35:15 +01:00
Chris Hill-Scott
9c83d559f3 Fix wonky tables on dashboard and activity page
Tables with a `layout` of `fixed` determine column widths from the
width of the column headings.

We weren’t setting the width of the first column heading, so our tables
were getting out of alignment.
2016-07-13 16:56:28 +01:00
Chris Hill-Scott
c006b8748c Add conditional placeholder detection
Implements: https://github.com/alphagov/notifications-utils/pull/51

Copies the same regex.

Adds some CSS to display conditional placeholders differently to
normal placeholders (vertical rather that curved right-hand edge).
2016-07-12 17:11:52 +01:00
Chris Hill-Scott
ec01eee7b9 Merge pull request #766 from alphagov/visual-refactor-team-page
Visual refactor team page
2016-07-08 09:02:20 +01:00
Chris Hill-Scott
f9ebb337e3 Tidy layout of team page
The team page was a bit of a mess:

- invited and active tables didn’t line up
- lots of things were wrapping onto two lines
- the empty fields for when a user didn’t have permissions looked broken

This commit splits each row of the table (not actually a table any more)
onto two lines. First line has the user’s info, second has their
permissions and any associated actions.
2016-07-07 12:43:35 +01:00
Chris Hill-Scott
ddef996f34 Rename ‘API keys’ page to ‘API integration’
Since this page is more than just your API keys, it should be named
something else.

Hopefully the word ‘integration’ will give non-techical users a clue
that it’s possible to use Notify without doing the CSV dance.
2016-07-06 10:12:20 +01:00
Chris Hill-Scott
8c05c08249 Reword ‘send emails’ to ‘upload recipients’
…and change the page heading on next page to match.

‘Send emails’ doesn’t speak to you if you already have the idea of a
file or address book in mind. ‘Upload’ better describes what you’re
going to do on the next page.

Also makes all the links regular weight, because having the first one
bold looked like a heading.
2016-07-01 14:27:58 +01:00
Chris Hill-Scott
25829762bf Add ‘get started’ back to the dashboard
Since we’re removing the write email/write text message calls to action
from the tour, we should reintroduce them to the dashboard, for users
who are unsure what they should do next.
2016-07-01 14:00:45 +01:00
Chris Hill-Scott
e988a3633a Platform admin: Highlight service in research mode
Research mode trumps live.

Copies the same style we use in the page footer.
2016-06-23 17:47:19 +01:00
Chris Hill-Scott
68cb76a12e Merge pull request #715 from alphagov/fancy-homepage
Make it clearer what Notify is for from homepage
2016-06-22 15:01:17 +01:00
Chris Hill-Scott
1667996716 Make it clearer what Notify is for from homepage
Uses some graphic design to communicate what Notify is:

- for sending messages to lots of people
- messages can be personalised
2016-06-22 14:37:02 +01:00
Leo Hemsted
cabf6cb6b1 Merge pull request #717 from alphagov/service-status
Add live/trial flag on platform-admin page
2016-06-22 14:28:44 +01:00
Chris Hill-Scott
2aabc4a7e9 Merge pull request #719 from alphagov/dashboard-link
Add a ‘dashboard’ link to the navigation
2016-06-22 14:12:27 +01:00
Chris Hill-Scott
0c31931876 Fix background colours on big numbers without links 2016-06-22 13:40:55 +01:00
Chris Hill-Scott
3ffeec6fbb Use tabular numbers for all big numbers
Reimplements https://github.com/alphagov/notifications-admin/pull/169

> Tabular numbers have numerals of a standard fixed width. As all
> numbers have the same width, sets of numbers may be more easily
> compared. We recommend using them where different numbers are likely
> to be compared, or where different numbers should line up with each
> other, eg in tables.

— 5f38012f94/docs/mixins.md (tabular-numbers)
2016-06-22 09:56:17 +01:00
Chris Hill-Scott
743c747688 Refactor navigation SASS
Moves the right-padding from being on the container and each element
to just being on the container.

No visual changes.
2016-06-22 09:34:21 +01:00
Chris Hill-Scott
9abd19e092 Add a ‘dashboard’ link to the navigation
It’s been unclear that:

- the dashboard exists
- that you click the name of the service to get back to it

So this commit:

- takes the link off the service name
- adds a link labelled ‘Dashboard’ to the navigation
2016-06-22 09:31:37 +01:00
Chris Hill-Scott
d2b4dd5007 Revert "Add character count as you type"
This reverts commit fbc4abf85d.
2016-06-20 16:03:21 +01:00
Chris Hill-Scott
c975e0f671 Remove placeholder hint JS
This was used for an older iteration of placeholder guidance. Not used
anywhere now.
2016-06-20 14:45:59 +01:00
Chris Hill-Scott
fbc4abf85d Add character count as you type
Text messages have a maximum length, which we tell the users. We
shouldn’t expect people to count the characters in the message
themselves.

This commit borrows [the word counter from the Digital Marketplace
frontend toolkit](9d17690de5/toolkit/javascripts/word-counter.js)
and adapts it to count characters instead.

Things I’m still not sure about with this:

- what should it say when the message goes over the length of one text
  message
- what’s the interaction with placeholders, which will change the length
  of the message

This commit also adds a line to the pricing page which explains that
service name counts towards the length of the message.
2016-06-20 14:45:59 +01:00
Chris Hill-Scott
3fa0e3aa66 Give more guidance about what to put in templates
There are some common questions that keep coming up when users are
editing or creating templates. This commit adds a pattern for sections
of guidance which can be shown/hidden.

It then modifies the guidance as follows.

Change:

- guidance about placeholders; give an example about what to do and what
  not to do (because the mistake we keep seeing people make is putting
  the thing itself, not the name of the thing)

Add (pretty basic at the moment but a need for these has come out of
research):

- guidance about links
- guidance about message length for text messages
2016-06-20 14:05:25 +01:00
Chris Hill-Scott
5a95f4a7dd Tighten up spacing for better visual grouping 2016-06-17 16:30:02 +01:00
Chris Hill-Scott
fa7345e9d0 Make template statistics on the dashboard a table
It was a `<dl>` before which is kinda weird. Especially when the jobs
table was a real `<table>`.

It also means we can give it column headings so that new and invited
users have a better idea of what it is.
2016-06-17 16:30:02 +01:00
Chris Hill-Scott
18578af75c Merge pull request #686 from alphagov/no-jump-email
Stop page jumping on first load with a long email
2016-06-15 09:38:56 +01:00
Chris Hill-Scott
66a33e4e47 Stop page jumping on first load with a long email
A long email message needs to be collapsed to only show the first few
lines. The problem is that we were doing this by adding a class with
Javascript, meaning that the email wasn’t being collapsed until the
script in the footer ran.

This caused a jump in the page because the browser was painting the
whole email message, then repainting it once it was collapsed.

This commit takes advantage of the `.js-enabled` class added to the
`<body>` by a script in the `<head>` of GOV.UK template.

This means that the email message is collapsed with CSS before the first
paint of the page, so no jump.

This introduces some complexity in how we determine which emails get the
expander toggle. Because they’re already collapsed we can’t get their
height and work out if they’re long enough to need collapsing.

So we need to take a copy of the message, put it off-screen, expand it,
get its height, then remove it from the DOM. Bit of a faff.

Because of this there’s still a quick flash of the toggle if you see an
email message that’s too short to need collapsing. I think this is the
lesser of two evils—very short email messages will be few and far
between in the real world.
2016-06-15 09:35:55 +01:00
Chris Hill-Scott
a0f6956eab Give headline numbers a blue, not black background
These numbers don’t look very clickable white-on-black.

Blue is the colour of links, so lets see if they are more clickable in
blue.

The same clicking-a-big-number thing is also happening on the activity
page, so this commit also changes the activity page to look the same.
2016-06-14 11:00:56 +01:00
Chris Hill-Scott
e7e0b2f227 Put counts into the notification filters
We can filter notifications on the activity page by state.

This commit adds counts to those filters.

This is mainly so that we can consistently do the same thing on the job
page later on.
2016-06-14 11:00:56 +01:00
Chris Hill-Scott
e5d2514846 Make template graphs look consistent with page
The graphs of template usage feel a bit weird to me now.

1. They are counts of messages, but the numbers are very small
   not big like we do everywhere else (eg the counts on a job)

2. There’s a lot of blue, especially for something that you can’t
   click

This commit makes the numbers bigger and the bar chart grey.
2016-06-14 11:00:56 +01:00
Chris Hill-Scott
cdc900b7ef Merge pull request #675 from alphagov/fix-table-display
Fix table display
2016-06-13 11:39:08 +01:00
Chris Hill-Scott
281c54b80b Make job counters smaller
With sending, delivered and failed all on one line there’s not much
space. When these numbers get relatively big (in the 000s) they can
start mushing into each other.

This commit makes them smaller so that they remain separate.
2016-06-13 10:26:01 +01:00
Chris Hill-Scott
4077e2860d Fix display of spreadsheet tables
a9f79bcf07 made all tables have a `fixed`
layout. This causes issues with the spreadsheet-looking tables.

This commit treats tables with half-width first columns as the
exception, not the rule, and makes other tables display as before.
2016-06-13 10:26:01 +01:00
Chris Hill-Scott
940170159a Handle AJAX errors when updating content
With the change in implementation in the previous commit, any error
(eg server responds with `500`) would cause the page to not be updated
again.

This is better than the previous implementation, whereby the browser
would re-request as fast as it could until it got a successful response.

This commit handles errors by clearing the render queue if the server
returns an error. So:

- Any updates that would have been performed based on this request are
  dropped
- Subsequent updates will be attempted as if it was the first load of
  the page, ie after a delay of `x` seconds
2016-06-12 14:16:27 +01:00
Chris Hill-Scott
9c92a2bd86 Stop AJAX updates queuing requests
The `updateContent` module updates a section of the page based on an
AJAX request.

The current implementation will poll every `x` seconds. If the server
takes a long time to respond, this results in a the browser queuing up
requests. If a particular endpoint is slow, this can result in one
client making enough requests to slow down the whole server, to the
point where it gets removed from the loadbalancer, eventually bringing
the whole site down.

This commit rewrites the module so that it queues up the render
operations, not the requests.

There is one queue per endpoint, so for
`http://example.com/endpoint.json`:

1. Queue is empty
```javascript
{
  'http://example.com/endpoint.json': []
}
```

2. Inital re-render is put on the queue…
```javascript
{
  'http://example.com/endpoint.json': [
    function render(){…}
  ]
}
```

…AJAX request fires
```
GET http://example.com/endpoint.json
```

3. Every `x` seconds, another render operation is put on the queue
```javascript
{
  'http://example.com/endpoint.json': [
    function render(){…},
    function render(){…},
    function render(){…}
  ]
}
```

4. AJAX request returns queue is flushed by executing each queued
render function in sequence
```javascript
render(response); render(response); render(response);
```
```javascript
{
  'http://example.com/endpoint.json': []
}
```

5. Repeat

This means that, at most, the AJAX requests will never fire more than
once every `x` seconds, where `x` defaults to `1.5`.
2016-06-12 14:15:04 +01:00
Chris Hill-Scott
a9f79bcf07 Truncate items that don’t fit in the first column
The first column of a table is a heading, and will always be 50% wide.

It makes the table harder to scan when the information in the first
column breaks onto multiple lines, and introduces uneven whitespace in
the table.

This commit adds some CSS to force things in the first column to only
ever be one line. If they are too long to fit, they get truncated with
an ellipsis (`…`)
2016-06-09 11:36:22 +01:00
Chris Hill-Scott
2e8e650733 Put same info in both tables of notifications
We have tables listing notifications on:
- the job page
- the ‘activity’ page

Previously that had subtly different information, in a different order.
This commit makes them exactly the same.
2016-06-09 11:36:22 +01:00
Chris Hill-Scott
d213e2cc67 Give each row in a table a heading
The first columns of our tables are always headings for the
subsequent columns, even though they go horizontally.

HTML has the `<th>` tag, which doesn’t just have to be used for headings
along the top of a table. So this commit changes the first column to be
a `<th>`.

This then allows us to style these elements differently, specifically
making them 50% wide. This makes pages like the dashboard align more
nicely.
2016-06-09 11:36:22 +01:00
Chris Hill-Scott
51f6450e5d Make placeholder look more editable
Depends on:
- [ ] https://github.com/alphagov/notifications-utils/pull/40

In research we’ve noticed two problems with the appearance of
placeholders:

1. We are inconsistent about when we display the ((double brackets)).
   Sometimes we show them, sometimes we don’t. This doesn’t help user’s
   understanding about where the column names in their CSV file come
   from, or how they can edit the template to fix any errors.

2. Because they look so different from normal `<textarea>` text, it’s
   not immediately obvious that they can be edited just like normal
   text. They look more like something that can be dragged/inserted.

So this commit:

1. Makes the brackets always-visible.

2. Makes the text colour of the placeholder `$text-colour`, and only
   highlights the name of the ‘variable’, not the brackets themselves.
2016-06-06 12:59:40 +01:00
Chris Hill-Scott
3ac76192d0 Warn users a template change will break things
When a user adds or removes placeholders in their template we should consider
this a ‘breaking change’ and warn them accordingly.

Implementing this mostly relies on using
https://github.com/alphagov/notifications-utils/pull/37

Temporarily storing the new template until the user confirms that they want to
make the changes in done using hidden fields. This is a bit hacky, but the
complexity of making sessions interact with WTForms was just too much to handle.

This commit also changes the example spreadsheet that we show on this page to
look more like a spreadsheet.
2016-05-31 17:07:05 +01:00
Chris Hill-Scott
b84d06bd68 Move parameters out of the …_message components
This commit refactors the `email_message` and `sms_message` UI components to
take fewer parameters.

`name`, `edit_link` and anything to do with versions are identical for both
text and email messages so I’ve moved them to the pages where you choose a
template or see the versions.

This commit also tidies up the wording and styling of the template history
stuff.
2016-05-27 11:08:40 +01:00
Chris Hill-Scott
16d83faa72 Put uploaded files on the dashboard
This commit depends on and uses the data returned by:
- [x] https://github.com/alphagov/notifications-api/pull/345
- [x] https://github.com/alphagov/notifications-api/pull/347
- [x] https://github.com/alphagov/notifications-admin/pull/612

It puts the last 5 jobs on the dashboard. This should be changed to all the jobs
from the last 7 days when that parameter is available.

It also:
- links to the jobs page
- makes the numbers on the jobs page consistent with the dashboard
- makes the numbers on an individual job consistent with the appearance of the
  dashboard
2016-05-26 09:00:00 +01:00
Chris Hill-Scott
c41944080c Make the tour interactive
_The code for this is quite hacky and light on tests. But I’d really like to get
it in the app for the research tomorrow to see how well the feature works._

This commit changes the tour from being a set of static screens to some help
which guides you through the process of sending your first test message.

The theory behind this is that what users are really struggling with is the
concept of a variable, rather than the relationship between the placeholders and
the column headers. And like learning to program, the best way to learn is by
taking an example and modifying it to your own needs.

This means that when someone adds their first service we set them up an
example email template and an example text message template. Then there is a
guided, three step process where _all_ the user can do is send a test message to
themselves.

Once the message is sent, the user still has the example templates which they
can edit, rather than having to remember what they’re supposed to be doing.
2016-05-25 13:14:09 +01:00
Chris Hill-Scott
45f21e9a10 Hide ‘created at…’ on the templates page
I don’t think that if there’s only one version of the template that it’s
useful to see the created at date.

The auditing stuff only becomes relevant once someone a template has been
changed.
2016-05-24 09:22:12 +01:00