Commit Graph

9894 Commits

Author SHA1 Message Date
Chris Hill-Scott
8bc5fa5bb0 Rename URL to remove term ‘whitelist’
See c31264d4c for rationale. To avoid confusion the codebase should use
the same terminology as the UI.
2020-06-12 10:27:55 +01:00
Chris Hill-Scott
e721c73119 Rename Jinja template to remove term ‘whitelist’
See c31264d4c for rationale. To avoid confusion the codebase should use
the same terminology as the UI.
2020-06-12 10:27:30 +01:00
Chris Hill-Scott
16cc640822 Rename API client methods to remove term ‘whitelist’
See c31264d4c for rationale. To avoid confusion the codebase should use
the same terminology as the UI.
2020-06-12 10:27:18 +01:00
Chris Hill-Scott
23f9728108 Rename endpoint to remove term ‘whitelist’
See c31264d4c for rationale. To avoid confusion the codebase should use
the same terminology as the UI.
2020-06-12 10:26:59 +01:00
Chris Hill-Scott
bf6bd8ad0f Rename form objects to remove the term ‘whitelist’
See c31264d4c for rationale. To avoid confusion the codebase should use
the same terminology as the UI.
2020-06-12 10:25:44 +01:00
Chris Hill-Scott
c31264d4c9 Rename ‘whitelist’ to ‘guest list’ in UI
This commit changes all the places where a user would see the term
‘whitelist’ in the content of page to say guestlist instead.

We’re removing the term ‘whitelist’ for two reasons. The first reason
is that we agree with the National Cyber Security Centre say:

> It's fairly common to say whitelisting and blacklisting to describe
> desirable and undesirable things in cyber security. For instance, when
> talking about which applications you will allow or deny on your
> corporate network; or deciding which bad passwords you want your users
> not to be able to use.

> However, there's an issue with the terminology. It only makes sense if
> you equate white with 'good, permitted, safe' and black with 'bad,
> dangerous, forbidden'. There are some obvious problems with this. So
> in the name of helping to stamp out racism in cyber security, we will
> avoid this casually pejorative wording on our website in the future.
> No, it's not the biggest issue in the world - but to borrow a slogan
> from elsewhere: every little helps.

– https://www.ncsc.gov.uk/blog-post/terminology-its-not-black-and-white

The second reason is that we’ve observed some users think that they have
to put recipients in the whitelist even when they’re already with in the
team. We think that the term ‘whitelist’ might be reinforcing this
mental model because of how ‘whitelists’ might work in other
applications.

We considered the following alternatives or concepts:
- Development
- Recipients
- Sandbox
- Extended team
- Smoke test recipients
- Allowed
- Nominated
- Bonus
- Additional
- Safe
- Team list
- Trusted contacts
- Designated people
- Guest list
- Team key list

We also considered not giving it a name, and explaining it as a nuance
of how the team key works. After mocking this up it felt more disjoined.
We think it’s still useful for the thing to have a name so that it’s
easy to refer to between the docs and the UI.

We like the term ‘guest list’ because:
- of how it sits with team members – members and guests in the abstract
- a guest list is a concept that a lot of people will be familiar with
  – a list of people who can access a thing
- ‘guest’ is very different to ‘recipient’ – we want to mitigate any
  confusion between this and the (emergency) contact lists
2020-06-12 09:56:31 +01:00
karlchillmaid
14cb386279 Merge pull request #3471 from alphagov/update-permanent-failure-error-message-content
Update permanent failure error message content
2020-06-10 17:02:27 +01:00
Rebecca Law
1f3d74195f Updated the message so the TextField didn't escape the HTML 2020-06-10 16:01:01 +01:00
karlchillmaid
b464d5b898 Add contact us information 2020-06-10 13:59:59 +01:00
Chris Hill-Scott
4c5a8a5764 Merge pull request #3473 from alphagov/bump-utils-39.4.3
Bump utils to 39.4.3
2020-06-09 16:02:55 +01:00
Chris Hill-Scott
b7429fe8a9 Bump utils to 39.4.3
Brings in a bug fix for when a personalisation value is an empty list.
2020-06-09 10:37:16 +01:00
Chris Hill-Scott
98d7794d7e Merge pull request #3470 from alphagov/enforce-service-permissions
Enforce correct naming of service permissions
2020-06-08 10:40:09 +01:00
karlchillmaid
0df3d2d323 Update error message content 2020-06-05 17:37:16 +01:00
karlchillmaid
1bf6eb06a5 Update error message content 2020-06-05 17:36:04 +01:00
karlchillmaid
221a32441b Update permanent failure error name 2020-06-05 17:34:54 +01:00
karlchillmaid
b2983bd566 Update permanent failure error message description 2020-06-05 17:33:31 +01:00
Chris Hill-Scott
e089de74ee Refactor to not need custom constructor
All the constructor of the service model is doing is setting a default
value of a property, this is more idiomatically expressed with a custom
property, and means we can get rid of the custom constructor entirely.
2020-06-03 15:34:55 +01:00
Chris Hill-Scott
a95d9b5152 Enforce service permissions
This should catch typos more quickly and obviously.
2020-06-03 15:34:55 +01:00
Chris Hill-Scott
d846a73438 Merge pull request #3469 from alphagov/fix-reversed-out-paragraph-text-colour
Fix paragraphs with reversed-out text
2020-06-02 11:33:39 +01:00
Chris Hill-Scott
7578bbcf0b Fix paragraphs with reversed-out text
Since these two paragraphs sit on a blue background, they should have
white text. But this was getting overridden when the `govuk-body` class
was added in a previous commit, and the paragraphs appeared with black
text.

