Commit Graph

8647 Commits

Author SHA1 Message Date
karlchillmaid
4e7a5aaaa1 Update app/templates/views/trial-mode.html
Co-Authored-By: Chris Hill-Scott <me@quis.cc>
2019-11-20 13:45:29 +00:00
karlchillmaid
3d6b66b21d Update content 2019-11-20 11:34:03 +00:00
karlchillmaid
b5fb43212a Update lead in and second bullet 2019-11-20 11:32:42 +00:00
karlchillmaid
1a25ac9676 Update trial mode content 2019-11-20 11:25:36 +00:00
Chris Hill-Scott
ebb29b82a9 Merge pull request #3189 from alphagov/update-tags-new-taxonomy
Update Zendesk tags to reflect new taxonomy
2019-11-20 10:59:17 +00:00
Chris Hill-Scott
e24b72f974 Merge pull request #3190 from alphagov/product-page-pricing-letters-update
Update product page with new letter prices
2019-11-20 10:58:40 +00:00
Chris Hill-Scott
a3ae9e8ba0 Update product page with new letter prices
We updated the letter pricing in https://github.com/alphagov/notifications-admin/pull/3128

The minimum price has gone up from 30p to 35p
2019-11-20 10:53:39 +00:00
Chris Hill-Scott
12b7c5d5e8 Remove notify_go_live_incomplete tag
The new taxonomy doesn't have a `notify_go_live_incomplete` tag. We
replaced this with `notify_go_live_incomplete_mou` because the only way
users can submit an incomplete request is if they do not agree to the
MOU.

These are the incomplete tags:

- `notify_go_live_incomplete_mou`
- `notify_go_live_incomplete_reply_to`
- `notify_go_live_incomplete_shared_email`
- `notify_go_live_incomplete_templates`

Of those, only the first one is applied automatically.
2019-11-19 16:42:25 +00:00
Chris Hill-Scott
7a5d301104 Update Zendesk tags to reflect new taxonomy
Requests to go live and email branding requests come through to Zendesk
with tags attached automatically.

With the revised taxonomy some of these tags need to be updated, as
summarised in this spreadsheet.

In addition, `notify_action` tag has to be added in each of those cases.

Old|New
---|---
`notify_request_to_go_live_complete`|`notify_go_live_complete`
`notify_request_to_go_live_incomplete`|`notify_go_live_incomplete`
`notify_action_add_branding`|`notify_branding`
`notify_request_to_go_live_incomplete_mou`|`notify_go_live_incomplete_mou`
`notify_request_to_go_live`|`notify_go_live`

– https://docs.google.com/spreadsheets/d/1o5ATsFsVK8Qpj7x8QvxX-SfEuBZ75028GEySVcdBFYU/edit#gid=0https://www.pivotaltracker.com/story/show/169842970
2019-11-19 15:46:29 +00:00
karlchillmaid
94ee7b16d9 Merge pull request #3180 from alphagov/update-error-page-content
Update error page content
2019-11-19 09:39:14 +00:00
karlchillmaid
128e0de0e4 Merge pull request #3188 from alphagov/fix-quotes
Fix quotes
2019-11-19 08:37:06 +00:00
karlchillmaid
2ae8cc6e68 Fix quotes 2019-11-18 17:09:34 +00:00
Chris Hill-Scott
0361fb6991 Fix duplicated ‘GOV.UK Notify’ in page titles
The `per_page_title` block appends ‘– GOV.UK Notify’ – there’s no need
to hard code it (see e4b040b380/app/templates/admin_template.html (L15))
2019-11-18 17:08:20 +00:00
karlchillmaid
6abd8da4a1 Merge pull request #3186 from alphagov/security-page-content-updates
Update Classifications and security vetting content
2019-11-18 17:05:17 +00:00
Leo Hemsted
e4b040b380 Merge pull request #3187 from alphagov/bump-utils
bump reqs
2019-11-18 15:21:52 +00:00
Leo Hemsted
f85bd3a8dd bump reqs
utils bump, and a bunch of test dependencies
can't bump pytest-xdist as it requires pytest>4
2019-11-18 14:59:02 +00:00
karlchillmaid
7065f158d9 Update Classifications and security vetting 2019-11-18 13:48:54 +00:00
Chris Hill-Scott
32cc08432c Merge pull request #3160 from alphagov/no-min-height-sticky-button
Remove min-height from sticky submit buttons
2019-11-15 12:35:21 +00:00
Chris Hill-Scott
3d9d841eae Merge pull request #3183 from alphagov/send-thousands
Comma-delimit thousands in ‘Send’ button
2019-11-13 16:59:09 +00:00
Chris Hill-Scott
db86abc2c2 Merge pull request #3184 from alphagov/prefer-non-all-urls
Prefer shorter URL
2019-11-13 15:58:36 +00:00
Chris Hill-Scott
37f0c4459b Prefer shorter URL
Flask will pick the first route that matches. Decorators get applied
from innermost to outermost.

