Commit Graph

795 Commits

Author SHA1 Message Date
Martyn Inglis
49b4387b25 Merge branch 'master' into handle-new-template-stats-endpoint 2016-08-23 09:30:38 +01:00
Martyn Inglis
4dec7a7939 Changed order of templates activity page from alphabetical to desc count. 2016-08-23 09:14:21 +01:00
Martyn Inglis
9fbd410474 Merge branch 'master' into use_new_template_stats_endpoint
Conflicts:
	app/notify_client/template_statistics_api_client.py
2016-08-22 16:47:42 +01:00
Martyn Inglis
c43fde0ac0 For the brief moment when we have incompatible API versions out,
We won't call template stats by template id as the format has changed. So just ask the question "do you want to delete" without the context.
2016-08-22 16:35:14 +01:00
Chris Hill-Scott
1e254415d2 Text message not Sms 2016-08-22 13:30:03 +01:00
Martyn Inglis
63fa77fde7 Admin app now in line with new API response for template statistics
- dropped the day level aggregate. Now grouped by template only,
2016-08-22 13:14:35 +01:00
Martyn Inglis
55c4443a05 Admin app uses the new API response formats. 2016-08-18 15:30:57 +01:00
Leo Hemsted
fde8d81868 send organisation back in correct variable 2016-08-15 11:15:49 +01:00
Leo Hemsted
3c0f06a36d set value of radio input to be org id
also don't use nil, this isn't ruby
2016-08-15 10:39:34 +01:00
Leo Hemsted
fb510d2522 only set organisation on GET and add allowed fields to service client
we were overwriting it before validating the form for POST, so lost info
2016-08-12 12:37:18 +01:00
Leo Hemsted
7c16614538 set current services's values on service branding form 2016-08-12 11:48:04 +01:00
Chris Hill-Scott
6b5e64479a Add a page to set organisation and branding option
Platform admin only.

Adds radio buttons to choose one of:
- three hard-coded branding options
- organisations from a list provided by the API
2016-08-12 10:31:43 +01:00
Leo Hemsted
20c39d24b7 Merge pull request #863 from alphagov/allow-partial-service-updates
Allow partial service updates from service API client
2016-08-12 10:07:55 +01:00
Leo Hemsted
6d27d568fe Merge pull request #865 from alphagov/remove-noti-stats
remove unused call to notification statistics
2016-08-11 17:32:07 +01:00
Chris Hill-Scott
002b58a062 Make service API client do partial updates
The service API client was updating every attribute of a service. Which,
while kinda clunky, is fine…

…until something calling it doesn’t pass in every attribute of the
current service. It was then defaulting optional parameters to `None`.
Which resulted in a bug whereby every time a service was set to live,
its `reply_to_address` and `sms_sender_name` got overwritten to be
empty.

This commit changes the `update` method to only require the service ID,
and pass whatever other named arguments it received straight through to
the API. The API handles partial updates just fine (I think).
2016-08-11 17:07:33 +01:00
Chris Hill-Scott
a809ef59fb Merge pull request #861 from alphagov/trial-mode-api-keys
Talk about trial mode on API keys page
2016-08-11 16:44:16 +01:00
Chris Hill-Scott
497a9548e3 Merge pull request #859 from alphagov/point-documentation-at-clients
Link to client documentation, not API documentation
2016-08-11 16:44:14 +01:00
Leo Hemsted
6fc474a37f remove unused call to notification statistics 2016-08-11 12:07:50 +01:00
Chris Hill-Scott
e82cb21ecc Talk about trial mode on API keys page
When you make a ‘normal’ API key it won’t work as described until your
serivce is live.

We should make this clear at the point at which you choose this key.
2016-08-10 17:04:22 +01:00
Chris Hill-Scott
7010e35256 Remove example personalisation from template page
This was of dubious value, and the syntax probably isn’t accurate for
all languages.
2016-08-10 10:31:21 +01:00
Leo Hemsted
3f3463b1ff Merge branch 'master' into remove-stats-from-send 2016-08-09 14:41:00 +01:00
Leo Hemsted
f2b6bfbfc2 Merge pull request #815 from alphagov/weekly-refactor
Weekly stats aggregate page refactor
2016-08-09 09:37:50 +01:00
Leo Hemsted
f46d10b401 Merge pull request #844 from alphagov/deskpro-user-email
Fix deskpro user email
2016-08-08 11:32:13 +01:00
Chris Hill-Scott
652534533b Rewrite prev/next test to use BeautifulSoup 2016-08-05 11:33:32 +01:00
Chris Hill-Scott
b85b929b11 Lose the confusing list slicing
Slicing was to avoid duplicate items in the list. A more idomatic way
to avoid duplicate items in a list is to use a `set` instead.

The order of the list doesn’t really matter, but it’s a lot easier to
test for if the order is consistent.
2016-08-05 11:16:34 +01:00
Chris Hill-Scott
01bb2ada0a Don’t let _set_status_filters mutate original list
Mutating stuff is scary and prone to problems. Better for it to
return a new list instead.
2016-08-05 11:02:30 +01:00
Chris Hill-Scott
e621dddd6d Don’t show the download until the job is complete
The CSV report isn’t very useful until it has all the rows from your
original file. So we shouldn’t show you the link until all notifications
have been created.

