Commit Graph

32 Commits

Author SHA1 Message Date
Chris Hill-Scott
c31762265c Colour code notification statuses
Makes the table easier to scan.

Delivered stays as before.

Sending is greyed out.

All other statuses are failure, and stand out by being red and bold.
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
b1852f4b78 Make permanent failure status more human
Replace with ‘Phone number doesn’t exist’ or ‘Email address doesn’t’
exist.
2016-06-09 11:36:21 +01:00
Chris Hill-Scott
0a337a2663 On the activity page, only link to template or job
If the notification has come from an API call, the template is the
only thing that exists

If it’s a job, then we need to tell you name of the file. But you can
click though to see the template.
2016-06-09 11:06:53 +01:00
Chris Hill-Scott
8d7850ead1 Use .csv extension not querystring parameter
The link to download a CSV of notifications looks like
`/endpoint?download=csv`. This not not very web idiomatic.

The service manual recommends:
> Only use query strings for URLs with unordered parameters like options
> to search pages.

The CSV is a different representation of the same data, it does not
perform searching or filtering on the data.

The proper way (as we do elsewhere in this app) is to put an extension
on the endpoint to indicate an alternate representation, eg
`/endpoint.csv`
2016-06-07 16:35:49 +01:00
Chris Hill-Scott
06903d54be Remove template type filter from activity
This commit splits the activity page into two pages, one for emails
and one for SMS.

Technically this means moving from having template type in the
querystring and putting in it the URL, eg:

*Before*:
`/services/abc/notifications/?template_type=sms`

*After*:
`/services/abc/notifications/sms`
This commit changes the activity page to only have controls
2016-06-07 16:35:49 +01:00
Chris Hill-Scott
5b5ad2c5dc Fix 500 on job page when notifications are sending
Sending notifications don’t have an `updated_at`. This causes the time
formatting to throw a wobly, because it doesn’t expect `None`.

This commit changes the template to also look for the `created_at`,
which all notifications have.
2016-06-06 13:53:49 +01:00
Rebecca Law
6c14d925c5 Fix test to use a real status 2016-05-18 12:05:26 +01:00
Adam Shimali
a20fc1aa47 If user clicks failed or both filters for notifications status view,
append all other failure states to query to api.
2016-05-18 11:44:58 +01:00
Rebecca Law
fcf277c413 Merge branch 'master' into template_history_view
Conflicts:
	requirements.txt
2016-05-13 17:30:33 +01:00
Henry Hadlow
e3fa1ac253 Tidy up text on forgot your password screens
Display updated_at instead of created_at for notifications.
2016-05-11 16:30:15 +01:00
Chris Hill-Scott
f6ba5ec8d0 Merge pull request #528 from alphagov/activity-improvements
Link up the last 7 days
2016-05-03 10:58:51 +01:00
Chris Hill-Scott
127651b894 Make ‘7 days’ text on activity page not bold’ 2016-05-03 08:57:19 +01:00
Chris Hill-Scott
d82569f883 Fix page titles on activity page
We were getting some weirdness like ‘Failed both’.

This commit fixes the problem, and adds some tests for the page headings
to make sure they don’t break again.
2016-04-29 16:03:56 +01:00
Pete Herlihy
2f418eed65 Reminder of 7 days data retention on the activity pages 2016-04-29 15:30:44 +01:00
Adam Shimali
a627cf9002 Change activity to view to request 7 days data.
Cleaned up filters a bit so that if you want both templates
email and sms is passed.

Added mock assertion to test.
2016-04-28 15:52:20 +01:00
Chris Hill-Scott
7ddaf56aa9 Reverse the order of the filters on activity page
So that they match the order of the page title, eg ‘Failed text
messages’
2016-04-15 14:05:00 +01:00
Chris Hill-Scott
cadc700712 Remove human-friendly timestamps from activity page
This fix introduced by e6490e1 did not fix anything.