So if the same endpoint is served at `/abc` and `/123` the one used
when `url_for` is generating a URL is whichever decorator is lowest
(in terms of line number).

It doesn’t functionally make a difference, but it’s causing the
functional tests to fail at the moment. And shorter URLs are nicer, so
I think it makes sense to change here, rather than change the tests.
2019-11-13 15:13:57 +00:00
Chris Hill-Scott
0d2f1a0716 Merge pull request #3182 from alphagov/fix-template-type-all
Add a specific route for template_type=all
2019-11-13 14:22:30 +00:00
Chris Hill-Scott
91283c99b9 Add a specific route for template_type=all
`all` is not a real template type, so for links to template folders that
apply to all template types we have a URL that looks like:
```
/services/<uuid:service_id>/templates
```

However Flask only generates this url when `url_for` is called with
`template_type=None`. If called with `template_type=all` then Flask will
generate a URL like
```
/services/<uuid:service_id>/templates/all
```

However attempting to load this URL will now 404, since `all` is not a
template type recognised by the regex introduced in
https://github.com/alphagov/notifications-admin/pull/3176

It would be nice to not have URLs with `all` in them at all, but since
people might have bookmarked them we need to support them indefinitely.

Also considered but decided against adding `all` to the set of template
types because it might cause other problems, for example attempting to
create a new template with a type of `all` would never work.
2019-11-13 14:17:30 +00:00
Chris Hill-Scott
c3b2017f47 Comma-delimit thousands in ‘Send’ button
Matches the style of how we display numbers in the thousands elsewhere.
2019-11-13 13:29:49 +00:00
Chris Hill-Scott
a0f6f9b137 Add a specific route for template_type=all
`all` is not a real template type, so for links to template folders that
apply to all template types we have a URL that looks like:
```
/services/<uuid:service_id>/templates/folders/<uuid:template_folder_id>
```

However Flask only generates this url when `url_for` is called with
`template_type=None`. If called with `template_type=all` then Flask will
generate a URL like
```
/services/<uuid:service_id>/templates/all/folders/<uuid:template_folder_id>
```

However attempting to load this URL will now 404, since `all` is not a
template type recognised by the regex introduced in
https://github.com/alphagov/notifications-admin/pull/3176

It would be nice to not have URLs with `all` in them at all, but since
people might have bookmarked them we need to support them indefinitely.

Also considered but decided against adding `all` to the set of template
types because it might cause other problems, for example attempting to
create a new template with a type of `all` would never work.
2019-11-13 12:53:53 +00:00
Leo Hemsted
7735c23428 Merge pull request #3175 from alphagov/pyup-scheduled-update-2019-11-04
Scheduled weekly dependency update for week 44
2019-11-13 12:18:40 +00:00
Chris Hill-Scott
24dc438446 Merge pull request #3176 from alphagov/require-uuids-in-urls
Be stricter about the format of URL parameters
2019-11-13 10:33:31 +00:00
Tom Byers
272c6a3c91 Update tests with new error message content 2019-11-12 17:06:06 +00:00
Tom Byers
74e280ce51 Fix reference to main.support in views 2019-11-12 17:02:38 +00:00
Tom Byers
059fb66fae Merge pull request #3173 from alphagov/dependabot/npm_and_yarn/jquery-3.4.1
Bump jquery from 1.12.4 to 3.4.1
2019-11-11 14:23:06 +00:00
Tom Byers
47781cc929 Change treatment of space character in URLs
jQuery changed it from using '+' to '%20' between
versions 1 and 3. This updates the test to match.
2019-11-11 12:08:21 +00:00
Leo Hemsted
846895dca2 frozen reqs 2019-11-11 12:05:32 +00:00
pyup-bot
d58624c767 Update notifications-python-client from 5.3.0 to 5.4.0 2019-11-11 12:04:23 +00:00
pyup-bot
91979a0584 Update pytz from 2019.2 to 2019.3 2019-11-11 12:04:23 +00:00
karlchillmaid
894fc6eacf Update page title 2019-11-11 09:43:35 +00:00
karlchillmaid
0c18f3c55a Update 500 error content 2019-11-11 09:16:39 +00:00
karlchillmaid
0d9f5f5acf Update 413 error content 2019-11-11 09:07:05 +00:00
karlchillmaid
d2c3705d57 Update 410 error content 2019-11-11 09:05:15 +00:00
karlchillmaid
e8c53ac2c5 Update 404 error content 2019-11-11 09:02:57 +00:00
karlchillmaid
ee1c3d6853 Update 403 error content 2019-11-11 08:57:09 +00:00
karlchillmaid
6160be9db4 Update 401 error content 2019-11-11 08:54:27 +00:00
Tom Byers
2b5ba5f438 Use screenMock helper in fullscreenTable test 2019-11-08 17:37:06 +00:00
Tom Byers
e65946680a Use screenMock helper in API key test
jQuery 3 checks for any styles before dimension so
a value typical of the browser defaults needs to
be provided when mocking them.

