Commit Graph

10911 Commits

Author SHA1 Message Date
Chris Hill-Scott
92c6cca6a1 Don’t populate invite with users from other orgs
We shouldn’t have a page where someone can look up any other user’s
email address based on their user ID.

We also don’t want a page where a malicious user could send someone an
link which would get them invited to the service.

Restricting the invite to be populated just from users in their own
organisation doesn’t mitigate against this stuff completely, but they
probably have a way of finding out the email address of someone in their
organisation already.
2020-12-31 14:47:00 +00:00
Chris Hill-Scott
deaf2059f5 Short circuit if already a team member
It would be confusing if people got invited twice, so let’s tell people
if someone’s already been invited.
2020-12-31 14:45:58 +00:00
Chris Hill-Scott
6edc356c22 Allow invite form to be pre-populated
At the moment users must be invited to join a service. But this means:
- users must know that a service already exists
- they need to know who to ask for an invite

If the user doesn’t know these thing then sometimes they just go ahead
and set up a new service. Which means they have to get all the way to
the point of requesting to go live before we tell them that there’s
already a service with a similar name or purpose.

So we should let users:
1. discover what other services exist in their organisation
2. apply to join a service
3. automatically notify the service managers of their interest
4. be invited by a service manager
5. accept the invite

This commit implements step 4. We can just link them to the invite form
in step 3., but we should make it easy for them to send the invite,
without having to copy and paste email addresses.

