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

Uses the global store for the post title and adds undo/redo support. #501

Merged
merged 4 commits into from
Jan 28, 2019

Conversation

diegoreymendez
Copy link
Contributor

@diegoreymendez diegoreymendez commented Jan 25, 2019

Description:

Following @Tug 's indications here, this PR wires our title to the global store title.

This PR also adds undo/redo support for the title.

Moves forward #372 .

Dependencies:

Gutenberg PR: WordPress/gutenberg#13514

Testing:

Testing edits:

  1. Launch the demo app.
  2. Make sure the initial title is properly set up.
  3. Edit the title, switch to HTML mode and back.

Make sure the title is still as you left it before switching modes.

Testing undo redo:

  1. Edit the title as you see fit.
  2. Use the undo / redo buttons from the toolbar.

Make sure undo / redo works as it does in web-Gutenberg (ie: that's our baseline for comparing).

@diegoreymendez diegoreymendez added the [Type] Enhancement Improves a current area of the editor label Jan 25, 2019
@diegoreymendez diegoreymendez added this to the Beta milestone Jan 25, 2019
@diegoreymendez diegoreymendez self-assigned this Jan 25, 2019
@diegoreymendez
Copy link
Contributor Author

Fyi, @daniloercoli

@diegoreymendez diegoreymendez requested review from daniloercoli and removed request for Tug and pinarol January 25, 2019 23:07
@diegoreymendez
Copy link
Contributor Author

Reassigned to @daniloercoli since he's working on the title feature with me.

Copy link
Contributor

@daniloercoli daniloercoli left a comment

Choose a reason for hiding this comment

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

LGTM!

Remember to update the GB hash, once the companion GB PR is refreshed and merged to master.

@@ -92,7 +91,7 @@ class AppContainer extends React.Component<PropsType, StateType> {
toggleHtmlModeAction={ this.toggleHtmlModeAction }
setTitleAction={ this.setTitleAction }
Copy link
Contributor

@pinarol pinarol Jan 28, 2019

Choose a reason for hiding this comment

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

Hey @diegoreymendez 👋 it looks to me that we can also get rid of passing this.setTitleAction as a prop from component to component. So other components can also use editPost( { title: title } ) via their own props with the help of withDispatch. what do you think?

Copy link
Contributor Author

@diegoreymendez diegoreymendez Jan 28, 2019

Choose a reason for hiding this comment

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

That's a good observation. Thanks @pinarol!

Considering this PR is working as expected right now though, I've created an issue that I will be tackling right after this is complete.

As usual my goal is to split the work into atomic steps where possible.

@diegoreymendez diegoreymendez merged commit 23aaed1 into develop Jan 28, 2019
@diegoreymendez diegoreymendez deleted the issue/372-post-title-writing-flow branch January 28, 2019 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement Improves a current area of the editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants