Refactor MR Widget related links component
Closes #346774 (closed)
What does this MR do and why?
Refactor MR Widget Related Links Component, specifically the part which renders "Assign yourself to these issues"
link. Few notes:
- The main aim is to remove the dangerous
v-html
from the component - Alternatively,
v-safe-html
could be used here to solve that but it needs to allowdata-method
attribute which is blocked for security reasons - So we moved the link generation logic from backend to frontend to avoid any security or maintaineance concerns
More details:
-
before:
assign_to_closing_issues_link
sends the entire html for anchor link to the frontend -
now: the
assign_to_closing_issues_link
only sends the link path, and additionallyassign_to_closing_issues_count
sends the issue count - which should be enough to generate the link on the frontend
Screenshots or screen recordings
No visual changes
How to set up and validate locally
- Create an issue and make sure it's unassigned
- Create an MR and add
closes #issue_id
to the description - The MR widget would show the link to assign (the unassigned issue) to yourself
- It should work as-is after the MR changes are applied
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.
Edited by Dheeraj Joshi