fix(next): prevent errors in globals version view #12920
Merged
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.
What?
This PR fixes a runtime error that occurs when opening the "More versions..." drawer while browsing the versions for a global. It also fixes a minor runtime error when navigating to a global version view where an optional chaining operator was missing as the collection variable would be undefined as we are viewing a global.
This PR also adds an e2e test to ensure the versions drawer is accessible and renders the appropriate number of versions for globals.
Why?
To properly render global version views without errors.
How?
By threading the global slug to the versions drawer and adjusting some properties of the
renderDocumentserver function call there. This PR also adds an optional chaining operator theversionUseAsTitlein the original view to prevent an error in globals.Notes:
Before: (Missing optional chaining error)
error1-verions-Editing---Menu---Payload.webm
Before: (Versions drawer error)
error2-versions-Editing---Menu---Payload.webm
After:
versions-globals-Dashboard---Payload.webm