Fix link rendering in download dialogues#1798
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@jamesmisson is attempting to deploy a commit to the Universal Viewer Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Thanks, @jamesmisson -- this looks good to me.
One thing, though: this PR is targeted against dev; if we want to issue another 4.4.x bug fix release, it should be rebased onto the release-4.4 branch instead (or we can merge it as-is and cherry-pick the fix back to the release branch).
I'm still conferencing for the rest of the week, so my time is limited -- but let me know if you need help with anything and I'll do my best to help when I'm able!
c2791e1 to
c93a71f
Compare
8cacfa2 to
c67d75f
Compare
demiankatz
left a comment
There was a problem hiding this comment.
Looks good to me now; thanks, @jamesmisson!
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
Renderingcomponent 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*Renderingsfunctions (e.g.hasCanvasRenderings, so I've used the newgetSafeRenderingsin all of these, as well as in theRenderingsthemselves.This fix works with the manifest supplied: https://gist.githubusercontent.com/jamesmisson/1086007969f7f9947a729caf06b139d8/raw/e548676547355a248f85a912e6584fb7834b2281/poc3.json