Commit Graph

8943 Commits

Author SHA1 Message Date
Tom Byers
7d31431cef Fix test description 2020-01-08 17:48:37 +00:00
Tom Byers
40ac30a96d 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-08 17:03:04 +00:00
Tom Byers
d045316454 Change banner content to just cover analytics
Follows discussions with @quis, @yahoopete and
@karlchillmaid.
2020-01-08 17:02:31 +00:00
Tom Byers
f156fe2e95 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-08 10:23:52 +00:00
Tom Byers
73c531f70d 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-06 16:52:03 +00:00
Tom Byers
900aa19bd3 Add JS tests for analytics & cookies JS
Includes:
- tests for the analytics interface ported from
  GOVUK Frontend Toolkit
- tests for the cookie banner that appears on all
  pages except the cookies page
- tests for the cookies page JS
- tests for the hasConsentFor function
- adding a deleteCookie helper to remove
  cookies during tests
- polyfill for insertAdjacentText

The last one is because JSDOM doesn't support
insertAdjacentText but our target browsers
do. This polyfill also includes one for
insertAdjacentHTML.
2020-01-06 13:38:34 +00:00
Tom Byers
beeb273d6c Fix python tests broken by cookie banner 2020-01-03 17:28:33 +00:00
Tom Byers
61a5948020 Fix typo on privacy page 2020-01-03 17:28:33 +00:00
Tom Byers
ce52746f74 Update cookies page
Includes:
- new content
- added option to turn analytics on/off
- non-js version for the on/off switch
- a banner to confirm user's choice was saved,
  shown when they click the save button
- the cookie banner that appears on all other
  pages removed from this page
2020-01-03 17:28:33 +00:00
Tom Byers
f46dba8948 Move code for deleting old cookies into banner JS
Removes the following cookies:
- seen_cookie_message (flags if banner was already
  shown)
- _gid (Google Analytics cookie)
- _ga (Google Analytics cookie)

These were set by default before so potentially
still around for some users.

The code for this now exists as a static method on
the cookieMessage module and is called when the JS
loads for the first time.
2020-01-03 17:28:33 +00:00
Tom Byers
3a6537f49f Add new cookie banner code.
Copies HTML and Sass from GOV.UK Pubishing
components cookie-banner with changes to content
and functionality to better suit Notify.

Changes are:
- adds a 'reject' button which the GOV.UK
  code doesn't have
- adds Sass from the GOV.UK Frontend button
  component which the GOV.UK version used so
  is included here
- removed click tracking from cookie banner
2020-01-03 17:28:33 +00:00
Tom Byers
df882976e1 Add new analytics code to frontend build 2020-01-03 17:28:33 +00:00
Tom Byers
c3c5faad54 On page load, call analytics based on consent 2020-01-03 17:28:33 +00:00
Tom Byers
8fd9686c3d Add consent tracking to cookie functions
Taken from GOVUK components:

https://github.com/alphagov/govuk_publishing_components/blob/master/app/assets/javascripts/govuk_publishing_components/lib/cookie-functions.js

Also includes:
- make new cookie functions handle notify domains
- addition of hasConsentFor function to allow easy
  checking of consent for categories of cookie
2020-01-03 17:28:33 +00:00
Tom Byers
0954435afb Wrap analytics code in GOVUK interface
Wraps our analytics code in a stripped down
version of GOVUK.Analytics to allow us to plug in
the GOVUK code for consent.
2020-01-03 17:28:33 +00:00
Chris Hill-Scott
d22bf29529 Merge pull request #3239 from alphagov/lazy-load-letter-previews
Lazy load letter previews
2020-01-03 16:21:59 +00:00
Chris Hill-Scott
d21449c235 Lazy load letter previews
Brings in:
- [x] https://github.com/alphagov/notifications-utils/pull/687
2020-01-03 15:58:51 +00:00
Chris Hill-Scott
d11305741f Merge pull request #3237 from alphagov/returned-pdf-letters
Handle precompiled letters in returned letters list
2020-01-03 10:04:17 +00:00
Tom Byers
54a5f1d22c Merge pull request #3181 from alphagov/update-footer-links
Update footer links
2020-01-02 15:15:37 +00:00
Chris Hill-Scott
5ea02119f4 Handle precompiled via in returned letters list
Precompiled letters sent via the API don’t have:
- a template
- a filename

Which means in the list of returned letters we just show ‘None’. This
commit changes this to ‘Provided as PDF’, which is how we talk about
precompiled letters elsewhere (for example in the template statistics on
the dashboard).
2020-01-02 11:30:51 +00:00
Chris Hill-Scott
f0fe532b46 Pass uploaded file name into test data 2020-01-02 11:29:01 +00:00
Chris Hill-Scott
d3dd6a31e3 Merge pull request #3236 from alphagov/returned-letters-tweaks
Returned letters tweaks
2020-01-02 10:22:51 +00:00
Chris Hill-Scott
07f2ffca25 Add govuk-link class
So it’s one less link we have to do when moving to Design System.

