Commit Graph

3739 Commits

Author SHA1 Message Date
Ken Tsang
bcc45ede9c Refactored code for new service permissions 2017-06-23 14:27:41 +01:00
Chris Hill-Scott
f8a3132d8b Merge pull request #1330 from alphagov/template-nav
Make list of templates filterable by type
2017-06-23 14:08:38 +01:00
Chris Hill-Scott
3e335c3250 Hide template nav if service has one of each
There are a bunch of services that just have one text message template
and one email template.

In this case the template navigation is essentially the same as the
list of templates – a user can just differentiate by looking at the two
templates. Adding the nav would just be noise in this case.
2017-06-23 13:53:54 +01:00
Chris Hill-Scott
867143e871 Center-align pill text when there’s no big number
When the text is left aligned it looks messy because the spacing is so
uneven and there are no big numbers to give it some rhythm.
2017-06-23 13:49:27 +01:00
Chris Hill-Scott
f386b991cb Only show template navigation when it’s useful
There are lots of services that only send emails, or only send text
messages. For these services, being able to filter the list of templates
but type is pointless – it won’t cut the list down at all.

This commit adds some logic to only show the navigation if the service
has some variety of template types.
2017-06-23 13:49:26 +01:00
Chris Hill-Scott
358edf7f20 Make list of templates filterable by type
When users are trying to find a template there’s a fair chance that they
know whether or not it’s an email/text message/(letter) that they’re
looking for.

Making them scroll past a whole bunch of templates of a different type
means it will take them longer to find the template they are looking
for.

We already have search on the templates page, but this is only good for
where they can remember the name of the template. This will be
sometimes but not always.

This commit adds some navigation to filter down the list of templates to
only show one type at a time. By default it will show all templates. It
adapts the pattern we use for filtering notifications by
sending/failed/delivered, but without the counts of how many things are
in each bucket (I don’t think there’s any value in knowing you have X
text message templates; on this page you only really care
about the one template you’re looking for).

_Note: required re-arranging the functions in `templates.py`. The route
for `/template/:uuid` needs to come before the route for
`template/:string` otherwise Flask tries to interpret a template’s ID
as its type.
2017-06-23 13:49:24 +01:00
Chris Hill-Scott
114bac7b80 Merge pull request #1333 from alphagov/fix-empty-table-message
Fix empty table message
2017-06-23 13:45:34 +01:00
Chris Hill-Scott
cde7d781d5 Fix empty table message
Bug was happening because:

```python
bool(list())
>>> False
```

```python
bool((item for item in list()))
>>> True
```

i.e. generator expressions cast to boolean are `True`, even if they’re
empty – Python doesn’t evaluate them.

This was causing the functional tests to fail because it was taking too
long for any table rows to appear on the page.
2017-06-23 13:37:05 +01:00
Pete Herlihy
69445380d9 Merge pull request #1331 from alphagov/57-59
57 - 60
2017-06-23 13:14:20 +01:00
Chris Hill-Scott
b6ba3dca21 Merge pull request #1332 from alphagov/revert-1329-quis-patch-1
Revert "Re-add IDs for each notification to the jobs page"
2017-06-23 11:24:39 +01:00
Chris Hill-Scott
3cec61f2f5 Revert "Re-add IDs for each notification to the jobs page" 2017-06-23 11:22:49 +01:00
Chris Hill-Scott
17f729f816 Merge pull request #1329 from alphagov/quis-patch-1
Re-add IDs for each notification to the jobs page
2017-06-23 10:56:53 +01:00
Pete Herlihy
4ea1360e1f Along came 60 - GDS events 2017-06-23 10:56:48 +01:00
Chris Hill-Scott
27a212ad15 Re-add IDs for each notification to the jobs page
The functional tests use this for the sending a CSV flow here:
4ee47db851/tests/pages/pages.py (L365)
2017-06-23 10:45:57 +01:00
Pete Herlihy
8182b034a5 57 - 59 for Primary Authority Register and Data Science Sandbox 2017-06-23 10:26:58 +01:00
Chris Hill-Scott
1797162248 Merge pull request #1328 from alphagov/notification-page-reworked
Add a page for each notification and start linking to it
2017-06-23 10:16:54 +01:00
Chris Hill-Scott
95b4d9eb31 Merge pull request #1326 from alphagov/bigger-dar-logo
Increase resolution of the TFL DAR logo
2017-06-23 10:16:47 +01:00
Chris Hill-Scott
f070f2b0ab Merge pull request #1325 from alphagov/bigger-click-areas-templates
Make click areas bigger on choose template page
2017-06-23 10:16:42 +01:00
kentsanggds
01760f3405 Merge pull request #1327 from alphagov/create-inbound-api
Create inbound api
2017-06-22 12:36:28 +01:00
Chris Hill-Scott
010886e5be Make clickable areas bigger on tables with links
Generally, bigger click areas are better[1], as long as they don’t cause
ambiguity or accidental clicks.