Previously these paragraphs were inheriting their colour from a parent
element. But a class applied directly to the element is more specific.
So this commit fixes the problem by being more specific again, by
applying the colour to the element, in the context of it’s parent’s
class.
2020-06-02 11:10:09 +01:00
Chris Hill-Scott
0d9fae0031 Merge pull request #3467 from alphagov/no-bare-elements
Don’t allow paragraphs without class attribute
2020-06-02 10:30:46 +01:00
Chris Hill-Scott
f05d193809 Explain why this test ignores class attribute 2020-06-02 10:20:07 +01:00
Chris Hill-Scott
84f67bf1dd Don’t allow unstyled links
They should always be styled with the `govuk-link` class from GOV.UK
Frontend, or another custom class.
2020-05-29 17:25:11 +01:00
Chris Hill-Scott
4df99bd27f Don’t allow paragraphs without class attribute
All paragraphs should have class="govuk-body", or be otherwise
custom-styled. This commit adds some extra checks to our test fixture
that looks for paragraphs that don’t have any styling. Our test coverage
is pretty good, so this should check almost all pages, and prevent
regressions.

I’ve done this in such a way that it can be extended for other elements
(e.g. links) in the future.
2020-05-29 17:11:01 +01:00
Chris Hill-Scott
82ec03e263 Merge pull request #3461 from alphagov/pyup-scheduled-update-2020-05-25
Scheduled weekly dependency update for week 21
2020-05-29 13:32:16 +01:00
Chris Hill-Scott
18f3f0a7ae Freeze requirements 2020-05-28 10:47:52 +01:00
pyup-bot
b8e8858abe Update notifications-python-client from 5.5.1 to 5.6.0 2020-05-28 10:36:16 +01:00
Chris Hill-Scott
c142a8056a Merge pull request #3462 from alphagov/meta-tag-instead-of-robots
Hide pages from search engines using a meta tag instead of robots.txt
2020-05-27 16:02:04 +01:00
Chris Hill-Scott
e430455822 Merge pull request #3458 from alphagov/bump-utils-letter-timings
Bump utils to 39.4.2
2020-05-27 15:42:21 +01:00
Chris Hill-Scott
67be9d98c9 Bump utils to 39.4.2 2020-05-27 15:27:30 +01:00
Leo Hemsted
026d4af2ec Merge pull request #3457 from alphagov/redirect-preview-to-notifications
Redirect preview to notifications if the notification already exists in the db
2020-05-27 15:00:33 +01:00
Pea M. Tyczynska
33d749ab4c Merge pull request #3460 from alphagov/handle-session-expiring-name-change
Handle session expiring during service name change
2020-05-27 12:27:36 +01:00
David McDonald
699df9716e Merge pull request #3463 from alphagov/delete-cache-object-fix
Use redis_client rather than wrapper method
2020-05-27 12:05:17 +01:00
David McDonald
ee14ae33dc Use redis_client rather than wrapper method
Fixes a bug where we were calling a wrapper method when instead we
should have been calling the redis_client. This had resulted in no
actual calls to redis happening.
2020-05-27 11:56:07 +01:00
Pea Tyczynska
f997cc2801 Improve the error message following content review.
'Session expired' or similar makes it sound like a new error.
It could confuse the user and make them think the sign in didn't work
and that their session has expired again.

So we went with:
The change you made was not saved. Please try again.
2020-05-27 11:21:06 +01:00
Pea Tyczynska
8f8c250124 Handle session expiring during service name change 2020-05-27 11:21:06 +01:00
Chris Hill-Scott
978ebcbe9b Send HTTP header as well as inserting meta tag
This will let us use the decorator on endpoints that don’t return HTML.
2020-05-27 10:32:06 +01:00
Chris Hill-Scott
f12f0fae87 Remove robots.txt
Google’s documentation says:

> robots.txt is not a mechanism for keeping a web page out of Google. To
> keep a web page out of Google, you should use noindex directives

We’ve implemented a noindex directive now, so we don’t need to serve
robots.txt any more.
2020-05-27 10:20:07 +01:00
Chris Hill-Scott
f902205ef3 Remove email features page from search engines
Reimplements https://github.com/alphagov/notifications-aws/pull/796

