feat: embededded browse page to create new visualizations - #2599
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Kronmar-Bafu
approved these changes
Aug 4, 2026
Kronmar-Bafu
left a comment
Contributor
There was a problem hiding this comment.
workable solution to the existing problem
hupf
reviewed
Aug 5, 2026
| const isEmbedded = useIsEmbedded(); | ||
| return ( | ||
| <AppLayout hideHeader={hideHeader}> | ||
| <AppLayout hideHeader={hideHeader || isEmbedded}> |
Contributor
There was a problem hiding this comment.
It is suboptimal, that part of this is evaluated on the server and part of it on the client and we can't use the actual useOdsIframe hook here... but I guess it is what how it is...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The embedded visualisation on OpenData.swiss stopped working after we implemented more restrictive CSP policies.
Example page: https://opendata.swiss/de/dataset/programmstruktur-von-radioprogrammen-der-srg.
An analysis showed that opendata.swiss pages embed '/browse' pages. This was not anticipated when the stricter CSP policies were implemented. We expected only published visualisations to be embedded on third-party sites.
It also turned out that this was intentional and part of a broader feature designed some time ago. Instead of including the whole application, only a reduced 'browse' page should have been included using the URL parameter 'odsiframe=true'.
This would render a page with the basic dataset and a 'Create a Visualisation' button that opens the application in a new tab. Unfortunately, this change was not completely implemented, and will probably not be added to opendata.swiss soon.
This PR now addresses these issues.
This implements the
odsiframeparameter without setting the parameter in the URL.The drawback is that this only works on the client, whereas the 'odsiframe' parameter would also work on the server. As the page is rendered on the server, switching from the complete to the reduced layout only occurs after the page has been sent to the client, resulting in brief visible flickering.