Commit Graph

609 Commits

Author SHA1 Message Date
Chris Hill-Scott
ceef77b2af Fix ‘help’ appearing when it shouldn’t
Steps to reproduce:
- make a template with a placeholder
- click ‘send yourself a test’
- leave fields blank
- click ‘check’
- see error, click ‘back’

Expected: previous page

Actual: previous page with blue help sidebar

When the URL contains `help=0`, `request.args.get('help')` returns '0'.
Doing `if '0':` is the same as doing any `if <non empty string>:` which
returns `True`.

So we should only display the help when the help query parameter is:

- not missing
- AND a string that isn’t `'0'`
2016-06-24 10:26:45 +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
18963f4645 Redirect to homepage after signout 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
0c31931876 Fix background colours on big numbers without links 2016-06-22 13:40:55 +01:00
Leo Hemsted
c5f8e1a259 Add live/trial flag on platform-admin page
Show 'Live' or 'Trial' under each service to easily identify services
2016-06-21 12:27:49 +01:00
Adam Shimali
d4103767d2 Merge pull request #712 from alphagov/notification-stats-day-admin
Daily limit bugfix
2016-06-21 11:09:11 +01:00
Adam Shimali
f030d1cb8a Move check_messages in admin over to using get notification stats for
day.
2016-06-20 13:49:47 +01:00
Chris Hill-Scott
e44d9895ce Tidy up ‘change service name’ page
- Make service name repopulate in textbox
- More spacing between sections of the page
2016-06-20 13:33:29 +01:00
Chris Hill-Scott
b7e58b0a5b Unroll unneccessary for loop 2016-06-20 10:07:37 +01:00
Chris Hill-Scott
7416070199 Refactor job conftests to eliminate temp variables
These tests were assigning something to a variable, then immediately
returning that variable. Why not just return the thing itself?
2016-06-20 09:31:29 +01:00
Chris Hill-Scott
8ca7832541 Filter test messages from jobs on the dashboard
While test messages technically have a file and are a job, there’s not
much reason to ever revisit them. So all they end up doing is cluttering
the dashboard and making it harder to find the actual files you’ve
actually uploaded from your computer.

So this commit:

- abstracts the name of test messages into config
- filters out any files whose filename represents a test message
- adds some more thorough tests for the jobs on the dashboard
2016-06-20 09:31:20 +01:00
Chris Hill-Scott
87a8906f1a Merge pull request #701 from alphagov/label-template-statistics
Add some words to the template statistics on the dashboard
2016-06-20 09:27:28 +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
Leo Hemsted
539950d772 when not logged in, redirect to sign-in
parts of the initial setup/login stages were throwing 500s if user
not already in process (ie: user directly navigated to url):
* /resend-email-verification
* /text-not-received
* /send-new-code
* verify
2016-06-17 13:53:48 +01:00
Chris Hill-Scott
56d9c29e91 Highlight failing jobs on the dashboard
> When we have jobs that have over 3% failure rates we should highlight
> those so that peoples attention is drawn to deal with the failure.
>
> They would then go to the job view to see what the details are where
> they could filter by failure, but that's a different story...
>
> This is just about calculating and highlighting those that need their
> attention.

— https://www.pivotaltracker.com/story/show/121206123

This commit:

- calculates the failure rate for each job
- makes jobs with a failure rate of > 3% go red on the dashboard
2016-06-15 10:25:48 +01:00
Chris Hill-Scott
7a7fe7fec1 Merge pull request #681 from alphagov/tables-of-notifications
Make dashboard and activity pages consistently clickable
2016-06-15 09:37:35 +01:00
Chris Hill-Scott
ee8ad47e29 Merge pull request #685 from alphagov/delete-template-bug
fix bug - calling wrong template_statistic endpoint causing 500 error…
2016-06-15 09:37:29 +01:00
Chris Hill-Scott
6d7d5a4e46 Make jobs filterable by notification status
We can filter all notifications by status already. This commit reuses
the same code to filter the notifications for a job by status.

This means that, visually we can show the count on a job the same as
we do for all notifications, which is similar to how we show the counts
on the dashboard, so hopefully it feels like a bit more of a solid
thing.

This also applies to CSV downloads and AJAX updates, which will inherit
any filtering that their parent page has applied.
2016-06-14 11:12:46 +01:00
Leo Hemsted
845fee69c4 fix bug - calling wrong template_statistic endpoint causing 500 error on delete
- also unrolled a test with a for loop into a parametrized test
2016-06-14 11:01:33 +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
Adam Shimali
56c3401a39 Requesting a resend of verify code for a user that has not completed
registration will allow user to check and modify mobile number.

