Commit Graph

694 Commits

Author SHA1 Message Date
Leo Hemsted
bfcf4be447 separate branding/org test into two tests
it's a bit more legible and the running time of these tests is
negligable so split up the test into its two logical components
2016-08-16 14:46:59 +01:00
Leo Hemsted
fde8d81868 send organisation back in correct variable 2016-08-15 11:15:49 +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
da1fa2e61c Make _attach_current_user a pure function
Mutating dictionaries is gross and doesn’t work as you’d expect. Better
to have the function return a new dictionary instead.

Means we can be explicit that `created_by` is one of the allowed params
when updating a service.
2016-08-11 17:07:55 +01:00
Chris Hill-Scott
0cfe10639a Only allow update service to modify named attrs
To prevent typos and inadvertently updating something we shouldn’t,
this adds some filtering to the update_service method to make sure it
is only allowed to update certain attributes of a service.
2016-08-11 17:07:43 +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
Leo Hemsted
f642d6a6f1 rename test variables for clarity 2016-08-10 15:55:13 +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
Chris Hill-Scott
44a0845882 Replace documentation link with links to clients
In research we found that developers orientate themselves around the
API clients rather than the documentation.

We should get them to the client documentation as quickly as possible.

We currently link to the API documentation in three places:
- API integration page
- global footer
- template ‘API info’ page

For the first two this commit:
- removes the link to the documentation
- adds links to each of the 5 clients

For the last one it just removes the link entirely.
2016-08-10 10:31:10 +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
d0ef913520 Add a message if there are more than 50 rows
Similar to how we do it on the check page, we should indicate if there
are more results than we can show. No-one’s really complained about the
absence of this, but it can’t hurt.
2016-08-05 10:59:49 +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
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
e2875ea66e Merge branch 'master' into remove-stats-from-send 2016-07-29 11:08:42 +01:00
Leo Hemsted
a7c8e88ecb add tests and remove old aggregate code 2016-07-28 18:09:17 +01:00
minglis
817a52781f Merge pull request #803 from alphagov/remove-stats-from-job-page
Remove stats from job page
2016-07-26 11:24:00 +01:00
minglis
4db855c5b5 Merge pull request #804 from alphagov/too-many-messages
Too many messages
2016-07-26 11:23:55 +01:00
Leo Hemsted
eaf9b6dc54 pass 'today_only' flag to the back-end from send page
also bump notification-utils requirement to 8.7.0 for changes
to RecipientCSV
2016-07-25 15:26:43 +01:00
Leo Hemsted
45debe0d5b remove get_statistics_for_service_for_day from codebase
two down, three to go
2016-07-25 14:54:58 +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
aa37dc4929 add tests for send check error messages 2016-07-25 10:41:50 +01:00
Leo Hemsted
6ff77c995e add tests for service_api_client 2016-07-21 17:32:28 +01:00
Leo Hemsted
d6e6d05893 add tests for send check error messages 2016-07-21 15:39:00 +01:00
Leo Hemsted
eab66dc6be add tests for get_status_filters 2016-07-20 16:18:04 +01:00
Leo Hemsted
57e03349d2 remove get_statistics_for_service from statistics_api_client 2016-07-20 15:54:30 +01:00
Leo Hemsted
0cc2a90a1a add tests for get_dashboard_totals 2016-07-20 14:12:22 +01:00
Leo Hemsted
fade656e3b add new get_detailed_service mock to tests that the dashboard 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
52d5841bbe Reduce indentation by combining with statements 2016-07-19 12:47:16 +01:00
Chris Hill-Scott
55902d2927 Add a test for the ‘available for 7 days’ text
So that we can check it’s still correct when we make it dynamic.
2016-07-19 12:46:45 +01:00
Chris Hill-Scott
cfadead292 Make it clearer what you’re downloading
The previous text didn’t make it clear _what_ you were downloading as a
CSV file, you had to infer it from the context.

And the fact that it’s a CSV file is immaterial, it’s the data you care
about, not the format.
2016-07-19 12:46:20 +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
Chris Hill-Scott
500a503f07 Rewrite job page test to use Beautiful Soup
Beautiful Soup makes it easier to do assertions on specific pieces of
text. The diffs are more useful than when you do `if 'text' in page`.
2016-07-18 09:07:02 +01:00