Commit Graph

6101 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Rebecca Law
a4fed667e4 Updated to reflect change in API key in json result. 2019-12-27 12:40:12 +00:00
Rebecca Law
4c72efd08a Added tests 2019-12-24 14:33:52 +00:00
Rebecca Law
0273eea0cc Add email address and uploaded_letter 2019-12-24 11:22:12 +00:00
Rebecca Law
729281532d Added returned-letter-summary page.
This page displays a list of available reports, a report is a set of returned lettters that have been reported on the same day.
Each line of the page is a link that can download the report.

I'm not sure the format of the csv is right. The data might be confusing especially if the service has a mix of precompiled templates and jobs.
Units tests are still to come.
2019-12-24 08:44:56 +00:00
Rebecca Law
e2d979f199 New pages to show a summary of all the reports the services has for its returned letters 2019-12-24 08:44:56 +00:00
Tom Byers
869bd16536 Merge pull request #3225 from alphagov/fix-details
Add GOV.UK Frontend details component - second attempt
2019-12-23 09:47:56 +00:00
Rebecca Law
e0f9af8107 Update the javascript to work for www, non-www, and localhost 2019-12-20 16:00:23 +00:00
Tom Byers
751cca9f7d Add code to delete old analytics cookies 2019-12-20 14:52:02 +00:00
Tom Byers
53ced660ac Remove analytics cookies from all pages 2019-12-20 14:51:43 +00:00
Chris Hill-Scott
eb87548632 Serve video from a domain that doesn’t set cookies
Then it’s one less cookie we have to get users to opt in to. We don’t
derive any value from Youtube setting cookies.

`youtube-nocookie.com` is a domain provided by Google for this purpose.
2019-12-19 13:43:44 +00:00
Tom Byers
d55b3caa46 Disable tel number detection on IOS
Any string pattern identifiable as a telephone
number is turned into a link on IOS devices by
default.

We use telephone numbers in several ways, in
particular to link to sms notifications, so need
this behaviour turned off unless specifically
required.
2019-12-17 12:29:51 +00:00
Tom Byers
afd3fe5781 Include details JS 2019-12-17 10:28:14 +00:00
Tom Byers
84f90a7e1c Remove redundant details polyfill
We're now using the GOV.UK Frontend one.
2019-12-17 10:27:15 +00:00
Tom Byers
5dce31fc55 Correct platform admin details summary text 2019-12-17 10:27:15 +00:00