Commit Graph

2810 Commits

Author SHA1 Message Date
Tom Byers
2ded09a8b9 Fix tests broken by GOV.UK Frontend template
Fix test broken by removal of GOV.UK logo image
- tests/app/main/views/test_notifications.py

Fix tests that ref GOV.UK template CSS files
- tests/app/main/views/test_index.py

Fix test broken by govuk-visually-hidden
- tests/app/main/views/test_send.py

Fix tests broken by header menu link -> button
- tests/app/main/views/test_service_settings.py
- tests/app/main/views/test_template_folders.py

Fix tests broken by removing div#content
- tests/app/main/views/accounts/test_choose_accounts.py
- tests/app/test_navigation.py

Remove references to GOV.UK CSS
- tests/app/main/views/test_index.py

Fix tests querying the header navigation
- tests/app/test_navigation.py
2019-11-27 14:15:32 +00:00
Tom Byers
c1b8fb7531 Replace all visually-hidden classes
These have been replaced:

https://design-system.service.gov.uk/get-started/updating-your-code/#helper-class-names
2019-11-27 14:15:32 +00:00
Chris Hill-Scott
0d202786d0 Show who the recipient is even in trial mode
Trial mode should let you preview the letter the same as live mode,
except for being able to actually end the letter.

Showing the recipient helps people understand how the feature works.
2019-11-27 12:11:32 +00:00
Chris Hill-Scott
bf385486cf Update test with multiple placeholders added
It wasn’t possible to test for this before because the order of
placeholders was non-deterministic. The order has been made
deterministic in https://github.com/alphagov/notifications-utils/pull/674
2019-11-27 11:30:14 +00:00
Chris Hill-Scott
534be751dd Make developer instructions more explicit
The previous ‘you need to update your API calls’ text isn’t clear enough
now that the context of the spreadsheet has been removed.
2019-11-27 10:37:29 +00:00
Chris Hill-Scott
fcadab3ce8 Remove spreadsheet example from breaking change
Since we’re only showing this page to team who are using the API we
don’t have to worry about explaining what’s going on in terms of the
spreadsheet any more.

This makes the page simpler.
2019-11-27 10:37:29 +00:00
Chris Hill-Scott
dbc85fcc1f Only show breaking change page to API users
We introduced the ‘breaking change’ page[1] partly to help teach people
about the relationship between the placeholders in their template and
the data they were providing. Data can be provided either by API or by
uploading a spreadsheet. The users who we struggled to communicate this
relationship to were the ones using the upload a spreadsheet feature.

We made two changes to the context of this feature:

1. Around the same time we introduced the interactive tour[2], which
   ultimately proved to be the thing that helped people understand the
   relationship between the data they were providing and the
   placeholders in the template.

2. We introduced a way for people to send one-off messages without
   using the API or uploading a spreadsheet[3]. So for this page to say
   that you’ll need to update a spreadsheet or change an API call if you
   change the placeholders in your template is no longer accurate.

Therefore I think it makes sense to only show this page to teams who are
using the API to send messages. The best proxy we have for that is to
look at whether they’ve created any API keys.

***

1. https://github.com/alphagov/notifications-admin/pull/631
2. https://github.com/alphagov/notifications-admin/pull/613
3. https://github.com/alphagov/notifications-admin/pull/1293
2019-11-27 10:37:28 +00:00
Tom Byers
e09d510ab8 Revert "Replace govuk template with govuk frontend components - rewrite" 2019-11-26 12:14:09 +00:00
Tom Byers
9ac9c6d7d6 Fix tests broken by GOV.UK Frontend template
Fix test broken by removal of GOV.UK logo image
- tests/app/main/views/test_notifications.py

Fix tests that ref GOV.UK template CSS files
- tests/app/main/views/test_index.py

Fix test broken by govuk-visually-hidden
- tests/app/main/views/test_send.py

Fix tests broken by header menu link -> button
- tests/app/main/views/test_service_settings.py
- tests/app/main/views/test_template_folders.py

Fix tests broken by removing div#content
- tests/app/main/views/accounts/test_choose_accounts.py
- tests/app/test_navigation.py

Remove references to GOV.UK CSS
- tests/app/main/views/test_index.py

Fix tests querying the header navigation
- tests/app/test_navigation.py
2019-11-25 11:43:30 +00:00
Tom Byers
2bd7ce8cf6 Replace all visually-hidden classes
These have been replaced:

https://design-system.service.gov.uk/get-started/updating-your-code/#helper-class-names
2019-11-25 11:43:30 +00:00
Tom Byers
e02f94f238 Revert "Replace govuk template with govuk frontend components" 2019-11-25 10:37:35 +00:00
Tom Byers
73f7292840 Fix tests broken by GOV.UK Frontend template
Fix test broken by removal of GOV.UK logo image
- tests/app/main/views/test_notifications.py

