Add support for SVG rendering in design management
requested to merge 388711-svg-design-images-and-previews-without-size-properties-are-not-rendered into master
What does this MR do and why?
SVGs without dimension attributes were spanning in the design list. To keep image inside the container, set a fixed height for image. Also, the offset dimensions are zero thus dimension calculation was breaking. If offset dimensions are zero, calculate the image base dimensions from natural dimensions. Set the dimension on mount so that zoom works properly.
Screenshots or screen recordings
Before screenshot | After screenshot |
---|---|
How to set up and validate locally
- In rails console enable the feature flag
Feature.enable(:design_management_allow_dangerous_images)
- Go to Group > Project > Issues
- Create a Issue
- Upload an SVG image without height and width dimensions
- Check if the SVG is rendering in the list
- Click on the SVG image
- Check if the SVG is rendering on screen
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #388711 (closed)
Edited by Rajan Mistry