Remove the "Always show pre-publish checks" from pre-publish panel (#45672)
* Remove "always show prepublish panel" * Add changelog
This commit is contained in:
parent
718fe762fa
commit
ee044a7b50
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: minor
|
||||||
|
Type: fix
|
||||||
|
|
||||||
|
Remove the "Always show pre-publish checks" from pre-publish panel #45672
|
|
@ -20,7 +20,6 @@ import { store as productEditorUiStore } from '../../store/product-editor-ui';
|
||||||
import { TRACKS_SOURCE } from '../../constants';
|
import { TRACKS_SOURCE } from '../../constants';
|
||||||
import { VisibilitySection } from './visibility-section';
|
import { VisibilitySection } from './visibility-section';
|
||||||
import { ScheduleSection } from './schedule-section';
|
import { ScheduleSection } from './schedule-section';
|
||||||
import { ShowPrepublishChecksSection } from './show-prepublish-checks-section';
|
|
||||||
import { PostPublishSection, PostPublishTitle } from './post-publish';
|
import { PostPublishSection, PostPublishTitle } from './post-publish';
|
||||||
|
|
||||||
export function PrepublishPanel( {
|
export function PrepublishPanel( {
|
||||||
|
@ -152,9 +151,7 @@ export function PrepublishPanel( {
|
||||||
<div className="woocommerce-product-publish-panel__content">
|
<div className="woocommerce-product-publish-panel__content">
|
||||||
{ getPanelSections() }
|
{ getPanelSections() }
|
||||||
</div>
|
</div>
|
||||||
<div className="woocommerce-product-publish-panel__footer">
|
<div className="woocommerce-product-publish-panel__footer" />
|
||||||
<ShowPrepublishChecksSection />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
export * from './show-prepublish-checks-section';
|
|
|
@ -1,39 +0,0 @@
|
||||||
/**
|
|
||||||
* External dependencies
|
|
||||||
*/
|
|
||||||
import { createElement } from '@wordpress/element';
|
|
||||||
import { __ } from '@wordpress/i18n';
|
|
||||||
import { recordEvent } from '@woocommerce/tracks';
|
|
||||||
import { CheckboxControl } from '@wordpress/components';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Internal dependencies
|
|
||||||
*/
|
|
||||||
import { TRACKS_SOURCE } from '../../../constants';
|
|
||||||
import { useShowPrepublishChecks } from '../../../hooks/use-show-prepublish-checks';
|
|
||||||
|
|
||||||
export function ShowPrepublishChecksSection() {
|
|
||||||
const { isResolving, showPrepublishChecks, togglePrepublishChecks } =
|
|
||||||
useShowPrepublishChecks();
|
|
||||||
|
|
||||||
if ( isResolving ) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="woocommerce-publish-panel-show-checks">
|
|
||||||
<CheckboxControl
|
|
||||||
label={ __( 'Always show pre-publish checks.', 'woocommerce' ) }
|
|
||||||
checked={ showPrepublishChecks }
|
|
||||||
onChange={ ( selected: boolean ) => {
|
|
||||||
togglePrepublishChecks();
|
|
||||||
recordEvent( 'product_prepublish_panel', {
|
|
||||||
source: TRACKS_SOURCE,
|
|
||||||
action: 'toggle_prepublish_checks',
|
|
||||||
value: selected,
|
|
||||||
} );
|
|
||||||
} }
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
Loading…
Reference in New Issue