Commit Graph

564 Commits

Author SHA1 Message Date
minglis
b35f747fc1 Removed print 2016-06-03 12:00:08 +01:00
Martyn Inglis
29fd69258c Added invite user button for platform admins on any service 2016-06-03 11:10:38 +01:00
minglis
0219ddf2f8 Merge pull request #634 from alphagov/research-mode
Research mode
2016-06-02 12:00:39 +01:00
Chris Hill-Scott
20d76c0625 Merge pull request #631 from alphagov/breaking-change
Warn users when a template change is going to break things
2016-06-02 11:29:16 +01:00
Martyn Inglis
009a7160de pep8 appeased 2016-06-01 17:02:12 +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
Chris Hill-Scott
3ac76192d0 Warn users a template change will break things
When a user adds or removes placeholders in their template we should consider
this a ‘breaking change’ and warn them accordingly.

Implementing this mostly relies on using
https://github.com/alphagov/notifications-utils/pull/37

Temporarily storing the new template until the user confirms that they want to
make the changes in done using hidden fields. This is a bit hacky, but the
complexity of making sessions interact with WTForms was just too much to handle.

This commit also changes the example spreadsheet that we show on this page to
look more like a spreadsheet.
2016-05-31 17:07:05 +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
57875c731b tests for statistics_utils 2016-05-31 12:17:17 +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
Chris Hill-Scott
c41944080c Make the tour interactive
_The code for this is quite hacky and light on tests. But I’d really like to get
it in the app for the research tomorrow to see how well the feature works._

This commit changes the tour from being a set of static screens to some help
which guides you through the process of sending your first test message.

The theory behind this is that what users are really struggling with is the
concept of a variable, rather than the relationship between the placeholders and
the column headers. And like learning to program, the best way to learn is by
taking an example and modifying it to your own needs.

This means that when someone adds their first service we set them up an
example email template and an example text message template. Then there is a
guided, three step process where _all_ the user can do is send a test message to
themselves.

Once the message is sent, the user still has the example templates which they
can edit, rather than having to remember what they’re supposed to be doing.
2016-05-25 13:14:09 +01:00
Leo Hemsted
6d43067688 Merge pull request #608 from alphagov/platform-admin-dashboard
New platform admin page
2016-05-25 11:18:05 +01:00
Leo Hemsted
ecf0dd7ebb move platform admin links platform admin page
removed "View providers" and "List all services" from the choose service page and the left-hand nav bar
2016-05-25 10:36:47 +01:00
Leo Hemsted
1292bf9fe6 New platform-admin-dashboard page 2016-05-25 09:48:45 +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
a4db2dcfe9 Merge pull request #604 from alphagov/improve-job-csv
Improve the ‘download a CSV’ from the job page
2016-05-24 10:11:42 +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
Leo Hemsted
42e529fc90 Merge pull request #602 from alphagov/delete-button
delete template button POSTs archived:true
2016-05-24 09:37:31 +01:00
Chris Hill-Scott
61249e9d49 Merge pull request #582 from alphagov/better-errors-in-trial-mode
Make ‘Too many recipients’ error lower priority
2016-05-24 09:29:08 +01:00
Leo Hemsted
2f1a807be3 delete template button POSTs archived:true 2016-05-23 15:04:24 +01:00
Nicholas Staples
935f355d5c Download csv for job added.
Removed check for notifications so download button is always there.
2016-05-23 12:24:03 +01:00
Chris Hill-Scott
7de42a31e6 Make ‘Too many recipients’ error lower priority
This commit makes two main changes to what happens when a user is
in trial mode and they upload some email addresses belonging to
other people.

1. Add a specific banner error telling the user about trial mode

2. Make this error higher priority, eg it will show up before the
   error about having too many recipients in your file

This means making some changes to the tests so that the example CSV
files include the user’s phone number, then making them invalid by
omitting data required by the templates.

Depends on: https://github.com/alphagov/notifications-utils/pull/34
2016-05-23 10:22:13 +01:00
Chris Hill-Scott
ab239615c0 Merge pull request #596 from alphagov/update-deskpro-key-name
Use correct key to set team in DeskPro
2016-05-23 09:32:42 +01:00
Nicholas Staples
3f404d01b0 Added in notification row number for job pages. 2016-05-20 16:13:01 +01:00
Chris Hill-Scott
228abf4526 Use correct key to set team in DeskPro
For the `POST` ticket endpoint, the parameter is `agent_team_id`:

