From 211d39d45329fe204ff09f6ebf0e54d786a77e86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alba=20Rinc=C3=B3n?= Date: Wed, 20 Mar 2024 10:51:33 +0100 Subject: [PATCH] [CYS] Go to the assembler when the cys task is completed (#45713) * Show modal when the task is completed * Go to the assembler when the theme was already customized * Add changefile(s) from automation for the following project(s): woocommerce * Fix lint error --------- Co-authored-by: github-actions --- .../marketplace/components/products/products.tsx | 11 +++++++++++ .../changelog/45713-show-modal-when-cys-task-complete | 4 ++++ 2 files changed, 15 insertions(+) create mode 100644 plugins/woocommerce/changelog/45713-show-modal-when-cys-task-complete diff --git a/plugins/woocommerce-admin/client/marketplace/components/products/products.tsx b/plugins/woocommerce-admin/client/marketplace/components/products/products.tsx index 3b23df17cab..dc704b3d1de 100644 --- a/plugins/woocommerce-admin/client/marketplace/components/products/products.tsx +++ b/plugins/woocommerce-admin/client/marketplace/components/products/products.tsx @@ -12,6 +12,7 @@ import { Button } from '@wordpress/components'; import classnames from 'classnames'; import { addQueryArgs } from '@wordpress/url'; import { useSelect } from '@wordpress/data'; +import { ONBOARDING_STORE_NAME } from '@woocommerce/data'; /** * Internal dependencies @@ -68,6 +69,14 @@ export default function Products( props: ProductsProps ) { page: 'wc-admin', path: '/customize-store/design', } ); + const assemblerHubUrl = addQueryArgs( `${ ADMIN_URL }admin.php`, { + page: 'wc-admin', + path: '/customize-store/assembler-hub', + } ); + + const customizeStoreTask = useSelect( ( select ) => { + return select( ONBOARDING_STORE_NAME ).getTask( 'customize-store' ); + }, [] ); // Only show the "View all" button when on search but not showing a specific section of results. const showAllButton = props.showAllButton ?? false; @@ -155,6 +164,8 @@ export default function Products( props: ProductsProps ) { onClick={ () => { if ( ! isDefaultTheme ) { setIsModalOpen( true ); + } else if ( customizeStoreTask?.isComplete ) { + window.location.href = assemblerHubUrl; } else { window.location.href = customizeStoreDesignUrl; } diff --git a/plugins/woocommerce/changelog/45713-show-modal-when-cys-task-complete b/plugins/woocommerce/changelog/45713-show-modal-when-cys-task-complete new file mode 100644 index 00000000000..c11ad46bbd2 --- /dev/null +++ b/plugins/woocommerce/changelog/45713-show-modal-when-cys-task-complete @@ -0,0 +1,4 @@ +Significance: minor +Type: fix + +CYS - Go to the assembler when clicking to the "Design you own" button if the theme was already customized in the assembler. \ No newline at end of file