From 3ac5db6c6a554af8b4f231a9c984bf230a775ed6 Mon Sep 17 00:00:00 2001 From: "Matthew Riley MacPherson (tofumatt)" Date: Fri, 22 Jun 2018 19:30:52 +0100 Subject: [PATCH 1/2] fix: Show permalink editor in editor (fix #7467) --- editor/components/post-permalink/index.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/editor/components/post-permalink/index.js b/editor/components/post-permalink/index.js index b1ba0dec54c96f..40f33632f9c894 100644 --- a/editor/components/post-permalink/index.js +++ b/editor/components/post-permalink/index.js @@ -60,7 +60,7 @@ class PostPermalink extends Component { const { isCopied, isEditingPermalink } = this.state; const ariaLabel = isCopied ? __( 'Permalink copied' ) : __( 'Copy the permalink' ); - if ( isNew || ! previewLink ) { + if ( isNew ) { return null; } @@ -123,7 +123,13 @@ class PostPermalink extends Component { export default compose( [ withSelect( ( select ) => { - const { isEditedPostNew, isPermalinkEditable, getEditedPostPreviewLink, getPermalink, isCurrentPostPublished } = select( 'core/editor' ); + const { + isEditedPostNew, + isPermalinkEditable, + getEditedPostPreviewLink, + getPermalink, + isCurrentPostPublished, + } = select( 'core/editor' ); return { isNew: isEditedPostNew(), previewLink: getEditedPostPreviewLink(), From 7f3afdcce81d6a053122b47f499b9d09049c63bf Mon Sep 17 00:00:00 2001 From: "Matthew Riley MacPherson (tofumatt)" Date: Mon, 25 Jun 2018 22:14:28 +0100 Subject: [PATCH 2/2] Use getCurrentPost() to get the link --- editor/components/post-permalink/index.js | 13 ++++++++----- editor/store/selectors.js | 11 ----------- editor/store/test/selectors.js | 21 --------------------- 3 files changed, 8 insertions(+), 37 deletions(-) diff --git a/editor/components/post-permalink/index.js b/editor/components/post-permalink/index.js index 40f33632f9c894..e81302a486cdc1 100644 --- a/editor/components/post-permalink/index.js +++ b/editor/components/post-permalink/index.js @@ -56,11 +56,11 @@ class PostPermalink extends Component { } render() { - const { isNew, previewLink, isEditable, samplePermalink, isPublished } = this.props; + const { isNew, postLink, isEditable, samplePermalink, isPublished } = this.props; const { isCopied, isEditingPermalink } = this.state; const ariaLabel = isCopied ? __( 'Permalink copied' ) : __( 'Copy the permalink' ); - if ( isNew ) { + if ( isNew || ! postLink ) { return null; } @@ -80,7 +80,7 @@ class PostPermalink extends Component { { ! isEditingPermalink &&