Commit Graph

3094 Commits

Author SHA1 Message Date
Imdad Ahad
4ffc6e360c Remove notify app folder and installed python packages before we deploy the app 2017-02-13 17:32:51 +00:00
Chris Hill-Scott
e716eb5607 Merge pull request #1112 from alphagov/bump-utils-markdown-links
Bump utils to turn on Markdown links
2017-02-13 13:29:33 +00:00
imdadahad
cdd192590f Merge pull request #1106 from alphagov/feat-update-user-profile-password-with-new-endpoint
Update password on user profile with new endpoint
2017-02-10 17:23:46 +00:00
Chris Hill-Scott
1eebb990fd Merge pull request #1114 from alphagov/page-title-fix-activity-breakdown
Fix page title on activity breakdown
2017-02-09 10:59:26 +00:00
Chris Hill-Scott
909fd5ba03 Fix page title on activity breakdown 2017-02-09 10:48:17 +00:00
Chris Hill-Scott
6784874fe2 Merge pull request #1113 from alphagov/commas-in-failures
Add comma-separation to counts of failed messages
2017-02-09 10:37:22 +00:00
Chris Hill-Scott
7bd5525983 Add comma-separation to counts of failed messages 2017-02-09 10:19:19 +00:00
Chris Hill-Scott
ba61b37415 Merge pull request #1109 from alphagov/usage-by-year-2
Break down usage by month, filter by year
2017-02-09 09:36:23 +00:00
Chris Hill-Scott
27b95308ad Merge pull request #1111 from alphagov/service-30
Updated service count for NOMS - Assisted Prison Visit Scheme
2017-02-08 17:21:04 +00:00
Chris Hill-Scott
4d3a935a1b Bump utils to turn on Markdown links 2017-02-08 17:01:51 +00:00
Pete Herlihy
c3da85ba80 Updated service count for NOMS - Assisted Prision Visit Scheme 2017-02-08 16:44:40 +00:00
Chris Hill-Scott
21cdef72ce Merge pull request #1110 from alphagov/add-usage-link-to-nav
Add usage link to navigation
2017-02-08 11:45:40 +00:00
Chris Hill-Scott
eab943d353 Add usage link to navigation
We’ve seen services that have a lot of activity on their dashboard
miss the usage feature because the link gets pushed a long way down the
page.

We don’t want to move it up the page, because for most users the
templates/jobs stuff is more useful. And we don’t want to remove it
because it’s a useful part of the onboarding to understand the Notify
proposition.

So this commit adds it as a link to the nav, to make users more aware of
it, and as a quick way of getting into it for the small subset of users
who will care about it (a lot).

Order of the links is determined by what’s likely to be most useful for
first time users surfing the nav. Usage is more interesting than
settings, but less interesting than team members.
2017-02-08 11:35:35 +00:00
Pete Herlihy
3297cf5911 Merge pull request #1107 from alphagov/update-product-page
Update to 29 services for GOV.UK Verify
2017-02-08 11:22:30 +00:00
Chris Hill-Scott
3c7b41aace Limit months shown to current and past
Matches what we do on the usage page. No need to see months in the
future because there’s no way you’ll have sent any messages in those
months, unless you’re Marty McFly.
2017-02-08 11:16:11 +00:00
Chris Hill-Scott
ac9d4f2daf Break down usage by month, filter by year
The previous, weekly activity breakdown was what we reckoned might be
useful. But now that we have people using the platform it feels like
aggregating a service’s usage by month is:
- matches the timeframe users report on within their organisation
- is consistent with the usage page

And like the usage page this commit also limits the page to only show
one financial year’s worth of data at once (rather than data for all
time).

