Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy the stacked layout in the Products Task experiment #35611

Merged
merged 3 commits into from Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -2,25 +2,12 @@
* External dependencies
*/
import { useState, useEffect } from '@wordpress/element';
import { loadExperimentAssignment } from '@woocommerce/explat';

type Layout = 'control' | 'card' | 'stacked';

export const getProductLayoutExperiment = async (): Promise< Layout > => {
const [ cardAssignment, stackedAssignment ] = await Promise.all( [
loadExperimentAssignment( `woocommerce_products_task_layout_card_v3` ),
loadExperimentAssignment(
`woocommerce_products_task_layout_stacked_v3`
),
] );
// This logic may look flawed as in both looks like they can be assigned treatment at the same time,
// but in backend we segment the experiments by store country, so it will never be.
if ( cardAssignment?.variationName === 'treatment' ) {
return 'card';
} else if ( stackedAssignment?.variationName === 'treatment' ) {
return 'stacked';
}
return 'control';
// Deploy the stacked layout. Todo: cleanup the experiment code.
return 'stacked';
};

export const isProductTaskExperimentTreatment =
Expand Down
@@ -0,0 +1,4 @@
Significance: minor
Type: update

Update products task list UI