ministryofjustice / justice-gov-uk

Justice UK website
https://www.justice.gov.uk/
MIT License
2 stars 0 forks source link

Feature/cdpt 1661 404 updates #177

Closed EmilyHazlehurst closed 5 months ago

wilson1000 commented 5 months ago

We set up error pages in our server.conf configuration. Some rules allow access to certain directories when server access is restricted.

Interestingly, 401 isn't in there, but 400 is. What should we do about this?

    error_page 400 /app/themes/justice/error-pages/400.html;
    error_page 404 /app/themes/justice/error-pages/404.html;
    error_page 500 /app/themes/justice/error-pages/500.html;
    error_page 503 /app/themes/justice/error-pages/maintenance.html;

    # Empty location blocks to allow access when "/" location
    # sends an HTTP 503 during maintenance mode
    location /app/themes/justice/error-pages/ { }
    location /app/themes/justice/dist/ { }
wilson1000 commented 5 months ago

Good morning @EmilyHazlehurst 👋

For error pages, I've created a file in dist/patch/js/ccfw-check-consent.js that can be used to drop the GTM code. We need to make sure that the GTM ID is available on the page, in a data-allowed attribute I think 🤔 - please do check this if you choose to use the file, I hope it's helpful.

https://github.com/ministryofjustice/justice-gov-uk/blob/main/public/app/themes/justice/src/patch/js/ccfw-check-consent.js

EmilyHazlehurst commented 5 months ago

Good morning @EmilyHazlehurst 👋

For error pages, I've created a file in dist/patch/js/ccfw-check-consent.js that can be used to drop the GTM code. We need to make sure that the GTM ID is available on the page, in a data-allowed attribute I think 🤔 - please do check this if you choose to use the file, I hope it's helpful.

https://github.com/ministryofjustice/justice-gov-uk/blob/main/public/app/themes/justice/src/patch/js/ccfw-check-consent.js

Thanks @wilson1000. I think for now it's probably best to keep this as it is as the goal of the ticket was just to change the title and and search link on the pages. I've added the original gtm code back in and have updated the ID.

Perhaps we can improve this further as part of the frontend work, since the error pages have some accessibility issues and are quite messy? I can make a ticket for it today.