Open file link for new modal in new tab
What does this MR do and why?
This MR makes sure the new finding modal opens file links in a new tab. This brings consistency in the behavior between the old and new finding modal.
While the link is on the same domain, we're leaving the current experience because going back would not open the modal automatically. By opening a new tab for the file link, we can leave the modal opened in the previous tab.
A link can use target="_blank" if it's intentional that the user cannot use the browser's back function to return to the reference, and that it's clear to the user they are leaving the current experience.
Screenshots
Modal in MR, but can also be on pipeline security tab
Link opened
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
How to set up and validate locally
Setup
- You need an EE license
- You need to have runners enabled (See $2408961 for setting up a runner)
- Import https://gitlab.com/gitlab-org/govern/demos/sandbox/minac/test-remediations
- Do not run a pipeline yet on master!
- Enable feature flag:
echo "Feature.enable(:standalone_finding_modal_merge_request_widget)" | gdk rails c
- In the imported test-remediations project
- go to
reports/sast.json
and remove both entries invulnerabilities
, leaving effectively an empty array - commit and push this to master
- now, in
reports/sast.json
, add the removed vulnerabilities back again, but commit and push to a new branch, and create a merge request.
- go to
Validate
- Go to the created merge request
- Expand the security scanning widget
- Click on a finding
- **Click the file link and validate it opens a new tab **