From ee044a7b50049e51f76f5498abcb3125b62d4a0a Mon Sep 17 00:00:00 2001 From: Fernando Marichal Date: Mon, 18 Mar 2024 14:00:21 -0400 Subject: [PATCH] Remove the "Always show pre-publish checks" from pre-publish panel (#45672) * Remove "always show prepublish panel" * Add changelog --- ...668_remove_always_show_preprepublish_panel | 4 ++ .../prepublish-panel/prepublish-panel.tsx | 5 +-- .../show-prepublish-checks-section/index.ts | 1 - .../show-prepublish-checks-section.tsx | 39 ------------------- 4 files changed, 5 insertions(+), 44 deletions(-) create mode 100644 packages/js/product-editor/changelog/fix-45668_remove_always_show_preprepublish_panel delete mode 100644 packages/js/product-editor/src/components/prepublish-panel/show-prepublish-checks-section/index.ts delete mode 100644 packages/js/product-editor/src/components/prepublish-panel/show-prepublish-checks-section/show-prepublish-checks-section.tsx diff --git a/packages/js/product-editor/changelog/fix-45668_remove_always_show_preprepublish_panel b/packages/js/product-editor/changelog/fix-45668_remove_always_show_preprepublish_panel new file mode 100644 index 00000000000..52beddc91e9 --- /dev/null +++ b/packages/js/product-editor/changelog/fix-45668_remove_always_show_preprepublish_panel @@ -0,0 +1,4 @@ +Significance: minor +Type: fix + +Remove the "Always show pre-publish checks" from pre-publish panel #45672 diff --git a/packages/js/product-editor/src/components/prepublish-panel/prepublish-panel.tsx b/packages/js/product-editor/src/components/prepublish-panel/prepublish-panel.tsx index 407c3a2285c..1be8366147c 100644 --- a/packages/js/product-editor/src/components/prepublish-panel/prepublish-panel.tsx +++ b/packages/js/product-editor/src/components/prepublish-panel/prepublish-panel.tsx @@ -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( {
{ getPanelSections() }
-
- -
+
); } diff --git a/packages/js/product-editor/src/components/prepublish-panel/show-prepublish-checks-section/index.ts b/packages/js/product-editor/src/components/prepublish-panel/show-prepublish-checks-section/index.ts deleted file mode 100644 index 22473663964..00000000000 --- a/packages/js/product-editor/src/components/prepublish-panel/show-prepublish-checks-section/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './show-prepublish-checks-section'; diff --git a/packages/js/product-editor/src/components/prepublish-panel/show-prepublish-checks-section/show-prepublish-checks-section.tsx b/packages/js/product-editor/src/components/prepublish-panel/show-prepublish-checks-section/show-prepublish-checks-section.tsx deleted file mode 100644 index 6606e420da4..00000000000 --- a/packages/js/product-editor/src/components/prepublish-panel/show-prepublish-checks-section/show-prepublish-checks-section.tsx +++ /dev/null @@ -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 ( -
- { - togglePrepublishChecks(); - recordEvent( 'product_prepublish_panel', { - source: TRACKS_SOURCE, - action: 'toggle_prepublish_checks', - value: selected, - } ); - } } - /> -
- ); -}