Skip to content

Commit

Permalink
Revert "Prepublish Panel: Disable the Publish and Cancel buttons whil…
Browse files Browse the repository at this point in the history
…e saving (#32889)"

This reverts commit 24bf362.
  • Loading branch information
ockham authored Jun 30, 2021
1 parent d3fb83c commit 526d3b4
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ export class PostPublishButton extends Component {
};

const buttonProps = {
'aria-disabled': isButtonDisabled,
'aria-disabled': isButtonDisabled && ! hasNonPostEntityChanges,
className: 'editor-post-publish-button',
isBusy: ! isAutoSaving && isSaving && isPublished,
variant: 'primary',
Expand Down
30 changes: 0 additions & 30 deletions packages/editor/src/components/post-publish-button/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,6 @@ describe( 'PostPublishButton', () => {
);
} );

it( 'should be true if post is currently saving, even if there are non-post entity changes', () => {
// This normally means that we're still saving those changes.
const wrapper = shallow(
<PostPublishButton
hasNonPostEntityChanges
isPublishable
isSaveable
isSaving
/>
);

expect( wrapper.find( Button ).prop( 'aria-disabled' ) ).toBe(
true
);
} );

it( 'should be true if forceIsSaving is true', () => {
const wrapper = shallow(
<PostPublishButton isPublishable isSaveable forceIsSaving />
Expand Down Expand Up @@ -112,20 +96,6 @@ describe( 'PostPublishButton', () => {
false
);
} );

it( 'should be false if there are non-post entity changes', () => {
const wrapper = shallow(
<PostPublishButton
hasNonPostEntityChanges
isPublishable
isSaveable
/>
);

expect( wrapper.find( Button ).prop( 'aria-disabled' ) ).toBe(
false
);
} );
} );

describe( 'publish status', () => {
Expand Down
6 changes: 1 addition & 5 deletions packages/editor/src/components/post-publish-panel/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,7 @@ export class PostPublishPanel extends Component {
/>
</div>
<div className="editor-post-publish-panel__header-cancel-button">
<Button
disabled={ isSaving }
onClick={ onClose }
variant="secondary"
>
<Button onClick={ onClose } variant="secondary">
{ __( 'Cancel' ) }
</Button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ exports[`PostPublishPanel should render the pre-publish panel if the post is not
className="editor-post-publish-panel__header-cancel-button"
>
<ForwardRef(Button)
disabled={false}
variant="secondary"
>
Cancel
Expand Down Expand Up @@ -176,7 +175,6 @@ exports[`PostPublishPanel should render the spinner if the post is being saved 1
className="editor-post-publish-panel__header-cancel-button"
>
<ForwardRef(Button)
disabled={true}
variant="secondary"
>
Cancel
Expand Down

0 comments on commit 526d3b4

Please sign in to comment.