Skip to content

Commit

Permalink
Merge pull request #22486 from code-dot-org/angular-react-teacher-tab…
Browse files Browse the repository at this point in the history
…-logging

Angular/React teacher tab logging
  • Loading branch information
Erin Peach committed May 18, 2018
2 parents 4059e73 + 2791332 commit 0e8c3c5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
16 changes: 8 additions & 8 deletions apps/src/sites/code.org/pages/public/teacher-dashboard/index.js
Expand Up @@ -415,7 +415,7 @@ function main() {
firehoseClient.putRecord(
{
study: 'teacher-dashboard',
study_group: 'control',
study_group: 'react',
event: 'stats'
}
);
Expand All @@ -441,7 +441,7 @@ function main() {
firehoseClient.putRecord(
{
study: 'teacher-dashboard',
study_group: 'control',
study_group: 'react',
event: 'manage'
}
);
Expand Down Expand Up @@ -656,7 +656,7 @@ function main() {
firehoseClient.putRecord(
{
study: 'teacher-dashboard',
study_group: 'control',
study_group: 'react',
event: 'projects'
}
);
Expand Down Expand Up @@ -700,7 +700,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 @@ -737,7 +737,7 @@ function main() {
firehoseClient.putRecord(
{
study: 'teacher-dashboard',
study_group: 'control',
study_group: 'angular',
event: 'progress-detailed'
}
);
Expand All @@ -749,7 +749,7 @@ function main() {
firehoseClient.putRecord(
{
study: 'teacher-dashboard',
study_group: 'control',
study_group: 'angular',
event: 'progress-summary'
}
);
Expand Down Expand Up @@ -897,7 +897,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 @@ -987,7 +987,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

0 comments on commit 0e8c3c5

Please sign in to comment.