So this commit let the invite form be pre-populated with an existing
user’s email address.
2020-12-31 14:35:39 +00:00
karlchillmaid
6d8fdb669c Update contact list content (#3464)
* Make the naming of contact lists consistent

* Update content

* Update caption

* Update content

* Update content

* Update content

* Update tests

Co-authored-by: Chris Hill-Scott <me@quis.cc>
2020-12-31 14:03:54 +00:00
Chris Hill-Scott
e7b1834ad4 Merge pull request #3755 from alphagov/remove-inlining-of-images
Remove inlining of images in CSS
2020-12-30 13:36:19 +00:00
Chris Hill-Scott
92d5031d71 Merge pull request #3754 from alphagov/preload-fonts
Tell browsers to preload fonts
2020-12-30 11:09:29 +00:00
Chris Hill-Scott
656f9ca831 Merge pull request #3757 from alphagov/remove-cookie-naming-migration-code
Remove code to migrate cookie names
2020-12-30 11:08:58 +00:00
Chris Hill-Scott
47733bacc8 Remove code to migrate cookie names
We added this code in
https://github.com/alphagov/notifications-admin/pull/3371/files to
account for Flask Login renaming its cookies. We wanted our apps to be
compatible with the old and new names, so people didn’t get logged out
when we rolled out the change.

Now that all the cookies with the old names will have expired (some
weekends have passed since March) we can remove this loop.
2020-12-30 10:19:02 +00:00
Chris Hill-Scott
a2f4abf0d3 Remove inlining of images
In very old browsers it used to be that you could only make 2 concurrent
requests from the same origin.

So base64 encoding of images into CSS was an optimisation that became
popular because it reduced the number of separate requests.

However base64 encoding images has a few disadvantages:
- it increases the size of the image by about 30%
- it increases the size of the CSS file, which is a
  [render blocking resource](https://web.dev/render-blocking-resources/)
  so makes the page appear to load more slowly for the sake of some
  images which, on most pages, never get used
- GZipping things that are already compressed (for example PNG data) is
  very CPU intensive, and might be why Cloudfront sometimes gives up

Removing the inlining of images reduces the size of the CSS we’re
sending to the browser considerably:

–| Before | After | Saving
---|---|---|---
Uncompressed | 198kb | 164kb | 17%
Compressed | 38kb | 23kb | 39%
2020-12-29 18:40:16 +00:00
Chris Hill-Scott
ea124f2886 Tell browsers to preload fonts
When looking at Google’s PageSpeed Insights tool as part of the
compression work I noticed a suggestion that we preload our font files.
The tool suggests this should save about 300ms on first page load time.

***

Our font files are referenced from our CSS. This means that the browser
has to download and parse the CSS before it knows where to find the font
files. This means the requests happen in sequence.

We can make the requests happen in parallel by using a `<link>` tag with
`rel=preload`. This tells the browser to start downloading the fonts
before it’s even started downloading the CSS (the CSS will be the next
thing to start downloading, since it’s the next `<link>` element in the
head of the HTML).

Downloading fonts before things like images is important because once
the font is downloaded it causes the layout to repaint, and shift
everything around. So the page doesn’t feel stable until after the fonts
have loaded.

Google call this [cumulative layout shift](https://web.dev/cls/) which
is a score for how much the page moves around. A lower score means a
better experience (and, less importantly for us, means the page might
rank higher in search results)

We’re only preloading the WOFF2 fonts because only modern browsers
support preload, and these browsers also all support WOFF2.

We set an empty `crossorigin` attribute (which means anonymous-mode)
because the preload request needs to match the origin’s CORS mode. See
https://developer.mozilla.org/en-US/docs/Web/HTML/Preloading_content#CORS-enabled_fetches
for more details.

We set `as=font` because this helps the browser use the correct content
security policy, and prioritise which requests to make first.
2020-12-29 16:31:11 +00:00
Chris Hill-Scott
223003517a Merge pull request #3752 from alphagov/pyup-scheduled-update-2020-12-28
Scheduled weekly dependency update for week 52
2020-12-29 11:05:52 +00:00
Chris Hill-Scott
37038321ba Freeze requirements 2020-12-29 10:46:09 +00:00
pyup-bot
b887480f2e Update notifications-python-client from 5.7.0 to 5.7.1 2020-12-28 13:53:02 +00:00
pyup-bot
80fb52406c Update pytz from 2020.4 to 2020.5 2020-12-28 13:53:02 +00:00
karlchillmaid
e5c34907c3 Merge pull request #3748 from alphagov/use-the-singular-for-royal-mail
Use the singular for Royal Mail
2020-12-23 14:04:34 +00:00
karlchillmaid
f588105aeb Use the singular for Royal Mail
We should use the singular verb form when referring to organisations by name. 

As described in the GOV.UK style guide: https://www.gov.uk/guidance/style-guide/a-to-z-of-gov-uk-style#organisations
2020-12-23 13:56:37 +00:00
karlchillmaid
ada9b0f38d Merge pull request #3746 from alphagov/update-postage-prices
Tell users that postage prices will increase in February.
2020-12-23 11:43:43 +00:00
karlchillmaid
c8f9ef29f0 Update content 2020-12-23 11:12:19 +00:00
karlchillmaid
4ee309fab6 Update rate increase content 2020-12-23 10:58:48 +00:00
karlchillmaid
661b9df643 Revert letter price 2020-12-23 10:30:57 +00:00
karlchillmaid
78135840d4 Update price increases 2020-12-23 10:30:17 +00:00
Chris Hill-Scott
ea611431c4 Merge pull request #3747 from alphagov/accidental-markdown-go-live-ticket
Stop accidental markdown in go live ticket
2020-12-22 17:16:09 +00:00
Chris Hill-Scott
c3515e44cd Stop accidental markdown in go live ticket
In Markdown this is interpreted as a H1:
```
Text
---
```

We can prevent this by adding an extra linebreak, like this:
```
Text

---
```
2020-12-22 17:03:22 +00:00
Chris Hill-Scott
448467435c Merge pull request #3745 from alphagov/reply-to-address-in-ticket
Add email reply to address to go live ticket
2020-12-22 16:41:37 +00:00
karlchillmaid
58eba5c148 Get ready to update product page
Price of a single letter will need to change
2020-12-22 15:43:53 +00:00
karlchillmaid
f11d18c885 Add warning that prices will increase
Add warning that prices will increase – we’re still waiting on confirmation of the price increase and the date.
2020-12-22 15:29:40 +00:00
Tom Byers
aef3cf96ac Merge pull request #3744 from alphagov/revert-test-pre-compressed-asset
Revert "Merge pull request #3738 from alphagov/test-pre-compressed-as…
2020-12-22 14:25:31 +00:00
Chris Hill-Scott
d50eb11c7a Add email reply to address to go live ticket
It’s one of the things we check when someone makes a request to go live,
and putting it in the ticket means we don’t have to take the extra step
of clicking into the settings.

Also added some line breaks to chunk things up a bit more clearly.
2020-12-22 14:02:33 +00:00
Tom Byers
5a44cae266 Merge pull request #3734 from alphagov/give-cookie-banner-accessible-name
Give the cookie banner an accessible name
2020-12-22 11:29:53 +00:00
Tom Byers
24db85684c Revert "Merge pull request #3738 from alphagov/test-pre-compressed-asset"
This reverts commit 2a817024a1, reversing
changes made to d5f54d2d78.
2020-12-21 21:12:16 +00:00
Chris Hill-Scott
2708f8217a Merge pull request #3743 from alphagov/bump-utils-43.5.8
Bump utils to 43.5.8
2020-12-21 16:07:34 +00:00
Chris Hill-Scott
81beeb52fe Bump utils to 43.5.8
Changes:
https://github.com/alphagov/notifications-utils/compare/43.5.6...43.5.8
2020-12-18 14:35:15 +00:00
Tom Byers
e80b02d2c9 Merge pull request #3742 from alphagov/fix-for-file-input-in-safari
Fix for file input bug in safari
2020-12-17 14:24:25 +00:00
Tom Byers
55a4ca6579 Remove set-to-string conversion from upload code
Also changes the allowed_spreadsheet_file_extensions
variable to allowed_file_extensions for
consistency.
2020-12-17 13:04:27 +00:00
Tom Byers
ea3d61e6b9 Use format_list_items in file_upload component 2020-12-17 11:32:02 +00:00
Tom Byers
9716d5dbba Add format_list_items template filter 2020-12-17 11:32:00 +00:00
Tom Byers
97bc2817bc Merge pull request #3731 from alphagov/add-govuk-radios-5
Add GOVUK radios [part 5]
2020-12-16 14:48:49 +00:00
Tom Byers
51cc2a5296 Set accepted files for branding upload 2020-12-16 14:48:10 +00:00
Tom Byers
1096d1f707 Set accepted files for contact list upload 2020-12-16 14:48:10 +00:00
Tom Byers
fb1ac8bc42 Set accepted files for letter upload 2020-12-16 14:48:10 +00:00
Tom Byers
b8f8d743d5 Set accepted files for job spreadsheet upload 2020-12-16 14:48:10 +00:00
Tom Byers
e9722256ea Rename Spreadsheet.allowed_file_extensions
We will use this list in various views, to send
them through to the file_upload component.

These changes make it:
- into a Set so it can't be altered
- uppercase to show it is a constant
2020-12-16 14:48:10 +00:00
Tom Byers
eaa1a67d76 Add allowed_file_extensions arg to file_upload
Safari has a bug where it stops input[type=file]
elements working if they don't specify the types
of file to accept (via the `accept` attribute).

It seems to just effect certain versions of Mojave
but completely blocks this action so worth fixing.

This adds a 'allowed_file_extensions' keyword
argument to the file_upload component to let you
specify a value to be passed to `accept`.

This was spotted on x-gov Slack:

https://ukgovernmentdigital.slack.com/archives/C06GCJW7R/p1607952390112800

...and StackOverflow:

https://stackoverflow.com/q/64843459/679924
2020-12-16 14:48:10 +00:00
Chris Hill-Scott
c1788ec1d0 Merge pull request #3740 from alphagov/bump-utils-43.5.6
Bump utils to 43.5.6
2020-12-15 13:29:57 +00:00
Tom Byers
ea98681b24 Update liveSearch selector in set email|letter
Changes the selector the live search in the set
email and letter branding pages in service
settings and organisation settings. The current
one targeted the old radios HTML whereas this
version targets the same for the GOVUK Frontend
radios.
2020-12-15 12:08:09 +00:00
Tom Byers
88e85ea01c Update liveSearch JS tests and test helpers
Includes a change to make these tests use the
getRadioGroup helper to reduce duplication across
the tests. This also makes a few changes to the
helper so it can produce the HTML required.
2020-12-15 12:08:09 +00:00
Tom Byers
d620d9ea08 Hide legend on SetEmailBranding.branding_style
Effects all routes that use that form, or
SetLetterBranding, which inherits from it:
- /organisations/<service_id>/settings/set-letter-branding
- /organisations/<service_id>/settings/set-email-branding
- /<service_id>/service-settings/set-letter-branding
- /<service_id>/service-settings/set-email-branding
2020-12-15 12:08:09 +00:00
Tom Byers
4e47b62aa3 Update previewPane JS and JS radios test helpers
The previewPane JS used selectors that targeted
the old form of radios HTML.

The JS tests also contained selectors like this
and fragments of HTML, used for fixtures, modelled
on the old radios HTML.
2020-12-15 12:08:09 +00:00
Chris Hill-Scott
8364dda0ba Bump utils to 43.5.6
Changes:
https://github.com/alphagov/notifications-utils/compare/43.5.5...43.5.6
2020-12-14 15:57:37 +00:00
Chris Hill-Scott
8d9e6848ce Merge pull request #3741 from alphagov/pyup-scheduled-update-2020-12-14
Scheduled weekly dependency update for week 50
2020-12-14 15:55:54 +00:00