Merge pull request #32928 from woocommerce/update/32911-remove-explat-calls-for-headercard-exp
Remove ExPlat calls for woocommerce_tasklist_progression_headercard experiments
This commit is contained in:
commit
d3ef624ab9
|
@ -35,11 +35,9 @@ import { TasksPlaceholder } from '../tasks';
|
|||
import {
|
||||
WELCOME_MODAL_DISMISSED_OPTION_NAME,
|
||||
WELCOME_FROM_CALYPSO_MODAL_DISMISSED_OPTION_NAME,
|
||||
WOOCOMMERCE_ADMIN_INSTALL_TIMESTAMP_OPTION_NAME,
|
||||
} from './constants';
|
||||
import { WelcomeFromCalypsoModal } from './welcome-from-calypso-modal';
|
||||
import { WelcomeModal } from './welcome-modal';
|
||||
import { useHeadercardExperimentHook } from './hooks/use-headercard-experiment-hook';
|
||||
import './style.scss';
|
||||
import '../dashboard/style.scss';
|
||||
import { getAdminSetting } from '~/utils/admin-settings';
|
||||
|
@ -70,8 +68,6 @@ export const Layout = ( {
|
|||
shouldShowWelcomeFromCalypsoModal,
|
||||
isTaskListHidden,
|
||||
updateOptions,
|
||||
installTimestamp,
|
||||
installTimestampHasResolved,
|
||||
} ) => {
|
||||
const userPrefs = useUserPreferences();
|
||||
const shouldShowStoreLinks = taskListComplete || isTaskListHidden;
|
||||
|
@ -79,15 +75,18 @@ export const Layout = ( {
|
|||
shouldShowStoreLinks || window.wcAdminFeatures.analytics;
|
||||
const [ showInbox, setShowInbox ] = useState( true );
|
||||
const isDashboardShown = ! query.task;
|
||||
|
||||
const {
|
||||
isLoadingExperimentAssignment,
|
||||
isLoadingTwoColExperimentAssignment,
|
||||
experimentAssignment,
|
||||
twoColExperimentAssignment,
|
||||
} = useHeadercardExperimentHook(
|
||||
installTimestampHasResolved,
|
||||
installTimestamp
|
||||
);
|
||||
} = {
|
||||
isLoadingExperimentAssignment: false,
|
||||
isLoadingTwoColExperimentAssignment: false,
|
||||
experimentAssignment: null,
|
||||
twoColExperimentAssignment: null,
|
||||
};
|
||||
|
||||
const isRunningTwoColumnExperiment =
|
||||
twoColExperimentAssignment?.variationName === 'treatment';
|
||||
|
@ -317,20 +316,11 @@ export default compose(
|
|||
const welcomeModalDismissed =
|
||||
getOption( WELCOME_MODAL_DISMISSED_OPTION_NAME ) !== 'no';
|
||||
|
||||
const installTimestamp = getOption(
|
||||
WOOCOMMERCE_ADMIN_INSTALL_TIMESTAMP_OPTION_NAME
|
||||
);
|
||||
|
||||
const welcomeModalDismissedHasResolved = hasFinishedResolution(
|
||||
'getOption',
|
||||
[ WELCOME_MODAL_DISMISSED_OPTION_NAME ]
|
||||
);
|
||||
|
||||
const installTimestampHasResolved = hasFinishedResolution(
|
||||
'getOption',
|
||||
[ WOOCOMMERCE_ADMIN_INSTALL_TIMESTAMP_OPTION_NAME ]
|
||||
);
|
||||
|
||||
const shouldShowWelcomeModal =
|
||||
welcomeModalDismissedHasResolved &&
|
||||
! welcomeModalDismissed &&
|
||||
|
@ -353,8 +343,6 @@ export default compose(
|
|||
( list ) => list.isVisible && list.displayProgressHeader
|
||||
),
|
||||
taskListComplete: getTaskList( 'setup' )?.isComplete,
|
||||
installTimestamp,
|
||||
installTimestampHasResolved,
|
||||
};
|
||||
} ),
|
||||
withDispatch( ( dispatch ) => ( {
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: update
|
||||
|
||||
Remove ExPlat calls for woocommerce_tasklist_progression_headercard_2col_2022_05 and woocommerce_tasklist_progression_headercard_2022_05
|
|
@ -267,12 +267,6 @@ class Notes extends \WC_REST_CRUD_Controller {
|
|||
$args['orderby'] = 'date_created';
|
||||
}
|
||||
|
||||
// Hide selected notes for users not in experiment.
|
||||
$is_tasklist_experiment_assigned_treatment = $this->is_tasklist_experiment_assigned_treatment();
|
||||
if ( false === $is_tasklist_experiment_assigned_treatment ) {
|
||||
$args['excluded_name'] = array( 'wc-admin-complete-store-details', 'wc-admin-update-store-details' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter the query arguments for a request.
|
||||
*
|
||||
|
@ -281,6 +275,7 @@ class Notes extends \WC_REST_CRUD_Controller {
|
|||
*
|
||||
* @param array $args Key value array of query var to query value.
|
||||
* @param WP_REST_Request $request The request used.
|
||||
* @since 3.9.0
|
||||
*/
|
||||
$args = apply_filters( 'woocommerce_rest_notes_object_query', $args, $request );
|
||||
|
||||
|
@ -606,6 +601,7 @@ class Notes extends \WC_REST_CRUD_Controller {
|
|||
* @param WP_REST_Response $response The response object.
|
||||
* @param array $data The original note.
|
||||
* @param WP_REST_Request $request Request used to generate the response.
|
||||
* @since 3.9.0
|
||||
*/
|
||||
return apply_filters( 'woocommerce_rest_prepare_note', $response, $data, $request );
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ class WC_Admin_Tests_API_Admin_Notes extends WC_REST_Unit_Test_Case {
|
|||
// Create a new note containing an action with a nonce.
|
||||
$note = new \Automattic\WooCommerce\Admin\Notes\Note();
|
||||
$note->set_name( 'nonce-note' );
|
||||
$note->add_action( 'learn-more', __( 'Learn More', 'woocommerce-admin' ), 'https://woocommerce.com/', 'unactioned' );
|
||||
$note->add_action( 'learn-more', __( 'Learn More', 'woocommerce' ), 'https://woocommerce.com/', 'unactioned' );
|
||||
$note->add_nonce_to_action( 'learn-more', 'foo', 'bar' );
|
||||
$note->save();
|
||||
|
||||
|
@ -121,7 +121,7 @@ class WC_Admin_Tests_API_Admin_Notes extends WC_REST_Unit_Test_Case {
|
|||
// Create a new note containing an action with a nonce.
|
||||
$note = new \Automattic\WooCommerce\Admin\Notes\Note();
|
||||
$note->set_name( 'nonce-note' );
|
||||
$note->add_action( 'learn-more', __( 'Learn More', 'woocommerce-admin' ), 'https://example.com/?x=1&y=2', 'unactioned' );
|
||||
$note->add_action( 'learn-more', __( 'Learn More', 'woocommerce' ), 'https://example.com/?x=1&y=2', 'unactioned' );
|
||||
$note->add_nonce_to_action( 'learn-more', 'foo', 'bar' );
|
||||
$note->save();
|
||||
|
||||
|
@ -257,10 +257,10 @@ class WC_Admin_Tests_API_Admin_Notes extends WC_REST_Unit_Test_Case {
|
|||
|
||||
/**
|
||||
* Test getting notes when the user is not in tasklist experiment excludes two notes.
|
||||
*
|
||||
* @since 3.5.0
|
||||
*/
|
||||
public function test_getting_notes_when_user_is_not_in_tasklist_experiment_excludes_two_notes() {
|
||||
$this->markTestSkipped( 'We are disabling the experiments for now.' );
|
||||
// Given.
|
||||
wp_set_current_user( $this->user );
|
||||
WC_Helper_Admin_Notes::reset_notes_dbs();
|
||||
|
|
Loading…
Reference in New Issue