-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix site editor redirection after creating new template or template part #49364
Merged
ntsekouras
merged 6 commits into
trunk
from
fix/create-new-template-and-part-redirection
Mar 27, 2023
Merged
Fix site editor redirection after creating new template or template part #49364
ntsekouras
merged 6 commits into
trunk
from
fix/create-new-template-and-part-redirection
Mar 27, 2023
Conversation
This file contains 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
ntsekouras
added
[Type] Bug
An existing feature does not function as intended
[Feature] Site Editor
Related to the overarching Site Editor (formerly "full site editing")
labels
Mar 27, 2023
ntsekouras
commented
Mar 27, 2023
packages/edit-site/src/components/add-new-template/new-template.js
Outdated
Show resolved
Hide resolved
ntsekouras
force-pushed
the
fix/create-new-template-and-part-redirection
branch
from
March 27, 2023 09:20
22f5d96
to
745295d
Compare
Size Change: -5 B (0%) Total Size: 1.34 MB
ℹ️ View Unchanged
|
Do we have an e2e test that cover this part? Feels like a good one to add (if we don't have) to avoid regressions. |
youknowriad
approved these changes
Mar 27, 2023
Mamaduka
approved these changes
Mar 27, 2023
aristath
approved these changes
Mar 27, 2023
I'll write one and then land. Thanks for the reviews! |
ntsekouras
added
the
Backport to WP Minor Release
Pull request that needs to be backported to a WordPress minor release
label
Mar 27, 2023
kevin940726
reviewed
Mar 27, 2023
ntsekouras
force-pushed
the
fix/create-new-template-and-part-redirection
branch
from
March 27, 2023 13:46
2dc2447
to
366f5ac
Compare
kevin940726
reviewed
Mar 27, 2023
ntsekouras
force-pushed
the
fix/create-new-template-and-part-redirection
branch
from
March 27, 2023 14:18
f371595
to
cd4e9c2
Compare
Mamaduka
pushed a commit
that referenced
this pull request
May 8, 2023
…art (#49364) * Fix site editor redirection after creating new template or template part * add e2e tests * address feedback * Update test/e2e/specs/site-editor/site-editor-url-navigation.spec.js Co-authored-by: Kai Hao <[email protected]> * minor update * fix linting --------- Co-authored-by: Kai Hao <[email protected]>
I just cherry-picked this PR to the wp/6.2 branch to get it included in the next release: 2bb4988 |
Mamaduka
removed
the
Backport to WP Minor Release
Pull request that needs to be backported to a WordPress minor release
label
May 8, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Feature] Site Editor
Related to the overarching Site Editor (formerly "full site editing")
[Type] Bug
An existing feature does not function as intended
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?
Fixes: #49346
From the issue:
Noting that this is the case for
Template Parts
too.Scenario 1 (expected):
Screen.Recording.2023-03-24.at.12.11.18.mov
Scenario 2 (the new template is still created, but the user is not directed to it, and the modal doesn't close):
Screen.Recording.2023-03-24.at.12.12.19.mov
Step-by-step reproduction instructions
How?
When we create a new template or template part in site editor we first update the
canvas mode
(setCanvasMode( 'edit' )) to the store before pushing to thehistory
. This sometimes can lead to race conditions withuseSyncCanvasModeWithURL
hook that then replaces the proper url with the previous one and just adding thecanvas=edit
param. The current syncing is susceptible to race conditions in different parts of code, but I didn't investigate in depth for now. It's something we need to have in mind.This PR adds the correct
canvas
mode directly so we don't need the syncing logic there.Testing Instructions in this PR