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

Angular/React teacher tab logging #22486

Merged
merged 3 commits into from May 18, 2018
Merged
Show file tree
Hide file tree
Changes from 2 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
16 changes: 8 additions & 8 deletions apps/src/sites/code.org/pages/public/teacher-dashboard/index.js
Expand Up @@ -410,7 +410,7 @@ function main() {
firehoseClient.putRecord(
{
study: 'teacher-dashboard',
study_group: 'control',
study_group: experiments.isEnabled(experiments.TEACHER_EXP_2018) ? 'react' : 'angular',
event: 'stats'
}
);
Expand All @@ -436,7 +436,7 @@ function main() {
firehoseClient.putRecord(
{
study: 'teacher-dashboard',
study_group: 'control',
study_group: experiments.isEnabled(experiments.TEACHER_EXP_2018) ? 'react' : 'angular',
event: 'manage'
}
);
Expand Down Expand Up @@ -651,7 +651,7 @@ function main() {
firehoseClient.putRecord(
{
study: 'teacher-dashboard',
study_group: 'control',
study_group: experiments.isEnabled(experiments.TEACHER_EXP_2018) ? 'react' : 'angular',
event: 'projects'
}
);
Expand Down Expand Up @@ -695,7 +695,7 @@ function main() {
firehoseClient.putRecord(
{
study: 'teacher-dashboard',
study_group: 'control',
study_group: experiments.isEnabled(experiments.TEACHER_EXP_2018) ? 'react' : 'angular',
event: 'progress-summary'
}
);
Expand Down Expand Up @@ -732,7 +732,7 @@ function main() {
firehoseClient.putRecord(
{
study: 'teacher-dashboard',
study_group: 'control',
study_group: experiments.isEnabled(experiments.TEACHER_EXP_2018) ? 'react' : 'angular',
event: 'progress-detailed'
}
);
Expand All @@ -744,7 +744,7 @@ function main() {
firehoseClient.putRecord(
{
study: 'teacher-dashboard',
study_group: 'control',
study_group: experiments.isEnabled(experiments.TEACHER_EXP_2018) ? 'react' : 'angular',
event: 'progress-summary'
}
);
Expand Down Expand Up @@ -892,7 +892,7 @@ function main() {
firehoseClient.putRecord(
{
study: 'teacher-dashboard',
study_group: 'control',
study_group: experiments.isEnabled(experiments.TEACHER_EXP_2018) ? 'react' : 'angular',
event: 'text-responses'
}
);
Expand Down Expand Up @@ -982,7 +982,7 @@ function main() {
firehoseClient.putRecord(
{
study: 'teacher-dashboard',
study_group: 'control',
study_group: experiments.isEnabled(experiments.TEACHER_EXP_2018) ? 'react' : 'angular',
event: 'assessments'
}
);
Expand Down
15 changes: 15 additions & 0 deletions apps/src/templates/sectionProgress/SectionProgressToggle.jsx
Expand Up @@ -4,6 +4,7 @@ import color from "@cdo/apps/util/color";
import FontAwesome from '@cdo/apps/templates/FontAwesome';
import { connect } from 'react-redux';
import {setCurrentView, ViewType} from './sectionProgressRedux';
import firehoseClient from '@cdo/apps/lib/util/firehose';

const styles = {
toggleButton: {
Expand Down Expand Up @@ -40,12 +41,26 @@ class SectionProgressToggle extends React.Component {
// Timeouts forces a render of the local state before dispatching
// the action.
if (this.state.selectedToggle === ViewType.SUMMARY) {
firehoseClient.putRecord(
{
study: 'teacher-dashboard',
study_group: 'react',
event: 'progress-detail'
}
);
this.setState({selectedToggle: ViewType.DETAIL}, () => {
setTimeout(() => {
this.props.setCurrentView(ViewType.DETAIL);
}, 0);
});
} else {
firehoseClient.putRecord(
{
study: 'teacher-dashboard',
study_group: 'react',
event: 'progress-summary'
}
);
this.setState({selectedToggle: ViewType.SUMMARY}, () => {
setTimeout(() => {
this.props.setCurrentView(ViewType.SUMMARY);
Expand Down