Commit Graph

71 Commits

Author SHA1 Message Date
Leo Hemsted
fb85877c75 add tests for platform admin list ordering 2016-11-14 11:33:39 +00:00
Leo Hemsted
f039397533 make letters error if user not logged in
also added tests for the various hiding logic points

also added new logged_in_client in conftest - so you dont need to
patch all those stupid API calls for get user and get service
2016-10-27 16:46:51 +01:00
Leo Hemsted
aa458a15da update tests to reflect new code
also change jobs.py to filter out test jobs (since we dont need to see em)
and to use the new statuses filter rather than filtering on front end
2016-10-10 15:43:01 +01:00
Chris Hill-Scott
48891babc4 Add log of notifications to API integration page
Now that we’ve removed simulated notifications from the dashboard and
activity pages they’re not visible anywhere in the app.

While they should’t be visible to non-technical users, developers have
a real need for Notify to confirm that their code is doing what they
expect. This is needed especially when they’re just getting started with
Notify.

There’s no way of seeing this info from the API either, because a key
can only get notifications created with a key of that type.

It doesn’t make sense to make this a ‘mode’ of the dashboard or activity
because the information about notifications that developers need is
also different. So this commit adds up to 50 of the most recent
notifications sent via the API to the page that developers use as their
‘home’ page.

This also lets us explain the 7 days thing to developers via the
empty slate state of this area of the page.
2016-09-29 09:28:04 +01:00
Chris Hill-Scott
311ae4cfa4 Sort services by newest created first
Other than which services are live it’s also interesting to know what
services are getting created on Notify. So let’s put the newest ones at
the top of the page.
2016-09-13 10:38:33 +01:00
Leo Hemsted
62868bc014 add test for id appearing in notification table
use new pytest yield fixture
2016-09-09 16:30:07 +01:00
Martyn Inglis
2f56643e3a Fix up issues caused by merge
- statistics now on job_json
- removed test that validates we handle the case where job has no statistics key - never happens
2016-09-05 14:45:34 +01:00
Chris Hill-Scott
4342b721f1 Show upcoming jobs on the dashboard
On the dashboard:
- adds a new ‘in the next 24 hours’ section to the dashboard which lists
  upcoming jobs
- tweaks some spacing on the dashboard so that it doesn’t look like too
  much of a mess
- don’t show scheduled jobs in the table of normal jobs

On the jobs page:
- don’t show scheduled jobs
2016-08-31 16:58:43 +01:00
Chris Hill-Scott
c1415c0429 Make conftest use job_status not status
`status` will be deprecated at some point. `job_status` is what gets
set to `scheduled` to show that a job has been scheduled for some time
in the future.
2016-08-31 16:58:26 +01:00
Chris Hill-Scott
bf872ab342 Base ‘% complete’ on notifications requested
The job is complete when all notifications are delivered or failed.

The report is complete once we have all notifications are in the
database.

This commit changes the meaning of the percentage from the former to the
latter. This is how it was before we removed the aggregate stats for
jobs.
2016-08-30 15:16:36 +01:00
Martyn Inglis
d149a9691a Added tests for the 2 use cases:
used templates

unused templates
2016-08-24 12:09:38 +01:00
Martyn Inglis
9d25f326b0 Using new endpoint for template statistics
- gets notifications by template id, returning the most recent to illustrate the last use of that template.
2016-08-22 16:25:35 +01:00
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
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
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
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
Chris Hill-Scott
50c20ce680 Add formatted notification status to CSV
This commit makes the CSV download use the same language for failure
reasons as the frontend.

It also adds a test around this stuff, which was patchily tested before.
2016-07-11 13:12:46 +01:00
Chris Hill-Scott
02dccde0bd Don’t show send/edit links for deleted template
Since you can’t really send or edit a deleted template we should show
a message telling you that the template has been deleted.

This is important because deleted templates still show up in the
template statistics.
2016-07-01 13:35:48 +01:00
minglis
0219ddf2f8 Merge pull request #634 from alphagov/research-mode
Research mode
2016-06-02 12:00:39 +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
Leo Hemsted
9669024f49 table with sending/delivered/failed stats for each service today 2016-05-31 14:10:32 +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
Nicholas Staples
3f404d01b0 Added in notification row number for job pages. 2016-05-20 16:13:01 +01:00
Nicholas Staples
83f25cd89b Beautify the template version links and template link page. 2016-05-20 13:58:16 +01:00
Rebecca Law
6c14d925c5 Fix test to use a real status 2016-05-18 12:05:26 +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
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
Henry Hadlow
e3fa1ac253 Tidy up text on forgot your password screens
Display updated_at instead of created_at for notifications.
2016-05-11 16:30:15 +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
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
f3210ea992 Functionality added to download all on activity page. All tests passing. 2016-04-19 11:45:36 +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
Nicholas Staples
8f8cdabfff Upload csv location updated, all tests passing. 2016-04-07 12:56:57 +01:00
Rebecca Law
1871243cc8 Check the uniqueness of the service name ignoring case.
When the service name changes the email_from changes to.
Renamed find_all_service_names to find_all_service_names_lower.
2016-03-31 10:26:03 +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
Rebecca Law
542d0f939e Add comment when adding the view_activity permission as a default.
Refactor client.login method so that we can start to migrate to one way to login for unit tests.
2016-03-30 10:53:15 +01:00
Nicholas Staples
48daac7b94 Merging conflict with two_factor.py
Fixed merge mistake with two_factor.py.
2016-03-30 10:11:06 +01:00
Rebecca Law
402f55be23 Merge branch 'master' into platform-admin
Conflicts:
	app/__init__.py
	app/main/views/add_service.py
	app/main/views/jobs.py
	app/templates/main_nav.html
	tests/app/main/views/test_dashboard.py
	tests/conftest.py
2016-03-18 16:32:10 +00:00
Rebecca Law
13d9acf7dd Completion of the platform admin user story. 2016-03-18 16:20:37 +00:00
Rebecca Law
d003dc4aa9 [WIP]: fixing unit tests 2016-03-18 10:49:22 +00:00
Rebecca Law
7eb4bcc592 Remove unused method
Added more tests
2016-03-17 14:25:28 +00:00
Rebecca Law
b28fbc16d7 A platform admin user is able to see a list of all services.
Each service on the list is linked to the dashboard page of the service.
The platform admin user can see/edit templates, see/invite users, see/edit service settings.
The platform admin user can not send messages, see/edit api keys and developer docs.
2016-03-17 10:46:47 +00:00
Nicholas Staples
a13ecc5cb5 whoops test fixes. 2016-03-16 17:05:27 +00:00
Nicholas Staples
b0ca855ba8 Notification history page added and pagination, tests all working. 2016-03-16 16:57:10 +00:00
Nicholas Staples
c5eaf97669 Tests added for choose_template page.
Remove indifferent change to file.
2016-03-09 13:55:40 +00:00