Commit Graph

9127 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
karlchillmaid
fa8a4ae4c2 Update error description 2020-02-03 17:02:22 +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
048f0f3179 Update JavaScripts 2020-02-03 17:01:47 +00:00
Tom Byers
3e31cdbfd2 Update fonts 2020-02-03 17:01:38 +00:00
Tom Byers
88bd14811d Update app/assets/error_pages/5xx.html 2020-02-03 17:01:28 +00:00
Tom Byers
a42eaf4184 Update PaaS Failwhale HTML page 2020-02-03 17:00:57 +00:00
Tom Byers
974826e3e2 Update stylesheets 2020-02-03 17:00:24 +00:00
Tom Byers
340111b187 Update images 2020-02-03 17:00:08 +00:00
Rebecca Law
18523587a6 Merge pull request #3282 from alphagov/sign-out-user-server-side
Ensure that the session is logged out server side, not just client side.
2020-02-03 15:25:18 +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
a49b492ade Merge pull request #3277 from alphagov/datetime-fix
bump utils to fix datetime formatting jinja bug
2020-01-28 13:07:20 +00:00
Leo Hemsted
01ba256ef9 bump utils to fix datetime formatting jinja bug 2020-01-28 10:32:21 +00:00
Leo Hemsted
b2d18e16ef Merge pull request #3276 from alphagov/letter-error-display
handle invalid upload errors correctly
2020-01-27 15:31:32 +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
Chris Hill-Scott
3b108e8c93 Add comment clarifying timings in test case 2020-01-23 16:32:08 +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
30543ef27f Merge pull request #3275 from alphagov/fix-deleting-of-old-cookie
Set cookie on document host by removing domain
2020-01-23 14:00:32 +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
945701c607 Merge pull request #3273 from alphagov/fix-ga-config
Update Google Analytics tracker config
2020-01-22 13:00:55 +00:00
Tom Byers
cfdc83a336 Update tests 2020-01-22 12:26:55 +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
Tom Byers
98e48e68f9 Change the URL JSDOM uses for the current page
https://jestjs.io/docs/en/configuration#testurl-string

Affects all DOM APIs that return information about
the URL, for example window.location.

Why:

We now have tests for setting/deleting cookies.
Tough-cookie, the library JSDOM uses for cookie
handling cookies doesn't allow setting cookies
with `domain=localhost`. This is correct by
RFC6265, the standard it follows, as domains must
have 2 or more `.`s in them.

The only way to set a cookie on `localhost` is to
leave out the `domain` attribute.

The code we are testing sets and deletes cookies
set on specific domains so using `localhost` is
out.

We also cannot just set/delete cookies on the
domains used as cookies are required to match the
domain of the current page.

The solution we are left with is to set the
current page to one from production and make sure
each cookie is set relative to that domain.

Note: this introduces `testURL` in isolation to be
sure it doesn't break any existing tests.
2020-01-22 11:08:29 +00:00
Leo Hemsted
1cd96d7e2f Merge pull request #3271 from alphagov/bump-python
fix service letter contact blocks
2020-01-21 17:41:37 +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
Leo Hemsted
c57aec8cd5 Merge pull request #3270 from alphagov/bump-python
bump python version
2020-01-21 15:17:30 +00:00
Leo Hemsted
edfcd49861 bump python version
we all run 3.6 locally, we test against 3.6 both locally and on
concourse, and the latest version of openpyxl (required by
pyexcel-xlsx) doesn't support 3.5 anymore
2020-01-21 15:10:43 +00:00
Leo Hemsted
772a47e870 Merge pull request #3269 from alphagov/reqs-bump
bump requirements
2020-01-21 14:55:40 +00:00
Leo Hemsted
9620559a55 bump requirements 2020-01-21 14:47:18 +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
d27d400f53 Test the boundary conditions
Since date math can be hard it’s good to test as close to the boundary
as possible, which hopefully catches stuff like timezone related bugs.
2020-01-21 14:15:48 +00:00
Chris Hill-Scott
f5ced76e63 Don’t mock job processing in the future
It could hide bugs or make the tests harder to understand later on if
what they’re testing is an impossible scenario.
2020-01-21 14:09:54 +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
Chris Hill-Scott
68bc41685c Merge pull request #3266 from alphagov/job-status-not-on-uploads
Don’t assume a job’s status will be present
2020-01-21 10:02:51 +00:00