Remove the "Always show pre-publish checks" from pre-publish panel (#45672)

* Remove "always show prepublish panel"

* Add changelog
This commit is contained in:
Fernando Marichal 2024-03-18 14:00:21 -04:00 committed by GitHub
parent 718fe762fa
commit ee044a7b50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 5 additions and 44 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: fix
Remove the "Always show pre-publish checks" from pre-publish panel #45672

View File

@ -20,7 +20,6 @@ import { store as productEditorUiStore } from '../../store/product-editor-ui';
import { TRACKS_SOURCE } from '../../constants';
import { VisibilitySection } from './visibility-section';
import { ScheduleSection } from './schedule-section';
import { ShowPrepublishChecksSection } from './show-prepublish-checks-section';
import { PostPublishSection, PostPublishTitle } from './post-publish';
export function PrepublishPanel( {
@ -152,9 +151,7 @@ export function PrepublishPanel( {
<div className="woocommerce-product-publish-panel__content">
{ getPanelSections() }
</div>
<div className="woocommerce-product-publish-panel__footer">
<ShowPrepublishChecksSection />
</div>
<div className="woocommerce-product-publish-panel__footer" />
</div>
);
}

View File

@ -1 +0,0 @@
export * from './show-prepublish-checks-section';

View File

@ -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>
);
}