Skip to content

Commit

Permalink
Ensure the right title appears at the right time.
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahmonster committed Sep 19, 2018
1 parent 1d9fab2 commit 95a40ca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
26 changes: 14 additions & 12 deletions packages/editor/src/components/post-publish-panel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,23 @@ class PostPublishPanel extends Component {
this.setState( { loading: true } );
}

onUpdateDisableToggle() {
// There should be a setting to allow users to skip the pre-publish step forever.
// When a user toggles this option on, their setting will be saved and they won't need
// to press two "publish" buttons in order to make a post happen.
}

render() {
const { isScheduled, isPublishSidebarEnabled, onClose, onTogglePublishSidebar, forceIsDirty, forceIsSaving, PrePublishExtension, PostPublishExtension, ...additionalProps } = this.props;
const { loading, submitted, hasPublishAction } = this.state;
const { hasPublishAction, isScheduled, isBeingScheduled, onClose, forceIsDirty, forceIsSaving, PrePublishExtension, PostPublishExtension, ...additionalProps } = this.props;
const { loading, submitted } = this.state;
let prePublishTitle;

if ( ! hasPublishAction ) {
prePublishTitle = __( 'Ready to submit for review?' );
} else if ( isBeingScheduled ) {
prePublishTitle = __( 'Ready to schedule?' );
} else {
prePublishTitle = __( 'Ready to publish?' );
}
return (
<div className="editor-post-publish-panel" { ...additionalProps }>
<div className="editor-post-publish-panel__header">
<strong className="editor-post-publish-panel__title">
{ hasPublishAction ? __( 'Ready to submit for review?' ) : __( 'Ready to publish?' ) }
{ prePublishTitle }
</strong>

<IconButton
Expand Down Expand Up @@ -110,8 +113,6 @@ class PostPublishPanel extends Component {
</div>
) }
</div>
<<<<<<< HEAD
=======

<div className="editor-post-publish-panel__disable-check">
<CheckboxControl
Expand All @@ -121,7 +122,6 @@ class PostPublishPanel extends Component {
/>
</div>

>>>>>>> Add a checkbox to skip the prepublish panel.
</div>
);
}
Expand All @@ -134,6 +134,7 @@ export default compose( [
getCurrentPostType,
isCurrentPostPublished,
isCurrentPostScheduled,
isEditedPostBeingScheduled,
isSavingPost,
isEditedPostDirty,
} = select( 'core/editor' );
Expand All @@ -143,6 +144,7 @@ export default compose( [
hasPublishAction: get( getCurrentPost(), [ '_links', 'wp:action-publish' ], false ),
isPublished: isCurrentPostPublished(),
isScheduled: isCurrentPostScheduled(),
isBeingScheduled: isEditedPostBeingScheduled(),
isSaving: isSavingPost(),
isDirty: isEditedPostDirty(),
isPublishSidebarEnabled: isPublishSidebarEnabled(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,18 @@ function PostPublishPanelPrepublish( {
isBeingScheduled,
children,
} ) {
let prePublishTitle, prePublishBodyText;
let prePublishBodyText;

if ( ! hasPublishAction ) {
prePublishTitle = __( 'Are you ready to submit for review?' );
prePublishBodyText = __( 'When you’re ready, submit your work for review, and an Editor will be able to approve it for you.' );
} else if ( isBeingScheduled ) {
prePublishTitle = __( 'Are you ready to schedule?' );
prePublishBodyText = __( 'Your post will be published at the specified date and time.' );
} else {
prePublishTitle = __( 'Are you ready to publish?' );
prePublishBodyText = __( 'Double-check your settings, then use the button to publish your post.' );
}

return (
<div className="editor-post-publish-panel__prepublish">
<div><strong>{ prePublishTitle }</strong></div>
<p>{ prePublishBodyText }</p>

{ hasPublishAction && (
Expand Down

0 comments on commit 95a40ca

Please sign in to comment.