Since deploying alphagov/notifications-utils#736 I’ve been looking at
how members of the public are ending up on our support page. The vast
majority are landing on https://www.notifications.service.gov.uk/features/email

Previously we thought that they were clicking the ‘contact us’ link in
the page, which deep linked into the support journey, so we removed
these deep links in alphagov/notifications-admin#3451

But the tickets are still coming in, so I think that people are still
landing on this page, then going directly to ‘support’ in the top
navigation. So the next measure we have available is to try to stop
people from landing on this page in the first place. All the examples
I’ve looked at show people coming from Google to this page. By putting
the page’s URL in our robots.txt it should stop Google (and other search
engines) listing it in search results.
2020-05-27 10:19:58 +01:00
David McDonald
979eab92c7 Merge pull request #3459 from alphagov/delete-cache-on-archive
Delete cached users and templates when archiving a service
2020-05-27 10:19:48 +01:00
Chris Hill-Scott
92ffe3a78c Use meta tag to tell search engines not to index
Google’s documentation says:

> robots.txt is not a mechanism for keeping a web page out of Google. To
> keep a web page out of Google, you should use noindex directives

A noindex directive means adding the following meta tag to pages that
shouldn’t be indexed:
```html
<meta name="robots" content="noindex" />
```

It’s also possible to set the directive as a HTTP header, but this seems
trickier to achieve on a per-view basis in Flask.

I’ve implemented this as a decorator so it can quickly be added to any
other pages that we decide shouldn’t appear in search results.
2020-05-27 10:19:48 +01:00
Leo Hemsted
d86070a7e8 redirect from upload preview to notifications if it already exists
the upload preview page has a file_id - this corresponds to the file in
the transient pdf uploads bucket. However, if the user already hit send
(and then navigated back) the file's no longer in that bcuket, it's been
moved to the regular letters-pdf bucket. So the s3 get request fails. To
avoid this, simply redirect to the notifications page if the file isn't
in the transient bucket. This is better for the user as it'll stop them
trying to submit it twice, and will provide more clarity on the status
of the notification too.
2020-05-26 14:07:47 +01:00
Leo Hemsted
90a6d6586e split test_uploads.py into three separate folders
one for the upload hub and list pages

one for contact list uploading/editing/viewing

one for sending a letter

no tests added/removed/changed
2020-05-26 14:07:46 +01:00
Chris Hill-Scott
9da843ceff Bump utils to 39.4.1 2020-05-26 13:37:04 +01:00
Chris Hill-Scott
e0de65cd81 Call mock rather than using fixture
Our get_notifications fixture tries to be too clever and work out which
fields to return based on what arguments it’s called with. This is very
indirect and makes the tests less specific.

In other places we call the mocking code directly with arguments that
make it more explicit what the mocked response should be. This commit
does this for tests that we’d otherwise have to make changes to the
fixture for, because postage can no longer be `None` for letter
notifications.
2020-05-26 13:37:03 +01:00
Chris Hill-Scott
d828c1c481 Bump utils to 39.4.0
Adds delivery estimates for letters posted to Europe or the rest of the
world.
2020-05-26 13:37:03 +01:00
David McDonald
0fdda016e2 Refactor archive to do one sync delete of all keys rather than many
Otherwise we could be waiting on 50 sync calls to redis to happen. This
way we do it in one sync call and follow the pattern of
b98f4561fa/app/notify_client/organisations_api_client.py (L56)
2020-05-22 17:12:00 +01:00
David McDonald
a65ada0d7e Delete cached users and templates when archiving a service
When the admin app gets user objects from the API, these include a dict
of permissions by service for what the user can do to that services.
Permissions for inactive services are not included in the response as
per:
87cb6f2597/app/dao/permissions_dao.py (L66)

However, this causes a bug where a service is archived but cached user
data still tells us that the user has permissions to view the service.
This should not be the case and causes errors where users can still see
the archived service page, it's settings, and even request to go live
for it, because they are using old cached data for the user.

We solve this by deleting the users who are part of the service from the
cache.

We also delete the templates for this service from the cache as the
templates are also archived when we ask the API to archive the service
as per:
d95c0131e0/app/service/rest.py (L597)

Note, one decision I had to make was whether to delete the user cache
for just active team members or also invited users. Assuming an invited
user can't see the service until they've accepted their invite anyway, it
shouldn't make any difference whether we delete their cache or not.
2020-05-22 16:27:05 +01:00
Chris Hill-Scott
b98f4561fa Merge pull request #3455 from alphagov/remove-file_id-from-form
Don’t show postage choice for international letters
2020-05-22 15:01:32 +01:00
Chris Hill-Scott
04ce13ebfc Remove default argument for file_id
It’s always provided now.
2020-05-22 14:50:33 +01:00