Commit Graph

93 Commits

Author SHA1 Message Date
Ken Tsang
bcc45ede9c Refactored code for new service permissions 2017-06-23 14:27:41 +01:00
Chris Hill-Scott
1797162248 Merge pull request #1328 from alphagov/notification-page-reworked
Add a page for each notification and start linking to it
2017-06-23 10:16:54 +01:00
kentsanggds
01760f3405 Merge pull request #1327 from alphagov/create-inbound-api
Create inbound api
2017-06-22 12:36:28 +01:00
Chris Hill-Scott
ff4a580ab4 Indicate template on scheduled jobs
We’ve removed the template on the jobs page, so you can no longer see
which template a job is about to be sent with.

This is removing information which might enable you to undo a costly
mistake.

I don’t think we need to bring back the whole template – giving its
name, and a link to it meets the need just as well.
2017-06-21 17:57:20 +01:00
Chris Hill-Scott
c554e9e32d Put template content or subject in tables
In tables where we show rows and rows of information we used to give
some meta information about the notification, or at least as much as we
could give in the very limited space available.

This information is now on the notifications page, so the information we
show in these tables should just be whatever helps users identify the
right message. I reckon that this is:
- the content of the message for text messages
- the subject for emails and letters

This also makes these pages consistent with:
- the inbound SMS page
- the way the people’s inboxes work for their text
  messsages/Whatsapps/emails

For consistency’s sake this makes the job page work the same way. It may
be slightly less useful here because on the job page every message is
sent from the same template, so will have broadly the same content.
2017-06-21 17:57:20 +01:00
Ken Tsang
3b47ff28f0 Refactored tests for inbound api 2017-06-21 12:15:53 +01:00
Leo Hemsted
20bb34849d add tests for notification status page 2017-06-16 15:29:34 +01:00
Chris Hill-Scott
7e8471f21f Look at body, not template in outbound texts
As of this PR we don’t return the template content any more:
https://github.com/alphagov/notifications-api/pull/1015
2017-06-14 17:44:50 +01:00
Chris Hill-Scott
f6d8e55579 Add two-way messaging view
> Once an inbound message has been received, there should be a way to
> see the other messages in the system from the same service to the same
> number. Both in and outbound. Nice inbox/whatsapp stylee view or some
> such. This way the context of the reply is understood.
>
> Initially will only see the outbound template, not the actual message,
> but we’re going to change this for the rest (soon), so that you can
> always see the full message for all outbound.
2017-06-10 12:03:10 +01:00
Chris Hill-Scott
85105fd6cd Only show inbound stuff if service has permission
Only services that have inbound SMS turned on should be able to see the
dashboard and ‘Received messages’ page.

There’s probably a cleaner way (decorator) of doing this permissions
stuff, but I think it can wait until we ship this.
2017-06-05 15:52:30 +01:00
Rebecca Law
fe24501075 Add a platform admin button to service-settings page to turn the inbound_sms messaging on and off.
If clicked you will be prompted to enter a sms sender number, when setting the permission on or off.
Team members will always be able to see the number, but will only be able to change it if the inbound_sms permission is off.
2017-06-02 16:33:31 +01:00
Chris Hill-Scott
6c2bba5e20 Remove fallback for empty SMS sender
The API will always return a value for this now (defaults to GOV.UK)
2017-05-23 13:55:59 +01:00
Ken Tsang
b1706fd213 Updated service settings for international sms 2017-04-24 13:52:10 +01:00
Chris Hill-Scott
cfc031cfbf Pass dvla_org_id through to template preview app 2017-04-24 10:25:36 +01:00
Chris Hill-Scott
f54689a2b7 Merge pull request #1168 from alphagov/contact-letter-block
add letter_contact_block edit fields
2017-03-06 11:11:54 +00:00
Leo Hemsted
5c3588445e add letter_contact_block edit fields
no actual template functionality yet - just the ability for services
that have letters enabled to edit a 10 line block that will go on the
top right hand side of their letters with contact information
2017-03-03 16:18:59 +00:00
Leo Hemsted
85efe0d117 remove flask's builtin remember me functionality
we don't need it cos we do it all ourselves
2017-03-02 16:55:10 +00:00
Leo Hemsted
9fda5d1847 remove remember_me cookie and related code 2017-02-27 15:18:18 +00:00
Leo Hemsted
154271b46e TestClient now sets up app.current_session correctly
previously it was attempting to do so from outside of a session
transaction, so failing. This still only happens when you've called
`login` with a mocker and service json blob, which is probably worth
reconsidering in the future, but for now, updated logged_in_client to
use the extra login args
2017-02-02 15:18:41 +00:00
Rebecca Law
3dfb3806d2 Add a selectField to edit and create templates that is only visible for platform admins that makes the template a priority template.
There is a check that the template can not be created as priority if the user is not a platform admin.
There is a check that the template can not change the `priority` unless they are a platform admin.
2017-01-18 15:11:34 +00:00
Imdad Ahad
50e0227480 Fairly large refactor of tests related to getting/viewing notifications 2017-01-13 11:37:14 +00:00
Imdad Ahad
d170c97cec Refactor existing tests to expect csv stream with helper method 2017-01-06 17:49:20 +00:00
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