Skip to content
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

Editor: Ignore save edit in undo history. #17452

Merged
merged 6 commits into from
Sep 16, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ export default compose( [
withDispatch( ( dispatch ) => {
const { editPost, savePost } = dispatch( 'core/editor' );
return {
onStatusChange: ( status ) => editPost( { status } ),
onStatusChange: ( status ) => editPost( { status }, { undoIgnore: true } ),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this is the right place to make this decision. Should status changes in general be ignored? Or publish status changes? Genuinely wondering...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends on the context and the entity.

This will cover publishing status changes for posts and it makes sense to ignore that.

It will be very context-dependent which is why I didn't make it part of the entity configuration.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok fair enough.

onSave: savePost,
};
} ),
Expand Down