Skip to content

Refactor MR Widget related links component

Dheeraj Joshi requested to merge djadmin-refactor-assign-related-issues into master

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 allow data-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 additionally assign_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

  1. when related issues present image

  2. when no related issue image

  3. walkthrough

assign_issue_link-

How to set up and validate locally

  1. Create an issue and make sure it's unassigned
  2. Create an MR and add closes #issue_id to the description
  3. The MR widget would show the link to assign (the unassigned issue) to yourself
  4. 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.

Edited by Dheeraj Joshi

Merge request reports

Loading