Registered (active) users will only be able to request resend to their
existing registered number.
2016-06-13 16:31:54 +01:00
Chris Hill-Scott
40564df15e Link back to all template versions from 1 version
If you get linked to a single version of a template, you’re at a dead
end. Let’s add a link to go back up a level to where you can understand
the current version in context.
2016-06-12 14:35:58 +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
Adam Shimali
d005406682 Merge pull request #661 from alphagov/invite-accepted-bug
Change when invite gets marked as accepted.
2016-06-08 13:32:20 +01:00
Chris Hill-Scott
29f8b94612 Merge pull request #657 from alphagov/make-activity-consistent
Make activity consistent
2016-06-08 12:57:07 +01:00
Adam Shimali
0544ea776b Change when invite gets marked as accepeted. 2016-06-08 11:52:26 +01:00
Chris Hill-Scott
3d7f07493b Add filters for ‘processed’ and sending states
- _Processed_ is all the notifications that we know about, ie sending,
  failed and delivered

- _Sending_ is notifications that we have either put into a queue or are
  waiting to hear back from the provider about.

The big numbers on the dashboard are a count of all the messages we’ve
processed. So when you click them, the table of notifications you see
on the dashboard should contain that number of notifications.

This also gets the activity page one step closer to being like the job
page:

         | Before                     | After
---------|----------------------------|---------------------------------
Activity | Sending, failed, both      | Processed, sending, failed, delivered
Job page | Sending, failed, delivered | Sending, failed, delivered
2016-06-07 16:37:06 +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
e1b2999371 Move test for downloads CSV of notifications
Downloading a CSV of notifications is very similar to viewing them on
a webpage. So I think it’s sensible to move the assertions about the
CSV download link into the same test, rather than it being it’s own
test.

This means being able to reuse the parametrization introuced in this
commit’s parent.
2016-06-07 16:35:49 +01:00
Chris Hill-Scott
9b099d78c7 Make test for activity page more thorough
This commit paramaterizes the test for the activity page, so that it
checks all combinations of template type and notification status.
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
Leo Hemsted
65615360eb Merge pull request #658 from alphagov/last-used-message
Last used message
2016-06-07 16:13:30 +01:00
NIcholas Staples
f399e4b240 Merge pull request #656 from alphagov/bug_fix_for_tour_back_button
Bug fixed when sending yourself a test the back button links to the c…
2016-06-07 15:17:40 +01:00
Leo Hemsted
c4305d1610 only get template statistics for specific template 2016-06-07 14:28:02 +01:00
Leo Hemsted
9db20819ef tests for last used message
also now parsing the datetime correctly and removing its UTC tz info to make comparisons work
2016-06-07 11:50:15 +01:00
Leo Hemsted
4831e068d9 Add warning message showing date template last used when deleting 2016-06-07 11:50:15 +01:00
Nicholas Staples
d53b4bd7cd Bug fixed when sending yourself a test the back button links to the correct url.
Remove traceback.
2016-06-07 09:55:04 +01:00
Adam Shimali
83b1158472 Merge pull request #652 from alphagov/permissions-bug-fix
Expand permissions before post to api
2016-06-07 09:36:50 +01:00
Adam Shimali
18ba6c16b4 In case user details were not in session the redirect did not use
url_for to redirect to sign in.
2016-06-06 14:46:16 +01:00
Adam Shimali
813e1c3351 Expand permissions to all possible values on admin before posting to
api. This makes template work for both existing and invited users.

API will no longer need to convert from what ui presents as permissions
2016-06-06 12:40:21 +01:00
Chris Hill-Scott
3ddc1d171d Merge pull request #646 from alphagov/rearrange-csv-errors
Prioritise CSV errors to help you match placeholders to column headers
2016-06-06 12:21:13 +01:00
Chris Hill-Scott
7884f7870b Redirect to single template view after edit
When you edit a template, you’re probably going to do something with
it straight afterwards, eg send yourself a test.

We could make it easy to find the template you’ve just saved by putting
it at the top of the pile. This gets confusing for other reasons (order
of templates will constantly shift about).

So this commit changes the flow to take you to the single page for the
template you’ve just edited.
2016-06-06 10:23:33 +01:00
Chris Hill-Scott
2ff6cf049f Change order of errors for bad CSV files
This commit rearranges the CSV errors (again) to make them geared towards
teaching you how to match placeholders to the column headers.

So the order of errors now is:

1. No phone number/email column
2. Column headers don’t match placeholders
3. Missing or bad data
4. Trial mode
5. Daily limit reached

This depends on:
- [x] https://github.com/alphagov/notifications-utils/pull/39 for 1.
2016-06-03 16:26:58 +01:00
minglis
b35f747fc1 Removed print 2016-06-03 12:00:08 +01:00
Martyn Inglis
29fd69258c Added invite user button for platform admins on any service 2016-06-03 11:10:38 +01:00
minglis
0219ddf2f8 Merge pull request #634 from alphagov/research-mode
Research mode
2016-06-02 12:00:39 +01:00
Chris Hill-Scott
20d76c0625 Merge pull request #631 from alphagov/breaking-change
Warn users when a template change is going to break things
2016-06-02 11:29:16 +01:00
Martyn Inglis
009a7160de pep8 appeased 2016-06-01 17:02:12 +01:00