Add edit confirmation popover in sidebar dropdown widget
What does this MR do and why?
This MR adds a confirmation popover in the Epic widget to make sure when the current user cannot view the assigned epic, they know that editing means they'll not be able to "assign back" the epic.
Issue for more information #371129 (closed)
Screenshots or screen recordings
| Without access | With access | |
|---|---|---|
| Step 1 | ![]() |
![]() |
| Step 2 | ![]() |
No intermediate step |
| Step 3 | ![]() |
![]() |
How to set up and validate locally
- Enable the feature flag
Feature.enable :epic_widget_edit_confirmation - Visit an Issue page with Epic already assigned
- Notice instead of the epic title, it says, "You don't have permission to view this epic."
- Click on
editto see the confirmation popover.
How to simulate the scenario where the user can access the issue but not the assigned epic.
h/t @nicolasdular!
-
Adminowns GroupGitLab Orgwith a confidential Epic - Group
GitLab OrghasProject GitLab - You create an issue in
Project GitLabthat is part of the confidential Epic - You invite a
User Otheronly to the Project GitLab -
User Otheris not allowed to view the Group Epic then
When you invite a team member, the email will not be sent to the inbox on local machine. In the GitLab folder, open tmp/letter_opener folder, sort by "Created at", open the rich.html file in the most recently created folder.
If the above method doesn't work
Simulate by adding a line of code in the file app/assets/javascripts/sidebar/components/sidebar_dropdown_widget.vue, jump to line 121, and add this return null; on line 122. Adding this line will simulate the above scenario.
Code
if (this.glFeatures?.epicWidgetEditConfirmation && this.isEpic) {
this.hasCurrentAttribute = data?.workspace?.issuable.hasEpic;
return null;
}
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.
Related to #371129 (closed)