Co-Authored-By: Tom Byers <tombaromba@gmail.com>
2020-01-02 10:08:18 +00:00
Chris Hill-Scott
317aa53b6a Don’t specify that routes are GET only
> By default a route only answers to `GET` requests

https://flask.palletsprojects.com/en/1.1.x/quickstart/#http-methods
2019-12-31 14:49:51 +00:00
Chris Hill-Scott
7059e475c1 Make URLs consistent/hackable
We do `/things` and `/things/<thing_id>` elsewhere; let’s be consistent
here.

Means you don’t have to remember the word ‘summary’.
2019-12-31 14:44:15 +00:00
Chris Hill-Scott
227fca6263 Make appearance of ‘empty’ table rows even
Our table rows take up 65px vertical space.

We also have things that look like rows that say:
- there are no rows
- there are more rows than can be shown on screen

This commit makes them appear the same height.
2019-12-31 14:40:17 +00:00
Chris Hill-Scott
3b7dc05dd6 Add a page for each report
It’s useful to get some kind of preview of the report before you
download it.

And if there’s only a few letters in there then you might not even need
to download it at all.

For teams with lots of letters we don’t want the page to load too slowly
so let’s cap the number of displayed items to 50, same as previewing
a spreadsheet.
2019-12-31 14:39:12 +00:00
Chris Hill-Scott
9c3315f194 Add field headings to table
Headings are good for accessibility. They also are what adds the grey
border to the top of the first row in the table.
2019-12-31 14:38:32 +00:00
Chris Hill-Scott
57ca75f5bc Add download attribute to link
This forces the file to download, rather than open in the user’s
browser. We do this in other places where we let people download CSV and
PDF files.
2019-12-31 14:37:50 +00:00
Chris Hill-Scott
8bcfb2fcde Use file list pattern for list of files
This means the page has the same appearance as other lists of stuff like
the notifications page.
2019-12-31 14:37:19 +00:00
Chris Hill-Scott
fae18f3008 Put CSV extension on filename
This follows our pattern for other downloadable reports, and gives
people who know/care about stuff like file types some indication of what
they’re about to download.
2019-12-31 14:36:38 +00:00
Tom Byers
59e40d4c3c Make dashboard test more specific
It was picking up the 'Get started' text from the
new link in the footer.
2019-12-31 10:29:56 +00:00
Tom Byers
0375af3441 Revert "Turn off 'Get started' link when signed out"
This reverts commit 6b27a9e7a3.
2019-12-31 10:02:45 +00:00
Tom Byers
f7d115d0de Revert "Remove signed_out template variable"
This reverts commit 8a59743746.
2019-12-31 10:02:13 +00:00
Rebecca Law
dcc42c5446 Merge pull request #3233 from alphagov/returned-letters
Returned letters
2019-12-31 09:30:01 +00:00
Rebecca Law
5320c3b34b Add class to anchor tag 2019-12-31 09:11:07 +00:00
Rebecca Law
03fe7674bf Add a url_converter to check the date format. 2019-12-30 16:53:32 +00:00
Tom Byers
8a59743746 Remove signed_out template variable
Turns out there's no need for it:

https://github.com/alphagov/notifications-admin/pull/3181#discussion_r362020673
2019-12-30 16:27:15 +00:00
Tom Byers
6b27a9e7a3 Turn off 'Get started' link when signed out 2019-12-30 15:15:02 +00:00
Tom Byers
aa2c095704 Update link to support 2019-12-30 14:31:36 +00:00
Tom Byers
8291378ee2 Reduce size of footer column headings 2019-12-30 14:30:21 +00:00
Tom Byers
62fbc07bff Use --end class for header nav
Uses `govuk-header__navigation--end` class which
does away with the need for a custom override.

Based on suggestion by @quis:

https://github.com/alphagov/notifications-admin/pull/3181#discussion_r361977771
2019-12-30 14:26:48 +00:00
Tom Byers
4ca2e06e6c Remove redundant custom footer component
Now the footer links have headings we don't need
this.
2019-12-30 14:20:46 +00:00
Tom Byers
d0fa640642 Update footer links to include new categories 2019-12-30 14:20:46 +00:00
Rebecca Law
41be4c054b Add test for url and pluralisation 2019-12-30 14:06:15 +00:00
Rebecca Law
401828d1e0 Remove POST where not needed.
Use  plural method to display letter or letters
Remove unused params from list_table method.
2019-12-30 08:39:39 +00:00
David McDonald
d73c3a68f9 Merge pull request #3234 from alphagov/pip-accel
Pip accel
2019-12-27 14:08:23 +00:00
Rebecca Law
a4fed667e4 Updated to reflect change in API key in json result. 2019-12-27 12:40:12 +00:00
David McDonald
224db44a9e Remove coveralls
We aren't using it
2019-12-24 15:25:34 +00:00
David McDonald
ecac52a155 Remove venv creating in makefile
Let's developer create their own virtualenvs using virtualenvwrapper as
they already do.
2019-12-24 15:24:07 +00:00