OpenDataScotland / jkan

A lightweight, backend-free open data portal, powered by Jekyll, based on the JKAN project
https://opendata.scot
MIT License
6 stars 13 forks source link

#99 Warn users when they try to download HTTP files #38

Closed JackGilmore closed 1 year ago

JackGilmore commented 1 year ago

Description

Solves https://github.com/OpenDataScotland/the_od_bods/issues/99

Motivation and Context

Trying to download files from HTTP only sites currently causes mixed content errors which makes downloading impossible without copying and pasting the download link into the browser address bar. Mixed content errors usually fail silently as the error only shows up in the browser's dev tools.

To mitigate this, I've added a listener where if a dataset resource link is clicked on and it is HTTP only, it will display a modal advising the user to copy and paste the URL into their browser address bar to download. It also provides a link to the original dataset page.

How Has This Been Tested?

Tested trying to download a HTTP only resource e.g. Angus Council Area Fact Sheet. Modal appears as expected.

Tested trying to download a HTTPS resource. Still allows download as normal and modal does not appear.

Screenshots (if appropriate):

image

Types of changes

Checklist: