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:
Current behavior:
- Both buttons navigate to
https://example.gitlab.com/user/project/~/releases#tagname
, wheretagname
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)
- if a
Why this new behavior?
We can now arrive at the Edit Release page in one of two ways:
- From the main Releases page
- 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](/-/project/278964/uploads/6e128e8928dcf8b09b971728da725bc4/2020-02-25_11.06.36.gif)
New behavior when clicking Save changes
User is redirected to the dedicated Release page for the edited Release.![2020-02-25_11.10.45](/-/project/278964/uploads/8d77248a72ae7e6013d8d46736aace01/2020-02-25_11.10.45.gif)
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](/-/project/278964/uploads/bc1af53918fabff99f07f0635c98310e/2020-02-25_11.15.41.gif)
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](/-/project/278964/uploads/fff584cefef454cfd19c8c58ee46782c/2020-02-25_11.25.10.gif)
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
.