Commit Graph

1967 Commits

Author SHA1 Message Date
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
Chris Hill-Scott
2e2e15bd95 Merge pull request #654 from alphagov/fix-500-notification-no-updated-at
Fix 500 on job page when notifications are sending
2016-06-07 09:40: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
67236d0c2b Merge pull request #655 from alphagov/two-factor-bug-fix
Two factor page bug
2016-06-06 14:58:32 +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
Chris Hill-Scott
5b5ad2c5dc Fix 500 on job page when notifications are sending
Sending notifications don’t have an `updated_at`. This causes the time
formatting to throw a wobly, because it doesn’t expect `None`.

This commit changes the template to also look for the `created_at`,
which all notifications have.
2016-06-06 13:53:49 +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
f71780ee27 Merge pull request #648 from alphagov/redirect-after-saving-template
Redirect to single template view after edit
2016-06-06 11:06:24 +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
a6833f4ad2 Change page <title> on check page
It was no longer accurate.
2016-06-05 18:41:19 +01:00
Chris Hill-Scott
4ac1a03a89 Use message_count_label component
For the button on the check page, we need to be able to say ‘1 text message’ or
‘55 emails’. We already have the logic to do this on the dashboard (101 text
messages sent), and it’s already in a component. So this commit makes the check
page use the same component.
2016-06-05 18:41:19 +01:00
Chris Hill-Scott
9332f57f55 Make components for nicely formatted lists
We have a couple of places now where we want nice lists made from `list`s, eg

- ‘name’, ‘date’ and ‘phone number’
- ((firstname)) ((lastname)) or ((date))

This commit adds a more generic component for doing this, which can handle:

- 1, 2, and n items
- comma (or other character) separated lists
- a conjunction between the last and one-before-last item
- characters to be inserted before and after each item, eg an opening and
  closing HTML tag

It also pulls the `list_of_placeholders` component from the breaking change
page, and makes it use the `formatted_list` component under the hood.
2016-06-05 18:39:32 +01:00
Chris Hill-Scott
3ace856d74 Only show row-level errors if all columns are OK
Row-level errors are:

- bad phone number/email address
- missing data

I think it’s distracting to show these on the page if there’s something more
fundamentally wrong with the file, eg placeholders don’t match.

So this commit makes sure that these error messages are only displayed when the
top-level error says ‘There is a problem with your data’
2016-06-03 16:26:59 +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
Chris Hill-Scott
2c17261795 Merge pull request #640 from alphagov/better-wording-around-example
Change wording around the example on the send page
2016-06-03 12:45:54 +01:00
minglis
bc9b37da7a Merge pull request #641 from alphagov/platform-admins-invite-users
Added invite user button for platform admins on any service
2016-06-03 12:00:23 +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
Chris Hill-Scott
20b2331b1e Change wording around the example on the send page
‘How to format your file’ sounds complicated and incidental.

‘See an example’ sounds like something that might be useful if you’re feeling
stuck.

Also makes the list of file formats a list, because it’s a list.
2016-06-03 09:06:12 +01:00
minglis
0219ddf2f8 Merge pull request #634 from alphagov/research-mode
Research mode
2016-06-02 12:00:39 +01:00
minglis
801cd8ddfb Merge pull request #637 from alphagov/travis-cache
caching in travis for pip and npm
2016-06-02 12:00:17 +01:00
Leo Hemsted
1971ada571 caching in travis for pip and npm 2016-06-02 11:36:42 +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
Chris Hill-Scott
53ec44a2d2 Remove commas from list of placeholders
Visually, the space between them is enough. Also the oxford comma thing didn’t
actuall work :|
2016-06-02 10:56:04 +01:00
Chris Hill-Scott
acfe87e788 Use hasattr instead of getattr
We don’t need the value returned by `getattr`, so using `hasattr` is cleaner.
2016-06-02 10:41:54 +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
Leo Hemsted
4237898e88 Merge pull request #630 from alphagov/platform-admin-list-services
Platform admin page - per service stats
2016-06-01 10:52:46 +01:00
Chris Hill-Scott
012e43549d Remove blue from column headings on send page
While the blue should help reinforce the relationship between the placeholders
and the column headings, it makes the column headings very busy visually, and
less like column headings. Which make the relationship harder to see. I think.
2016-05-31 17:07:31 +01:00
Chris Hill-Scott
6d3fbb1f51 Make example on send look more like a spreadsheet
Now that the example on the breaking changes page looks more like a spreadsheet,
we should do the same thing for the downloadable example on the send page.
2016-05-31 17:07:23 +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
a8c38b7478 list services on platform admin page 2016-05-31 14:07:19 +01:00
Leo Hemsted
b5e8f09af7 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 14:06:40 +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
960620f284 Merge pull request #624 from alphagov/fix-403-job-updates
Fix 403s when viewing a job as platform admin
2016-05-31 11:21:28 +01:00
Chris Hill-Scott
86511e088a Merge pull request #623 from alphagov/tidy-up-template-history
Move parameters out of the `…_message` components
2016-05-31 11:21:22 +01:00
NIcholas Staples
139ce3386d Merge pull request #625 from alphagov/download_all_job_notifications
Job notification download now includes all notifications.
2016-05-31 10:49:52 +01:00
Nicholas Staples
5ef5920c17 Job notification download now includes all notifications.
Get row number to match excel format.

Fix for no job_row_number.
2016-05-31 10:43:14 +01:00
Chris Hill-Scott
7a7eb095b1 Fix 403s when viewing a job as platform admin
While battling the bank holiday traffic on my way home this evening I realised
why looking at the job page was causing lots of 403 errors in the Chrome
console (a spike which was reflected on the Graphite screen).

There is a separate `.json` endpoint for getting updates to a job. This enpoint
did not have the `admin=True` option set in its permissions decorator. So when
viewing a service as a platform admin you could see the page, but not receive
any AJAX-powered updates to it.
2016-05-27 19:13:01 +01:00
Chris Hill-Scott
b84d06bd68 Move parameters out of the …_message components
This commit refactors the `email_message` and `sms_message` UI components to
take fewer parameters.

`name`, `edit_link` and anything to do with versions are identical for both
text and email messages so I’ve moved them to the pages where you choose a
template or see the versions.

This commit also tidies up the wording and styling of the template history
stuff.
2016-05-27 11:08:40 +01:00
Chris Hill-Scott
01884655c7 Merge pull request #620 from alphagov/remove-get-started-banner
Remove the get started banner from the dashboard
2016-05-27 08:46:57 +01:00