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

Revert "Revert "Manage Students: remove showShareColumn experiment flag"" #21769

Merged
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
4 changes: 1 addition & 3 deletions apps/src/templates/manageStudents/ManageStudentsAgeCell.jsx
Expand Up @@ -12,15 +12,13 @@ class ManageStudentAgeCell extends Component {
// Provided by redux
editStudent: PropTypes.func.isRequired,
setSharingDefault: PropTypes.func.isRequired,
// TODO (ErinB) Remove when we remove the experiment flag.
shareColumnExperimentEnabled: PropTypes.bool
};

// For privacy reasons, we disable sharing by default if the student is
// under the age of 13 if the age was previously not set.
onChangeAge = (e) => {
this.props.editStudent(this.props.id, {age: e.target.value});
if (this.props.age === '' && this.props.shareColumnExperimentEnabled) {
if (this.props.age === '') {
this.props.setSharingDefault(this.props.id);
}
};
Expand Down
14 changes: 4 additions & 10 deletions apps/src/templates/manageStudents/ManageStudentsTable.jsx
Expand Up @@ -20,9 +20,6 @@ import { connect } from 'react-redux';
import Notification, {NotificationType} from '../Notification';
import AddMultipleStudents from './AddMultipleStudents';
import Button from '../Button';
import experiments from '@cdo/apps/util/experiments';

const showShareColumn = experiments.isEnabled(experiments.SHARE_COLUMN);

const styles = {
headerName: {
Expand Down Expand Up @@ -154,7 +151,6 @@ class ManageStudentsTable extends Component {
id={rowData.id}
isEditing={rowData.isEditing}
editedValue={editedValue}
shareColumnExperimentEnabled={showShareColumn}
/>
);
};
Expand Down Expand Up @@ -218,12 +214,10 @@ class ManageStudentsTable extends Component {
{i18n.actions()}
</div>
<div style={styles.headerIcon}>
{showShareColumn &&
<ManageStudentsActionsHeaderCell
editAll={this.props.editAll}
isShareColumnVisible={this.props.showSharingColumn}
/>
}
<ManageStudentsActionsHeaderCell
editAll={this.props.editAll}
isShareColumnVisible={this.props.showSharingColumn}
/>
</div>
</span>
}
Expand Down
5 changes: 1 addition & 4 deletions apps/src/templates/teacherDashboard/sections.js
Expand Up @@ -18,7 +18,6 @@ import LoginTypeParagraph from '@cdo/apps/templates/teacherDashboard/LoginTypePa
import SectionsSharingButton from '@cdo/apps/templates/teacherDashboard/SectionsSharingButton';
import ManageStudentsTable from '@cdo/apps/templates/manageStudents/ManageStudentsTable';
import isRtl from '@cdo/apps/code-studio/isRtlRedux';
import experiments from '@cdo/apps/util/experiments';

/**
* On the manage students tab of an oauth section, use React to render a button
Expand Down Expand Up @@ -86,11 +85,9 @@ export function renderSectionTable(sectionId, loginType, courseName) {
store.dispatch(setLoginType(loginType));
store.dispatch(setSectionId(sectionId));

const showShareColumn = experiments.isEnabled(experiments.SHARE_COLUMN);

// Show share column by default for CSD and CSP courses
const coursesToShowShareSetting = ['csd', 'csp'];
if (showShareColumn && coursesToShowShareSetting.includes(courseName)) {
if (coursesToShowShareSetting.includes(courseName)) {
store.dispatch(toggleSharingColumn());
}

Expand Down
1 change: 0 additions & 1 deletion apps/src/util/experiments.js
Expand Up @@ -15,7 +15,6 @@ const STORAGE_KEY = 'experimentsList';
const GA_EVENT = 'experiments';
const EXPERIMENT_LIFESPAN_HOURS = 12;

experiments.SHARE_COLUMN = 'shareColumn';
/**
* Get our query string. Provided as a method so that tests can mock this.
*/
Expand Down
Expand Up @@ -73,7 +73,6 @@ describe('ManageStudentAgeCell', () => {
isEditing={true}
editStudent={editStudent}
setSharingDefault={setSharingDefault}
shareColumnExperimentEnabled={true}
/>
);
expect(editStudent.callCount).to.equal(0);
Expand Down