Repository navigation
[6.x] Keep the current tab when switching forms - #16057
Merged
Merged
Conversation
- Forms show page reuses the tab you came from (Logic, Results, etc.) when switching from another form - Falls back to the old redirect without permission for that tab, or when not coming from a form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the Problem
Closes #16047
Switching forms from the breadcrumb dropdown or the sidebar goes to
/cp/forms/{handle}, which redirects to Results if the form has submissions and to Edit if it doesn't. So you get bounced between tabs depending on which form you pick, and whatever tab you were on (Logic, Connect, Configure) is lost.What this PR Does
When you arrive at a form from another form's tab, you land on the same tab. If you don't have permission for that tab, or you came from somewhere else (like the forms listing), you get the existing redirect.
I've used the previous page's URL rather than remembering the last tab in the session. That way only switching between forms is affected, and clicking a form in the listing still lands where it always has. It also means the breadcrumb and the sidebar both behave the same without any front-end changes.
I didn't make the breadcrumb itself carry the rest of the URL over, as that would break for pages with IDs in them, like entries.
16047-keep-form-tab.mp4
How to Reproduce