Fix tests that ref GOV.UK template CSS files
- tests/app/main/views/test_index.py

Fix test broken by govuk-visually-hidden
- tests/app/main/views/test_send.py

Fix tests broken by header menu link -> button
- tests/app/main/views/test_service_settings.py
- tests/app/main/views/test_template_folders.py

Fix tests broken by removing div#content
- tests/app/main/views/accounts/test_choose_accounts.py
- tests/app/test_navigation.py

Remove references to GOV.UK CSS
- tests/app/main/views/test_index.py

Fix tests querying the header navigation
- tests/app/test_navigation.py
2019-11-22 17:45:45 +00:00
Tom Byers
c3b2d3c521 Replace all visually-hidden classes
These have been replaced:

https://design-system.service.gov.uk/get-started/updating-your-code/#helper-class-names
2019-11-22 17:45:45 +00:00
karlchillmaid
0599f54a83 Merge pull request #3191 from alphagov/update-trial-mode-content
Update trial mode content
2019-11-22 14:59:47 +00:00
Chris Hill-Scott
585189115f re-fix tests 2019-11-22 14:30:12 +00:00
Chris Hill-Scott
3ef822683f Fix tests
There’s an extra paragraph in the request to go live text now, so we
need to skip it to find the good stuff.
2019-11-22 14:12:25 +00:00
Pea (Malgorzata Tyczynska)
d07a370658 Merge pull request #3179 from alphagov/validate-service-and-org-name
Validate service and organisation name
2019-11-20 13:37:10 +00:00
Pea Tyczynska
21e6d994b9 Validate service and organisation name 2019-11-20 13:31:01 +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
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
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
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
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
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
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
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
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
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
Pea (Malgorzata Tyczynska)
21a59598b2 Merge pull request #3170 from alphagov/show-users-why-their-precompiled-letter-failed-validation
Show users why their precompiled letter failed validation
2019-11-07 11:23:30 +00:00
Chris Hill-Scott
653926f636 Merge pull request #3149 from alphagov/resize-all-textbox-dem
Let textareas resize automatically without having to highlight placeholders
2019-11-07 11:13:06 +00:00
Pea Tyczynska
678e0bed81 Show users more detailed validation failed mesage on notification page
Show valdiation failed messages on letter notifications in red text,
not in the banner like we do on Uploads and Validation checker pages.
This is because it is a different step in the journey: the user
has already sent the notification and styling needs to be in line
with other places where user is checking the notification she already
has sent.
2019-11-07 11:10:27 +00:00
Chris Hill-Scott
b671ad239d Merge pull request #3166 from alphagov/usage-back-on-dashboard
Put usage summary back on the dashboard
2019-11-07 10:32:51 +00:00
Pea Tyczynska
f12dc823cb Show dynamic message when letter fails validation in validation checker - part 2 2019-11-06 14:26:16 +00:00
Pea Tyczynska
5e10ed23a1 Refactor uploads preview error banner to use a shared component
Also refactor a corresponding test to avoid asserting on the content
2019-11-06 14:26:14 +00:00
Pea Tyczynska
c843940b14 Test letter too long error banner using exisitng data-error-type attribute
This way we can avoid both creating an id attribute for testing
and testing by content.
2019-11-06 12:21:18 +00:00
David McDonald
4ca4cef1b3 Merge pull request #3144 from alphagov/choose-postage
Choose postage
2019-11-05 10:14:40 +00:00
Chris Hill-Scott
889d601475 Put usage summary back on the dashboard
This reverts 1b1839ad30, which removed
the usage from the dashboard because it was causing performance
problems:

> **The yearly usage section on the dashboard page takes too log as a
> result services with large yearly stats are timing out.**
>
> As a short term fix we have taken the yearly stats off the dashboard.
>
> There is a plan to create permanent statistic tables to warehouse the
> data.

The long term fix (the fact tables) is now in place, so it should be OK
to bring this back.

This is part of a wider piece of work to refresh the dashboard page now
that jobs are moving to their own page.
2019-11-04 14:54:16 +00:00
Chris Hill-Scott
8782049548 Merge pull request #3165 from alphagov/letters-always-on-usage
Always show letters on the dashboard and usage page
2019-11-04 14:49:47 +00:00
Chris Hill-Scott
6c5255f30b Merge pull request #3167 from alphagov/hide-len-1-template-statistics
Don’t show template statistics on dashboard if only one template has been used
2019-11-04 14:45:33 +00:00
David McDonald
183c45d523 Assert radio buttons exist in form 2019-11-01 10:47:42 +00:00
David McDonald
2b8b4c25aa Send postage value to API when sending pre compiled letter 2019-11-01 10:47:42 +00:00