Commit Graph

148 Commits

Author SHA1 Message Date
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
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
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
Leo Hemsted
65615360eb Merge pull request #658 from alphagov/last-used-message
Last used message
2016-06-07 16:13:30 +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
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
Leo Hemsted
9669024f49 table with sending/delivered/failed stats for each service today 2016-05-31 14:10:32 +01:00
Leo Hemsted
f2cca024dd Merge pull request #619 from alphagov/platform-admin-stats
Headline stats on the platform admin page
2016-05-31 13:53:21 +01:00
Leo Hemsted
83b151982e add stats boxes to platform admin page
moved a couple of stats summary functions from dashboard to a shared statistics_utils file
2016-05-31 12:17:06 +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
Nicholas Staples
2505d1421b Fixed download bug for services with api notifications. Re-organised the mock job and job_json methods. 2016-05-24 12:35:12 +01:00
Chris Hill-Scott
dd25eb0fe1 Give the job CSV a helpful filename
If you’re downloading a bunch of reports from your jobs then it’s useful to be
able to differentiate between them. This commit makes it easy to do so by naming
the file with:
- the name of the template
- when the job was created
2016-05-24 09:57:21 +01:00
Martyn Inglis
664ae33108 Formatting 2016-05-18 13:10:51 +01:00
Chris Hill-Scott
158d4d6c43 Merge pull request #566 from alphagov/refactor-sending
Refactor and tidy up sending
2016-05-17 11:40:09 +01:00
Rebecca Law
c4de547b74 Merge pull request #568 from alphagov/template_history_view
Template history view
2016-05-17 08:50:40 +01:00
Adam Shimali
18a0b94d98 Admin app settings to save reply to email address for service. 2016-05-16 13:10:51 +01:00
Chris Hill-Scott
e84436d0e1 Make s3upload function return the UUID
Generating the UUID can be can be contained within this function,
thus any other part of the code using it doesn’t have to do the
ID-generating stuff itself.
2016-05-16 13:05:41 +01:00
Rebecca Law
d4225de45e Update json structure for unit tests. 2016-05-16 11:53:22 +01:00
Nicholas Staples
64e7a7b010 Update all dates to use utc, only in the template is it converted to british time.
Template versions and template version pages added.

Fix merge changes.
2016-05-12 21:34:39 +01:00
Rebecca Law
9232ab51d5 Merge pull request #554 from alphagov/add-created_by-to-jobs
Update the jobs and activity page to show the user that created the job.
2016-05-11 14:55:29 +01:00
Rebecca Law
46d5065297 Update the jobs and activity page to show the user that created the job. 2016-05-11 11:57:31 +01:00
Nicholas Staples
af500a96e7 Update all dates to use utc, only in the template is it converted to british time. 2016-05-11 11:20:45 +01:00
Adam Shimali
5d7ff0cb47 Merge pull request #542 from alphagov/previous-weeks
Add a page to show delivery rates week-by-week
2016-05-09 10:17:59 +01:00
Chris Hill-Scott
50427ecd3f Add a page to show delivery rates week-by-week
Implements
https://github.com/alphagov/notifications-api/pull/286

Will always show weeks as Monday to Sunday.
2016-05-05 10:56:20 +01:00
Chris Hill-Scott
687ccad018 Make send a test teach you how placeholders work
This commit does two main things:

- adds textboxes to the send yourself a test page, so you can replace
  ((name)) with ‘Chris’, or whatever your name is
- rejigs the send page a bit to make it clearer what the CSV upload is
  for and how to use it

The idea being that, since most users go into ‘send yourself a test’
first, it teaches them about how placeholders work by making them do the
replacing themselves.
2016-05-05 08:53:00 +01:00
NIcholas Staples
bd0afce745 Merge pull request #527 from alphagov/windows_csv
Only check on csv is the file extension.
2016-05-03 12:50:34 +01:00
Chris Hill-Scott
00030bc254 Add usage to the dashboard
Takes the number of emails and SMS fragments sent from:
https://github.com/alphagov/notifications-api/pull/273

