Skip to content

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:

  1. Visit any Project > Repository > Branches
  2. Click Stale Branches
  3. Delete any visible branch and confirm
  4. Redirect takes you back to Project > Repository > Branches instead of Stale Branches

After change:

  1. Visit any Project > Repository > Branches
  2. Click Stale Branches
  3. Delete any visible branch and confirm
  4. 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.

Related customer support ticket (internal link): https://gitlab.zendesk.com/agent/tickets/288202

Edited by Harsh Chouraria

Merge request reports

Loading