This commit expands the clickable area of tables where the left-hand
column is a link to include the meta information under the link.

We can’t make the whole row clickable, because sometimes we have links
in the right hand column which go to a different place

This commit also removes the CSS for `.spark-bar-label`, because these
elements are visually identical to `file-list`s now.

1. https://en.wikipedia.org/wiki/Fitts%27s_law
2017-06-21 17:57:21 +01:00
Chris Hill-Scott
b8cc0de44e Use file list pattern for notifications
Most of our tables are now lists which have:
- a thing you click on
- some secondary info about that thing underneath
- some extra numbers/status on the right hand side

Since these are so similar, they should share the same pattern, which
this commit does (using the `file-list` pattern).

Visually this means:
- the secondary text on the inbox becomes grey not black, for
  consistency
- the status bit of the notifications tables bottom align like the
  status of messages in the inbox

These both seem like OK changes to make for the sake of consistency.
2017-06-21 17:57:20 +01:00
Chris Hill-Scott
ff4a580ab4 Indicate template on scheduled jobs
We’ve removed the template on the jobs page, so you can no longer see
which template a job is about to be sent with.

This is removing information which might enable you to undo a costly
mistake.

I don’t think we need to bring back the whole template – giving its
name, and a link to it meets the need just as well.
2017-06-21 17:57:20 +01:00
Chris Hill-Scott
ba93be5ea5 Remove template from job page
Showing the template on the job page was semi-useful when you couldn’t
see the contents of each individual message. It was still a bit weird
because it just showed the template, never the actual messages that
went out, with the placeholders.

Now that users can click through to see individual messages, and can see
a short preview of the content on each row I think we can safely lose
the template preview on this page.
2017-06-21 17:57:20 +01:00
Chris Hill-Scott
c554e9e32d Put template content or subject in tables
In tables where we show rows and rows of information we used to give
some meta information about the notification, or at least as much as we
could give in the very limited space available.

This information is now on the notifications page, so the information we
show in these tables should just be whatever helps users identify the
right message. I reckon that this is:
- the content of the message for text messages
- the subject for emails and letters

This also makes these pages consistent with:
- the inbound SMS page
- the way the people’s inboxes work for their text
  messsages/Whatsapps/emails

For consistency’s sake this makes the job page work the same way. It may
be slightly less useful here because on the job page every message is
sent from the same template, so will have broadly the same content.
2017-06-21 17:57:20 +01:00
Chris Hill-Scott
f5b49b16e9 Don’t link to ‘Report’ jobs
‘Report’ jobs are what we used to have for one-off messages. The page
for a report job doesn’t contain any extra info from what’s on the
notification page. We will still have ‘Report’ jobs while we transition
to sending one-off messages through the API. So while we still have
these jobs, let’s hide any links to them because they’re not useful
pages.
2017-06-21 17:57:20 +01:00
Chris Hill-Scott
1eb3a5aca0 Link to the relevant job from notification page
If a notification has been sent from a job then that’s important context
to know about it. So we should surface that information on the page.

It also gives users an easy way of going back, if that’s the page
they’ve come from.
2017-06-21 17:56:08 +01:00
Ken Tsang
c5e1de9b33 Enable update of url / bearer_token inbound api 2017-06-21 17:34:22 +01:00
Chris Hill-Scott
929e2b841f Put notification meta above message, remove AJAX
The meta info about a notification (who sent it, when they sent it)
won’t ever change, so there’s no need for it to reload it using AJAX.

Putting it above the message and under the `<h1>` makes it match how
this information is displayed on the job page.

On the job page this information is bold, but visually the job page is
using too much bold now (nothing is emphasised/differentiated if
everything is bold). So this commit also makes this line of info regular
on both the notification and job pages.
2017-06-21 16:21:34 +01:00
Chris Hill-Scott
974953a64f Remove file name from single notification page
Having a file name for single messages made sense when they were called
‘Test message’. They made a bit of sense when single messages still had
a file, which had to be called _something_.

Now that individual messages don’t come from a file, and don’t land you
on a page that looks like a ‘report’.
2017-06-21 16:20:49 +01:00
Chris Hill-Scott
67b2937123 Show full message content on notification page
We’ve had a few teams talk about wanting to go back and check what their
users are sending out, including the content of any placeholders.

