Allow referencing and history of tab navigation on both detail and form pages #7191
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.
As described in #6442, linking to tabs or storing tab navigation in history only works for form pages (new/edit).
I also have some use cases where
Action::DETAILis added to actions of CrudControllers and where I want to redirect a user to a specific tab in the detail view. This currently does not work as the logic for activating the tab is present only in form.js.This PR simply moves the logic from form.js to app.js to make it present on both form and detail pages.
Furthermore it uses a slightly simplified approach to display the first tab with errors and I adjusted some commentary to make it less about forms and more about tabs.
Since I did not find any guidelines regarding PR-creation on the subject of altered frontend assets, I only commited the changes made to the JavaScript files and not those to
entrypoints.json,manifest.jsonand other build files in/public. If this is required, please do let me know.Fixes: #6442