Skip to content

Fix link rendering in download dialogues#1798

Open
jamesmisson wants to merge 4 commits into
UniversalViewer:devfrom
jamesmisson:fix-link-concat
Open

Fix link rendering in download dialogues#1798
jamesmisson wants to merge 4 commits into
UniversalViewer:devfrom
jamesmisson:fix-link-concat

Conversation

@jamesmisson

Copy link
Copy Markdown
Contributor

This tightens up the rendering of links in the download dialogue for both the PDF and OSD extensions.

PDF Download Dialogue

The link was being built with string concatenation. I've replaced this with attributes supplied to the JQuery element via an object.

This manifest has a rendering ID with Javascript that is now avoided: https://gist.githubusercontent.com/jamesmisson/15c81934ef12175441cab96ac53d0653/raw/3d67b52f1b92a2a0f7f9ffadd6648ee4d215c023/pdf-download-rendering.json

OSD Download Dialogue

The Rendering component allowed Javascript to be supplied in the rendering ID. I've added a filter that checks that the ID begins with http/https, and used it in the relevant places. We should probably give some thought to what passes through this filter, but this implements the mechanism at least.

Download Option section headings are rendered conditionally via has*Renderings functions (e.g. hasCanvasRenderings, so I've used the new getSafeRenderings in all of these, as well as in the Renderings themselves.

This fix works with the manifest supplied: https://gist.githubusercontent.com/jamesmisson/1086007969f7f9947a729caf06b139d8/raw/e548676547355a248f85a912e6584fb7834b2281/poc3.json

@jamesmisson jamesmisson requested a review from demiankatz July 3, 2026 16:46
@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
universalviewer Ready Ready Preview, Comment Jul 6, 2026 10:08am

Request Review

@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

@jamesmisson is attempting to deploy a commit to the Universal Viewer Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant