Commit Graph

6220 Commits

Author SHA1 Message Date
karlchillmaid
238fcd4652 Fix spacing 2020-02-04 13:45:55 +00:00
karlchillmaid
faf983356e Add status page and email
Add status page and email instructions to the 5xx error.

These match what we show on the 500 error page.
2020-02-04 13:44:55 +00:00
Tom Byers
f8564ebe0c Make agreed changes to content
The following changes are still to be decided:
- how to tell userr when the service will be up
  again on the PaaS failwhale page
- contact information for both pages
2020-02-03 17:02:01 +00:00
Tom Byers
9263bac59e Remove all code targetting IE8
We've dropped support for IE8 so this isn't
needed. For reference:

https://github.com/alphagov/notifications-admin/pull/3158#pullrequestreview-308447860
2020-02-03 17:01:54 +00:00
Tom Byers
88bd14811d Update app/assets/error_pages/5xx.html 2020-02-03 17:01:28 +00:00
Rebecca Law
0e1ee504ac - Add unit test for when case when the cookie doesn't match the db.
- Move code into User.signout method to further encapsulate the code.
2020-02-03 15:08:55 +00:00
Rebecca Law
937c9f2adc Ensure that the session is logged out server side, not just client side.
Anytime a user clicks "sign out" we should be signing them out server side as well. This can be accomplished by setting the Users.current_session_id = null.
I found that the method User.logged_in_elsewhere doesn't need to check if the current_session_id is None. The current_session_ids in the cookie and db (redis or postgres) then the user should be forced to log in again.
2020-02-03 12:24:02 +00:00
Leo Hemsted
4e1fcfbff1 handle invalid upload errors correctly
previously it assumed that invalid_pages would always exist, however it
might be `None` if the error isn't on a specific page. Errors on
specific pages include a page not being A4 or content being outside the
boundary. Errors not on specific pages include the file not being a pdf,
or containing too many pages
2020-01-27 15:11:37 +00:00
Chris Hill-Scott
da2bc29b40 Merge pull request #3263 from alphagov/fix-new-jobs-showing-as-deleted
Use time to determine why notifications don’t exist
2020-01-24 15:27:29 +00:00
Pea M. Tyczynska
ba6b412bca Merge pull request #3268 from alphagov/proper-form-for-letter-branding
Parametrise branding request flow so it serves both email and letter branding
2020-01-23 16:50:41 +00:00
Pea Tyczynska
a578ec23a3 Redirect to template after succesful branding request
if user entered branding request flow from a template.
2020-01-23 16:35:15 +00:00
Pea M. Tyczynska
fdff9d3b83 Ensure gov.uk branding only available for emails and not for letters
Also align and statements
2020-01-23 16:34:58 +00:00
Leo Hemsted
461ba32f4e Merge pull request #3274 from alphagov/one-more-thing
fix one more place where senders weren't sanitised
2020-01-23 15:38:45 +00:00
Tom Byers
6c2af9e696 Set cookie on document host by removing domain
Cookies using the hostname as a domain will be set
with a prefix of `.` by browsers, it seems to
ensure all subdomains are included in the scope.

When deleting the `seen_cookie_message` cookie we
want to set its domain without a `.` prefix, to
match the domain set by the original code.

Leaving the `domain` attribute out from the cookie
string will ensure the `.` prefix is not set.
2020-01-23 13:17:40 +00:00
Tom Byers
d68403f7dc Merge pull request #3272 from alphagov/stop-removing-ga-cookies
Stop removing GA cookies
2020-01-23 11:32:42 +00:00
Leo Hemsted
f3fa6a67e1 fix one more place where senders weren't sanitised
make sure everything is using the `nl2br` formatter that properly wraps
it in markdown to keep everything sanitised nicely. Also write a couple
of tests
2020-01-22 17:22:01 +00:00
Tom Byers
174c10c7ff Clear old cookies to be based on consent
We have been clearing all the Google Analytics
cookies on each page request.

It is now possible for a user to consent to having
Google Analytics cookies so this should have been
checking for that before deleting them.

