Commit Graph

565 Commits

Author SHA1 Message Date
Chris Hill-Scott
2e8e650733 Put same info in both tables of notifications
We have tables listing notifications on:
- the job page
- the ‘activity’ page

Previously that had subtly different information, in a different order.
This commit makes them exactly the same.
2016-06-09 11:36:22 +01:00
Adam Shimali
d005406682 Merge pull request #661 from alphagov/invite-accepted-bug
Change when invite gets marked as accepted.
2016-06-08 13:32:20 +01:00
Chris Hill-Scott
29f8b94612 Merge pull request #657 from alphagov/make-activity-consistent
Make activity consistent
2016-06-08 12:57:07 +01:00
Adam Shimali
0544ea776b Change when invite gets marked as accepeted. 2016-06-08 11:52:26 +01:00
Chris Hill-Scott
3d7f07493b Add filters for ‘processed’ and sending states
- _Processed_ is all the notifications that we know about, ie sending,
  failed and delivered

- _Sending_ is notifications that we have either put into a queue or are
  waiting to hear back from the provider about.

The big numbers on the dashboard are a count of all the messages we’ve
processed. So when you click them, the table of notifications you see
on the dashboard should contain that number of notifications.

This also gets the activity page one step closer to being like the job
page:

         | Before                     | After
---------|----------------------------|---------------------------------
Activity | Sending, failed, both      | Processed, sending, failed, delivered
Job page | Sending, failed, delivered | Sending, failed, delivered
2016-06-07 16:37:06 +01:00
Chris Hill-Scott
8d7850ead1 Use .csv extension not querystring parameter
The link to download a CSV of notifications looks like
`/endpoint?download=csv`. This not not very web idiomatic.

The service manual recommends:
> Only use query strings for URLs with unordered parameters like options
> to search pages.

The CSV is a different representation of the same data, it does not
perform searching or filtering on the data.

The proper way (as we do elsewhere in this app) is to put an extension
on the endpoint to indicate an alternate representation, eg
`/endpoint.csv`
2016-06-07 16:35:49 +01:00
Chris Hill-Scott
e1b2999371 Move test for downloads CSV of notifications
Downloading a CSV of notifications is very similar to viewing them on
a webpage. So I think it’s sensible to move the assertions about the
CSV download link into the same test, rather than it being it’s own
test.

This means being able to reuse the parametrization introuced in this
commit’s parent.
2016-06-07 16:35:49 +01:00
Chris Hill-Scott
9b099d78c7 Make test for activity page more thorough
This commit paramaterizes the test for the activity page, so that it
checks all combinations of template type and notification status.
2016-06-07 16:35:49 +01:00
Chris Hill-Scott
06903d54be Remove template type filter from activity
This commit splits the activity page into two pages, one for emails
and one for SMS.

Technically this means moving from having template type in the
querystring and putting in it the URL, eg:

*Before*:
`/services/abc/notifications/?template_type=sms`

*After*:
`/services/abc/notifications/sms`
This commit changes the activity page to only have controls
2016-06-07 16:35:49 +01:00
Leo Hemsted
65615360eb Merge pull request #658 from alphagov/last-used-message
Last used message
2016-06-07 16:13:30 +01:00
NIcholas Staples
f399e4b240 Merge pull request #656 from alphagov/bug_fix_for_tour_back_button
Bug fixed when sending yourself a test the back button links to the c…
2016-06-07 15:17:40 +01:00
Leo Hemsted
c4305d1610 only get template statistics for specific template 2016-06-07 14:28:02 +01:00
Leo Hemsted
9db20819ef tests for last used message
also now parsing the datetime correctly and removing its UTC tz info to make comparisons work
2016-06-07 11:50:15 +01:00
Leo Hemsted
4831e068d9 Add warning message showing date template last used when deleting 2016-06-07 11:50:15 +01:00
Nicholas Staples
d53b4bd7cd Bug fixed when sending yourself a test the back button links to the correct url.
Remove traceback.
2016-06-07 09:55:04 +01:00
Adam Shimali
83b1158472 Merge pull request #652 from alphagov/permissions-bug-fix
Expand permissions before post to api
2016-06-07 09:36:50 +01:00
Adam Shimali
18ba6c16b4 In case user details were not in session the redirect did not use
url_for to redirect to sign in.
2016-06-06 14:46:16 +01:00
Adam Shimali
813e1c3351 Expand permissions to all possible values on admin before posting to
api. This makes template work for both existing and invited users.

API will no longer need to convert from what ui presents as permissions
2016-06-06 12:40:21 +01:00
Chris Hill-Scott
3ddc1d171d Merge pull request #646 from alphagov/rearrange-csv-errors
Prioritise CSV errors to help you match placeholders to column headers
2016-06-06 12:21:13 +01:00
Chris Hill-Scott
7884f7870b Redirect to single template view after edit
When you edit a template, you’re probably going to do something with
it straight afterwards, eg send yourself a test.

We could make it easy to find the template you’ve just saved by putting
it at the top of the pile. This gets confusing for other reasons (order
of templates will constantly shift about).

So this commit changes the flow to take you to the single page for the
template you’ve just edited.
2016-06-06 10:23:33 +01:00
Chris Hill-Scott
2ff6cf049f Change order of errors for bad CSV files
This commit rearranges the CSV errors (again) to make them geared towards
teaching you how to match placeholders to the column headers.

So the order of errors now is:

1. No phone number/email column
2. Column headers don’t match placeholders
3. Missing or bad data
4. Trial mode
5. Daily limit reached

This depends on:
- [x] https://github.com/alphagov/notifications-utils/pull/39 for 1.
2016-06-03 16:26:58 +01:00
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
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
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
Rebecca Law
6c14d925c5 Fix test to use a real status 2016-05-18 12:05:26 +01:00