https://manuals.deskpro.com/html/developer-apps/api/api-tickets.html#id2
2016-05-20 15:58:20 +01:00
Nicholas Staples
83f25cd89b Beautify the template version links and template link page. 2016-05-20 13:58:16 +01:00
Adam Shimali
e608b60d93 Merge pull request #589 from alphagov/import-cleanup
Removed unused imports
2016-05-18 16:26:58 +01:00
Adam Shimali
e181940966 Renamed DESKPRO_TEAM_ID to DESKPRO_DEPT_ID to match name of param in
api call.

Added DESKPRO_ASSIGNED_AGENT_TEAM_ID so that tickets routed correctly.
2016-05-18 15:03:23 +01:00
Adam Shimali
25170e7e42 Removed unused imports 2016-05-18 14:39:06 +01:00
minglis
a892f44696 Merge pull request #588 from alphagov/no-downtime-deploys
No downtime deploys
2016-05-18 13:22:24 +01:00
Martyn Inglis
664ae33108 Formatting 2016-05-18 13:10:51 +01:00
Rebecca Law
6c14d925c5 Fix test to use a real status 2016-05-18 12:05:26 +01:00
Adam Shimali
a20fc1aa47 If user clicks failed or both filters for notifications status view,
append all other failure states to query to api.
2016-05-18 11:44:58 +01:00
Adam Shimali
e20ce561e9 Merge pull request #575 from alphagov/reply-to-email-surfaced
If service has reply to show it in form
2016-05-17 13:25:58 +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
Adam Shimali
d141af4b94 If service has reply to show it in form 2016-05-17 11:35:10 +01:00
Chris Hill-Scott
5625ef6eee Merge pull request #558 from alphagov/template-stats-2
Make template usage on dashboard easier to scan
2016-05-17 11:26:49 +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
ed74280044 Merge pull request #570 from alphagov/reply-to-email
Admin app settings to save reply to email address for service.
2016-05-16 17:51:05 +01:00
Chris Hill-Scott
d39717d348 Merge pull request #567 from alphagov/uncomment-out-tests
Uncomment commented-out tests
2016-05-16 14:29:10 +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
Chris Hill-Scott
f2a5d77853 Uncomment commented-out tests
Accidentally(?) introduced in 2792bece54
2016-05-16 10:53:15 +01:00
Chris Hill-Scott
7bbc307a3e Handle files that can’t be interpreted as spreadsheets
There shouldn’t be a case where we see a `ValueError` on upload any
more. Our file handling should be robust enough to deal with whatever is
thrown at it.

This commit:
- adds test files with bad data (PNG files with their extensions changed to look
  like spreadsheets)
- catches whatever exceptions are raised by trying to parse these files
- returns a helpful flash message to the user

Anything else should raise a `500`, eg if the file can’t be uploaded to S3.
2016-05-15 22:11:01 +01:00
Chris Hill-Scott
1409ca36ca Accept common spreadsheet formats, not just CSV
We require users to export their spreadsheets as CSV files before
uploading them. But this seems like the sort of thing a computer should
be able to do.

So this commit adds a wrapper class which:
- takes a the uploaded file
- returns it in a normalised format, or reads it using pyexcel[1]
- gives the data back in CSV format

This allows us to accept `.csv`, `.xlsx`, `.xls` (97 and 95), `.ods`,
`.xlsm` and `.tsv` files. We can upload the resultant CSV just like
normal, and process it for errors as before.

Testing
---

To test this I’ve added a selection of common spreadsheet files as test
data. They all contain the same data, so the tests look to see that the
resultant CSV output is the same for each.

UI changes
---

This commit doesn’t change the UI, apart from to give a different error
message if a user uploads a file type that we still don’t understand.

I intend to do this as a separate pull request, in order to fulfil
https://www.pivotaltracker.com/story/show/119371637
2016-05-15 22:10:58 +01:00
Rebecca Law
fcf277c413 Merge branch 'master' into template_history_view
Conflicts:
	requirements.txt
2016-05-13 17:30:33 +01:00
Chris Hill-Scott
8a4b0ba88c Add a message count component
The logic to say ‘1 email sent’ vs ‘12 text messages sent’ is repeated
all over the place. So this commit adds a component to put it in one
place.
2016-05-13 10:26:57 +01:00