This helps the mocking of `$.height` by providing
a default style for `height`.
2019-11-08 17:37:06 +00:00
Tom Byers
3fba2c381d Make screenMock helper mock more DOM APIs
jQuery 3 also calls `.getClientRects` to get the
position and dimension of elements.
2019-11-08 17:37:06 +00:00
Tom Byers
56a2aab5f0 Mock out getClientRects for tests that need it
jQuery 3 calls `getClientRects` in the
`.innerHeight` code. Version 1 didn't.

This mocks out those calls to the same as
`getCoundingClientRect`.
2019-11-08 17:37:06 +00:00
Katie Smith
c3c224dcc8 Merge pull request #3178 from alphagov/show-recipient-address-for-uploads
Show recipient when about to send uploaded letter
2019-11-08 13:12:41 +00:00
Katie Smith
a542047581 Show recipient when about to send uploaded letter
The recipient of the letter now displays at the bottom of the page when
previewing a valid letter. The template preview `/precompiled/sanitise`
endpoint returns the address, but we format it to display on a single
line with commas between each line. We also need to convert the
recipient address to ASCII so that it can be stored as S3 metadata.
2019-11-08 10:17:11 +00:00
Chris Hill-Scott
bf981c308a Require return_to param in action_blocked
The `action_blocked` endpoint needed a variation of the URL without
a `template_id` parameter, because `None` is no longer a valid
`template_id` (because it’s not a UUID).

This change was made in 265931d21746918c4ddfc19c4ad3f8cb5683c1bf, which
also removed the `return_to` parameter, because the back link on the
`action blocked` page only ever goes to `add_new_template` if there’s
no `template_id` provided.

However this was conflating the two things, so I’ve wound it back a bit
so that:
- there’s still a new route, whose URL doesn’t include `template_id`
  as a parameter
- `return_to` is always required

I’ve also refactored the code a bit to move the looking up of the back
link from the Jinja into the view layer, so that the related code is in
one place and easier to reason about.
2019-11-07 17:55:35 +00:00
Chris Hill-Scott
545b485d86 Add URL converters for template and file types
Sometimes we manually check that a URL parameter is in a required set.
Sometimes we don’t bother.

This commit adds a URL converter to do this so that:
- we don’t have to re-write the same code every time
- it’s easier to apply this check to other endpoints

This means endpoints that previously allowed a `template_type` or
`message_type` of `None` now 404. So I’ve had to add new routes for
with URLs that don’t include such parameters.

So this…:
```
/services/128b91b6-2996-4107-bb65-51b7c24a728d/notifications/sms.csv
/services/128b91b6-2996-4107-bb65-51b7c24a728d/notifications/None.csv
```

…becomes:
```
/services/128b91b6-2996-4107-bb65-51b7c24a728d/notifications/sms.csv
/services/128b91b6-2996-4107-bb65-51b7c24a728d/notifications.csv
```

This matches what we do for the HTML-responding equivalent (see
265931d217/app/main/views/jobs.py (L215-L216))
2019-11-07 13:48:09 +00:00
Chris Hill-Scott
ef335e7601 Require IDs to be UUIDs in URLS
We mostly rely on the API returning a 404 to generate 404s for trying
to get things with non-UUID IDs. This is fine, except our tests often
mock these API calls. So it could look like everything is working fine,
except the thing your passing in might never be a valid UUID, and thus
would 404 in a non-test environment.

So this commit:
1. uses the `uuid` URL converter everywhere there’s something that looks
   like an ID in a URL parameter
2.  adds a test which automates checking for 1.
2019-11-07 13:46:25 +00:00