Until this point, it’s useful to know how much longer you need to wait,
so this commit adds a percentage count of how much of the file has been
processed.
2016-08-05 10:59:49 +01:00
Chris Hill-Scott
45ae43d987 Include ‘created’ in ‘sending’ bucket
The difference between created and sending isn’t something a user should
have to care about. So this commit:
- counts created and sending as the same thing
- displays and notifications which have a status of created as sending
2016-08-05 10:59:49 +01:00
Chris Hill-Scott
51a4ab8060 Change ‘processed’ to ‘total’
Processed is not an easy to understand thing, and the overlap with
sending/delivered/failed is not easy to intuit.

‘Total’ is a much easier concept to grasp (it relates directly to your
file), and it’s less distracting because it doesn’t change.
2016-08-05 10:59:49 +01:00
Chris Hill-Scott
3fcfdc1bce Make sending count down from total rows
It’s weird when the sending number ramps up to ~200 or so and then
just floats around as new rows are being added and older ones are being
marked as delivered/failed.

It’s also not great that you don’t know how many rows are in a file, if
you haven’t uploaded it yourself. But the only reason you want to know
this is to know how much work Notify has remaining to do.

So ‘sending’ should start from the total number of rows in the file
and count down.
2016-08-05 10:59:49 +01:00
Chris Hill-Scott
47e7d418eb Remove redundant if statement
We check for the `None` case in the parent `if` statement.
2016-08-05 10:59:49 +01:00
Leo Hemsted
d5238bce5b handle if user doesn't provide name/email
also clean up usage of DESKPRO_PERSON_EMAIL and put it in the conf rather than env
2016-08-04 18:01:08 +01:00
Leo Hemsted
ff46aaa6cc send user contact info to deskpro correctly
previously we were erroneously setting our own reply email rather
than using the user's provided one 😵
2016-08-04 17:02:21 +01:00
Leo Hemsted
e2875ea66e Merge branch 'master' into remove-stats-from-send 2016-07-29 11:08:42 +01:00
Leo Hemsted
4ea23a7484 move away from statistics_api towards service_api 2016-07-29 10:28:18 +01:00
Leo Hemsted
a7c8e88ecb add tests and remove old aggregate code 2016-07-28 18:09:17 +01:00
Leo Hemsted
2ab23fa4ef move weekly summary page over to new notifications/weekly endpoint 2016-07-28 16:23:22 +01:00
Leo Hemsted
0accd88869 request stats for today from send page from GET /service/:id endpoint
also amended test cases to ensure they mock out correct call
2016-07-25 14:46:27 +01:00
Leo Hemsted
ee10b3a6c2 use detailed service endpoint in notification summary page
to help get rid of notification statistics tables, move over the
job page. fortunately its required data format is almost identical
to the return value of the detailed service endpoint, so little
work is required - only to add a sending column
2016-07-20 15:52:35 +01:00
Leo Hemsted
0cc2a90a1a add tests for get_dashboard_totals 2016-07-20 14:12:22 +01:00
Leo Hemsted
3ffd6c744c separate detailed and normal service_api_client.get_service
to make it easier to mock and control return values
2016-07-20 14:12:22 +01:00
Leo Hemsted
3e6eedd079 use new detailed service endpoint for dashboard totals
we don't want to use the old statistics endpoints any more
also a couple of quality of life changes
* moves some logic out of the _totals.html template
* tidies up statistics_utils
2016-07-20 14:12:22 +01:00
Leo Hemsted
4451a8634d add detailed flag to GET service api client
returns current (past 7 days) notification stats as well as service info
2016-07-20 14:12:22 +01:00
Chris Hill-Scott
8d7c37886c Merge pull request #795 from alphagov/delivery-info-specific-time
Make ‘Available for…’ text on job page relative
2016-07-20 12:01:06 +01:00
Chris Hill-Scott
f6bdef4ca3 Add tests for time_left
This commit extracts the code that works out the ‘Data available for…’
message so that it’s easy to unit test for.
2016-07-20 11:50:22 +01:00
Chris Hill-Scott
9a5fbca707 Make ‘Available for…’ text on job page relative
When we say ‘delivery information is available for 7 days’ you have to
infer _when_ the seven days starts. When you come back to the page it
still says ‘available for 7 days’ even if you only have a day left to
download it. This is confusing.

This commit changes the text to be relative to now, eg ‘available for 7
days’, ‘available for 1 day’.

The date is counted to midnight on the seventh day, which is when the
data is actually deleted.
2016-07-19 15:25:17 +01:00
Leo Hemsted
743a9d05d1 Merge pull request #794 from alphagov/refactior
Rename api_client to service_api_client
2016-07-19 13:26:34 +01:00
Chris Hill-Scott
86a4daa4e8 Don’t pass entire job thru to notifications page
It only needs the `id`, and it only needs that to generate the download
URL, so let’s just pass the URL through instead.
2016-07-19 12:47:06 +01:00
Chris Hill-Scott
83c1035f1b Really hide the ‘download CSV’ link in the tour
Tried to do this in
https://github.com/alphagov/notifications-admin/pull/743

Didn’t account for it reappearing when the AJAX fired, because the AJAX
request didn’t account for whether or not the user was in the tour.
2016-07-19 09:32:41 +01:00
Leo Hemsted
1cd2841c17 rename api_client to service_api_client 2016-07-15 15:23:23 +01:00