-
Notifications
You must be signed in to change notification settings - Fork 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
Editor: Manage post title edits using global Redux state #5445
Conversation
924be82
to
248979e
Compare
<EditorTitle | ||
isNew={ this.state.isNew } | ||
post={ this.state.post } | ||
site={ site } |
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.
With the new connect approach in EditorTitle it might be nice to get rid of passing the site object in here and perhaps just call isPermalinkEditable here instead and pass that resultant boolean as a prop in its lieu.
Testing out well for me. I did hit an edge-case bug, which exists in production as well that seems to be triggered by the protect-form mixin removing Steps:
Worth noting I could not re-create the bug by clicking "Back" in the sidebar. |
248979e
to
d029db1
Compare
Thanks @timmyc ! I rebased to resolve merge conflicts and to address your comments:
Replaced with
In the rebased 7176235, I've removed the passing of
It makes sense for the drafts reset, yeah, but for resetting edits to the post object itself on the subsequent lines, I'd feel safer to continue pulling the site ID from the post object. The rebased 59fe3fe changes this line.
Since this affects production, I'll see to investigating this as a separate pull request, perhaps in parallel to this one. |
Seems like a good idea. Took another glance and a spin and all is looking well! Excited to see the editor moving in this direction. |
d029db1
to
135ac10
Compare
Since at this point, title changes should be reflected in Flux store
135ac10
to
b0a0f88
Compare
I rebased this PR to eliminate conflicts after #6040 and other changes. Works well in my quick testing but needs more 👀 . |
That was what I had in mind - rebasing seemed like a good way to explore and this code and get it ready for re-use. Still, I don't yet understand some of the code I cribbed from here well enough to be confident merging, and #6548 isn't quite working yet. |
I'm not opposed to someone picking it back up, but personally I'd planned on chipping away at some of the easier migrations to help shake out requirements and bugs before tackling this critical one. |
Superseded by #8814 |
This pull request seeks to implement the logic necessary to start assigning edited post values through Redux state, including displaying the current value, editing the value, saving edited values, and considering edited values in Redux state for "dirty" and "empty content" checking. As of this pull request, only title edits will be managed through global state.
The implementation includes compatibility with the Flux approach, specifically in assigning edited values from Redux state to the Flux store prior to saving. This will be removed in future iterations as the editor becomes completely dependent upon Redux state, especially once we start saving the post through Redux action creators.
Testing instructions:
Verify that titles can be viewed, updated, and saved in the post editor. Verify also that the Save option is shown iff the post has any revisions which differ from the saved post, and only if the post has "content" (non-whitespace-only title, content, or excerpt assigned). Confirm expected behavior for new posts and pages, and existing posts and pages.