WIP: Review UI for SVG Vector Graphics files

Review Request #11846 — Created Oct. 8, 2021 and updated

akim.ruslanov
Review Board
release-4.0.x
students

Currently ReviewBoard has a limited way of rendering SVG files and does
not allow for proper scaling and zooming. We are now attempting to utilize
SVG potential to full extent and allow users to inifinitely scale/zoom SVG images.

The new solution utilizes viewBox attribute of SVGs and attempts to manipulate it
in order to create zoom-in ability.

The UI was tested using Google Chrome and Safari.

No unit tests were run yet and no additional tests added.

Summary Author
wip initial
aruslanov@fispan.com
mousewheel works in parent view
aruslanov@fispan.com
clean up
aruslanov@fispan.com

Description From Last Updated

Col: 44 Missing semicolon.

reviewbotreviewbot

Col: 30 Missing semicolon.

reviewbotreviewbot

Col: 44 ['width'] is better written in dot notation.

reviewbotreviewbot

Col: 44 ['height'] is better written in dot notation.

reviewbotreviewbot

Col: 43 ['width'] is better written in dot notation.

reviewbotreviewbot

Col: 44 ['height'] is better written in dot notation.

reviewbotreviewbot

Col: 15 '$image' is defined but never used.

reviewbotreviewbot

Col: 63 Expected '===' and instead saw '=='.

reviewbotreviewbot

This is listening for events on an element with the image-diff-attachment which is a child of the current view, but ...

daviddavid

This event is getting ignored completely and I am not super sure why. The only reasoning I could find was ...

akim.ruslanovakim.ruslanov

This event works. I have tried this because I wanted to see if mousewheel event works at all. So my ...

akim.ruslanovakim.ruslanov
Checks run (1 failed, 1 succeeded)
flake8 passed.
JSHint failed.

JSHint

akim.ruslanov
akim.ruslanov
akim.ruslanov
Review request changed

Commits:

Summary Author
-
wip initial
aruslanov@fispan.com
-
mousewheel works in parent view
aruslanov@fispan.com
+
wip initial
aruslanov@fispan.com
+
mousewheel works in parent view
aruslanov@fispan.com
+
clean up
aruslanov@fispan.com

Diff:

Revision 3 (+329 -23)

Show changes

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
akim.ruslanov
  1. 
      
  2. reviewboard/static/rb/js/views/imageReviewableView.es6.js (Diff revision 3)
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     

    This event is getting ignored completely and I am not super sure why. The only reasoning I could find was that the event does not get triggered if the views are nested.

  3. This event works. I have tried this because I wanted to see if mousewheel event works at all. So my best guess (from another comment), is that events get cancelled out when views are rendered in nested approach.

  4. 
      
david
  1. 
      
  2. This is listening for events on an element with the image-diff-attachment which is a child of the current view, but it looks like this view is attached to an <img> with no children. You probably want to just change the key to be mousewheel.

    1. So I tried that, but the same issue persists...

    2. So after some more research, I found out that the events in subviews might be killed during the re-rendering of the views or swapping them out. I tried using this._imageView.delegateEvents() but it didn't help either. Perhaps, I was misusing this method or am I misunderstanding the reason why the event is getting triggered?

  3. 
      
Loading...