Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add layer specific disclaimers #329

Merged
merged 7 commits into from
Dec 17, 2024

Conversation

RobQuincey-DC
Copy link
Contributor

This PR adds optional disclaimers to individual layers.

Disclaimers appear the first time a user switches a layer on, and then reappears depending on the frequency. They are designed to warn users about terms of use or issues with a particular layer.

How it works

You create a 'disclaimer' in the management console, and then in the layer details page you choose the disclaimer you want.

  • A layer can only have one disclaimer.
  • A disclaimer can be tied to multiple layers
    • In this case, the disclaimer will only appear when selecting the first layer. Any subsequent layers with the same disclaimer will not show, allowing you to 'bundle' layers together with the same disclaimer and prevent having to show users the same disclaimer constantly
  • The maximum amount a layer disclaimer can be shown is once per 'session' (defined here - https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage).
  • Disclaimers can be written in HTML and will appear in a modal
  • Disclaimers can have custom button text, or use the default of 'Close'
  • Disclaimers have a frequency that works the same as the welcome message, with the slight difference being the 'always' option will only show once per session.

Limitations

If a layer is already turned on (either through layer customisations or via a share link) the disclaimer will not trigger unless the user turns the layer off and back on. This is to prevent being potentially bombarded with disclaimers on first load. Imagine you have a welcome message, a tour, a cookie control banner and three layers turned on with separate disclaimers, the user would have to dismiss SIX separate overlays before the map could be used.
We could improve the logic to bundle any disclaimers into the welcome screen in one go, but this was deemed out of scope for initial implementation.

Copy link
Contributor

@paul-dorsetcouncil paul-dorsetcouncil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the implementation in general but I have two comments, one is a nit pick and the other might need looking at before we approve?

  1. Could the bubble appear more centrally? I think the tour is in the middle but disclaimer is appearing at the top slightly over the header. This is not really an issue and happy to go with the majority if we are happy with the location.
  2. It appears that the bubble clears if you click anywhere outside the popup. This is fine for some but I think for the "Accept" example we will need to prevent that behaviour and force the user to actually click the button. This one I think we might want to investigate further.

Other than these suggestions, I think it looks good and happy to accept after we've discussed point 2 above.

@RobQuincey-DC
Copy link
Contributor Author

@paul-dorsetcouncil Good spot, that was supposed to not be dismissible by clicking outside. That is now fixed so you have to click the button to dismiss the modal. I've also moved the modal to the middle of the screen.

Copy link
Contributor

@paul-dorsetcouncil paul-dorsetcouncil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you.

@RobQuincey-DC RobQuincey-DC merged commit 8551738 into main Dec 17, 2024
1 check passed
@RobQuincey-DC RobQuincey-DC linked an issue Dec 17, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add layer specific disclaimers
3 participants