Skip to content

Remove merge request widget inline js

What does this MR do?

Removes the inline JS from the MR widget partial

Are there points in the code the reviewer needs to double check?

Testing this is hard, I'm not sure what I'm doing wrong locally, but it doesn't like me doing a lot of things, anything like creating a blob or accepting a merge request, it just seems to error gracefully in the UI with everything.

Luckily I had a huge battle with the specs trying to get this right, so I assume there is a lot of coverage which is great.

There are a few points in here that I didn't understand on the Ruby side of the fence so a magical rubician should go over this. This was doing things like responding to specific AJAX requests with JS as plaintext from partials like merge.js.html, I looked for where these partials were referenced and could find no other references to .js.html other than in those file names (which have now been removed). I assume what was happening is the Ruby action /merge would execute the merge method defined in that controller and if that method doesn't render anything explicitly it will find the merge.*.html partial which in this case was the plaintext JS. I have now set that action to render the correct partials and then adding the code to insert these partials in the CS class. Pleeeeeeease tell me if this is wrong as there is likely more to remove. 🙏

Why was this MR needed?

@connorshea forced me to at cursor-point! 🖱

What are the relevant issue numbers?

Contributes to #19866 (closed)

Screenshots (if relevant)

Does this MR meet the acceptance criteria?

Merge request reports