Update alert when trying to create an issue for a vulnerability which already has an issue linked to it
Overview
When creating an issue from a vulnerability which already has an issue linked to it an alert is rendered:
As an UX improvement the alert should be changed to this:
Copy:
Unable to create link to vulnerability
Manually link this issue by adding it to the linked issue section of the originating vulnerability.
How to replicate this
- Go to the details page of any vulnerability
- Create issue via the button at the bottom
- Click the browser's "back" button to get back to the vulnerability's detail page
- Repeat step 2. to create another issue
Related disscussions
The following discussion from !47528 (merged) should be addressed:
-
@andyvolpe stated in a discussion:
Make the issue link creation failure to look more like this alert. Specifically, add the Copy URL to clipboard
button.
Implementation Plan
The template that renders the alert can be found at ee/app/views/vulnerabilities/_unable_to_link_vulnerability.html.haml
.
There is an existing haml
helper to render a copy-to-clipboard button:
= clipboard_button(text: local_variable_holding_the_url_to_the_issue, button_text: _("Copy issue URL to clipboard"), hide_button_icon: true, hide_tooltip: true, class: "gl-button btn btn-default")
-
Add clipboard button to template -
Add local partial-variable to provide the clipboard-button text that will be copied to the clipboard - eg.: #{request.original_url}/#{@issue.iid}
-
Add styling -
Add specs
Edited by David Pisek