So lets remove the ‘3 days ago’ thing completely and just say the date
and time instead.
2016-04-14 13:47:53 +01:00
Chris Hill-Scott
e6490e18d1 Use a different module for doing nice timestamps
There is a bug in Babel[1] which means that it throws an exception if
it can’t find the locale it wants to use.

This is not a problem when developing locally, because OS X comes with
lots of locales. The AWS machines, however, only have one locale, which
is not the one that Babel is looking for. Hence the ‘Activity’ page
doesn’t work.

This commit changes to using Humanize[2] instead, which is much less
vast and hopefully less hungry in its requirements.

That’s a morning we won’t get back…

1. https://github.com/python-babel/babel/issues/137
2. https://pypi.python.org/pypi/humanize
2016-04-14 11:39:43 +01:00
Chris Hill-Scott
9b4933f16b Make activity page use new nomenclature for status
Statuses used to be:
- failed
- complaint
- bounce
- sent
- delivered

Now they are:
- sent
- sending
- delivered

This change broke the notifications page on the admin app.

It also made me realise that we should be ignoring ‘sending’ messages in
the history page—it should only show messages we’ve tried to deliver.

The code for this is a bit of a bodge, but it will get things working
again for now.
2016-04-13 17:10:05 +01:00
Chris Hill-Scott
a25bbaea06 Move download CSV link to top
You might miss it at the bottom if you’ve got lots of rows.
Better to have it in a consistent place.
2016-04-13 16:17:09 +01:00
Chris Hill-Scott
e282ca2109 Allow filter links to be used in combination
Means you can see, for example emails that have failed.

Means adding:
- logic to generate links which can have a type parameter, a status
  parameter, or both
- a ‘pill’ UI component for seeing which filters you currently have
  applied
- some logic to change the page title based on which filters you have
  applied
2016-04-13 16:17:09 +01:00
Chris Hill-Scott
1a6bb37171 Tidy up the ‘Activity’ table
This table had a lot of columns, which meant that some of them became
very narrow, wrapping the text awkwardly.

This commit groups some of the data into a chunk, which occupies the
first column.
2016-04-13 16:17:09 +01:00
Chris Hill-Scott
c81b8c39f6 Add view for a single template
> At the moment, we have an all email templates page, and an edit an
> individual page.
>
> This gets messy when we refer to templates like the dashboard and the
> activity views. We solve this currently by using anchor links to the
> list page, but this is clunky.
>
> So lets add it, then update the links on the dash and activity to the
> new view page.
>
> Should be a link from the view a single template page, to the template
> hub page.

https://www.pivotaltracker.com/story/show/117349227
2016-04-13 13:41:53 +01:00
Nicholas Staples
a6d1c5b693 Download CSV option now available.
App is updated to use the rebased db.
2016-04-12 15:38:02 +01:00
Chris Hill-Scott
2b9e016d14 ‘History’/‘Notifications activity’ → ‘Activity’ 2016-04-08 10:55:08 +01:00
Chris Hill-Scott
39e94ac8ec Add row numbers to tables
When a table is showing the contents of a CSV file, it should look
something like a spreadsheet.

The minimally skeuomorphic way to do this is by adding row numbers.

This commit doesn’t
- make the row numbers monospace (it’s barely noticeable and doesn’t
  reflect what actual spreadsheets do)
- make the first column heading ‘Row’ (again, doesn’t reflect how actual
  spreadsheets work, and takes up more valuable space)
2016-04-06 11:31:37 +01:00
Nicholas Staples
359d1c29cb Bug fixed, links now work. All tests passing. 2016-04-05 11:29:24 +01:00
Nicholas Staples
c31c55666b Added current_service to flask context and template context.
Fix all tests and conflicts.

Removed comment line.
2016-04-04 17:01:20 +01:00
Nicholas Staples
a41dda8884 Working functionality for filtering notifications and all tests passing. 2016-04-04 16:34:06 +01:00
Nicholas Staples
0411238dd9 Add in anchor link, and update link in notification history. 2016-03-17 10:59:47 +00:00
Nicholas Staples
b0ca855ba8 Notification history page added and pagination, tests all working. 2016-03-16 16:57:10 +00:00