From 3e19912b09f11f8e4efe9cedfe384f51bff6e648 Mon Sep 17 00:00:00 2001 From: Hardeep Asrani Date: Tue, 19 Dec 2023 03:08:31 +0530 Subject: [PATCH 1/7] fix: onboarding imported_items tracking --- src/onboarding/store.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/onboarding/store.js b/src/onboarding/store.js index 8368e52be..d3f5df961 100644 --- a/src/onboarding/store.js +++ b/src/onboarding/store.js @@ -177,7 +177,10 @@ const actions = { const pageTemplates = select.getLibrary( 'page_templates' ); const importedTemplates = select.getImportedTemplates(); - event.imported_items = selectedTemplates; + event.imported_items = selectedTemplates.reduce( ( obj, item ) => { + obj[item] = true; + return obj; + }, {}); await Promise.all( selectedTemplates From 6e2078f4e8f1036d94fac1c5d213872a35ef4a93 Mon Sep 17 00:00:00 2001 From: Hardeep Asrani Date: Tue, 19 Dec 2023 03:17:29 +0530 Subject: [PATCH 2/7] fix: e2e test zip --- .wp-env.override.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.wp-env.override.json b/.wp-env.override.json index 29860b07f..59893c03e 100644 --- a/.wp-env.override.json +++ b/.wp-env.override.json @@ -13,7 +13,7 @@ "development": { "themes": [ "./test/emptytheme" ], "mappings": { - "wp-content/themes/raft": "https://github.com/Codeinwp/raft/archive/refs/heads/onboarding.zip" + "wp-content/themes/raft": "https://downloads.wordpress.org/theme/raft.zip" } }, "tests": { @@ -29,9 +29,9 @@ "wp-content/mu-plugins": "./packages/e2e-tests/mu-plugins", "wp-content/plugins/gutenberg-test-plugins": "./packages/e2e-tests/plugins", "wp-content/themes/gutenberg-test-themes": "./test/gutenberg-test-themes", - "wp-content/themes/gutenberg-test-themes/twentytwentyone": "https://downloads.wordpress.org/theme/twentytwentyone.1.7.zip", - "wp-content/themes/gutenberg-test-themes/twentytwentythree": "https://downloads.wordpress.org/theme/twentytwentythree.1.0.zip", - "wp-content/themes/raft": "https://github.com/Codeinwp/raft/archive/refs/heads/onboarding.zip" + "wp-content/themes/gutenberg-test-themes/twentytwentyone": "https://downloads.wordpress.org/theme/twentytwentyone.zip", + "wp-content/themes/gutenberg-test-themes/twentytwentythree": "https://downloads.wordpress.org/theme/twentytwentythree.zip", + "wp-content/themes/raft": "https://downloads.wordpress.org/theme/raft.zip" } } } From f0c07ae3fbe3e537d6cb5a9713e2466512e54bf6 Mon Sep 17 00:00:00 2001 From: Hardeep Asrani Date: Tue, 19 Dec 2023 03:51:33 +0530 Subject: [PATCH 3/7] fix: fix redirection loop when you activate Raft after Otter --- inc/plugins/class-fse-onboarding.php | 3 +++ inc/plugins/class-options-settings.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/inc/plugins/class-fse-onboarding.php b/inc/plugins/class-fse-onboarding.php index a9e4e2197..f2498fb56 100644 --- a/inc/plugins/class-fse-onboarding.php +++ b/inc/plugins/class-fse-onboarding.php @@ -87,6 +87,9 @@ public function on_switch_theme() { return; } + // Flag onboarding status in case being run from a theme. + self::set_onboarding_status(); + // Run the onboarding. $redirect = add_query_arg( array( diff --git a/inc/plugins/class-options-settings.php b/inc/plugins/class-options-settings.php index 37b68dfa0..6c5ee91bf 100644 --- a/inc/plugins/class-options-settings.php +++ b/inc/plugins/class-options-settings.php @@ -718,7 +718,7 @@ function ( $item ) { 'themeisle_blocks_settings_onboarding_wizard', array( 'type' => 'boolean', - 'description' => __( 'Enable Onboarding Wizard.', 'otter-blocks' ), + 'description' => __( 'Enable FSE Onboarding Wizard.', 'otter-blocks' ), 'show_in_rest' => true, 'default' => true, ) From fe961947cd38b044aed79ed845d7daf10b2dca5e Mon Sep 17 00:00:00 2001 From: Hardeep Asrani Date: Tue, 19 Dec 2023 04:48:45 +0530 Subject: [PATCH 4/7] fix: style conflict with third-party plugins --- src/blocks/editor.scss | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/blocks/editor.scss b/src/blocks/editor.scss index 5fa86caf8..772cd8cc8 100644 --- a/src/blocks/editor.scss +++ b/src/blocks/editor.scss @@ -1,9 +1,3 @@ -.block-editor-block-inspector { - .components-base-control:not(.components-input-control) { - margin: 24px 0; - } -} - .otter-masonry { .blocks-gallery-grid { .blocks-gallery-item { From 8d60c6c4e795dbcf0cd626056d280e67a35d9c41 Mon Sep 17 00:00:00 2001 From: Hardeep Asrani Date: Tue, 19 Dec 2023 05:24:54 +0530 Subject: [PATCH 5/7] fix: fix woo products not appearing in block conditions --- src/pro/plugins/conditions/edit.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pro/plugins/conditions/edit.js b/src/pro/plugins/conditions/edit.js index 814577d6f..979641474 100644 --- a/src/pro/plugins/conditions/edit.js +++ b/src/pro/plugins/conditions/edit.js @@ -147,16 +147,16 @@ const ProductsMultiselect = ( props ) => { } = select( COLLECTIONS_STORE_KEY ); // eslint-disable-next-line camelcase - const productsError = getCollectionError?.( '/wc/store', 'products', { per_page: -1 }); + const productsError = getCollectionError?.( '/wc/store', 'products', { per_page: 0 }); - const products = productsError ? [] : ( getCollection?.( '/wc/store', 'products', { 'per_page': -1 }) ?? [])?.map( result => ({ + const products = productsError ? [] : ( getCollection?.( '/wc/store', 'products', { 'per_page': 0 }) ?? [])?.map( result => ({ value: result.id, label: decodeEntities( result.name ) }) ); return { products, - isLoading: isResolving( 'getCollection', [ '/wc/store', 'products', { 'per_page': -1 }]) + isLoading: isResolving( 'getCollection', [ '/wc/store', 'products', { 'per_page': 0 }]) }; }, []); From a7be740c02cd97a52603d34cb084946f1643dbaa Mon Sep 17 00:00:00 2001 From: Hardeep Asrani Date: Tue, 19 Dec 2023 10:17:25 +0530 Subject: [PATCH 6/7] chore: fix various small bugs --- src/blocks/editor.scss | 10 ++++++++++ src/blocks/helpers/block-utility.js | 7 ------- src/blocks/plugins/conditions/edit.js | 2 +- src/blocks/plugins/otter-tools-inspector/index.tsx | 10 ++++++++-- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/blocks/editor.scss b/src/blocks/editor.scss index 772cd8cc8..26391f1a8 100644 --- a/src/blocks/editor.scss +++ b/src/blocks/editor.scss @@ -1,3 +1,9 @@ +.components-tools-panel-item { + .components-base-control:not(.components-input-control) { + margin: 24px 0; + } +} + .otter-masonry { .blocks-gallery-grid { .blocks-gallery-item { @@ -206,3 +212,7 @@ svg.o-block-icon { } } } + +.w-full { + width: 100%; +} diff --git a/src/blocks/helpers/block-utility.js b/src/blocks/helpers/block-utility.js index 15d53df69..183b70aeb 100644 --- a/src/blocks/helpers/block-utility.js +++ b/src/blocks/helpers/block-utility.js @@ -471,13 +471,6 @@ export function pullReusableBlockContentById( id ) { return parse( reusableBlock.content.raw ?? reusableBlock.content ); } -/** - * Open the Otter sidebar menu. - */ -export function openOtterSidebarMenu() { - document?.querySelector( '.interface-pinned-items button[aria-label~="Otter"]' )?.click(); -} - /** * Insert a block below the given block. * diff --git a/src/blocks/plugins/conditions/edit.js b/src/blocks/plugins/conditions/edit.js index e754b94da..2700101a8 100644 --- a/src/blocks/plugins/conditions/edit.js +++ b/src/blocks/plugins/conditions/edit.js @@ -466,7 +466,7 @@ const Edit = ({