Skip to content

Update redirect behavior of Edit Release page

What does this MR do?

Updates the way the Edit Release page redirects when the user clicks Save changes or Cancel:

image

Current behavior:

  • Both buttons navigate to https://example.gitlab.com/user/project/~/releases#tagname, where tagname is the name of the tag whose release was just edited.

New behavior:

  • Save changes navigates to the dedicated Release page (being developed in #32827 (closed))
  • Cancel does one of two things:
    • if a back_url query parameter is present, it navigates to this URL
    • if no back_url query parameter is present, it keeps its current behavior (see section above)

Why this new behavior?

We can now arrive at the Edit Release page in one of two ways:

  1. From the main Releases page
  2. From the dedicated Releases page (see #32827 (closed))

This change allows the Cancel button on the Edit Release page to redirect the user back to the previous page.

GIFs

Current behavior when clicking Save changes User is brought back to the main Releases page and the edited Release is scrolled to and highlighted. 2020-02-25_11.06.36
Current behavior when clicking Cancel Same behavior as clicking Save changes (shown above). 2020-02-25_11.08.49
New behavior when clicking Save changes User is redirected to the dedicated Release page for the edited Release. 2020-02-25_11.10.45
New behavior when clicking Cancel with a back_url User is redirected to the URL specified in the back_url query parameter. In this example, `back_url` points to the dedicated Release page (`http://0.0.0.0:3001/root/release-test/-/releases/v16.3`). 2020-02-25_11.15.41
New behavior when clicking Cancel without a back_url Same behavior as is currently implemented: User is brought back to the main Releases page and the edited Release is scrolled to and highlighted. 2020-02-25_11.25.10

Other changes

This MR also updates the Cancel button to be a GlLink instead of a GlButton for better accessibility.

Also, because this MR introduces a change that relies on a feature flag (see below), a new setFeatureFlags action was introduced. In fact, this change is responsible for most of the changes in this MR.

Feature flag

Since this change relies on the "dedicated Release page" (see #32827 (closed)), this change is hidden behind the release_show_page feature flag, which is currently disabled by default.

Dependencies

This MR is dependent on the changes in !24006 (merged). To allow this MR to be reviewed before !24006 (merged) is merged, I've temporarily updated this MR to target !24006 (merged)'s branch (nfriend-dedicated-release-page) instead of master. Once !24006 (merged) is merged, I'll update this MR to target master.

Edited by Nathan Friend

Merge request reports