Skip to content

Run user select Js only where needed

Created by: cirosantilli

Transform current implementation into regular Coffescript classes so that the same call method can be reused on the dispatcher as for other classes.

Same rationale as: https://github.com/gitlabhq/gitlabhq/pull/8123

I have built the map by grepping for the touched classes + testing it out.

Double check

That I didn't make any mistakes when converting the existing coffee into classes.

The only changes are:

  • formatResult and formatSelection became instance methods. For this to work, callbacks that use them need to bind with => instead of -> ( to avoid repeating class names by using the binded this)
  • removed the prefix from instance methods, e.g. userFormatSelection became just formatSelection since it is already inside the UserSelect class

Merge request reports