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

Conversation

nylen
Copy link
Member

@nylen nylen commented May 15, 2017

See #748. cc @jasmussen - if we want to keep the save button disabled (I would think we do for a few more releases...) then this will automate it. This method also has a bit better UX becuse the button is visually disabled rather than appearing to work but doing nothing when clicked.

Should we also add a way for power users to save anyway?

@jasmussen
Copy link
Contributor

Very cool! 🎉

I suspect we'll want to disable saving or at the very least publishing until we stop using post content as the base, that's what we ideally want people to stop publishing because it really screams "this is a test build", and then the user might be surprised when they publish it on the frontend.

Should we also add a way for power users to save anyway?

Not worth it, especially since disabling is an interim thing.

If need be, and if it's a minuscule amount of work, then we can let people save/publish if they actively open an existing post in the editor, rather than use the stock post content. However even then we should probably work in #707, possibly even decide on #708 first.

@nylen
Copy link
Member Author

nylen commented May 15, 2017

until we stop using post content as the base

I am assuming that you mean our dummy post-content.js here, in which case I agree. As an interim step maybe we have a button that says "OK I want to write something!" and when you click it, you get a blank screen with the save button enabled.

It's not difficult at all to distinguish between a new or an existing post, but I agree there's value in waiting until the functionality around post statuses is more fleshed out first.

@nylen nylen force-pushed the update/disable-save-in-builds branch from ef1dcc9 to f28c84f Compare May 15, 2017 19:46
@mtias mtias added [Type] Build Tooling Issues or PRs related to build tooling Framework Issues related to broader framework topics, especially as it relates to javascript labels May 16, 2017
Copy link
Member

@aduth aduth left a comment

Choose a reason for hiding this comment

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

Looks good 👍

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.

@nylen nylen merged commit a25be79 into master May 18, 2017
@nylen nylen deleted the update/disable-save-in-builds branch May 18, 2017 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Issues related to broader framework topics, especially as it relates to javascript [Type] Build Tooling Issues or PRs related to build tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants