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

Automatically disable the save button in release builds #790

Merged
merged 1 commit into from
May 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion editor/header/tools/publish-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,17 @@ function PublishButton( {
saveCallback = onSaveDraft;
}

const buttonDisabledHint = process.env.NODE_ENV === 'production'
? wp.i18n.__( 'The Save button is disabled during early alpha releases.' )
: null;

return (
<Button
isPrimary
isLarge
onClick={ () => saveCallback( post, edits, blocks ) }
disabled={ ! buttonEnabled }
disabled={ ! buttonEnabled || process.env.NODE_ENV === 'production' }
title={ buttonDisabledHint }
Copy link
Member

Choose a reason for hiding this comment

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

Reminds me, I have an in-progress tooltip branch which should help surface this a bit better than native browser tooltips.

>
{ buttonText }
</Button>
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const config = {
},
plugins: [
new webpack.DefinePlugin( {
'process.env.NODE_ENV': JSON.stringify( process.env.NODE_ENV ),
'process.env.NODE_ENV': JSON.stringify( process.env.NODE_ENV || 'development' ),
} ),
new ExtractTextPlugin( {
filename: './[name]/build/style.css',
Expand Down