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
edit
to see the confirmation popover.
How to simulate the scenario where the user can access the issue but not the assigned epic.
h/t @nicolasdular
!
-
Admin
owns GroupGitLab Org
with a confidential Epic - Group
GitLab Org
hasProject GitLab
- You create an issue in
Project GitLab
that is part of the confidential Epic - You invite a
User Other
only to the Project GitLab -
User Other
is 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)