Fix: "View as" link is not updated after the post is updated and the permalink is changed#11262
Merged
jorgefilipecosta merged 1 commit intoNov 7, 2018
Conversation
youknowriad
requested changes
Nov 5, 2018
| REQUEST_POST_UPDATE: ( action, store ) => { | ||
| requestPostUpdate( action, store ); | ||
| }, | ||
| REQUEST_POST_UPDATE_SUCCESS: requestPostUpdateSuccess, |
Contributor
There was a problem hiding this comment.
Is the old effect requestPostUpdateSuccess not necessary anymore?
updateViewAsPermalink seems undefined right?
| return; | ||
| } | ||
| nodeToUpdate.setAttribute( 'href', newPermalink ); | ||
| }; |
Contributor
There was a problem hiding this comment.
Can we move this effect to the edit-post module instead? Ideally, the editor package has no knowledge about any WP context.
f717c79 to
63d06fa
Compare
Member
Author
|
Hi @youknowriad thank you for your review, this PR is now using a different approach attending to your feedback. |
…permalink is changed new
63d06fa to
9f99d1a
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes: #7275
The editor contains a "View as" pointing to the post permalink on the top bar.
This link comes from the page rendered on the server. When the post is updated with a permalink change the page is not rendered again so the "View as" link continued to be the same.
This PR adds an effect to update the dom of the "View as" link to contain the new permalink when the post is saved with success and the permalink was changed.
How has this been tested?
Create a new post, and publish it.
Reload the editor and verify we have a "View as" link in the top bar.
Change the post permalink and press update, verify that when the post is saved with success the View as link points to the new permalink.