Fix publish dropdown visibility in new product after hiding pre-publish modal (#45682)
* Publish dropdown visible after hidding panel * Add changelog * Rename prop
This commit is contained in:
parent
5485665727
commit
506a8b0086
|
@ -0,0 +1,4 @@
|
|||
Significance: minor
|
||||
Type: fix
|
||||
|
||||
Fix publish dropdown visibility in new product after hiding pre-publish modal #45682
|
|
@ -249,7 +249,8 @@ export function Header( {
|
|||
|
||||
<PublishButton
|
||||
productType={ productType }
|
||||
prePublish={ showPrepublishChecks }
|
||||
isPrePublishPanelVisible={ showPrepublishChecks }
|
||||
isMenuButton
|
||||
/>
|
||||
|
||||
<WooHeaderItem.Slot name="product" />
|
||||
|
|
|
@ -25,7 +25,8 @@ import type { PublishButtonProps } from './types';
|
|||
|
||||
export function PublishButton( {
|
||||
productType = 'product',
|
||||
prePublish,
|
||||
isMenuButton,
|
||||
isPrePublishPanelVisible = true,
|
||||
...props
|
||||
}: PublishButtonProps ) {
|
||||
const { createErrorNotice } = useDispatch( 'core/notices' );
|
||||
|
@ -68,7 +69,7 @@ export function PublishButton( {
|
|||
if (
|
||||
productType === 'product' &&
|
||||
window.wcAdminFeatures[ 'product-pre-publish-modal' ] &&
|
||||
prePublish
|
||||
isMenuButton
|
||||
) {
|
||||
function renderPublishButtonMenu(
|
||||
menuProps: Dropdown.RenderProps
|
||||
|
@ -78,7 +79,11 @@ export function PublishButton( {
|
|||
);
|
||||
}
|
||||
|
||||
if ( editedStatus !== 'publish' && editedStatus !== 'future' ) {
|
||||
if (
|
||||
editedStatus !== 'publish' &&
|
||||
editedStatus !== 'future' &&
|
||||
isPrePublishPanelVisible
|
||||
) {
|
||||
function handlePrePublishButtonClick(
|
||||
event: MouseEvent< HTMLButtonElement >
|
||||
) {
|
||||
|
|
|
@ -8,5 +8,6 @@ export type PublishButtonProps = Omit<
|
|||
'aria-disabled' | 'variant' | 'children'
|
||||
> & {
|
||||
productType?: string;
|
||||
prePublish?: boolean;
|
||||
isMenuButton?: boolean;
|
||||
isPrePublishPanelVisible?: boolean;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue