Preserve branch filter state after delete
What does this MR do and why?
The current UI behavior after deleting a branch under a project is to redirect back to the branches overview page instead of the filtered state page such as active or stale branches
This change modifies the behavior to rely on the referer in the request to go back to exactly the same state page the delete action was called from and falls back to the overview page if the back redirect is not possible
How to set up and validate locally
Before change:
- Visit any Project > Repository > Branches
- Click Stale Branches
- Delete any visible branch and confirm
- Redirect takes you back to Project > Repository > Branches instead of Stale Branches
After change:
- Visit any Project > Repository > Branches
- Click Stale Branches
- Delete any visible branch and confirm
- Redirect takes you back to Project > Repository > Branches > Stale Branches
The above can be repeated for Active and All branch filtered views too.
Deletions from the default overview page also redirects back to the normal path.
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 customer support ticket (internal link): https://gitlab.zendesk.com/agent/tickets/288202