This commit also makes some changes to the jobs view code so that our
aggregation of failure states is consistent between the dashboard pages
and the jobs pages.
2017-02-08 10:59:26 +00:00
Pete Herlihy
c35e1ee6af Merge pull request #1108 from alphagov/feat-update-deskpro-ticket-subjects
Provide better subject lines for Deskpro tickets
2017-02-07 17:02:02 +00:00
Imdad Ahad
24b372de77 Update go-live message + tests 2017-02-07 16:14:58 +00:00
Pete Herlihy
7e93058484 Update subject line for Request to go live tickets 2017-02-07 16:03:55 +00:00
Pete Herlihy
93fb6655fa Added user name to feedback subject line in tests 2017-02-07 16:03:40 +00:00
Pete Herlihy
c906bec3eb Making the feedback tickets subject unique to avoid threading in gmail
Lots of tickets get rolled into a single thread and can mean we miss some tickets.  This will ensure a different thread for each one.
2017-02-07 16:03:02 +00:00
Pete Herlihy
1a668e1304 Update to 29 services for GOV.UK Verify 2017-02-07 14:02:49 +00:00
Imdad Ahad
48b4dce848 Update password on user profile with new endpoint 2017-02-07 13:32:20 +00:00
Imdad Ahad
7ad56df78b Change user api client to update password with new endpoint 2017-02-07 13:31:46 +00:00
Chris Hill-Scott
38a385f54e Merge pull request #1104 from alphagov/bump-utils-addresses-in-letters
Handle partial letter addresses more gracefully
2017-02-06 12:52:46 +00:00
Chris Hill-Scott
df6c899796 Fix XSS vulnarability with emails
Rolling this into the same PR because it’s just a version bump.

Brings in:
- [ ] https://github.com/alphagov/notifications-utils/pull/113
2017-02-06 12:33:32 +00:00
Chris Hill-Scott
8bb15e7a58 Handle partial letter addresses more gracefully
Brings in:
- [x] https://github.com/alphagov/notifications-utils/pull/108

Specifically, see these tests for detail of what happens when someone
only fills in some of the required/not required lines of an address:
9e6cb14a5c (diff-e5050dea996611c8bdf32cfe6e8214cdR264)
2017-02-06 12:33:32 +00:00
Chris Hill-Scott
3663783b3b Merge pull request #1094 from alphagov/usage-by-year
Filter and navigate usage by financial year
2017-02-06 12:33:25 +00:00
Chris Hill-Scott
2a502753a4 Filter and navigate usage by financial year
Right now we tell people that the usage page is for the current
financial year. This is a lie – it’s for all time.

So this commit calls through to the API to get the stats for (by
default) the current financial year.

We already do this for the monthly breakdown, this just does the same
thing for the yearly totals.

It also adds navigation to show the data for other financial years:
- previous so you can go back and see your usage and verify that the
  bill you’re about to pay is correct
- next so that you can check what your SMS allowance is going to be
  before you actually get into it
2017-02-06 12:25:48 +00:00
Chris Hill-Scott
8b2ea28111 Merge pull request #1105 from alphagov/tidy-tests
Tidy up tests
2017-02-06 12:22:57 +00:00
Chris Hill-Scott
f3b0c0a556 Use client and logged_in_client fixtures
Wherever possible, because Don’t Repeat Yourself.
2017-02-06 10:44:38 +00:00
Chris Hill-Scott
929dc45224 Normalize whitespace in test arguments
We have a bunch of different styles of handling when function
definitions span multiple lines, which they almost always do with tests.

Here’s why an argument per line, single indent is best:
- cleaner diffs when you change the name of a method (one line change
  instead of multiple lines)
- works better on narrow screens, eg Github’s diff view, or with two
  terminals side by side on a laptop screen
- works with any editor’s indenting shortcuts, no need for an IDE

Also, trailing comma in the list of arguments is good because adding a
new argument to a method becomes a one line, not two line diff.
2017-02-06 10:44:37 +00:00
Rebecca Law
b9d88cccc3 Merge pull request #1103 from alphagov/testing-doc
Testing doc
2017-02-03 10:44:38 +00:00
Rebecca Law
d1449a26ad Use table instead of lists.
Edits to contents.
2017-02-03 10:35:35 +00:00
Rebecca Law
35cc9106c2 Match words to the create api key page 2017-02-02 16:58:15 +00:00
Rebecca Law
93081d4387 Edits to the integration testing doc
Linked to in the footer and the documentation page.
2017-02-02 16:14:56 +00:00
Rebecca Law
b1150efbbc Merge pull request #1100 from alphagov/implement-suspend-service
Add Suspend and Resume service buttons to service-settings page.
2017-02-02 16:08:48 +00:00
Chris Hill-Scott
5edeb14875 Merge pull request #1060 from alphagov/support-feedback-flow
Add triaging to the support and feedback flow
2017-02-02 15:38:51 +00:00
Chris Hill-Scott
5fa115a8bd Fix intermittent test failure on query ordering
(I suspect that) because Python dictionaries are not ordered, you can’t
rely on the order of query parameters in a URL to match the arguments
passed to `url_for`. This means the tests can intermittently fail.

