-
Notifications
You must be signed in to change notification settings - Fork 745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modify Logo skin object to handle SVGs #3898
Conversation
For the sanitization part I believe a simple try catch, if there is not svg node found we just log the info and don't show any logo. As for third party, I think using the File manager class is the way to go? @mitchelsellers |
@mathisjay @valadas Yes, I think the FileManager class is the way we will have to go for the download of the file for parsing as PhysicalPath is not always going to be there and not always locally. I'm going to throw a few more notes in on a review form a performance perspective. Lastly, in this situation if the provided SVG file is not valid, an empty string is going to be rendered, is this proper? I think we need to give something better for a fallback? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mathisjay FIrst of all, I don't want to be critical here at all, so please do call/email me directly with any concerns that you may have about this. This is just a mission-critical element that impacts every page-load of a site so I want to be sure that we have it right. See the attached.
One additional note/question for @dnnsoftware/approvers, this will also create a bit of a Regression in out of the box functionality with regards to ADA Compliance it seems as most likely we would need to take the existing Alt text and put it into the <title> of the SVG from what I've found. (https://css-tricks.com/accessible-svgs/) I don't typically do this with SVG's so I cannot confirm with actual compliance testing
svg = cacheSvg; | ||
} | ||
|
||
Literal litSvg = new Literal(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need some sort of fallback at this point if the file couldn't be obtained.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would you suggest here? Inject the Portal Name as string literal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure on this, but there needs to be something somewhere I think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this still needs a try/catch around it
I'll look into the FileNamager class, not used that before. |
Made the requested changes. I just rewrote the whole process since the previous code was only expecting an image and not efficient when allowing other types. The previous code was already using the FileManager class to load the Logo file, so I think we are good there. Please verify. |
@mathisjay as discussed earlier, i was working on this PR probably at the same time as you and just read your last comment after pushing to your branch... Let me know if you like my changes or if I messed up yours... @mitchelsellers would you re-review, this should:
I also fixed the Stylecop warnings on this file. |
Thanks @valadas |
Ok, what do you think now @mitchelsellers ? |
I was having a hard time reviewing the changes because of how much of the original logic was adjusted or moved around. I've re-created what y'all did, but arranged it a little differently in my fork 8428629. Let me know if y'all see any issues in that. When taken altogether, I think it results in a diff that's a lot cleaner. The only issue I saw in my testing was that since we're caching SVG document, changing the |
I've pushed a squashed version to ab2a618, which should be easier to review. |
Just wanted to make a reference in the PR to @mathisjay's comment on the commit ab2a618#commitcomment-40515132 /cc @valadas |
It is a bit hard to follow up on commits in a fork for a PR :) But yeah, IMO the only issue with the changes on your fork is that if the svg has no classes to begin with but we give the skinObject a CssClass, then it would include a space with your changes as in " myclass" (hence why I put it in a list, added the class and then joined them). I don't believe this List is a huge performance hit, this would just be called on first load or cache clear it would not get hammered much... |
Resolves dnnsoftware#3893 Co-authored-by: Daniel Valadas <info@danielvaladas.com> Co-authored-by: Brian Dukes <bdukes@engagesoftware.com>
@valadas thanks for the feedback, I've adjusted how we're generated the value of the |
Oh, yeah, love it. |
@valadas @mitchelsellers can we get another 👍 and get this merged? |
Second review is there but having issues merging if someone else can |
@valadas we need you to clear your "request changes" review before we can merge |
Sorry guys, done and done |
Resolves #3893