Skip to content

Commit

Permalink
Merge pull request #43500 from code-dot-org/nov9-remove-experiment
Browse files Browse the repository at this point in the history
[HOC] Remove Costume tab experiment
  • Loading branch information
ajpal committed Nov 10, 2021
2 parents c381256 + ea30e52 commit 6598769
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 48 deletions.
23 changes: 2 additions & 21 deletions apps/src/p5lab/P5LabVisualizationHeader.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/** @file Row of controls above the visualization. */
import PropTypes from 'prop-types';
import React from 'react';
import experiments from '@cdo/apps/util/experiments';
import {changeInterfaceMode} from './actions';
import {Goal, show} from './redux/animationPicker';
import {connect} from 'react-redux';
import {P5LabInterfaceMode, P5LabType} from './constants';
import msg from '@cdo/locale';
Expand All @@ -30,8 +28,7 @@ class P5LabVisualizationHeader extends React.Component {
isBlockly: PropTypes.bool.isRequired,
numAllowedModes: PropTypes.number.isRequired,
isShareView: PropTypes.bool.isRequired,
isReadOnlyWorkspace: PropTypes.bool.isRequired,
openAnimationPicker: PropTypes.func.isRequired
isReadOnlyWorkspace: PropTypes.bool.isRequired
};

changeInterfaceMode = mode => {
Expand Down Expand Up @@ -59,21 +56,6 @@ class P5LabVisualizationHeader extends React.Component {
}

this.props.onInterfaceModeChange(mode);

/*
* User Experiment for costume tab:
* Treatment B: Clicking button switches to the Costume Tab and opens the animation picker modal
* Original (No treatment): Clicking button switches to the Costume Tab (and does not open the modal)
*
* This user experiment will be conducted in November 2021. This code should be removed
* and the behavior should revert to the original behavior by November 11, 2021.
*/
if (
experiments.isEnabled(experiments.COSTUME_TAB_B) &&
mode === P5LabInterfaceMode.ANIMATION
) {
this.props.openAnimationPicker();
}
};

shouldShowPoemSelector() {
Expand Down Expand Up @@ -145,7 +127,6 @@ export default connect(
isReadOnlyWorkspace: state.pageConstants.isReadOnlyWorkspace
}),
dispatch => ({
onInterfaceModeChange: mode => dispatch(changeInterfaceMode(mode)),
openAnimationPicker: () => dispatch(show(Goal.NEW_ANIMATION, true))
onInterfaceModeChange: mode => dispatch(changeInterfaceMode(mode))
})
)(P5LabVisualizationHeader);
29 changes: 4 additions & 25 deletions apps/src/p5lab/spritelab/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import {APP_HEIGHT, P5LabInterfaceMode} from '../constants';
import {TOOLBOX_EDIT_MODE} from '../../constants';
import {animationSourceUrl} from '../redux/animationList';
import {changeInterfaceMode} from '../actions';
import {Goal, show, showBackground} from '../redux/animationPicker';
import {Goal, showBackground} from '../redux/animationPicker';
import i18n from '@cdo/locale';
import experiments from '@cdo/apps/util/experiments';
import spritelabMsg from '@cdo/spritelab/locale';
function animations(areBackgrounds) {
const animationList = getStore().getState().animationList;
Expand Down Expand Up @@ -178,17 +177,6 @@ const customInputTypes = {
costumePicker: {
addInput(blockly, block, inputConfig, currentInputRow) {
let buttons;
/*
* A/B/C experiment for costume tab:
* Treatment A: Clicking button opens the animation picker modal over the codespace
* Treatment B: Clicking button switches to the Costume Tab and opens the animation picker modal
* Original (No treatment): Clicking button switches to the Costume Tab (and does not open the modal)
*
* This user experiment will be conducted in November 2021. This code should be removed
* and the behavior should revert to the original behavior by November 11, 2021.
*/
const isAEnabled = experiments.isEnabled(experiments.COSTUME_TAB_A);
const isBEnabled = experiments.isEnabled(experiments.COSTUME_TAB_B);
if (
getStore().getState().pageConstants &&
getStore().getState().pageConstants.showAnimationMode
Expand All @@ -197,18 +185,9 @@ const customInputTypes = {
{
text: i18n.costumeMode(),
action: () => {
if (isAEnabled) {
getStore().dispatch(show(Goal.NEW_ANIMATION, true));
} else if (isBEnabled) {
getStore().dispatch(
changeInterfaceMode(P5LabInterfaceMode.ANIMATION)
);
getStore().dispatch(show(Goal.NEW_ANIMATION, true));
} else {
getStore().dispatch(
changeInterfaceMode(P5LabInterfaceMode.ANIMATION)
);
}
getStore().dispatch(
changeInterfaceMode(P5LabInterfaceMode.ANIMATION)
);
}
}
];
Expand Down
2 changes: 0 additions & 2 deletions apps/src/util/experiments.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ experiments.OPT_IN_EMAIL_REG_PARTNER = 'optInEmailRegPartner';
experiments.MULTISELECT = 'multiselect';
experiments.CODE_REVIEW_GROUPS = 'codeReviewGroups';
experiments.JAVALAB_UNIT_TESTS = 'javalabUnitTests';
experiments.COSTUME_TAB_A = 'costumeTabA';
experiments.COSTUME_TAB_B = 'costumeTabB';
experiments.P5LAB_TEACHER_UPLOAD = 'p5labTeacherUpload';

/**
Expand Down

0 comments on commit 6598769

Please sign in to comment.