Make the scale and moveState attributes of RegionCommentBlockView public.

Review Request #13986 — Created June 18, 2024 and submitted

Information

Review Board
release-7.x

Reviewers

When converting the RegionCommentBlockView class to TypeScript, we made all
of its attributes private. With the doc review work in Power Pack, we'll have
a child class of RegionCommentBlockView for document region comments. We
want to be able to access the scale and move state attribute from this
child class, but we can't do this since they've become private on RB7.

This reverts back to how we had them before, renaming them from private
variables to their old _scale and _moveState names thus making them
public. This also means that for doc review region comments in Power Pack,
we don't have to deal with variable name compatibility, since the _scale
and _moveState name is used across RB5, 6, and 7.0.1.

One thing to note is that this means Power Pack 6 doc review region comments
will be broken on Review Board 7.0, they'll only be supported on 7.0.1+.
And, Power Pack 5.2.4's PDF review comments are only supported on 7.0.1+.
These comments are currently broken for 7.0. anyways.

Ran JS unit tests.

Tested created/moving/resizing/deleting PDF region comments.

Tested created/moving/resizing/deleting image region comments.

Summary ID
Make the scale and moveState attributes of RegionCommentBlockView public.
459412d09d5636d11790e47e57493c06c763c76b
Description From Last Updated

I think if Power Pack needs this information (and _scale), we should just go ahead and make them officially public. …

chipx86chipx86

Let's use :js:attr: for these.

chipx86chipx86
maubin
chipx86
  1. 
      
  2. Show all issues

    I think if Power Pack needs this information (and _scale), we should just go ahead and make them officially public.

    We could also assign to the _-based names for backwards-compatibility, and add a comment stating that they're deprecated, just so older Power Pack releases will continue to work.

    1. Since older versions of Power Pack don't even access these _-based variables (only my new changes in 5.0.x and 6 do), I'll just update my Power Pack changes to try accessing the public variables, and if they aren't defined then fall back on accessing the _-based ones. Falling back on the _ will maintain compatibility with RB5 and 6, and accessing the public variables will maintain compatibility with 7.0.1+.

      Keeping the _ variables around along with the new public ones doesn't really help in any way. I would still need to do the workaround mentioned above where I try the public variables first then fall back on the _ ones, so I think it's safe to just get rid of them.

    2. The one advantage to keeping the _ ones around is that older Power Pack releases wouldn't break with these changes, but it's also fair to say people need to upgrade Power Pack for 7.0.x.

  3. 
      
maubin
david
  1. Ship It!
  2. 
      
chipx86
  1. 
      
  2. Show all issues

    Let's use :js:attr: for these.

  3. 
      
maubin
Review request changed
Status:
Completed
Change Summary:
Pushed to release-7.x (a86fc62)