From 0aae2b5d1aba25cb068923dca3a822e6e9517705 Mon Sep 17 00:00:00 2001 From: Luigi Teschio Date: Thu, 14 Mar 2024 14:07:09 +0100 Subject: [PATCH 1/4] CYS - Core: fix wp-admin page visible when click on start designing --- .../client/customize-store/intro/index.tsx | 3 +++ .../customize-store/intro/intro-banners.tsx | 8 ++++++-- .../product-list-content.tsx | 18 +++++++++++++++++- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/plugins/woocommerce-admin/client/customize-store/intro/index.tsx b/plugins/woocommerce-admin/client/customize-store/intro/index.tsx index 2e453e6d2877..4ede587486d5 100644 --- a/plugins/woocommerce-admin/client/customize-store/intro/index.tsx +++ b/plugins/woocommerce-admin/client/customize-store/intro/index.tsx @@ -224,6 +224,9 @@ export const Intro: CustomizeStoreComponent = ( { sendEvent, context } ) => { setOpenDesignChangeWarningModal={ setOpenDesignChangeWarningModal } + redirectToCYSFlow={ () => + sendEvent( 'DESIGN_WITHOUT_AI' ) + } sendEvent={ sendEvent } /> diff --git a/plugins/woocommerce-admin/client/customize-store/intro/intro-banners.tsx b/plugins/woocommerce-admin/client/customize-store/intro/intro-banners.tsx index 519901d64ff6..29a632ad068c 100644 --- a/plugins/woocommerce-admin/client/customize-store/intro/intro-banners.tsx +++ b/plugins/woocommerce-admin/client/customize-store/intro/intro-banners.tsx @@ -219,7 +219,11 @@ export const ThemeHasModsBanner = ( { ); }; -export const NoAIBanner = () => { +export const NoAIBanner = ( { + redirectToCYSFlow, +}: { + redirectToCYSFlow: () => void; +} ) => { const [ isModalOpen, setIsModalOpen ] = useState( false ); interface Theme { stylesheet?: string; @@ -249,7 +253,7 @@ export const NoAIBanner = () => { if ( ! isDefaultTheme ) { setIsModalOpen( true ); } else { - window.location.href = customizeStoreDesignUrl; + redirectToCYSFlow(); } } } showAIDisclaimer={ false } diff --git a/plugins/woocommerce-admin/client/marketplace/components/product-list-content/product-list-content.tsx b/plugins/woocommerce-admin/client/marketplace/components/product-list-content/product-list-content.tsx index eeb8e7a25c28..fa9d868d6285 100644 --- a/plugins/woocommerce-admin/client/marketplace/components/product-list-content/product-list-content.tsx +++ b/plugins/woocommerce-admin/client/marketplace/components/product-list-content/product-list-content.tsx @@ -21,6 +21,7 @@ import { Product, ProductType } from '../product-list/types'; import { appendURLParams } from '../../utils/functions'; import { ADMIN_URL, getAdminSetting } from '~/utils/admin-settings'; import { NoAIBanner } from '~/customize-store/intro/intro-banners'; +import { addQueryArgs } from '@wordpress/url'; export default function ProductListContent( props: { products: Product[]; @@ -119,7 +120,22 @@ export default function ProductListContent( props: { } ), } } /> - { index === bannerPosition && } + { index === bannerPosition && ( + { + const customizeStoreDesignUrl = + addQueryArgs( + `${ ADMIN_URL }admin.php`, + { + page: 'wc-admin', + path: '/customize-store/design', + } + ); + window.location.href = + customizeStoreDesignUrl; + } } + /> + ) } ) ) } From cb2ff932f498dd10e8b5a439c0c01fa18bd65c44 Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 14 Mar 2024 13:14:15 +0000 Subject: [PATCH 2/4] Add changefile(s) from automation for the following project(s): woocommerce --- ...reen-visible-for-a-moment-after-clicking-start-designing-1 | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 plugins/woocommerce/changelog/45586-45542-cys-core-wp-admin-screen-visible-for-a-moment-after-clicking-start-designing-1 diff --git a/plugins/woocommerce/changelog/45586-45542-cys-core-wp-admin-screen-visible-for-a-moment-after-clicking-start-designing-1 b/plugins/woocommerce/changelog/45586-45542-cys-core-wp-admin-screen-visible-for-a-moment-after-clicking-start-designing-1 new file mode 100644 index 000000000000..a90b6dac65b8 --- /dev/null +++ b/plugins/woocommerce/changelog/45586-45542-cys-core-wp-admin-screen-visible-for-a-moment-after-clicking-start-designing-1 @@ -0,0 +1,4 @@ +Significance: minor +Type: fix + +CYS - Core: fix wp-admin page visible when click on start designing \ No newline at end of file From 6a547e2d7b94a36f3b5ac590334f69c4b5821d4d Mon Sep 17 00:00:00 2001 From: Luigi Teschio Date: Thu, 14 Mar 2024 16:15:42 +0100 Subject: [PATCH 3/4] not show wp-admin after the click on the dialog button --- .../client/customize-store/intro/intro-banners.tsx | 6 +----- .../client/customize-store/intro/warning-modals.tsx | 6 +++--- .../client/marketplace/components/products/products.tsx | 4 +++- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/plugins/woocommerce-admin/client/customize-store/intro/intro-banners.tsx b/plugins/woocommerce-admin/client/customize-store/intro/intro-banners.tsx index 29a632ad068c..874186c40d9a 100644 --- a/plugins/woocommerce-admin/client/customize-store/intro/intro-banners.tsx +++ b/plugins/woocommerce-admin/client/customize-store/intro/intro-banners.tsx @@ -234,10 +234,6 @@ export const NoAIBanner = ( { }, [] ); const isDefaultTheme = currentTheme?.stylesheet === 'twentytwentyfour'; - const customizeStoreDesignUrl = addQueryArgs( `${ ADMIN_URL }admin.php`, { - page: 'wc-admin', - path: '/customize-store/design', - } ); return ( <> @@ -261,7 +257,7 @@ export const NoAIBanner = ( { { isModalOpen && ( ) } diff --git a/plugins/woocommerce-admin/client/customize-store/intro/warning-modals.tsx b/plugins/woocommerce-admin/client/customize-store/intro/warning-modals.tsx index a6c706e684ea..5369582a73e3 100644 --- a/plugins/woocommerce-admin/client/customize-store/intro/warning-modals.tsx +++ b/plugins/woocommerce-admin/client/customize-store/intro/warning-modals.tsx @@ -197,10 +197,10 @@ export const StartOverWarningModal = ( { export const ThemeSwitchWarningModal = ( { setIsModalOpen, - customizeStoreDesignUrl, + redirectToCYSFlow, }: { setIsModalOpen: ( arg0: boolean ) => void; - customizeStoreDesignUrl: string; + redirectToCYSFlow: () => void; } ) => { return (