[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 <github-actions@github.com>
This commit is contained in:
Alba Rincón 2024-03-20 10:51:33 +01:00 committed by GitHub
parent 28f79b4ebe
commit 211d39d453
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 0 deletions

View File

@ -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;
}

View File

@ -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.