-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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: Moving a page to the trash on the site editor does not goes back to the pages list #65119
Fix: Moving a page to the trash on the site editor does not goes back to the pages list #65119
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
isDeleting: store.isDeletingPost(), | ||
postId: store.getCurrentPostId(), | ||
title: store.getCurrentPostAttribute( 'title' ), | ||
item: store.getCurrentPost(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we avoid calling the selector here which triggers a pre-rendering on each range and only call getCurrentPost
within the callback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @youknowriad good catch, the suggestion was applied.
Size Change: -5 B (0%) Total Size: 1.78 MB
ℹ️ View Unchanged
|
481bc58
to
8c6da6e
Compare
The |
Hi @Mamaduka, thank you for the review, I removed the trash handling from it as suggested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @jorgefilipecosta! The updates work as expected ✅
There's a small error in BrowserURL
unit test file that needs to be fixed.
/home/runner/work/gutenberg/gutenberg/packages/edit-post/src/components/browser-url/test/index.js
[2] 9:26 error 'getPostTrashedURL' is defined but never used no-unused-vars
Do we have an e2e test about this flow? Would be a good addition if not. |
2a10201
to
28ba06b
Compare
We don't have an e2e test for this flow I will look into implementing one. |
On #65087 we restored the move to trash button. But with the sidebar unification between the edit post and edit site that means the move to trash button is now also available on the edit site.
On the edit site, we have an issue where if we move a page to the trash the page is moved to trash but for the user, it seems like nothing happened as the editor keeps open on that page. And the move to trash button is still available, which is confusing.
This PR fixes the issue by calling onActionPerformed with the move-to-trash action after the post is moved to the trash, this ensures the expected behavior after a post is trashed happens no matter if the user is on the site editor or the post editor.
cc: @youknowriad, @Mamaduka as code reviewers of the related pull request.
Testing Instructions
Opened the site editor, and went to the pages section.
Opened a page in the editor, moved the page to the trash, and verified the UI was moved to the pages list (on the trunk it keeps the page opened as if nothing happened).