This makes that change, with tests for those
scenarios.
2020-01-22 12:14:23 +00:00
Tom Byers
0885dde2c1 Update Google Analytics tracker config
Removes the following fields from the tracker
config:
- `name`, which was erroring due to it
  including a `.`
- `displayFeaturesTask` which seems to be
  deprecated

Also refactors the `create` command to put all
fields into the options parameter, as shown in the
developer docs:

https://developers.google.com/analytics/devguides/collection/analyticsjs/creating-trackers
2020-01-22 12:10:01 +00:00
Leo Hemsted
5bbbdc3cd9 fix xss with service letter contact blocks
service contact blocks contain new lines - and jinja2 normally ignores
newlines (as in it keeps them as new lines) - but we need to turn them
into `<br>` tags so that we can show the formatting that the user has
added. We were previously just doing `{{ block | nl2br | safe }}`. nl2br
turns the new lines into `<br>` tags, and then `safe` tells jinja that
it doesn't need to escape the html.

this causes issues if the user adds `<script>alert(1)</script>` to their
contact block (or some other evil xss hack), where that will get let
through due to the safe flag

To solve this, use `Markup(html='escape')` to sanitise any html, and
then convert new lines to <br>.

bump utils

another xss
2020-01-21 17:34:49 +00:00
Pea Tyczynska
5a32177982 Delete old letter branding request page 2020-01-21 16:47:42 +00:00
Pea M. Tyczynska
cc61e87701 Parametrized options label for the branding request form
Co-Authored-By: Chris Hill-Scott <me@quis.cc>
2020-01-21 16:47:42 +00:00
Pea Tyczynska
02cb6c9c38 Create a letter branding request flow to match email branding request
Test if service settings links to branding request page for letters

Parametrize all branding tests so they also work for letter branding
2020-01-21 16:47:14 +00:00
Chris Hill-Scott
291734b0c4 Merge branch 'master' into fix-new-jobs-showing-as-deleted 2020-01-21 14:24:40 +00:00
Chris Hill-Scott
f6a263a7b2 Rename property to more accurately describe purpose
`recently_created` says it would just be looking at the `created_at`
field to see if it's been created recently. Technically this method
isn't doing that, whilst its behaviour would be similar, it's actually
different and maybe therefore a bit misleading.
2020-01-21 14:07:23 +00:00
Chris Hill-Scott
d93866bc7e Use utils function to parse datetime strings
Rather than hard-coding a format string in a bunch of different places
we can use the function we already have in utils.

This commit also refactors some logic around password resets to put the
date-parsing changes in the most sensible bit of the codebase, so it’s
clearer what the intention of the view-layer code is.
2020-01-21 13:55:57 +00:00
David McDonald
8a41b63e23 Merge pull request #3267 from alphagov/bank-hols
Add more bank holiday dates
2020-01-21 10:24:02 +00:00
Chris Hill-Scott
6ff9dac161 Merge pull request #3254 from alphagov/letter-validation-short-messages
Add separate messages for precompiled letters that have failed validation
2020-01-21 10:02:58 +00:00
David McDonald
8d2053216f Add more bank holiday dates 2020-01-20 17:14:54 +00:00
Chris Hill-Scott
0202f73f9a Remove job_status from allowed properties
We can’t guarantee it’s always present, so shouldn’t allow direct access
to it.
2020-01-20 16:47:09 +00:00
Chris Hill-Scott
34f209a08b Fix mixed-up error messages
The too many pages error was being returned when the file couldn’t be
read. This commit corrects the error message, and adds a test to make
sure this case is covered.
2020-01-20 15:54:07 +00:00
Chris Hill-Scott
32105b3328 Don’t assume jobs status will be present
The API response for jobs includes a field called `job_status`. The API
response for uploads doesn’t.

