Fix broken samples, add root readme, expose convenient testing of the samples#51
Open
zdrawku wants to merge 2 commits into
Open
Fix broken samples, add root readme, expose convenient testing of the samples#51zdrawku wants to merge 2 commits into
zdrawku wants to merge 2 commits into
Conversation
zdrawku
commented
Jun 16, 2026
- This PR fixes the samples that were not loading on production:
- It also introduces a root readme.md file (as such was missing)
- And exposes a way for convenient testing of the samples locally against an iframe integration
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates several Reveal SDK JavaScript samples to work in production/doc-embedded scenarios (notably srcdoc iframes with CSP), adds a missing root README.md, and introduces a local srcdoc harness to validate docs-style embedding behavior.
Changes:
- Add
tools/srcdoc-harness.htmlto load sample HTML into an iframe viasrcdocand toggle CSP modes (none/block/allow). - Add root
README.mddocumenting a recommended local validation workflow (direct +srcdocharness + docs integration). - Update selected “LoadingDashboards*” samples to use the hosted
https://samples.revealbi.io/...backend instead ofhttp://localhost:5111/(and fix the blob sample’s direct dashboard fetch URL).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/srcdoc-harness.html | New srcdoc iframe harness for reproducing CSP behavior locally. |
| README.md | New root documentation for running and validating samples + harness workflow. |
| LoadingDashboards/client/index.html | Switch sample base URL to hosted backend for production/doc embedding. |
| LoadingDashboards-Resource/client/index.html | Switch sample base URL to hosted backend. |
| LoadingDashboards-Json/client/index.html | Switch sample base URL to hosted backend. |
| LoadingDashboards-FileStream/client/index.html | Switch sample base URL to hosted backend. |
| LoadingDashboards-File/client/index.html | Switch sample base URL to hosted backend. |
| LoadingDashboards-Blob/client/index.html | Switch base URL and update direct dashboard fetch to hosted backend. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+19
to
+23
| Then open sample pages at: | ||
|
|
||
| ```text | ||
| http://localhost:8080/<sample-folder>/index.html | ||
| ``` |
Comment on lines
+214
to
+217
| } catch (error) { | ||
| preview.srcdoc = ""; | ||
| statusEl.textContent = `Failed to load ${path}: ${error.message}`; | ||
| } |
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.