UVE toolbar address bar and copy-url strip the base path when the EMA/UVE app "url" contains a path segment
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 970
- Forks
- 486
- Avg merge
- 3d 33m
- Merged PRs (30d)
- 170
Description
Description
When a UVE/EMA app is configured with a url that includes a path segment (e.g. https://my-frontend.example.com/uve), the editor's toolbar address bar and the "copy URL" popover drop that path segment from the displayed/copied URL. The URL the editor actually loads in the iframe is correct — only the displayed and copied values are wrong.
Steps to reproduce
- Configure a UVE/EMA app entry whose
urlincludes a base path, mapped to a pattern:{ "config": [ { "pattern": "/my/page", "url": "https://my-frontend.example.com/uve" } ] } - Open a page matching the pattern in the UVE.
- Look at the toolbar address bar and click the "copy URL" button.
Expected
The address bar and copy-url show the full URL including the configured base path:
https://my-frontend.example.com/uve/my/page
Actual
The base path (/uve) is dropped:
https://my-frontend.example.com/my/page
Scope / notes
- Only affects display. The iframe request is built by
buildIframeURL(withEditor.ts) via string concatenation, which correctly preserves the base path. The bug is isolated to the toolbar/copy-url values. - Only triggers when the configured
urlhas a path segment. With a bare host (https://my-frontend.example.com) there is no path to lose, so the output is correct — which is why this is rarely seen.
Root cause
The toolbar/copy-url values are built with new URL(path, host), where host is the configured app url and path is the page path with a leading slash (/my/page). Per the URL spec, an absolute-path first argument replaces the base's entire pathname, discarding /uve.
Minimal demonstration:
new URL('/my/page', 'https://host.example.com/uve').toString()
// → 'https://host.example.com/my/page' (base path lost)
'https://host.example.com/uve'.replace(/\/$/, '') + '/my/page'
// → 'https://host.example.com/uve/my/page' (correct — what buildIframeURL does)
Affected code
core-web/libs/portlets/edit-ema/portlet/src/lib/edit-ema-editor/edit-ema-editor.component.ts:1793—$pageURLScomputed:new URL(path, host)(line 1804) andnew URL(path, https://<siteHostname>)(line 1815)core-web/libs/portlets/edit-ema/portlet/src/lib/utils/index.ts:609—createFullURL:new URL(+ "${url}?..." +, clientHost)(line 626), used for the "current view" entry (edit-ema-editor.component.ts:1808)- Consumed by the template at
edit-ema-editor.component.html:107($pageURL→ address bar) and:82(copy-url popover) - Correct reference implementation:
buildIframeURLatcore-web/libs/portlets/edit-ema/portlet/src/lib/store/features/editor/withEditor.ts:61
Suggested fix direction
Build the toolbar/copy-url values by appending the page path to the full configured base (as buildIframeURL does) instead of resolving an absolute path against it with new URL(path, host).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the $pageURLS computation in edit-ema-editor.component.ts and the createFullURL helper in utils/index.ts, then compare them with buildIframeURL in withEditor.ts. Verify the toolbar address bar and copy-url popover preserve a configured base path while still producing correct URLs for apps without one.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100