Using these numbers it’s possible to show:
- how much of your allowance is left
- or how much you have spent

For now the allowance and rates are hard coded.

Only for users that have manage service.
2016-05-03 11:06:12 +01:00
Nicholas Staples
f581ff44d0 Only check on csv is the file extension.
Update validator logic

Update message for the validator.
2016-05-03 10:10:58 +01:00
NIcholas Staples
96297d2989 Merge pull request #522 from alphagov/sms_msg_limit
Sms msg limit
2016-04-29 12:29:45 +01:00
Nicholas Staples
471eac209e Handling template content size error. All tests passing. 2016-04-29 09:38:59 +01:00
Andrew White
8995a86bb6 Merge pull request #520 from alphagov/redirect-to-dashboard-when-existing-service
Redirect to dashboard if this isn't the first service
2016-04-28 17:23:14 +01:00
Andrew White
7812b1cef5 Redirect to dashboard if this isn't the first service
There's no need to show the tour again if the user has previously
created a service so just redirect to the dashboard instead.
2016-04-28 16:44:12 +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
Adam Shimali
7c1867fde6 Record login including remembered user login events to the api based of flask login
signals.
2016-04-27 16:39:17 +01:00
Nicholas Staples
3122500ce0 Failed login count set to zero with password reset. 2016-04-26 11:51:34 +01:00
Chris Hill-Scott
312a903e65 Limit templates usage on dashboard to last 7 days
Previous the table of templates on the dashboard was for all time.
This commit uses the `limit_days` parameter of the API endpoint to only
show template usage from the last 7 days, aligning with the big numbers
shown above.
2016-04-20 15:02:29 +01:00
Chris Hill-Scott
8d6eb0985b Merge pull request #471 from alphagov/craig-david
Show the last 7 days of statistics on the dashboard
2016-04-20 11:13:51 +01:00
Chris Hill-Scott
be7c7cebbc Limit big numbers to the last 7 days
Implements and depends on:
- https://github.com/alphagov/notifications-api/pull/241
2016-04-19 17:10:39 +01:00
Nicholas Staples
f3210ea992 Functionality added to download all on activity page. All tests passing. 2016-04-19 11:45:36 +01:00
Nicholas Staples
6d9de1a500 Make service live and revert working, all tests passing. 2016-04-14 15:38:34 +01:00
Nicholas Staples
a6a42d6f26 Fixed bug for subject not updating when changed on the edit template page. 2016-04-14 14:08:35 +01:00
Nicholas Staples
3865c722fc Updated notifications_utils version and associated code. Added email subject formatting for placeholders. 2016-04-14 12:00:55 +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
Adam Shimali
159fe60c1a Template statistics now surfaced on dashboard.
Job list removed.

Template statistics retrieved at same time as
notification stats.
2016-04-05 11:47:24 +01:00
Chris Hill-Scott
7a0a81c07c Show error if restricted service uploads real CSV
Implements: https://github.com/alphagov/notifications-utils/pull/16

Also changes a bunch of the mocked phone numbers to be real-looking so
that the tests are checking for the right kind of error.
2016-04-04 17:17:52 +01:00
Nicholas Staples
a41dda8884 Working functionality for filtering notifications and all tests passing. 2016-04-04 16:34:06 +01:00
Rebecca Law
9a2cb60f5e Update the service name validation in the ServiceNameForm and AddServiceForm to check the email_safe version
of the name against a list of all service email_from fields.
Update find_all_service_names to find_all_service_email_from, which returns the email_from of all services.
2016-03-31 15:17:05 +01:00
Rebecca Law
677237ba47 Update email_from when the service name is changed.
Update unit tests
Service name is uniqueness is not based on case.
2016-03-30 17:12:00 +01:00