We already provide this functionality through the API, this commit makes
it the default in the admin app too.

We couldn’t do this before because we didn’t have the individual
notification page.

It’s better to do this by re-hydrating the template than pulling the
content from the API, because things like letters have multiple areas
of content – this is more complex than what we can get from API at the
moment.
2017-06-21 16:20:45 +01:00
Chris Hill-Scott
5e4aff2a7b Refactor test to match subsequent line
Easier to read these asserts if they’re formatted the same.
2017-06-21 15:17:11 +01:00
Chris Hill-Scott
b578c3589b Put status under message
Since we’ve removed the table of notifications from the single
notification page there’s no way of knowing the status of a
notification.

This re-adds it in a way that’s similar to how it looks on inbound
messages.
2017-06-21 15:15:13 +01:00
Chris Hill-Scott
a964417555 Show recipient on notification page
Since we removed the notifications table from this page we need a
different way of showing who the message was sent to.

Our `Template` classes already have a way of doing this, and we have a
flag to switch this on (which is what this PR changes).
2017-06-21 15:09:45 +01:00
Chris Hill-Scott
16d92b9a62 Remove notifications table from notification page
This table will only over show one notification.

There’s a better way to display who the recipient was, and what the
status of the notification is.
2017-06-21 15:09:44 +01:00
Chris Hill-Scott
742173dd33 Remove counts from notification page
The counts on the notification page will only ever show 1 thing. Which
feels like overkill, especially if you’re only sending one-off messages.

It’s also confusing when you come from the job/activity pages which
have one set of numbers to then be confronted with a different set of
numbers.

The important stuff on this page is:
- what the message was
- some meta information about it

Sorry Leo 😢
2017-06-21 15:09:44 +01:00
Chris Hill-Scott
7d0aed0ae8 Link to each recipient on activity and job pages
We have a page for individual notifications now.

On the job and activity pages each row of the table represents an
individual notification. So it makes sense for these things to be linked
together, so that a user can navigate from one to the other.

This will make more sense once we make some more changes to the
individual notification page.
2017-06-21 15:09:43 +01:00
Chris Hill-Scott
2ee5880e0c Change URL of notification page
This page is going to be used to show all notifications now, not just
ones sent as one-offs.
2017-06-21 15:09:40 +01:00
Leo Hemsted
250c64c4fb Merge pull request #1324 from alphagov/one-off
One off status page
2017-06-21 15:05:55 +01:00
Ken Tsang
ba8ee3e60a Add test for elided inbound api urls 2017-06-21 13:43:52 +01:00
Ken Tsang
3b47ff28f0 Refactored tests for inbound api 2017-06-21 12:15:53 +01:00
Chris Hill-Scott
7a07252854 Increase resolution of the TFL DAR logo
We’re showing these kinds of logos bigger as of this PR:
https://github.com/alphagov/notifications-utils/pull/170

If we don’t increase the resolution of the asset to be bigger then it
will look blurry.

New image is `108px` high, which is `2 * 54px`, in order for it to look
as good as possible on retina screens.
2017-06-21 10:53:32 +01:00
Ken Tsang
b2d07f1bb3 Refactor test to use flag 2017-06-20 17:51:58 +01:00
Ken Tsang
d3d0c0c0b6 Add create_service_inbound_api 2017-06-20 13:29:20 +01:00
Ken Tsang
827c6ccc99 Refactor inbound api html and processing 2017-06-20 13:24:01 +01:00
Ken Tsang
5d5bb69f0e Refactored set inbound api page 2017-06-20 13:07:50 +01:00
Ken Tsang
d9286b036f Add get and update service inbound api 2017-06-20 13:06:46 +01:00
Ken Tsang
5b54dd53a2 Change bearer input to password 2017-06-20 13:03:28 +01:00
Leo Hemsted
d47c2cdf9f remove dupe fixture 2017-06-20 10:51:25 +01:00
Chris Hill-Scott
02f8e4e14b Remove unused CSS
This stuff if leftover from when we used to have the sidebar of links
next to each template.
2017-06-20 10:06:15 +01:00
Chris Hill-Scott
18e8b570d7 Make click areas bigger on template picker
Generally, bigger click areas are better[1], as long as they don’t cause
ambiguity.

This commit expands the clickable area of links to templates to include
hint text underneath which states the type of template.

1. https://en.wikipedia.org/wiki/Fitts%27s_law
2017-06-20 10:05:21 +01:00