Commit Graph

720 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
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
8e688d989b Use short date of utcnow to query notifications to align with
date stored in db for notification.
2016-06-21 10:54:30 +01:00
Chris Hill-Scott
a6219ecda2 Merge pull request #711 from alphagov/template-guidance
Give users more help about what to put in their templates
2016-06-20 16:23:22 +01:00
Chris Hill-Scott
eed554ebb8 Give the textbox on edit template a better label
‘Message content’ is very much _our_ name for the thing. ‘Message’ is
more human-friendly.
2016-06-20 14:04:36 +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
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
4c5622a019 Merge pull request #700 from alphagov/tour-into-templates
Redirect to the templates page after the tour
2016-06-17 16:35:00 +01:00
Chris Hill-Scott
fb6cf3b3f4 Removed unused get template call 2016-06-17 16:15:51 +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
4bc1cad416 Highlight failure rate on the jobs page
Forgot to do this as part of
56d9c29e91
2016-06-16 11:06:57 +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
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
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
a6833f4ad2 Change page <title> on check page
It was no longer accurate.
2016-06-05 18:41:19 +01:00
Chris Hill-Scott
4ac1a03a89 Use message_count_label component
For the button on the check page, we need to be able to say ‘1 text message’ or
‘55 emails’. We already have the logic to do this on the dashboard (101 text
messages sent), and it’s already in a component. So this commit makes the check
page use the same component.
2016-06-05 18:41:19 +01:00
Chris Hill-Scott
3ace856d74 Only show row-level errors if all columns are OK
Row-level errors are:

- bad phone number/email address
- missing data

I think it’s distracting to show these on the page if there’s something more
fundamentally wrong with the file, eg placeholders don’t match.

So this commit makes sure that these error messages are only displayed when the
top-level error says ‘There is a problem with your data’
2016-06-03 16:26:59 +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
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
Chris Hill-Scott
acfe87e788 Use hasattr instead of getattr
We don’t need the value returned by `getattr`, so using `hasattr` is cleaner.
2016-06-02 10:41:54 +01:00
Martyn Inglis
c9297459e2 Research mode
- adds a new link on service settings page to switch service into/out of research mode
- platform admin only
- shows an indicator in the footer
2016-06-01 16:07:43 +01:00
Chris Hill-Scott
6d3fbb1f51 Make example on send look more like a spreadsheet
Now that the example on the breaking changes page looks more like a spreadsheet,
we should do the same thing for the downloadable example on the send page.
2016-05-31 17:07:23 +01:00