Add reopen action to closed MR widget state
What does this MR do and why?
For #372986 (closed).
This MR adds the "Reopen" action from the MR header to the Closed-state MR Widget.
Caveats
As with the current behavior in production, closing a merge request with either the quick action (/close
) or the Close button below the comment box (whether it also leaves a comment or not), does not fully refresh the page with all the required information to reopen.
To see this in (dis)action in production now, use either method to close the MR. Then, note that the "kebab" menu in the top right of the page still shows the menu item to close the merge request rather than to reopen it. The only things that are updated are:
- The badge in the top left
- The status of the MR (which switches the widget to the closed widget)
- The list of system notes (which shows that the MR was closed)
To get this new UX feature to work with the dynamically updating MR state, we'll need to send more information back in the GQL response - particularly the MR Actions serialized JSON that I'm providing via the DOM normally.
Screenshots or screen recordings
These are the various UI changes.
Phase | Desktop | Mobile |
---|---|---|
Normal, idle | ||
Normal, pending API request | ||
Normal, successful reopen | ||
Normal, the API reported an error | ||
User is not authenticated |
These are the two primary workflows. Note that if the user is not authenticated, the widget action simply won't appear as seen above.
Path | Media |
---|---|
Successful | mr-widget-closed-reopen |
API Error | mr-widget-closed-reopen-failure |
How to set up and validate locally
- Close an MR or have an already-closed MR
- Load your closed MR
- Scroll to the MR widgets section of the Overview tab
- Use the top-right corner of the Closed widget to interact with this new addition
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.