From 97cc0a0d73dcacfefcdff785c802762e2a0a60d6 Mon Sep 17 00:00:00 2001
From: George Goldberg <george@gberg.me>
Date: Fri, 24 Feb 2017 17:34:21 +0000
Subject: PLT-5071: Client side component of Telemetry. (#5516)

---
 webapp/components/user_settings/user_settings_general.jsx | 12 ++++++++++++
 1 file changed, 12 insertions(+)

(limited to 'webapp/components/user_settings/user_settings_general.jsx')

diff --git a/webapp/components/user_settings/user_settings_general.jsx b/webapp/components/user_settings/user_settings_general.jsx
index d79507511..f9c624aa0 100644
--- a/webapp/components/user_settings/user_settings_general.jsx
+++ b/webapp/components/user_settings/user_settings_general.jsx
@@ -16,6 +16,7 @@ import * as Utils from 'utils/utils.jsx';
 
 import {intlShape, injectIntl, defineMessages, FormattedMessage, FormattedHTMLMessage, FormattedDate} from 'react-intl';
 import {updateUser, uploadProfileImage} from 'actions/user_actions.jsx';
+import {trackEvent} from 'actions/diagnostics_actions.jsx';
 
 const holders = defineMessages({
     usernameReserved: {
@@ -127,6 +128,8 @@ class UserSettingsGeneralTab extends React.Component {
 
         user.username = username;
 
+        trackEvent('settings', 'user_settings_update', {field: 'username'});
+
         this.submitUser(user, Constants.UserUpdateEvents.USERNAME, false);
     }
 
@@ -143,6 +146,8 @@ class UserSettingsGeneralTab extends React.Component {
 
         user.nickname = nickname;
 
+        trackEvent('settings', 'user_settings_update', {field: 'username'});
+
         this.submitUser(user, Constants.UserUpdateEvents.NICKNAME, false);
     }
 
@@ -161,6 +166,8 @@ class UserSettingsGeneralTab extends React.Component {
         user.first_name = firstName;
         user.last_name = lastName;
 
+        trackEvent('settings', 'user_settings_update', {field: 'fullname'});
+
         this.submitUser(user, Constants.UserUpdateEvents.FULLNAME, false);
     }
 
@@ -189,6 +196,7 @@ class UserSettingsGeneralTab extends React.Component {
         }
 
         user.email = email;
+        trackEvent('settings', 'user_settings_update', {field: 'email'});
         this.submitUser(user, Constants.UserUpdateEvents.EMAIL, true);
     }
 
@@ -228,6 +236,8 @@ class UserSettingsGeneralTab extends React.Component {
             return;
         }
 
+        trackEvent('settings', 'user_settings_update', {field: 'picture'});
+
         const {formatMessage} = this.props.intl;
         const picture = this.state.picture;
 
@@ -268,6 +278,8 @@ class UserSettingsGeneralTab extends React.Component {
 
         user.position = position;
 
+        trackEvent('settings', 'user_settings_update', {field: 'position'});
+
         this.submitUser(user, Constants.UserUpdateEvents.Position, false);
     }
 
-- 
cgit v1.2.3-1-g7c22

