WIP: Proof of concept using request.referer for cancel button
What does this MR do?
This is a proof of concept MR to get some backend feedback about using request.referer
as a way to navigate "back" to the previous page when clicking the "Cancel" button on the Edit Release page.
Why would we want to do this?
There will soon be two ways to arrive at the Edit Release page:
- from the main Releases page
- from the "dedicated" Release page (see #32827 (closed))
Using request.referer
instead of a static path allows the page to redirect the user back to their previous page when the "Cancel" button is clicked.
Additionally, since the Releases page is now paginated (!19912 (merged)), using request.referer
allows the user to retain their pagination when clicking "Cancel" instead of being redirected back to page 1.
Known issues
If the user:
- navigates to the Edit Release page
- clicks on the "Edit Release" breadcrumb link (which points to the current page)
- clicks "Cancel"
the user will be "redirected" to the same page they are on (the Edit Release page).
Prior art
I couldn't find any other examples in our codebase where we do something similar, which is why I'm a little hesitant about this option.
Going forward
Our plan is to combine the Tags and Release creation/edit pages into one, which will result in a similar situation - a single form will be accessed from different locations (i.e. from the Releases page or the Tags page) - so we'll need the ability to intelligently route the user back to the correct location on save. My thought is that request.referer
could be used for this purpose as well.