The `Job` mode handles uploads and jobs, so it needs to account for the
possibility of the field not being there.
2020-01-20 15:25:47 +00:00
Tom Byers
5de29f2389 Fix Google Analytics tracking code 2020-01-20 10:05:15 +00:00
Tom Byers
a67cd65f47 Make Google Analytics cookies expire in 1 year 2020-01-20 10:05:06 +00:00
Tom Byers
1d9c5e5da9 Default the cookie banner to be hidden
It should only be shown if JS is available and the
cookieMessage JS finds consent has not been set.
2020-01-20 10:04:58 +00:00
Tom Byers
1a97c6028c Add event tracking to window.GOVUK.analytics
app/assets/javascripts/errorTracking.js sent
events to `window.ga`.

This extends the API of `window.GOVUK.Analytics`
to include support for sending events so all
calls to `window.ga` can use it instead of direct
access.

This use of `window.ga` was missed from the
initial work on `window.GOVUK.Anaytics`.
2020-01-20 10:04:56 +00:00
karlchillmaid
c8f36683ed Remove lead in line before table 2020-01-20 10:04:18 +00:00
Tom Byers
2d1a51cafb Add captions to tables on cookies page 2020-01-20 10:04:18 +00:00
Tom Byers
c11f6c403a Remove line-break from cookies page paragraph 2020-01-20 10:04:18 +00:00
karlchillmaid
16f3c1ad13 Update description of what the cookies do
Update description of what information the cookies capture
2020-01-20 10:04:18 +00:00
Tom Byers
24f18f914b Change size and layout of cookie banner buttons 2020-01-20 10:04:08 +00:00
Tom Byers
4c532f24af Remove unused argument from cookie_banner macro 2020-01-20 10:04:07 +00:00
Tom Byers
ac13d6a4f4 Make 'Hide' button identify as a link
It looks like a link so its semantics should
identify it as one.

This can effect users of speech recognition
software, in scenarios where they instruct it to
click an element which looks like one thing but
the software can only identify as something else.
2020-01-20 10:04:07 +00:00
karlchillmaid
a7876f4661 Update cookies content 2020-01-20 10:03:54 +00:00
karlchillmaid
24c418bfe6 Change 'we' to 'Notify'
Makes the meaning a bit clearer
2020-01-20 10:03:48 +00:00
karlchillmaid
b1e6841bb7 Replace negative contraction
Replace negative contraction.

GDS style guide: https://www.gov.uk/guidance/style-guide/a-to-z-of-gov-uk-style#contractions
2020-01-20 10:03:47 +00:00
Tom Byers
ff2e1dd921 Add hidden text to cookie banner buttons
Visual users get the context from the proximity to
the h2 but we need to provide this for others.

I've tried using `aria-describedby` to link them
to the h2 but this ends up making the h2 text the
button's description in the accessibility tree. In
Voiceover this means you only get that information
as extra context, announced a while after the
label if the VO cursor stays on the button.

We want all the information in the accessible
label so chose this approach instead.
2020-01-20 10:03:47 +00:00
Tom Byers
d37379fc68 Change banner content to just cover analytics
Follows discussions with @quis, @yahoopete and
@karlchillmaid.
2020-01-20 10:03:47 +00:00
Tom Byers
8a0d0a15a8 Hide cookie banner if no-js
Decided in discussions with @quis and @yahoopete
that users without JS available cannot
accept/reject analytics cookies so the banner has
no use.
2020-01-20 10:03:47 +00:00
Tom Byers
3e8ed578d0 Improvements based on frontend feedback
Paired with @aliuk2012 on the implementation and
with a view to making the component generic enough
to be used on digital marketplace apps as well.
These changes came from that session.

They include:
- removal of an unused `data-accept-cookies`
  attribute
- removal of `govuk-!-padding-top-4` class and
  moving of associated styles into component CSS
- swapping out the `aria-label` on the parent
  element for an `aria-describedby` linked to the
  h2 to have one thing labelling the banner region
- removal of unused CSS and any already provided
  by the govuk-button class
- inclusion of @import's for styles attached to
  govuk-body and govuk-button classes
2020-01-20 10:03:36 +00:00
Tom Byers
ca019d4a0d Fix typo on privacy page 2020-01-20 10:03:19 +00:00