Repository navigation
fix(ui): only embed http(s) learning resource URLs - #36300
Conversation
VideoPlayer and StorylaneTour loaded the resource's source URL into their iframes as-is when it was not a YouTube/Vimeo link. Both now accept only an http(s) URL, the same rule PdfViewer and openUrlInNewTab already apply via getSafeHttpUrl, and show the invalid-URL state otherwise. The learning resource form now validates the source URL the same way.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
🔄 Playwright impact map auto-refreshedThis PR touched specs or UI source that changed the source→spec routing map. I regenerated What is this file? It is the auto-generated half of Playwright's PR planner. It routes "if source X changes, run specs Y" by walking spec imports and cross-referencing What if I want to regenerate locally instead? Run this before pushing your next change to skip the bot commit: python3 .github/scripts/generate_playwright_impact_map.py
git add .github/playwright/impact-map.generated.json
git commit --amend --no-edit # or a separate commit |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
…aphy Per ADR:2026-10-11-migrated-antd-components-adopt-core-styling, callers handle layout but do not set padding on a core component through className.
Code Review ✅ Approved 1 closed / 1 findings🟡 Medium risk · Rejecting non-HTTP(S) learning-resource URLs prevents script-capable embeds, but may make existing non-web resources unavailable. Restricts Learning Center video and Storylane embeds and the learning-resource source URL field to http(s) URLs, so ✅ 1 closed✅ Quality: Padding set via className on core Typography breaks the styling rule
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
…) (#36934) * fix(ui): only embed http(s) learning resource URLs (backport 2.0 #36300) Video and Storylane resources pass source.url through getSafeHttpUrl before it becomes the iframe src, and show the invalid-URL state instead of a frame when it is not an http(s) URL. Ported by hand: 2.0 predates the player refactor on main, so the change is applied to 2.0's components. The learning-resource form change from #36300 is not needed on 2.0, whose form already validates the source URL with antd's url rule. (cherry picked from commit 8d53dbe) * fix(ui): link only http(s) URLs in the article viewer Backport of the ArticleViewer change in #36156 to 2.0: the "open in new tab" link on an article that failed to load uses getSafeHttpUrl, so a non-http(s) source URL renders no href. (cherry picked from commit ca9b8c0, ArticleViewer hunk only)



Describe your changes:
Fixes #36299
The Learning Center's video and Storylane players loaded a resource's source URL into their embedded frame unchanged whenever it was not a YouTube or Vimeo link. Now both accept only an http(s) URL, the same rule
PdfViewerandopenUrlInNewTabalready apply to this field throughgetSafeHttpUrl, and show the existinglabel.invalid-urlstate otherwise. The learning-resource form's source URL field uses the same check, so such a value can't be saved from the UI.VideoPlayer:getSafeHttpUrlruns first, and only an accepted URL reachesgetEmbedUrl. The YouTube and Vimeo embed rewriting is unchanged. Without a safe URL, no frame is rendered.StorylaneTour: the same guard on its framesrc.useLearningResourceFields:sourceUrlis validated withgetSafeHttpUrlinstead of the sharedisValidUrl.isValidUrlitself is unchanged because theme settings use it too. Every source URL placeholder inLearning.constants.tsis alreadyhttps://….Type of change:
High-level design:
N/A, small change.
Tests:
Use cases covered
javascript:,data:, or a string that does not parse) shows the invalid-URL state, and no frame is rendered.label.invalid-url.Unit tests
VideoPlayer.test.tsx,StorylaneTour.test.tsxandLearningResourcesSettings.test.tsx. InVideoPlayer.test.tsx, "should handle invalid URL gracefully" now expects the invalid-URL state instead of a frame whosesrcis the unparsed string.jest src/components/Learning/ResourcePlayer src/components/discovery/personal-space/Profile/tabs/platform-settings: 30 suites, 268 tests pass.main, 8 of the new or updated tests fail. They are the VideoPlayer, StorylaneTour and form cases.tsc --noEmitreports no errors in them.Backend integration tests
make java_affected: no Java tests are impacted.Playwright (UI) tests
Not run locally.
make playwright_affectedselects 22 specs and reports impact-map gaps. They run in this PR's CI.Manual testing performed
I ran this branch's UI (
vite) against a local server and signed in as admin, on Settings → Preferences → Learning Resource:https://www.youtube.com/embed/<id>…).🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no blocking issues were found.Summary
Restricts learning-resource URLs to HTTP(S).
No actionable new issues or repository-rule violations were found. No previous review threads were supplied. Tests and browser checks were not run; local UI capture was blocked by missing dependencies.
Reviews (2) · Last reviewed commit: "fix(ui): put the invalid-URL padding on ..." · Reviewed by Greptile