This does some hacky workaround stuff to still have reasonable test, but
one that will pass whatever the order of the query parameters is.
2017-02-02 15:31:03 +00:00
Chris Hill-Scott
ef1bbb5692 Be stricter about meaning of severe query param
`severe` can mean one of three things:
- `yes` – user has told us this is an emergency
- `no` – user has told us this isn’t an emergency
- Anything else – user hasn’t been asked the question or has
  hacked/mangled the URL

This commit adds some stricter sanitisation of the `severe` query
parameter and does so up front, rather than spreading it across multiple
functions.
2017-02-02 15:18:42 +00:00
Chris Hill-Scott
f3e52d310b Make calculation of business hours timezone aware
`replace` doesn’t convert a time from one timezone to another. It just
changes the label that says what timezone a time is in 😬

`.localize` is how we handle these kind of issues in the API (see
d0b467b2fb/app/utils.py (L42-L44) )

So this commit changes the calculation to use `.localize`, and makes the
tests timezone aware to check we’re doing this right.
2017-02-02 15:18:42 +00:00
Chris Hill-Scott
b39222a62e Removed duplicate test 2017-02-02 15:18:42 +00:00
Chris Hill-Scott
97f3a2374b Don’t test for existance of current_user
Current_user is never falsy - it's an `AnonymousUserMixin` when
someone's not logged in.
2017-02-02 15:18:42 +00:00
Chris Hill-Scott
17a4d8ef3b Use boolean logic instead of any/all
Using and/or over any/all has a couple of advantages:

- it's a bit quicker
- it won't evaluate the second half at all if the first half fails – if
  it is in business hours, and convert_to_boolean would raise, with your
  use of all we'd throw a 500, whereas if we had or, business_hours
  would trip and we'd skip over the second half without worrying about
  exceptions

any and all are designed for use with variable length args eg
`any(x for x in thing())`
2017-02-02 15:18:42 +00:00
Leo Hemsted
199dc24cb8 display service name in feedback email if user is logged in
also, split out a couple of tests for legibility and clear up some
linter errors
2017-02-02 15:18:41 +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
Chris Hill-Scott
d2680fe885 Require email address for reporting problems
If you report a problem we want to be able to get back to you to find
out more information, or to update you on the status of a fix. So it
shouldn’t be possible to report a problem without providing an email
address.

This commit makes `email_address` a required field when `ticket_type` is
problem.

This requires a bit of fiddling with the tests which weren’t expecting
to have to provide an email address. So the tests now either:
- pass an email address
- check for an error when they don’t pass an email address
2017-02-02 15:18:41 +00:00
Chris Hill-Scott
5f47ebb8e0 Remove redundant test
This looks like I accidentally copy pasted this (along with some stuff
that was meant to come over) as part of 22fe164711
2017-02-02 15:18:41 +00:00
Chris Hill-Scott
8f3ba46b27 Preserve message in session if we go out of hours
This is a real edge case, but it seems worth handling.

How you’d get to this case:
- it’s 5:29pm and you start to describe the problem you’re having
- it’s 5:31pm and you click ‘submit’
- you’re redirected to the triage page because we’re now out of hours
- you click ‘this is a serious problem’

What would be bad thing to happen:
- you’re back on the message page and all the stuff you’ve written is
  gone

What would be a good thing to happen:
- we save the message in a session so that you can check it again before
  sending it
2017-02-02 15:18:41 +00:00
Chris Hill-Scott
4ef087fb01 Add a confirmation page
Generally I prefer confirmation pages to the flash message thing
(they’re harder to miss). So this commit adds one.

It also adds some logic to this page, so that, depending what the user
has told us about the thing they’ve submitted, we can tell them how
quickly to expect a response.
2017-02-02 15:18:41 +00:00