From 2843fbb7a8beb03fd8168b699855db39c9edb534 Mon Sep 17 00:00:00 2001 From: louwie17 Date: Thu, 18 May 2023 13:00:42 -0300 Subject: [PATCH] Fix editor header hidden in Firefox (#38247) * Update page config to add support for layout header/footer * Fix lint error --- .../fix-38242_editor_hidden_in_firefox | 4 +++ .../src/components/block-editor/style.scss | 6 ----- .../client/layout/controller.js | 6 +++++ .../woocommerce-admin/client/layout/index.js | 25 +++++++++++-------- .../fix-38242_editor_hidden_in_firefox | 4 +++ 5 files changed, 28 insertions(+), 17 deletions(-) create mode 100644 packages/js/product-editor/changelog/fix-38242_editor_hidden_in_firefox create mode 100644 plugins/woocommerce/changelog/fix-38242_editor_hidden_in_firefox diff --git a/packages/js/product-editor/changelog/fix-38242_editor_hidden_in_firefox b/packages/js/product-editor/changelog/fix-38242_editor_hidden_in_firefox new file mode 100644 index 00000000000..9dd9e2a4c53 --- /dev/null +++ b/packages/js/product-editor/changelog/fix-38242_editor_hidden_in_firefox @@ -0,0 +1,4 @@ +Significance: minor +Type: update + +Remove css unrelated to the product block editor. diff --git a/packages/js/product-editor/src/components/block-editor/style.scss b/packages/js/product-editor/src/components/block-editor/style.scss index 17ac7b9e1ac..cfec1c5b370 100644 --- a/packages/js/product-editor/src/components/block-editor/style.scss +++ b/packages/js/product-editor/src/components/block-editor/style.scss @@ -101,9 +101,3 @@ display: none; // use important or increase specificity. } } - -.woocommerce-layout:has( .woocommerce-product-block-editor ) { - .woocommerce-layout__header { - display: none; - } -} diff --git a/plugins/woocommerce-admin/client/layout/controller.js b/plugins/woocommerce-admin/client/layout/controller.js index 4ee1e18b89c..20e5b34ddd9 100644 --- a/plugins/woocommerce-admin/client/layout/controller.js +++ b/plugins/woocommerce-admin/client/layout/controller.js @@ -182,6 +182,9 @@ export const getPages = () => { navArgs: { id: 'woocommerce-add-product', }, + layout: { + header: false, + }, wpOpenMenu: 'menu-posts-product', capability: 'manage_woocommerce', } ); @@ -196,6 +199,9 @@ export const getPages = () => { navArgs: { id: 'woocommerce-edit-product', }, + layout: { + header: false, + }, wpOpenMenu: 'menu-posts-product', capability: 'manage_woocommerce', } ); diff --git a/plugins/woocommerce-admin/client/layout/index.js b/plugins/woocommerce-admin/client/layout/index.js index 9c06bfd0e10..13e1f8cc38b 100644 --- a/plugins/woocommerce-admin/client/layout/index.js +++ b/plugins/woocommerce-admin/client/layout/index.js @@ -185,7 +185,8 @@ function _Layout( { ); } - const { breadcrumbs } = page; + const { breadcrumbs, layout = { header: true, footer: true } } = page; + const { header: showHeader = true, footer: showFooter = true } = layout; const query = Object.fromEntries( new URLSearchParams( location && location.search ) @@ -199,15 +200,17 @@ function _Layout( { >
-
+ { showHeader && ( +
+ ) } { ! isEmbedded && ( @@ -226,7 +229,7 @@ function _Layout( { ) } -
+ { showFooter &&
}
diff --git a/plugins/woocommerce/changelog/fix-38242_editor_hidden_in_firefox b/plugins/woocommerce/changelog/fix-38242_editor_hidden_in_firefox new file mode 100644 index 00000000000..962598f3daf --- /dev/null +++ b/plugins/woocommerce/changelog/fix-38242_editor_hidden_in_firefox @@ -0,0 +1,4 @@ +Significance: patch +Type: update + +Add support for `showHeader` config in router config to hide header if needed.