mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
PLT-5071: Client side component of Telemetry. (#5516)
This commit is contained in:
@@ -6,6 +6,7 @@ import TeamStore from 'stores/team_store.jsx';
|
||||
import PreferenceStore from 'stores/preference_store.jsx';
|
||||
import * as AsyncClient from 'utils/async_client.jsx';
|
||||
import * as GlobalActions from 'actions/global_actions.jsx';
|
||||
import {trackEvent} from 'actions/diagnostics_actions.jsx';
|
||||
|
||||
import {Constants, Preferences} from 'utils/constants.jsx';
|
||||
|
||||
@@ -31,10 +32,23 @@ export default class TutorialIntroScreens extends React.Component {
|
||||
this.handleNext = this.handleNext.bind(this);
|
||||
this.createScreen = this.createScreen.bind(this);
|
||||
this.createCircles = this.createCircles.bind(this);
|
||||
this.skipTutorial = this.skipTutorial.bind(this);
|
||||
|
||||
this.state = {currentScreen: 0};
|
||||
}
|
||||
handleNext() {
|
||||
switch (this.state.currentScreen) {
|
||||
case 0:
|
||||
trackEvent('tutorial', 'tutorial_screen_1_welcome_to_mattermost_next');
|
||||
break;
|
||||
case 1:
|
||||
trackEvent('tutorial', 'tutorial_screen_2_how_mattermost_works_next');
|
||||
break;
|
||||
case 2:
|
||||
trackEvent('tutorial', 'tutorial_screen_3_youre_all_set_next');
|
||||
break;
|
||||
}
|
||||
|
||||
if (this.state.currentScreen < 2) {
|
||||
this.setState({currentScreen: this.state.currentScreen + 1});
|
||||
return;
|
||||
@@ -53,6 +67,18 @@ export default class TutorialIntroScreens extends React.Component {
|
||||
skipTutorial(e) {
|
||||
e.preventDefault();
|
||||
|
||||
switch (this.state.currentScreen) {
|
||||
case 0:
|
||||
trackEvent('tutorial', 'tutorial_screen_1_welcome_to_mattermost_skip');
|
||||
break;
|
||||
case 1:
|
||||
trackEvent('tutorial', 'tutorial_screen_2_how_mattermost_works_skip');
|
||||
break;
|
||||
case 2:
|
||||
trackEvent('tutorial', 'tutorial_screen_3_youre_all_set_skip');
|
||||
break;
|
||||
}
|
||||
|
||||
AsyncClient.savePreference(
|
||||
Preferences.TUTORIAL_STEP,
|
||||
UserStore.getCurrentId(),
|
||||
|
||||
Reference in New Issue
Block a user