PLT-5071: Client side component of Telemetry. (#5516)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
f182d196ff
Коммит
97cc0a0d73
@@ -1,12 +0,0 @@
|
|||||||
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
|
|
||||||
// See License.txt for license information.
|
|
||||||
|
|
||||||
import Client from 'client/web_client.jsx';
|
|
||||||
|
|
||||||
export function track(category, action, label, property, value) {
|
|
||||||
Client.track(category, action, label, property, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function trackPage() {
|
|
||||||
Client.trackPage();
|
|
||||||
}
|
|
||||||
@@ -10,6 +10,7 @@ import * as ChannelUtils from 'utils/channel_utils.jsx';
|
|||||||
import PreferenceStore from 'stores/preference_store.jsx';
|
import PreferenceStore from 'stores/preference_store.jsx';
|
||||||
|
|
||||||
import {loadProfilesAndTeamMembersForDMSidebar} from 'actions/user_actions.jsx';
|
import {loadProfilesAndTeamMembersForDMSidebar} from 'actions/user_actions.jsx';
|
||||||
|
import {trackEvent} from 'actions/diagnostics_actions.jsx';
|
||||||
|
|
||||||
import Client from 'client/web_client.jsx';
|
import Client from 'client/web_client.jsx';
|
||||||
import * as AsyncClient from 'utils/async_client.jsx';
|
import * as AsyncClient from 'utils/async_client.jsx';
|
||||||
@@ -171,6 +172,7 @@ export function openDirectChannelToUser(user, success, error) {
|
|||||||
const channel = ChannelStore.getByName(channelName);
|
const channel = ChannelStore.getByName(channelName);
|
||||||
|
|
||||||
if (channel) {
|
if (channel) {
|
||||||
|
trackEvent('api', 'api_channels_join_direct');
|
||||||
PreferenceStore.setPreference(Preferences.CATEGORY_DIRECT_CHANNEL_SHOW, user.id, 'true');
|
PreferenceStore.setPreference(Preferences.CATEGORY_DIRECT_CHANNEL_SHOW, user.id, 'true');
|
||||||
loadProfilesAndTeamMembersForDMSidebar();
|
loadProfilesAndTeamMembersForDMSidebar();
|
||||||
|
|
||||||
@@ -224,10 +226,12 @@ export function openDirectChannelToUser(user, success, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function markFavorite(channelId) {
|
export function markFavorite(channelId) {
|
||||||
|
trackEvent('api', 'api_channels_favorited');
|
||||||
AsyncClient.savePreference(Preferences.CATEGORY_FAVORITE_CHANNEL, channelId, 'true');
|
AsyncClient.savePreference(Preferences.CATEGORY_FAVORITE_CHANNEL, channelId, 'true');
|
||||||
}
|
}
|
||||||
|
|
||||||
export function unmarkFavorite(channelId) {
|
export function unmarkFavorite(channelId) {
|
||||||
|
trackEvent('api', 'api_channels_unfavorited');
|
||||||
const pref = {
|
const pref = {
|
||||||
user_id: UserStore.getCurrentId(),
|
user_id: UserStore.getCurrentId(),
|
||||||
category: Preferences.CATEGORY_FAVORITE_CHANNEL,
|
category: Preferences.CATEGORY_FAVORITE_CHANNEL,
|
||||||
|
|||||||
8
webapp/actions/diagnostics_actions.jsx
Обычный файл
8
webapp/actions/diagnostics_actions.jsx
Обычный файл
@@ -0,0 +1,8 @@
|
|||||||
|
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
|
||||||
|
// See License.txt for license information.
|
||||||
|
|
||||||
|
import Client from 'client/web_client.jsx';
|
||||||
|
|
||||||
|
export function trackEvent(category, event, properties) {
|
||||||
|
Client.trackEvent(category, event, properties);
|
||||||
|
}
|
||||||
@@ -17,6 +17,7 @@ import {loadProfilesAndTeamMembersForDMSidebar} from 'actions/user_actions.jsx';
|
|||||||
import {loadChannelsForCurrentUser} from 'actions/channel_actions.jsx';
|
import {loadChannelsForCurrentUser} from 'actions/channel_actions.jsx';
|
||||||
import {stopPeriodicStatusUpdates} from 'actions/status_actions.jsx';
|
import {stopPeriodicStatusUpdates} from 'actions/status_actions.jsx';
|
||||||
import * as WebsocketActions from 'actions/websocket_actions.jsx';
|
import * as WebsocketActions from 'actions/websocket_actions.jsx';
|
||||||
|
import {trackEvent} from 'actions/diagnostics_actions.jsx';
|
||||||
|
|
||||||
import Constants from 'utils/constants.jsx';
|
import Constants from 'utils/constants.jsx';
|
||||||
const ActionTypes = Constants.ActionTypes;
|
const ActionTypes = Constants.ActionTypes;
|
||||||
@@ -28,7 +29,6 @@ import * as Utils from 'utils/utils.jsx';
|
|||||||
|
|
||||||
import en from 'i18n/en.json';
|
import en from 'i18n/en.json';
|
||||||
import * as I18n from 'i18n/i18n.jsx';
|
import * as I18n from 'i18n/i18n.jsx';
|
||||||
import {trackPage} from 'actions/analytics_actions.jsx';
|
|
||||||
import {browserHistory} from 'react-router/es6';
|
import {browserHistory} from 'react-router/es6';
|
||||||
|
|
||||||
export function emitChannelClickEvent(channel) {
|
export function emitChannelClickEvent(channel) {
|
||||||
@@ -53,7 +53,6 @@ export function emitChannelClickEvent(channel) {
|
|||||||
AsyncClient.getChannelStats(chan.id, true);
|
AsyncClient.getChannelStats(chan.id, true);
|
||||||
AsyncClient.viewChannel(chan.id, oldChannelId);
|
AsyncClient.viewChannel(chan.id, oldChannelId);
|
||||||
loadPosts(chan.id);
|
loadPosts(chan.id);
|
||||||
trackPage();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Mark previous and next channel as read
|
// Mark previous and next channel as read
|
||||||
@@ -94,6 +93,10 @@ export function emitInitialLoad(callback) {
|
|||||||
global.window.mm_config = data.client_cfg;
|
global.window.mm_config = data.client_cfg;
|
||||||
global.window.mm_license = data.license_cfg;
|
global.window.mm_license = data.license_cfg;
|
||||||
|
|
||||||
|
if (global.window && global.window.analytics) {
|
||||||
|
global.window.analytics.identify(global.window.mm_config.DiagnosticId);
|
||||||
|
}
|
||||||
|
|
||||||
UserStore.setNoAccounts(data.no_accounts);
|
UserStore.setNoAccounts(data.no_accounts);
|
||||||
|
|
||||||
if (data.user && data.user.id) {
|
if (data.user && data.user.id) {
|
||||||
@@ -515,6 +518,8 @@ export function emitSearchMentionsEvent(user) {
|
|||||||
terms = termKeys.join(' ');
|
terms = termKeys.join(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trackEvent('api', 'api_posts_search_mention');
|
||||||
|
|
||||||
AppDispatcher.handleServerAction({
|
AppDispatcher.handleServerAction({
|
||||||
type: ActionTypes.RECEIVED_SEARCH_TERM,
|
type: ActionTypes.RECEIVED_SEARCH_TERM,
|
||||||
term: terms,
|
term: terms,
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import UserStore from 'stores/user_store.jsx';
|
|||||||
|
|
||||||
import {loadStatusesForChannel} from 'actions/status_actions.jsx';
|
import {loadStatusesForChannel} from 'actions/status_actions.jsx';
|
||||||
import {loadNewDMIfNeeded} from 'actions/user_actions.jsx';
|
import {loadNewDMIfNeeded} from 'actions/user_actions.jsx';
|
||||||
|
import {trackEvent} from 'actions/diagnostics_actions.jsx';
|
||||||
|
|
||||||
import Client from 'client/web_client.jsx';
|
import Client from 'client/web_client.jsx';
|
||||||
import * as AsyncClient from 'utils/async_client.jsx';
|
import * as AsyncClient from 'utils/async_client.jsx';
|
||||||
@@ -64,10 +65,12 @@ export function handleNewPost(post, msg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function flagPost(postId) {
|
export function flagPost(postId) {
|
||||||
|
trackEvent('api', 'api_posts_flagged');
|
||||||
AsyncClient.savePreference(Preferences.CATEGORY_FLAGGED_POST, postId, 'true');
|
AsyncClient.savePreference(Preferences.CATEGORY_FLAGGED_POST, postId, 'true');
|
||||||
}
|
}
|
||||||
|
|
||||||
export function unflagPost(postId, success) {
|
export function unflagPost(postId, success) {
|
||||||
|
trackEvent('api', 'api_posts_unflagged');
|
||||||
const pref = {
|
const pref = {
|
||||||
user_id: UserStore.getCurrentId(),
|
user_id: UserStore.getCurrentId(),
|
||||||
category: Preferences.CATEGORY_FLAGGED_POST,
|
category: Preferences.CATEGORY_FLAGGED_POST,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
import Client from './client.jsx';
|
import Client from './client.jsx';
|
||||||
|
|
||||||
import TeamStore from 'stores/team_store.jsx';
|
import TeamStore from 'stores/team_store.jsx';
|
||||||
|
import UserStore from 'stores/user_store.jsx';
|
||||||
import BrowserStore from 'stores/browser_store.jsx';
|
import BrowserStore from 'stores/browser_store.jsx';
|
||||||
|
|
||||||
import * as GlobalActions from 'actions/global_actions.jsx';
|
import * as GlobalActions from 'actions/global_actions.jsx';
|
||||||
@@ -29,16 +30,22 @@ class WebClientClass extends Client {
|
|||||||
onTeamStoreChanged() {
|
onTeamStoreChanged() {
|
||||||
this.setTeamId(TeamStore.getCurrentId());
|
this.setTeamId(TeamStore.getCurrentId());
|
||||||
}
|
}
|
||||||
|
trackEvent(category, event, props) {
|
||||||
track(category, action, label, property, value) {
|
|
||||||
if (global.window && global.window.analytics) {
|
if (global.window && global.window.analytics) {
|
||||||
global.window.analytics.track(action, {category, label, property, value});
|
const properties = Object.assign({category, type: event, user_id: UserStore.getCurrentId()}, props);
|
||||||
}
|
const options = {
|
||||||
}
|
context: {
|
||||||
|
ip: '0.0.0.0'
|
||||||
trackPage() {
|
},
|
||||||
if (global.window && global.window.analytics) {
|
page: {
|
||||||
global.window.analytics.page();
|
path: '',
|
||||||
|
referrer: '',
|
||||||
|
search: '',
|
||||||
|
title: '',
|
||||||
|
url: ''
|
||||||
|
}
|
||||||
|
};
|
||||||
|
global.window.analytics.track('event', properties, options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -74,7 +81,7 @@ class WebClientClass extends Client {
|
|||||||
password,
|
password,
|
||||||
token,
|
token,
|
||||||
(data) => {
|
(data) => {
|
||||||
this.track('api', 'api_users_login_success', '', 'login_id', loginId);
|
this.trackEvent('api', 'api_users_login_success');
|
||||||
BrowserStore.signalLogin();
|
BrowserStore.signalLogin();
|
||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
@@ -82,7 +89,7 @@ class WebClientClass extends Client {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
(err) => {
|
(err) => {
|
||||||
this.track('api', 'api_users_login_fail', '', 'login_id', loginId);
|
this.trackEvent('api', 'api_users_login_fail');
|
||||||
if (error) {
|
if (error) {
|
||||||
error(err);
|
error(err);
|
||||||
}
|
}
|
||||||
@@ -96,7 +103,8 @@ class WebClientClass extends Client {
|
|||||||
password,
|
password,
|
||||||
token,
|
token,
|
||||||
(data) => {
|
(data) => {
|
||||||
this.track('api', 'api_users_login_success', '', 'login_id', loginId);
|
this.trackEvent('api', 'api_users_login_success');
|
||||||
|
this.trackEvent('api', 'api_users_login_ldap_success');
|
||||||
BrowserStore.signalLogin();
|
BrowserStore.signalLogin();
|
||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
@@ -104,7 +112,8 @@ class WebClientClass extends Client {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
(err) => {
|
(err) => {
|
||||||
this.track('api', 'api_users_login_fail', '', 'login_id', loginId);
|
this.trackEvent('api', 'api_users_login_fail');
|
||||||
|
this.trackEvent('api', 'api_users_login_ldap_fail');
|
||||||
if (error) {
|
if (error) {
|
||||||
error(err);
|
error(err);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -144,11 +144,7 @@ export default class Client {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
track(category, action, label, property, value) { // eslint-disable-line no-unused-vars
|
trackEvent(category, event, properties) { // eslint-disable-line no-unused-vars
|
||||||
// NO-OP for inherited classes to override
|
|
||||||
}
|
|
||||||
|
|
||||||
trackPage() {
|
|
||||||
// NO-OP for inherited classes to override
|
// NO-OP for inherited classes to override
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,8 +193,6 @@ export default class Client {
|
|||||||
console.error(e); // eslint-disable-line no-console
|
console.error(e); // eslint-disable-line no-console
|
||||||
}
|
}
|
||||||
|
|
||||||
this.track('api', 'api_weberror', methodName, 'message', msg);
|
|
||||||
|
|
||||||
this.handleError(err, res);
|
this.handleError(err, res);
|
||||||
|
|
||||||
if (errorCallback) {
|
if (errorCallback) {
|
||||||
@@ -425,7 +419,7 @@ export default class Client {
|
|||||||
attach('license', license, license.name).
|
attach('license', license, license.name).
|
||||||
end(this.handleResponse.bind(this, 'uploadLicenseFile', success, error));
|
end(this.handleResponse.bind(this, 'uploadLicenseFile', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_license_upload');
|
this.trackEvent('api', 'api_license_upload');
|
||||||
}
|
}
|
||||||
|
|
||||||
importSlack(fileData, success, error) {
|
importSlack(fileData, success, error) {
|
||||||
@@ -472,7 +466,7 @@ export default class Client {
|
|||||||
send(data).
|
send(data).
|
||||||
end(this.handleResponse.bind(this, 'adminResetPassword', success, error));
|
end(this.handleResponse.bind(this, 'adminResetPassword', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_admin_reset_password');
|
this.trackEvent('api', 'api_admin_reset_password');
|
||||||
}
|
}
|
||||||
|
|
||||||
ldapSyncNow(success, error) {
|
ldapSyncNow(success, error) {
|
||||||
@@ -523,7 +517,7 @@ export default class Client {
|
|||||||
send(team).
|
send(team).
|
||||||
end(this.handleResponse.bind(this, 'createTeam', success, error));
|
end(this.handleResponse.bind(this, 'createTeam', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_users_create', '', 'email', team.name);
|
this.trackEvent('api', 'api_teams_create');
|
||||||
}
|
}
|
||||||
|
|
||||||
updateTeam(team, success, error) {
|
updateTeam(team, success, error) {
|
||||||
@@ -535,7 +529,7 @@ export default class Client {
|
|||||||
send(team).
|
send(team).
|
||||||
end(this.handleResponse.bind(this, 'updateTeam', success, error));
|
end(this.handleResponse.bind(this, 'updateTeam', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_teams_update_name');
|
this.trackEvent('api', 'api_teams_update_name', {team_id: this.getTeamId()});
|
||||||
}
|
}
|
||||||
|
|
||||||
getAllTeams(success, error) {
|
getAllTeams(success, error) {
|
||||||
@@ -635,7 +629,7 @@ export default class Client {
|
|||||||
send(data).
|
send(data).
|
||||||
end(this.handleResponse.bind(this, 'inviteMembers', success, error));
|
end(this.handleResponse.bind(this, 'inviteMembers', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_teams_invite_members');
|
this.trackEvent('api', 'api_teams_invite_members', {team_id: this.getTeamId()});
|
||||||
}
|
}
|
||||||
|
|
||||||
addUserToTeam(teamId, userId, success, error) {
|
addUserToTeam(teamId, userId, success, error) {
|
||||||
@@ -652,7 +646,7 @@ export default class Client {
|
|||||||
send({user_id: userId}).
|
send({user_id: userId}).
|
||||||
end(this.handleResponse.bind(this, 'addUserToTeam', success, error));
|
end(this.handleResponse.bind(this, 'addUserToTeam', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_teams_invite_members');
|
this.trackEvent('api', 'api_teams_invite_members', {team_id: nonEmptyTeamId});
|
||||||
}
|
}
|
||||||
|
|
||||||
addUserToTeamFromInvite(data, hash, inviteId, success, error) {
|
addUserToTeamFromInvite(data, hash, inviteId, success, error) {
|
||||||
@@ -664,7 +658,7 @@ export default class Client {
|
|||||||
send({hash, data, invite_id: inviteId}).
|
send({hash, data, invite_id: inviteId}).
|
||||||
end(this.handleResponse.bind(this, 'addUserToTeam', success, error));
|
end(this.handleResponse.bind(this, 'addUserToTeam', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_teams_invite_members');
|
this.trackEvent('api', 'api_teams_invite_members');
|
||||||
}
|
}
|
||||||
|
|
||||||
removeUserFromTeam(teamId, userId, success, error) {
|
removeUserFromTeam(teamId, userId, success, error) {
|
||||||
@@ -681,7 +675,7 @@ export default class Client {
|
|||||||
send({user_id: userId}).
|
send({user_id: userId}).
|
||||||
end(this.handleResponse.bind(this, 'removeUserFromTeam', success, error));
|
end(this.handleResponse.bind(this, 'removeUserFromTeam', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_teams_remove_members');
|
this.trackEvent('api', 'api_teams_remove_members', {team_id: nonEmptyTeamId});
|
||||||
}
|
}
|
||||||
|
|
||||||
getInviteInfo(inviteId, success, error) {
|
getInviteInfo(inviteId, success, error) {
|
||||||
@@ -713,6 +707,14 @@ export default class Client {
|
|||||||
url += '&iid=' + encodeURIComponent(inviteId);
|
url += '&iid=' + encodeURIComponent(inviteId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (emailHash) {
|
||||||
|
this.trackEvent('api', 'api_users_create_email');
|
||||||
|
} else if (inviteId) {
|
||||||
|
this.trackEvent('api', 'api_users_create_link');
|
||||||
|
} else {
|
||||||
|
this.trackEvent('api', 'api_users_create_spontaneous');
|
||||||
|
}
|
||||||
|
|
||||||
request.
|
request.
|
||||||
post(url).
|
post(url).
|
||||||
set(this.defaultHeaders).
|
set(this.defaultHeaders).
|
||||||
@@ -721,7 +723,7 @@ export default class Client {
|
|||||||
send(user).
|
send(user).
|
||||||
end(this.handleResponse.bind(this, 'createUser', success, error));
|
end(this.handleResponse.bind(this, 'createUser', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_users_create', '', 'email', user.email);
|
this.trackEvent('api', 'api_users_create');
|
||||||
}
|
}
|
||||||
|
|
||||||
updateUser(user, type, success, error) {
|
updateUser(user, type, success, error) {
|
||||||
@@ -734,9 +736,9 @@ export default class Client {
|
|||||||
end(this.handleResponse.bind(this, 'updateUser', success, error));
|
end(this.handleResponse.bind(this, 'updateUser', success, error));
|
||||||
|
|
||||||
if (type) {
|
if (type) {
|
||||||
this.track('api', 'api_users_update_' + type);
|
this.trackEvent('api', 'api_users_update_' + type);
|
||||||
} else {
|
} else {
|
||||||
this.track('api', 'api_users_update');
|
this.trackEvent('api', 'api_users_update');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -754,7 +756,7 @@ export default class Client {
|
|||||||
send(data).
|
send(data).
|
||||||
end(this.handleResponse.bind(this, 'updatePassword', success, error));
|
end(this.handleResponse.bind(this, 'updatePassword', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_users_newpassword');
|
this.trackEvent('api', 'api_users_newpassword');
|
||||||
}
|
}
|
||||||
|
|
||||||
updateUserNotifyProps(notifyProps, success, error) {
|
updateUserNotifyProps(notifyProps, success, error) {
|
||||||
@@ -766,7 +768,7 @@ export default class Client {
|
|||||||
send(notifyProps).
|
send(notifyProps).
|
||||||
end(this.handleResponse.bind(this, 'updateUserNotifyProps', success, error));
|
end(this.handleResponse.bind(this, 'updateUserNotifyProps', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_users_update_notification_settings');
|
this.trackEvent('api', 'api_users_update_notification_settings');
|
||||||
}
|
}
|
||||||
|
|
||||||
updateUserRoles(userId, newRoles, success, error) {
|
updateUserRoles(userId, newRoles, success, error) {
|
||||||
@@ -782,7 +784,7 @@ export default class Client {
|
|||||||
send(data).
|
send(data).
|
||||||
end(this.handleResponse.bind(this, 'updateUserRoles', success, error));
|
end(this.handleResponse.bind(this, 'updateUserRoles', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_users_update_user_roles');
|
this.trackEvent('api', 'api_users_update_roles');
|
||||||
}
|
}
|
||||||
|
|
||||||
updateTeamMemberRoles(teamId, userId, newRoles, success, error) {
|
updateTeamMemberRoles(teamId, userId, newRoles, success, error) {
|
||||||
@@ -799,7 +801,7 @@ export default class Client {
|
|||||||
send(data).
|
send(data).
|
||||||
end(this.handleResponse.bind(this, 'updateTeamMemberRoles', success, error));
|
end(this.handleResponse.bind(this, 'updateTeamMemberRoles', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_teams_update_member_roles');
|
this.trackEvent('api', 'api_teams_update_member_roles', {team_id: teamId});
|
||||||
}
|
}
|
||||||
|
|
||||||
updateActive(userId, active, success, error) {
|
updateActive(userId, active, success, error) {
|
||||||
@@ -815,7 +817,7 @@ export default class Client {
|
|||||||
send(data).
|
send(data).
|
||||||
end(this.handleResponse.bind(this, 'updateActive', success, error));
|
end(this.handleResponse.bind(this, 'updateActive', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_users_update_active');
|
this.trackEvent('api', 'api_users_update_active');
|
||||||
}
|
}
|
||||||
|
|
||||||
sendPasswordReset(email, success, error) {
|
sendPasswordReset(email, success, error) {
|
||||||
@@ -830,7 +832,7 @@ export default class Client {
|
|||||||
send(data).
|
send(data).
|
||||||
end(this.handleResponse.bind(this, 'sendPasswordReset', success, error));
|
end(this.handleResponse.bind(this, 'sendPasswordReset', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_users_send_password_reset');
|
this.trackEvent('api', 'api_users_send_password_reset');
|
||||||
}
|
}
|
||||||
|
|
||||||
resetPassword(code, newPassword, success, error) {
|
resetPassword(code, newPassword, success, error) {
|
||||||
@@ -846,7 +848,7 @@ export default class Client {
|
|||||||
send(data).
|
send(data).
|
||||||
end(this.handleResponse.bind(this, 'resetPassword', success, error));
|
end(this.handleResponse.bind(this, 'resetPassword', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_users_reset_password');
|
this.trackEvent('api', 'api_users_reset_password');
|
||||||
}
|
}
|
||||||
|
|
||||||
emailToOAuth(email, password, token, service, success, error) {
|
emailToOAuth(email, password, token, service, success, error) {
|
||||||
@@ -858,7 +860,7 @@ export default class Client {
|
|||||||
send({password, email, token, service}).
|
send({password, email, token, service}).
|
||||||
end(this.handleResponse.bind(this, 'emailToOAuth', success, error));
|
end(this.handleResponse.bind(this, 'emailToOAuth', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_users_email_to_oauth');
|
this.trackEvent('api', 'api_users_email_to_oauth');
|
||||||
}
|
}
|
||||||
|
|
||||||
oauthToEmail(email, password, success, error) {
|
oauthToEmail(email, password, success, error) {
|
||||||
@@ -874,7 +876,7 @@ export default class Client {
|
|||||||
send(data).
|
send(data).
|
||||||
end(this.handleResponse.bind(this, 'oauthToEmail', success, error));
|
end(this.handleResponse.bind(this, 'oauthToEmail', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_users_oauth_to_email');
|
this.trackEvent('api', 'api_users_oauth_to_email');
|
||||||
}
|
}
|
||||||
|
|
||||||
emailToLdap(email, password, token, ldapId, ldapPassword, success, error) {
|
emailToLdap(email, password, token, ldapId, ldapPassword, success, error) {
|
||||||
@@ -893,7 +895,7 @@ export default class Client {
|
|||||||
send(data).
|
send(data).
|
||||||
end(this.handleResponse.bind(this, 'emailToLdap', success, error));
|
end(this.handleResponse.bind(this, 'emailToLdap', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_users_email_to_ldap');
|
this.trackEvent('api', 'api_users_email_to_ldap');
|
||||||
}
|
}
|
||||||
|
|
||||||
ldapToEmail(email, emailPassword, token, ldapPassword, success, error) {
|
ldapToEmail(email, emailPassword, token, ldapPassword, success, error) {
|
||||||
@@ -911,7 +913,7 @@ export default class Client {
|
|||||||
send(data).
|
send(data).
|
||||||
end(this.handleResponse.bind(this, 'ldapToEmail', success, error));
|
end(this.handleResponse.bind(this, 'ldapToEmail', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_users_oauth_to_email');
|
this.trackEvent('api', 'api_users_ldap_to_email');
|
||||||
}
|
}
|
||||||
|
|
||||||
getInitialLoad(success, error) {
|
getInitialLoad(success, error) {
|
||||||
@@ -962,19 +964,20 @@ export default class Client {
|
|||||||
login(loginId, password, mfaToken, success, error) {
|
login(loginId, password, mfaToken, success, error) {
|
||||||
this.doLogin({login_id: loginId, password, token: mfaToken}, success, error);
|
this.doLogin({login_id: loginId, password, token: mfaToken}, success, error);
|
||||||
|
|
||||||
this.track('api', 'api_users_login', '', 'login_id', loginId);
|
this.trackEvent('api', 'api_users_login');
|
||||||
}
|
}
|
||||||
|
|
||||||
loginById(id, password, mfaToken, success, error) {
|
loginById(id, password, mfaToken, success, error) {
|
||||||
this.doLogin({id, password, token: mfaToken}, success, error);
|
this.doLogin({id, password, token: mfaToken}, success, error);
|
||||||
|
|
||||||
this.track('api', 'api_users_login', '', 'id', id);
|
this.trackEvent('api', 'api_users_login');
|
||||||
}
|
}
|
||||||
|
|
||||||
loginByLdap(loginId, password, mfaToken, success, error) {
|
loginByLdap(loginId, password, mfaToken, success, error) {
|
||||||
this.doLogin({login_id: loginId, password, token: mfaToken, ldap_only: 'true'}, success, error);
|
this.doLogin({login_id: loginId, password, token: mfaToken, ldap_only: 'true'}, success, error);
|
||||||
|
|
||||||
this.track('api', 'api_users_login', '', 'login_id', loginId);
|
this.trackEvent('api', 'api_users_login');
|
||||||
|
this.trackEvent('api', 'api_users_login_ldap');
|
||||||
}
|
}
|
||||||
|
|
||||||
doLogin(outgoingData, success, error) {
|
doLogin(outgoingData, success, error) {
|
||||||
@@ -1014,7 +1017,7 @@ export default class Client {
|
|||||||
accept('application/json').
|
accept('application/json').
|
||||||
end(this.handleResponse.bind(this, 'logout', success, error));
|
end(this.handleResponse.bind(this, 'logout', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_users_logout');
|
this.trackEvent('api', 'api_users_logout');
|
||||||
}
|
}
|
||||||
|
|
||||||
checkMfa(loginId, success, error) {
|
checkMfa(loginId, success, error) {
|
||||||
@@ -1030,7 +1033,7 @@ export default class Client {
|
|||||||
send(data).
|
send(data).
|
||||||
end(this.handleResponse.bind(this, 'checkMfa', success, error));
|
end(this.handleResponse.bind(this, 'checkMfa', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_users_oauth_to_email');
|
this.trackEvent('api', 'api_users_oauth_to_email');
|
||||||
}
|
}
|
||||||
|
|
||||||
generateMfaSecret(success, error) {
|
generateMfaSecret(success, error) {
|
||||||
@@ -1086,6 +1089,8 @@ export default class Client {
|
|||||||
type('application/json').
|
type('application/json').
|
||||||
accept('application/json').
|
accept('application/json').
|
||||||
end(this.handleResponse.bind(this, 'getProfiles', success, error));
|
end(this.handleResponse.bind(this, 'getProfiles', success, error));
|
||||||
|
|
||||||
|
this.trackEvent('api', 'api_profiles_get');
|
||||||
}
|
}
|
||||||
|
|
||||||
getProfilesInTeam(teamId, offset, limit, success, error) {
|
getProfilesInTeam(teamId, offset, limit, success, error) {
|
||||||
@@ -1095,6 +1100,8 @@ export default class Client {
|
|||||||
type('application/json').
|
type('application/json').
|
||||||
accept('application/json').
|
accept('application/json').
|
||||||
end(this.handleResponse.bind(this, 'getProfilesInTeam', success, error));
|
end(this.handleResponse.bind(this, 'getProfilesInTeam', success, error));
|
||||||
|
|
||||||
|
this.trackEvent('api', 'api_profiles_get_in_team', {team_id: teamId});
|
||||||
}
|
}
|
||||||
|
|
||||||
getProfilesInChannel(channelId, offset, limit, success, error) {
|
getProfilesInChannel(channelId, offset, limit, success, error) {
|
||||||
@@ -1104,6 +1111,8 @@ export default class Client {
|
|||||||
type('application/json').
|
type('application/json').
|
||||||
accept('application/json').
|
accept('application/json').
|
||||||
end(this.handleResponse.bind(this, 'getProfilesInChannel', success, error));
|
end(this.handleResponse.bind(this, 'getProfilesInChannel', success, error));
|
||||||
|
|
||||||
|
this.trackEvent('api', 'api_profiles_get_in_channel', {team_id: this.getTeamId(), channel_id: channelId});
|
||||||
}
|
}
|
||||||
|
|
||||||
getProfilesNotInChannel(channelId, offset, limit, success, error) {
|
getProfilesNotInChannel(channelId, offset, limit, success, error) {
|
||||||
@@ -1113,6 +1122,8 @@ export default class Client {
|
|||||||
type('application/json').
|
type('application/json').
|
||||||
accept('application/json').
|
accept('application/json').
|
||||||
end(this.handleResponse.bind(this, 'getProfilesNotInChannel', success, error));
|
end(this.handleResponse.bind(this, 'getProfilesNotInChannel', success, error));
|
||||||
|
|
||||||
|
this.trackEvent('api', 'api_profiles_get_not_in_channel', {team_id: this.getTeamId(), channel_id: channelId});
|
||||||
}
|
}
|
||||||
|
|
||||||
getProfilesByIds(userIds, success, error) {
|
getProfilesByIds(userIds, success, error) {
|
||||||
@@ -1123,6 +1134,8 @@ export default class Client {
|
|||||||
accept('application/json').
|
accept('application/json').
|
||||||
send(userIds).
|
send(userIds).
|
||||||
end(this.handleResponse.bind(this, 'getProfilesByIds', success, error));
|
end(this.handleResponse.bind(this, 'getProfilesByIds', success, error));
|
||||||
|
|
||||||
|
this.trackEvent('api', 'api_profiles_get_by_ids');
|
||||||
}
|
}
|
||||||
|
|
||||||
searchUsers(term, teamId, options, success, error) {
|
searchUsers(term, teamId, options, success, error) {
|
||||||
@@ -1190,6 +1203,8 @@ export default class Client {
|
|||||||
accept('application/json').
|
accept('application/json').
|
||||||
send({channel_id: id}).
|
send({channel_id: id}).
|
||||||
end(this.handleResponse.bind(this, 'setActiveChannel', success, error));
|
end(this.handleResponse.bind(this, 'setActiveChannel', success, error));
|
||||||
|
|
||||||
|
this.trackEvent('api', 'api_channels_set_active', {channel_id: id});
|
||||||
}
|
}
|
||||||
|
|
||||||
verifyEmail(uid, hid, success, error) {
|
verifyEmail(uid, hid, success, error) {
|
||||||
@@ -1234,7 +1249,7 @@ export default class Client {
|
|||||||
accept('application/json').
|
accept('application/json').
|
||||||
end(this.handleResponse.bind(this, 'uploadProfileImage', success, error));
|
end(this.handleResponse.bind(this, 'uploadProfileImage', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_users_update_profile_picture');
|
this.trackEvent('api', 'api_users_update_profile_picture');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Channel Routes Section
|
// Channel Routes Section
|
||||||
@@ -1248,7 +1263,7 @@ export default class Client {
|
|||||||
send(channel).
|
send(channel).
|
||||||
end(this.handleResponse.bind(this, 'createChannel', success, error));
|
end(this.handleResponse.bind(this, 'createChannel', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_channels_create', channel.type, 'name', channel.name);
|
this.trackEvent('api', 'api_channels_create', {team_id: this.getTeamId()});
|
||||||
}
|
}
|
||||||
|
|
||||||
createDirectChannel(userId, success, error) {
|
createDirectChannel(userId, success, error) {
|
||||||
@@ -1259,6 +1274,8 @@ export default class Client {
|
|||||||
accept('application/json').
|
accept('application/json').
|
||||||
send({user_id: userId}).
|
send({user_id: userId}).
|
||||||
end(this.handleResponse.bind(this, 'createDirectChannel', success, error));
|
end(this.handleResponse.bind(this, 'createDirectChannel', success, error));
|
||||||
|
|
||||||
|
this.trackEvent('api', 'api_channels_create_direct', {team_id: this.getTeamId()});
|
||||||
}
|
}
|
||||||
|
|
||||||
updateChannel(channel, success, error) {
|
updateChannel(channel, success, error) {
|
||||||
@@ -1270,7 +1287,7 @@ export default class Client {
|
|||||||
send(channel).
|
send(channel).
|
||||||
end(this.handleResponse.bind(this, 'updateChannel', success, error));
|
end(this.handleResponse.bind(this, 'updateChannel', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_channels_update');
|
this.trackEvent('api', 'api_channels_update', {team_id: this.getTeamId(), channel_id: channel.id});
|
||||||
}
|
}
|
||||||
|
|
||||||
updateChannelHeader(channelId, header, success, error) {
|
updateChannelHeader(channelId, header, success, error) {
|
||||||
@@ -1287,7 +1304,7 @@ export default class Client {
|
|||||||
send(data).
|
send(data).
|
||||||
end(this.handleResponse.bind(this, 'updateChannel', success, error));
|
end(this.handleResponse.bind(this, 'updateChannel', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_channels_header');
|
this.trackEvent('api', 'api_channels_header', {team_id: this.getTeamId(), channel_id: channelId});
|
||||||
}
|
}
|
||||||
|
|
||||||
updateChannelPurpose(channelId, purpose, success, error) {
|
updateChannelPurpose(channelId, purpose, success, error) {
|
||||||
@@ -1304,7 +1321,7 @@ export default class Client {
|
|||||||
send(data).
|
send(data).
|
||||||
end(this.handleResponse.bind(this, 'updateChannelPurpose', success, error));
|
end(this.handleResponse.bind(this, 'updateChannelPurpose', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_channels_purpose');
|
this.trackEvent('api', 'api_channels_purpose', {team_id: this.getTeamId(), channel_id: channelId});
|
||||||
}
|
}
|
||||||
|
|
||||||
updateChannelNotifyProps(data, success, error) {
|
updateChannelNotifyProps(data, success, error) {
|
||||||
@@ -1325,7 +1342,7 @@ export default class Client {
|
|||||||
accept('application/json').
|
accept('application/json').
|
||||||
end(this.handleResponse.bind(this, 'leaveChannel', success, error));
|
end(this.handleResponse.bind(this, 'leaveChannel', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_channels_leave');
|
this.trackEvent('api', 'api_channels_leave', {team_id: this.getTeamId(), channel_id: channelId});
|
||||||
}
|
}
|
||||||
|
|
||||||
joinChannel(channelId, success, error) {
|
joinChannel(channelId, success, error) {
|
||||||
@@ -1336,7 +1353,7 @@ export default class Client {
|
|||||||
accept('application/json').
|
accept('application/json').
|
||||||
end(this.handleResponse.bind(this, 'joinChannel', success, error));
|
end(this.handleResponse.bind(this, 'joinChannel', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_channels_join');
|
this.trackEvent('api', 'api_channels_join', {team_id: this.getTeamId(), channel_id: channelId});
|
||||||
}
|
}
|
||||||
|
|
||||||
joinChannelByName(name, success, error) {
|
joinChannelByName(name, success, error) {
|
||||||
@@ -1347,7 +1364,7 @@ export default class Client {
|
|||||||
accept('application/json').
|
accept('application/json').
|
||||||
end(this.handleResponse.bind(this, 'joinChannelByName', success, error));
|
end(this.handleResponse.bind(this, 'joinChannelByName', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_channels_join_name');
|
this.trackEvent('api', 'api_channels_join_name', {team_id: this.getTeamId()});
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteChannel(channelId, success, error) {
|
deleteChannel(channelId, success, error) {
|
||||||
@@ -1358,7 +1375,7 @@ export default class Client {
|
|||||||
accept('application/json').
|
accept('application/json').
|
||||||
end(this.handleResponse.bind(this, 'deleteChannel', success, error));
|
end(this.handleResponse.bind(this, 'deleteChannel', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_channels_delete');
|
this.trackEvent('api', 'api_channels_delete', {team_id: this.getTeamId(), channel_id: channelId});
|
||||||
}
|
}
|
||||||
|
|
||||||
viewChannel(channelId, prevChannelId = '', time = 0, success, error) {
|
viewChannel(channelId, prevChannelId = '', time = 0, success, error) {
|
||||||
@@ -1410,7 +1427,7 @@ export default class Client {
|
|||||||
accept('application/json').
|
accept('application/json').
|
||||||
end(this.handleResponse.bind(this, 'getChannel', success, error));
|
end(this.handleResponse.bind(this, 'getChannel', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_channel_get');
|
this.trackEvent('api', 'api_channel_get', {team_id: this.getTeamId(), channel_id: channelId});
|
||||||
}
|
}
|
||||||
|
|
||||||
// SCHEDULED FOR DEPRECATION IN 3.7 - use getMoreChannelsPage instead
|
// SCHEDULED FOR DEPRECATION IN 3.7 - use getMoreChannelsPage instead
|
||||||
@@ -1421,6 +1438,8 @@ export default class Client {
|
|||||||
type('application/json').
|
type('application/json').
|
||||||
accept('application/json').
|
accept('application/json').
|
||||||
end(this.handleResponse.bind(this, 'getMoreChannels', success, error));
|
end(this.handleResponse.bind(this, 'getMoreChannels', success, error));
|
||||||
|
|
||||||
|
this.trackEvent('api', 'api_channels_more', {team_id: this.getTeamId()});
|
||||||
}
|
}
|
||||||
|
|
||||||
getMoreChannelsPage(offset, limit, success, error) {
|
getMoreChannelsPage(offset, limit, success, error) {
|
||||||
@@ -1430,6 +1449,8 @@ export default class Client {
|
|||||||
type('application/json').
|
type('application/json').
|
||||||
accept('application/json').
|
accept('application/json').
|
||||||
end(this.handleResponse.bind(this, 'getMoreChannelsPage', success, error));
|
end(this.handleResponse.bind(this, 'getMoreChannelsPage', success, error));
|
||||||
|
|
||||||
|
this.trackEvent('api', 'api_channels_more_page', {team_id: this.getTeamId()});
|
||||||
}
|
}
|
||||||
|
|
||||||
searchMoreChannels(term, success, error) {
|
searchMoreChannels(term, success, error) {
|
||||||
@@ -1524,7 +1545,7 @@ export default class Client {
|
|||||||
send({user_id: userId}).
|
send({user_id: userId}).
|
||||||
end(this.handleResponse.bind(this, 'addChannelMember', success, error));
|
end(this.handleResponse.bind(this, 'addChannelMember', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_channels_add_member');
|
this.trackEvent('api', 'api_channels_add_member', {team_id: this.getTeamId(), channel_id: channelId});
|
||||||
}
|
}
|
||||||
|
|
||||||
removeChannelMember(channelId, userId, success, error) {
|
removeChannelMember(channelId, userId, success, error) {
|
||||||
@@ -1536,7 +1557,7 @@ export default class Client {
|
|||||||
send({user_id: userId}).
|
send({user_id: userId}).
|
||||||
end(this.handleResponse.bind(this, 'removeChannelMember', success, error));
|
end(this.handleResponse.bind(this, 'removeChannelMember', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_channels_remove_member');
|
this.trackEvent('api', 'api_channels_remove_member', {team_id: this.getTeamId(), channel_id: channelId});
|
||||||
}
|
}
|
||||||
|
|
||||||
updateChannelMemberRoles(channelId, userId, newRoles, success, error) {
|
updateChannelMemberRoles(channelId, userId, newRoles, success, error) {
|
||||||
@@ -1574,7 +1595,7 @@ export default class Client {
|
|||||||
send({command, ...commandArgs}).
|
send({command, ...commandArgs}).
|
||||||
end(this.handleResponse.bind(this, 'executeCommand', success, error));
|
end(this.handleResponse.bind(this, 'executeCommand', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_integrations_used');
|
this.trackEvent('api', 'api_integrations_used');
|
||||||
}
|
}
|
||||||
|
|
||||||
addCommand(command, success, error) {
|
addCommand(command, success, error) {
|
||||||
@@ -1586,7 +1607,7 @@ export default class Client {
|
|||||||
send(command).
|
send(command).
|
||||||
end(this.handleResponse.bind(this, 'addCommand', success, error));
|
end(this.handleResponse.bind(this, 'addCommand', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_integrations_created');
|
this.trackEvent('api', 'api_integrations_created');
|
||||||
}
|
}
|
||||||
|
|
||||||
editCommand(command, success, error) {
|
editCommand(command, success, error) {
|
||||||
@@ -1598,7 +1619,7 @@ export default class Client {
|
|||||||
send(command).
|
send(command).
|
||||||
end(this.handleResponse.bind(this, 'editCommand', success, error));
|
end(this.handleResponse.bind(this, 'editCommand', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_integrations_created');
|
this.trackEvent('api', 'api_integrations_created');
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteCommand(commandId, success, error) {
|
deleteCommand(commandId, success, error) {
|
||||||
@@ -1610,7 +1631,7 @@ export default class Client {
|
|||||||
send({id: commandId}).
|
send({id: commandId}).
|
||||||
end(this.handleResponse.bind(this, 'deleteCommand', success, error));
|
end(this.handleResponse.bind(this, 'deleteCommand', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_integrations_deleted');
|
this.trackEvent('api', 'api_integrations_deleted');
|
||||||
}
|
}
|
||||||
|
|
||||||
listTeamCommands(success, error) {
|
listTeamCommands(success, error) {
|
||||||
@@ -1643,14 +1664,10 @@ export default class Client {
|
|||||||
send({...post, create_at: 0}).
|
send({...post, create_at: 0}).
|
||||||
end(this.handleResponse.bind(this, 'createPost', success, error));
|
end(this.handleResponse.bind(this, 'createPost', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_posts_create', post.channel_id, 'length', post.message.length);
|
this.trackEvent('api', 'api_posts_create', {team_id: this.getTeamId(), channel_id: post.channel_id});
|
||||||
|
|
||||||
if (post.message.match(/\s#./)) {
|
if (post.parent_id != null && post.parent_id !== '') {
|
||||||
this.track('api', 'api_posts_hashtag');
|
this.trackEvent('api', 'api_posts_replied', {team_id: this.getTeamId(), channel_id: post.channel_id});
|
||||||
}
|
|
||||||
|
|
||||||
if (post.message.match(/\s@./)) {
|
|
||||||
this.track('api', 'api_posts_mentions');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1663,6 +1680,8 @@ export default class Client {
|
|||||||
type('application/json').
|
type('application/json').
|
||||||
accept('application/json').
|
accept('application/json').
|
||||||
end(this.handleResponse.bind(this, 'getPermalinkTmp', success, error));
|
end(this.handleResponse.bind(this, 'getPermalinkTmp', success, error));
|
||||||
|
|
||||||
|
this.trackEvent('api', 'api_channels_permalink', {team_id: this.getTeamId()});
|
||||||
}
|
}
|
||||||
|
|
||||||
getPostById(postId, success, error) {
|
getPostById(postId, success, error) {
|
||||||
@@ -1692,7 +1711,7 @@ export default class Client {
|
|||||||
send(post).
|
send(post).
|
||||||
end(this.handleResponse.bind(this, 'updatePost', success, error));
|
end(this.handleResponse.bind(this, 'updatePost', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_posts_update');
|
this.trackEvent('api', 'api_posts_update', {team_id: this.getTeamId(), channel_id: post.channel_id});
|
||||||
}
|
}
|
||||||
|
|
||||||
deletePost(channelId, postId, success, error) {
|
deletePost(channelId, postId, success, error) {
|
||||||
@@ -1703,7 +1722,7 @@ export default class Client {
|
|||||||
accept('application/json').
|
accept('application/json').
|
||||||
end(this.handleResponse.bind(this, 'deletePost', success, error));
|
end(this.handleResponse.bind(this, 'deletePost', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_posts_delete');
|
this.trackEvent('api', 'api_posts_delete', {team_id: this.getTeamId(), channel_id: channelId});
|
||||||
}
|
}
|
||||||
|
|
||||||
search(terms, isOrSearch, success, error) {
|
search(terms, isOrSearch, success, error) {
|
||||||
@@ -1719,7 +1738,7 @@ export default class Client {
|
|||||||
send(data).
|
send(data).
|
||||||
end(this.handleResponse.bind(this, 'search', success, error));
|
end(this.handleResponse.bind(this, 'search', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_posts_search');
|
this.trackEvent('api', 'api_posts_search', {team_id: this.getTeamId()});
|
||||||
}
|
}
|
||||||
|
|
||||||
getPostsPage(channelId, offset, limit, success, error) {
|
getPostsPage(channelId, offset, limit, success, error) {
|
||||||
@@ -1747,6 +1766,8 @@ export default class Client {
|
|||||||
type('application/json').
|
type('application/json').
|
||||||
accept('application/json').
|
accept('application/json').
|
||||||
end(this.handleResponse.bind(this, 'getPostsBefore', success, error));
|
end(this.handleResponse.bind(this, 'getPostsBefore', success, error));
|
||||||
|
|
||||||
|
this.trackEvent('api', 'api_posts_get_before', {team_id: this.getTeamId(), channel_id: channelId});
|
||||||
}
|
}
|
||||||
|
|
||||||
getPostsAfter(channelId, postId, offset, numPost, success, error) {
|
getPostsAfter(channelId, postId, offset, numPost, success, error) {
|
||||||
@@ -1756,6 +1777,8 @@ export default class Client {
|
|||||||
type('application/json').
|
type('application/json').
|
||||||
accept('application/json').
|
accept('application/json').
|
||||||
end(this.handleResponse.bind(this, 'getPostsAfter', success, error));
|
end(this.handleResponse.bind(this, 'getPostsAfter', success, error));
|
||||||
|
|
||||||
|
this.trackEvent('api', 'api_posts_get_after', {team_id: this.getTeamId(), channel_id: channelId});
|
||||||
}
|
}
|
||||||
|
|
||||||
getFlaggedPosts(offset, limit, success, error) {
|
getFlaggedPosts(offset, limit, success, error) {
|
||||||
@@ -1765,6 +1788,8 @@ export default class Client {
|
|||||||
type('application/json').
|
type('application/json').
|
||||||
accept('application/json').
|
accept('application/json').
|
||||||
end(this.handleResponse.bind(this, 'getFlaggedPosts', success, error));
|
end(this.handleResponse.bind(this, 'getFlaggedPosts', success, error));
|
||||||
|
|
||||||
|
this.trackEvent('api', 'api_posts_get_flagged', {team_id: this.getTeamId()});
|
||||||
}
|
}
|
||||||
|
|
||||||
getFileInfosForPost(channelId, postId, success, error) {
|
getFileInfosForPost(channelId, postId, success, error) {
|
||||||
@@ -1789,6 +1814,8 @@ export default class Client {
|
|||||||
// Routes for Files
|
// Routes for Files
|
||||||
|
|
||||||
uploadFile(file, filename, channelId, clientId, success, error) {
|
uploadFile(file, filename, channelId, clientId, success, error) {
|
||||||
|
this.trackEvent('api', 'api_files_upload', {team_id: this.getTeamId(), channel_id: channelId});
|
||||||
|
|
||||||
return request.
|
return request.
|
||||||
post(`${this.getTeamFilesRoute()}/upload`).
|
post(`${this.getTeamFilesRoute()}/upload`).
|
||||||
set(this.defaultHeaders).
|
set(this.defaultHeaders).
|
||||||
@@ -1855,7 +1882,7 @@ export default class Client {
|
|||||||
send(app).
|
send(app).
|
||||||
end(this.handleResponse.bind(this, 'registerOAuthApp', success, error));
|
end(this.handleResponse.bind(this, 'registerOAuthApp', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_apps_register');
|
this.trackEvent('api', 'api_apps_register');
|
||||||
}
|
}
|
||||||
|
|
||||||
allowOAuth2(responseType, clientId, redirectUri, state, scope, success, error) {
|
allowOAuth2(responseType, clientId, redirectUri, state, scope, success, error) {
|
||||||
@@ -1890,6 +1917,8 @@ export default class Client {
|
|||||||
accept('application/json').
|
accept('application/json').
|
||||||
send({id}).
|
send({id}).
|
||||||
end(this.handleResponse.bind(this, 'deleteOAuthApp', success, error));
|
end(this.handleResponse.bind(this, 'deleteOAuthApp', success, error));
|
||||||
|
|
||||||
|
this.trackEvent('api', 'api_apps_delete');
|
||||||
}
|
}
|
||||||
|
|
||||||
getOAuthAppInfo(id, success, error) {
|
getOAuthAppInfo(id, success, error) {
|
||||||
@@ -1943,7 +1972,7 @@ export default class Client {
|
|||||||
send(hook).
|
send(hook).
|
||||||
end(this.handleResponse.bind(this, 'addIncomingHook', success, error));
|
end(this.handleResponse.bind(this, 'addIncomingHook', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_integrations_created');
|
this.trackEvent('api', 'api_integrations_created', {team_id: this.getTeamId()});
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteIncomingHook(hookId, success, error) {
|
deleteIncomingHook(hookId, success, error) {
|
||||||
@@ -1955,7 +1984,7 @@ export default class Client {
|
|||||||
send({id: hookId}).
|
send({id: hookId}).
|
||||||
end(this.handleResponse.bind(this, 'deleteIncomingHook', success, error));
|
end(this.handleResponse.bind(this, 'deleteIncomingHook', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_integrations_deleted');
|
this.trackEvent('api', 'api_integrations_deleted', {team_id: this.getTeamId()});
|
||||||
}
|
}
|
||||||
|
|
||||||
listIncomingHooks(success, error) {
|
listIncomingHooks(success, error) {
|
||||||
@@ -1976,7 +2005,7 @@ export default class Client {
|
|||||||
send(hook).
|
send(hook).
|
||||||
end(this.handleResponse.bind(this, 'addOutgoingHook', success, error));
|
end(this.handleResponse.bind(this, 'addOutgoingHook', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_integrations_created');
|
this.trackEvent('api', 'api_integrations_created', {team_id: this.getTeamId()});
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteOutgoingHook(hookId, success, error) {
|
deleteOutgoingHook(hookId, success, error) {
|
||||||
@@ -1988,7 +2017,7 @@ export default class Client {
|
|||||||
send({id: hookId}).
|
send({id: hookId}).
|
||||||
end(this.handleResponse.bind(this, 'deleteOutgoingHook', success, error));
|
end(this.handleResponse.bind(this, 'deleteOutgoingHook', success, error));
|
||||||
|
|
||||||
this.track('api', 'api_integrations_deleted');
|
this.trackEvent('api', 'api_integrations_deleted', {team_id: this.getTeamId()});
|
||||||
}
|
}
|
||||||
|
|
||||||
listOutgoingHooks(success, error) {
|
listOutgoingHooks(success, error) {
|
||||||
@@ -2069,6 +2098,8 @@ export default class Client {
|
|||||||
attach('image', image, image.name).
|
attach('image', image, image.name).
|
||||||
field('emoji', JSON.stringify(emoji)).
|
field('emoji', JSON.stringify(emoji)).
|
||||||
end(this.handleResponse.bind(this, 'addEmoji', success, error));
|
end(this.handleResponse.bind(this, 'addEmoji', success, error));
|
||||||
|
|
||||||
|
this.trackEvent('api', 'api_emoji_custom_add');
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteEmoji(id, success, error) {
|
deleteEmoji(id, success, error) {
|
||||||
@@ -2078,6 +2109,8 @@ export default class Client {
|
|||||||
accept('application/json').
|
accept('application/json').
|
||||||
send({id}).
|
send({id}).
|
||||||
end(this.handleResponse.bind(this, 'deleteEmoji', success, error));
|
end(this.handleResponse.bind(this, 'deleteEmoji', success, error));
|
||||||
|
|
||||||
|
this.trackEvent('api', 'api_emoji_custom_delete');
|
||||||
}
|
}
|
||||||
|
|
||||||
getCustomEmojiImageUrl(id) {
|
getCustomEmojiImageUrl(id) {
|
||||||
@@ -2127,6 +2160,8 @@ export default class Client {
|
|||||||
accept('application/json').
|
accept('application/json').
|
||||||
send(reaction).
|
send(reaction).
|
||||||
end(this.handleResponse.bind(this, 'saveReaction', success, error));
|
end(this.handleResponse.bind(this, 'saveReaction', success, error));
|
||||||
|
|
||||||
|
this.trackEvent('api', 'api_reactions_save', {team_id: this.getTeamId(), channel_id: channelId, post_id: reaction.post_id});
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteReaction(channelId, reaction, success, error) {
|
deleteReaction(channelId, reaction, success, error) {
|
||||||
@@ -2136,6 +2171,8 @@ export default class Client {
|
|||||||
accept('application/json').
|
accept('application/json').
|
||||||
send(reaction).
|
send(reaction).
|
||||||
end(this.handleResponse.bind(this, 'deleteReaction', success, error));
|
end(this.handleResponse.bind(this, 'deleteReaction', success, error));
|
||||||
|
|
||||||
|
this.trackEvent('api', 'api_reactions_delete', {team_id: this.getTeamId(), channel_id: channelId, post_id: reaction.post_id});
|
||||||
}
|
}
|
||||||
|
|
||||||
listReactions(channelId, postId, success, error) {
|
listReactions(channelId, postId, success, error) {
|
||||||
|
|||||||
@@ -497,6 +497,7 @@ export default class CreatePost extends React.Component {
|
|||||||
placement='top'
|
placement='top'
|
||||||
screens={screens}
|
screens={screens}
|
||||||
overlayClass='tip-overlay--chat'
|
overlayClass='tip-overlay--chat'
|
||||||
|
diagnosticsTag='tutorial_tip_1_sending_messages'
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
|
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
|
||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
import {track} from 'actions/analytics_actions.jsx';
|
import {trackEvent} from 'actions/diagnostics_actions.jsx';
|
||||||
|
|
||||||
import Constants from 'utils/constants.jsx';
|
import Constants from 'utils/constants.jsx';
|
||||||
import {cleanUpUrlable} from 'utils/url.jsx';
|
import {cleanUpUrlable} from 'utils/url.jsx';
|
||||||
@@ -22,6 +22,10 @@ export default class TeamSignupDisplayNamePage extends React.Component {
|
|||||||
this.state = {};
|
this.state = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
trackEvent('signup', 'signup_team_01_name');
|
||||||
|
}
|
||||||
|
|
||||||
submitNext(e) {
|
submitNext(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
@@ -60,8 +64,6 @@ export default class TeamSignupDisplayNamePage extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
track('signup', 'signup_team_02_name');
|
|
||||||
|
|
||||||
var nameError = null;
|
var nameError = null;
|
||||||
var nameDivClass = 'form-group';
|
var nameDivClass = 'form-group';
|
||||||
if (this.state.nameError) {
|
if (this.state.nameError) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
import {checkIfTeamExists, createTeam} from 'actions/team_actions.jsx';
|
import {checkIfTeamExists, createTeam} from 'actions/team_actions.jsx';
|
||||||
import {track} from 'actions/analytics_actions.jsx';
|
import {trackEvent} from 'actions/diagnostics_actions.jsx';
|
||||||
import Constants from 'utils/constants.jsx';
|
import Constants from 'utils/constants.jsx';
|
||||||
import * as URL from 'utils/url.jsx';
|
import * as URL from 'utils/url.jsx';
|
||||||
|
|
||||||
@@ -27,6 +27,10 @@ export default class TeamUrl extends React.Component {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
trackEvent('signup', 'signup_team_02_url');
|
||||||
|
}
|
||||||
|
|
||||||
submitBack(e) {
|
submitBack(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.props.state.wizard = 'display_name';
|
this.props.state.wizard = 'display_name';
|
||||||
@@ -106,7 +110,7 @@ export default class TeamUrl extends React.Component {
|
|||||||
|
|
||||||
createTeam(teamSignup.team,
|
createTeam(teamSignup.team,
|
||||||
() => {
|
() => {
|
||||||
track('signup', 'signup_team_08_complete');
|
trackEvent('signup', 'signup_team_03_complete');
|
||||||
},
|
},
|
||||||
(err) => {
|
(err) => {
|
||||||
this.setState({nameError: err.message});
|
this.setState({nameError: err.message});
|
||||||
@@ -126,8 +130,6 @@ export default class TeamUrl extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
track('signup', 'signup_team_03_url');
|
|
||||||
|
|
||||||
let nameError = null;
|
let nameError = null;
|
||||||
let nameDivClass = 'form-group';
|
let nameDivClass = 'form-group';
|
||||||
if (this.state.nameError) {
|
if (this.state.nameError) {
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ export default class LoggedIn extends React.Component {
|
|||||||
super(params);
|
super(params);
|
||||||
|
|
||||||
this.onUserChanged = this.onUserChanged.bind(this);
|
this.onUserChanged = this.onUserChanged.bind(this);
|
||||||
this.setupUser = this.setupUser.bind(this);
|
|
||||||
|
|
||||||
// Because current CSS requires the root tag to have specific stuff
|
// Because current CSS requires the root tag to have specific stuff
|
||||||
$('#root').attr('class', 'channel-view');
|
$('#root').attr('class', 'channel-view');
|
||||||
@@ -45,9 +44,7 @@ export default class LoggedIn extends React.Component {
|
|||||||
user: UserStore.getCurrentUser()
|
user: UserStore.getCurrentUser()
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.state.user) {
|
if (!this.state.user) {
|
||||||
this.setupUser(this.state.user);
|
|
||||||
} else {
|
|
||||||
GlobalActions.emitUserLoggedOutEvent('/login');
|
GlobalActions.emitUserLoggedOutEvent('/login');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -56,21 +53,10 @@ export default class LoggedIn extends React.Component {
|
|||||||
return this.state.user != null;
|
return this.state.user != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
setupUser(user) {
|
|
||||||
// Update segment indentify
|
|
||||||
if (global.window.mm_config.SegmentDeveloperKey != null && global.window.mm_config.SegmentDeveloperKey !== '') {
|
|
||||||
global.window.analytics.identify(user.id, {
|
|
||||||
createdAt: user.create_at,
|
|
||||||
id: user.id
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onUserChanged() {
|
onUserChanged() {
|
||||||
// Grab the current user
|
// Grab the current user
|
||||||
const user = UserStore.getCurrentUser();
|
const user = UserStore.getCurrentUser();
|
||||||
if (!Utils.areObjectsEqual(this.state.user, user)) {
|
if (!Utils.areObjectsEqual(this.state.user, user)) {
|
||||||
this.setupUser(user);
|
|
||||||
this.setState({
|
this.setState({
|
||||||
user
|
user
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import $ from 'jquery';
|
|||||||
import {browserHistory} from 'react-router/es6';
|
import {browserHistory} from 'react-router/es6';
|
||||||
import UserStore from 'stores/user_store.jsx';
|
import UserStore from 'stores/user_store.jsx';
|
||||||
import BrowserStore from 'stores/browser_store.jsx';
|
import BrowserStore from 'stores/browser_store.jsx';
|
||||||
|
import Constants from 'utils/constants.jsx';
|
||||||
|
|
||||||
export default class Root extends React.Component {
|
export default class Root extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@@ -26,12 +27,26 @@ export default class Root extends React.Component {
|
|||||||
this.localizationChanged = this.localizationChanged.bind(this);
|
this.localizationChanged = this.localizationChanged.bind(this);
|
||||||
this.redirectIfNecessary = this.redirectIfNecessary.bind(this);
|
this.redirectIfNecessary = this.redirectIfNecessary.bind(this);
|
||||||
|
|
||||||
|
const segmentKey = Constants.DIAGNOSTICS_SEGMENT_KEY;
|
||||||
|
|
||||||
// Ya....
|
// Ya....
|
||||||
/*eslint-disable */
|
/*eslint-disable */
|
||||||
if (window.mm_config.SegmentDeveloperKey != null && window.mm_config.SegmentDeveloperKey !== "") {
|
if (segmentKey != null && segmentKey !== '' && window.mm_config.DiagnosticsEnabled) {
|
||||||
!function(){var analytics=global.window.analytics=global.window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","group","track","ready","alias","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="3.0.1";
|
!function(){var analytics=global.window.analytics=global.window.analytics||[];if(!analytics.initialize)if(analytics.invoked)window.console&&console.error&&console.error("Segment snippet included twice.");else{analytics.invoked=!0;analytics.methods=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","group","track","ready","alias","page","once","off","on"];analytics.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);analytics.push(e);return analytics}};for(var t=0;t<analytics.methods.length;t++){var e=analytics.methods[t];analytics[e]=analytics.factory(e)}analytics.load=function(t){var e=document.createElement("script");e.type="text/javascript";e.async=!0;e.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.com/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(e,n)};analytics.SNIPPET_VERSION="3.0.1";
|
||||||
analytics.load(window.mm_config.SegmentDeveloperKey);
|
analytics.load(segmentKey);
|
||||||
analytics.page();
|
|
||||||
|
analytics.page('ApplicationLoaded', {
|
||||||
|
path: '',
|
||||||
|
referrer: '',
|
||||||
|
search: '',
|
||||||
|
title: '',
|
||||||
|
url: '',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
context: {
|
||||||
|
ip: '0.0.0.0'
|
||||||
|
},
|
||||||
|
});
|
||||||
}}();
|
}}();
|
||||||
}
|
}
|
||||||
/*eslint-enable */
|
/*eslint-enable */
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import * as Utils from 'utils/utils.jsx';
|
|||||||
import * as ChannelUtils from 'utils/channel_utils.jsx';
|
import * as ChannelUtils from 'utils/channel_utils.jsx';
|
||||||
import * as ChannelActions from 'actions/channel_actions.jsx';
|
import * as ChannelActions from 'actions/channel_actions.jsx';
|
||||||
|
|
||||||
|
import {trackEvent} from 'actions/diagnostics_actions.jsx';
|
||||||
import Constants from 'utils/constants.jsx';
|
import Constants from 'utils/constants.jsx';
|
||||||
|
|
||||||
import {FormattedMessage, FormattedHTMLMessage} from 'react-intl';
|
import {FormattedMessage, FormattedHTMLMessage} from 'react-intl';
|
||||||
@@ -363,6 +364,7 @@ export default class Sidebar extends React.Component {
|
|||||||
|
|
||||||
showMoreChannelsModal() {
|
showMoreChannelsModal() {
|
||||||
this.setState({showMoreChannelsModal: true});
|
this.setState({showMoreChannelsModal: true});
|
||||||
|
trackEvent('ui', 'ui_channels_more_public');
|
||||||
}
|
}
|
||||||
|
|
||||||
hideMoreChannelsModal() {
|
hideMoreChannelsModal() {
|
||||||
@@ -378,6 +380,7 @@ export default class Sidebar extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
showMoreDirectChannelsModal() {
|
showMoreDirectChannelsModal() {
|
||||||
|
trackEvent('ui', 'ui_channels_more_direct');
|
||||||
this.setState({showDirectChannelsModal: true});
|
this.setState({showDirectChannelsModal: true});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -448,6 +451,7 @@ export default class Sidebar extends React.Component {
|
|||||||
placement='right'
|
placement='right'
|
||||||
screens={screens}
|
screens={screens}
|
||||||
overlayClass='tip-overlay--sidebar'
|
overlayClass='tip-overlay--sidebar'
|
||||||
|
diagnosticsTag='tutorial_tip_2_channels'
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -566,6 +570,7 @@ export default class Sidebar extends React.Component {
|
|||||||
<Link
|
<Link
|
||||||
to={link}
|
to={link}
|
||||||
className={rowClass}
|
className={rowClass}
|
||||||
|
onClick={this.trackChannelSelectedEvent}
|
||||||
>
|
>
|
||||||
{icon}
|
{icon}
|
||||||
{channel.display_name}
|
{channel.display_name}
|
||||||
@@ -577,6 +582,10 @@ export default class Sidebar extends React.Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trackChannelSelectedEvent() {
|
||||||
|
trackEvent('ui', 'ui_channel_selected');
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
// Check if we have all info needed to render
|
// Check if we have all info needed to render
|
||||||
if (this.state.currentTeam == null || this.state.currentUser == null) {
|
if (this.state.currentTeam == null || this.state.currentUser == null) {
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import PreferenceStore from 'stores/preference_store.jsx';
|
|||||||
import WebrtcStore from 'stores/webrtc_store.jsx';
|
import WebrtcStore from 'stores/webrtc_store.jsx';
|
||||||
|
|
||||||
import {getFlaggedPosts} from 'actions/post_actions.jsx';
|
import {getFlaggedPosts} from 'actions/post_actions.jsx';
|
||||||
|
import {trackEvent} from 'actions/diagnostics_actions.jsx';
|
||||||
|
|
||||||
import * as Utils from 'utils/utils.jsx';
|
import * as Utils from 'utils/utils.jsx';
|
||||||
import Constants from 'utils/constants.jsx';
|
import Constants from 'utils/constants.jsx';
|
||||||
@@ -71,6 +72,10 @@ export default class SidebarRight extends React.Component {
|
|||||||
const isOpen = this.state.searchVisible || this.state.postRightVisible;
|
const isOpen = this.state.searchVisible || this.state.postRightVisible;
|
||||||
const willOpen = nextState.searchVisible || nextState.postRightVisible;
|
const willOpen = nextState.searchVisible || nextState.postRightVisible;
|
||||||
|
|
||||||
|
if (!isOpen && willOpen) {
|
||||||
|
trackEvent('ui', 'ui_rhs_opened');
|
||||||
|
}
|
||||||
|
|
||||||
if (isOpen !== willOpen) {
|
if (isOpen !== willOpen) {
|
||||||
PostStore.jumpPostsViewSidebarOpen();
|
PostStore.jumpPostsViewSidebarOpen();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,9 @@
|
|||||||
import LoadingScreen from 'components/loading_screen.jsx';
|
import LoadingScreen from 'components/loading_screen.jsx';
|
||||||
|
|
||||||
import * as GlobalActions from 'actions/global_actions.jsx';
|
import * as GlobalActions from 'actions/global_actions.jsx';
|
||||||
|
import {trackEvent} from 'actions/diagnostics_actions.jsx';
|
||||||
|
|
||||||
import BrowserStore from 'stores/browser_store.jsx';
|
import BrowserStore from 'stores/browser_store.jsx';
|
||||||
import {track} from 'actions/analytics_actions.jsx';
|
|
||||||
import {getInviteInfo} from 'actions/team_actions.jsx';
|
import {getInviteInfo} from 'actions/team_actions.jsx';
|
||||||
import {loginById, createUserWithInvite} from 'actions/user_actions.jsx';
|
import {loginById, createUserWithInvite} from 'actions/user_actions.jsx';
|
||||||
|
|
||||||
@@ -37,6 +38,10 @@ export default class SignupEmail extends React.Component {
|
|||||||
this.state = this.getInviteInfo();
|
this.state = this.getInviteInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
trackEvent('signup', 'signup_user_01_welcome');
|
||||||
|
}
|
||||||
|
|
||||||
getInviteInfo() {
|
getInviteInfo() {
|
||||||
let data = this.props.location.query.d;
|
let data = this.props.location.query.d;
|
||||||
let hash = this.props.location.query.h;
|
let hash = this.props.location.query.h;
|
||||||
@@ -117,7 +122,7 @@ export default class SignupEmail extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleSignupSuccess(user, data) {
|
handleSignupSuccess(user, data) {
|
||||||
track('signup', 'signup_user_02_complete');
|
trackEvent('signup', 'signup_user_02_complete');
|
||||||
loginById(
|
loginById(
|
||||||
data.id,
|
data.id,
|
||||||
user.password,
|
user.password,
|
||||||
@@ -401,8 +406,6 @@ export default class SignupEmail extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
track('signup', 'signup_user_01_welcome');
|
|
||||||
|
|
||||||
let serverError = null;
|
let serverError = null;
|
||||||
if (this.state.serverError) {
|
if (this.state.serverError) {
|
||||||
serverError = (
|
serverError = (
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
import FormError from 'components/form_error.jsx';
|
import FormError from 'components/form_error.jsx';
|
||||||
|
|
||||||
import * as GlobalActions from 'actions/global_actions.jsx';
|
import * as GlobalActions from 'actions/global_actions.jsx';
|
||||||
import {track} from 'actions/analytics_actions.jsx';
|
|
||||||
import {addUserToTeamFromInvite} from 'actions/team_actions.jsx';
|
import {addUserToTeamFromInvite} from 'actions/team_actions.jsx';
|
||||||
import {webLoginByLdap} from 'actions/user_actions.jsx';
|
import {webLoginByLdap} from 'actions/user_actions.jsx';
|
||||||
|
import {trackEvent} from 'actions/diagnostics_actions.jsx';
|
||||||
|
|
||||||
import * as Utils from 'utils/utils.jsx';
|
import * as Utils from 'utils/utils.jsx';
|
||||||
|
|
||||||
@@ -39,6 +39,10 @@ export default class SignupLdap extends React.Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentDidMount() {
|
||||||
|
trackEvent('signup', 'signup_user_01_welcome');
|
||||||
|
}
|
||||||
|
|
||||||
handleLdapIdChange(e) {
|
handleLdapIdChange(e) {
|
||||||
this.setState({
|
this.setState({
|
||||||
ldapId: e.target.value
|
ldapId: e.target.value
|
||||||
@@ -107,8 +111,6 @@ export default class SignupLdap extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
track('signup', 'signup_user_01_welcome');
|
|
||||||
|
|
||||||
let ldapIdPlaceholder;
|
let ldapIdPlaceholder;
|
||||||
if (global.window.mm_config.LdapLoginFieldName) {
|
if (global.window.mm_config.LdapLoginFieldName) {
|
||||||
ldapIdPlaceholder = global.window.mm_config.LdapLoginFieldName;
|
ldapIdPlaceholder = global.window.mm_config.LdapLoginFieldName;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
import Constants from 'utils/constants.jsx';
|
import Constants from 'utils/constants.jsx';
|
||||||
|
|
||||||
|
import {trackEvent} from 'actions/diagnostics_actions.jsx';
|
||||||
import {switchTeams} from 'actions/team_actions.jsx';
|
import {switchTeams} from 'actions/team_actions.jsx';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
@@ -19,6 +20,7 @@ export default class TeamButton extends React.Component {
|
|||||||
|
|
||||||
handleSwitch(e) {
|
handleSwitch(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
trackEvent('ui', 'ui_team_sidebar_switch_team');
|
||||||
switchTeams(this.props.url);
|
switchTeams(this.props.url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import TeamStore from 'stores/team_store.jsx';
|
|||||||
import PreferenceStore from 'stores/preference_store.jsx';
|
import PreferenceStore from 'stores/preference_store.jsx';
|
||||||
import * as AsyncClient from 'utils/async_client.jsx';
|
import * as AsyncClient from 'utils/async_client.jsx';
|
||||||
import * as GlobalActions from 'actions/global_actions.jsx';
|
import * as GlobalActions from 'actions/global_actions.jsx';
|
||||||
|
import {trackEvent} from 'actions/diagnostics_actions.jsx';
|
||||||
|
|
||||||
import {Constants, Preferences} from 'utils/constants.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.handleNext = this.handleNext.bind(this);
|
||||||
this.createScreen = this.createScreen.bind(this);
|
this.createScreen = this.createScreen.bind(this);
|
||||||
this.createCircles = this.createCircles.bind(this);
|
this.createCircles = this.createCircles.bind(this);
|
||||||
|
this.skipTutorial = this.skipTutorial.bind(this);
|
||||||
|
|
||||||
this.state = {currentScreen: 0};
|
this.state = {currentScreen: 0};
|
||||||
}
|
}
|
||||||
handleNext() {
|
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) {
|
if (this.state.currentScreen < 2) {
|
||||||
this.setState({currentScreen: this.state.currentScreen + 1});
|
this.setState({currentScreen: this.state.currentScreen + 1});
|
||||||
return;
|
return;
|
||||||
@@ -53,6 +67,18 @@ export default class TutorialIntroScreens extends React.Component {
|
|||||||
skipTutorial(e) {
|
skipTutorial(e) {
|
||||||
e.preventDefault();
|
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(
|
AsyncClient.savePreference(
|
||||||
Preferences.TUTORIAL_STEP,
|
Preferences.TUTORIAL_STEP,
|
||||||
UserStore.getCurrentId(),
|
UserStore.getCurrentId(),
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
import UserStore from 'stores/user_store.jsx';
|
import UserStore from 'stores/user_store.jsx';
|
||||||
import PreferenceStore from 'stores/preference_store.jsx';
|
import PreferenceStore from 'stores/preference_store.jsx';
|
||||||
import * as AsyncClient from 'utils/async_client.jsx';
|
import * as AsyncClient from 'utils/async_client.jsx';
|
||||||
|
import {trackEvent} from 'actions/diagnostics_actions.jsx';
|
||||||
|
|
||||||
import Constants from 'utils/constants.jsx';
|
import Constants from 'utils/constants.jsx';
|
||||||
|
|
||||||
@@ -25,6 +26,7 @@ export default class TutorialTip extends React.Component {
|
|||||||
|
|
||||||
this.handleNext = this.handleNext.bind(this);
|
this.handleNext = this.handleNext.bind(this);
|
||||||
this.toggle = this.toggle.bind(this);
|
this.toggle = this.toggle.bind(this);
|
||||||
|
this.skipTutorial = this.skipTutorial.bind(this);
|
||||||
|
|
||||||
this.state = {currentScreen: 0, show: false};
|
this.state = {currentScreen: 0, show: false};
|
||||||
}
|
}
|
||||||
@@ -48,6 +50,22 @@ export default class TutorialTip extends React.Component {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.props.diagnosticsTag) {
|
||||||
|
let tag = this.props.diagnosticsTag;
|
||||||
|
|
||||||
|
if (this.props.screens.length > 1) {
|
||||||
|
tag += '_' + (this.state.currentScreen + 1).toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.state.currentScreen === this.props.screens.length - 1) {
|
||||||
|
tag += '_okay';
|
||||||
|
} else {
|
||||||
|
tag += '_next';
|
||||||
|
}
|
||||||
|
|
||||||
|
trackEvent('tutorial', tag);
|
||||||
|
}
|
||||||
|
|
||||||
this.closeRightSidebar();
|
this.closeRightSidebar();
|
||||||
this.toggle();
|
this.toggle();
|
||||||
}
|
}
|
||||||
@@ -62,6 +80,15 @@ export default class TutorialTip extends React.Component {
|
|||||||
skipTutorial(e) {
|
skipTutorial(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if (this.props.diagnosticsTag) {
|
||||||
|
let tag = this.props.diagnosticsTag;
|
||||||
|
if (this.props.screens.length > 1) {
|
||||||
|
tag += '_' + this.state.currentScreen;
|
||||||
|
}
|
||||||
|
tag += '_skip';
|
||||||
|
trackEvent('tutorial', tag);
|
||||||
|
}
|
||||||
|
|
||||||
AsyncClient.savePreference(
|
AsyncClient.savePreference(
|
||||||
Preferences.TUTORIAL_STEP,
|
Preferences.TUTORIAL_STEP,
|
||||||
UserStore.getCurrentId(),
|
UserStore.getCurrentId(),
|
||||||
@@ -174,7 +201,8 @@ TutorialTip.defaultProps = {
|
|||||||
TutorialTip.propTypes = {
|
TutorialTip.propTypes = {
|
||||||
screens: React.PropTypes.array.isRequired,
|
screens: React.PropTypes.array.isRequired,
|
||||||
placement: React.PropTypes.string.isRequired,
|
placement: React.PropTypes.string.isRequired,
|
||||||
overlayClass: React.PropTypes.string
|
overlayClass: React.PropTypes.string,
|
||||||
|
diagnosticsTag: React.PropTypes.string
|
||||||
};
|
};
|
||||||
|
|
||||||
export function createMenuTip(toggleFunc, onBottom) {
|
export function createMenuTip(toggleFunc, onBottom) {
|
||||||
@@ -207,6 +235,7 @@ export function createMenuTip(toggleFunc, onBottom) {
|
|||||||
placement={placement}
|
placement={placement}
|
||||||
screens={screens}
|
screens={screens}
|
||||||
overlayClass={'tip-overlay--header--' + arrow}
|
overlayClass={'tip-overlay--header--' + arrow}
|
||||||
|
diagnosticsTag='tutorial_tip_3_main_menu'
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import * as Utils from 'utils/utils.jsx';
|
|||||||
|
|
||||||
import {intlShape, injectIntl, defineMessages, FormattedMessage, FormattedHTMLMessage, FormattedDate} from 'react-intl';
|
import {intlShape, injectIntl, defineMessages, FormattedMessage, FormattedHTMLMessage, FormattedDate} from 'react-intl';
|
||||||
import {updateUser, uploadProfileImage} from 'actions/user_actions.jsx';
|
import {updateUser, uploadProfileImage} from 'actions/user_actions.jsx';
|
||||||
|
import {trackEvent} from 'actions/diagnostics_actions.jsx';
|
||||||
|
|
||||||
const holders = defineMessages({
|
const holders = defineMessages({
|
||||||
usernameReserved: {
|
usernameReserved: {
|
||||||
@@ -127,6 +128,8 @@ class UserSettingsGeneralTab extends React.Component {
|
|||||||
|
|
||||||
user.username = username;
|
user.username = username;
|
||||||
|
|
||||||
|
trackEvent('settings', 'user_settings_update', {field: 'username'});
|
||||||
|
|
||||||
this.submitUser(user, Constants.UserUpdateEvents.USERNAME, false);
|
this.submitUser(user, Constants.UserUpdateEvents.USERNAME, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,6 +146,8 @@ class UserSettingsGeneralTab extends React.Component {
|
|||||||
|
|
||||||
user.nickname = nickname;
|
user.nickname = nickname;
|
||||||
|
|
||||||
|
trackEvent('settings', 'user_settings_update', {field: 'username'});
|
||||||
|
|
||||||
this.submitUser(user, Constants.UserUpdateEvents.NICKNAME, false);
|
this.submitUser(user, Constants.UserUpdateEvents.NICKNAME, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -161,6 +166,8 @@ class UserSettingsGeneralTab extends React.Component {
|
|||||||
user.first_name = firstName;
|
user.first_name = firstName;
|
||||||
user.last_name = lastName;
|
user.last_name = lastName;
|
||||||
|
|
||||||
|
trackEvent('settings', 'user_settings_update', {field: 'fullname'});
|
||||||
|
|
||||||
this.submitUser(user, Constants.UserUpdateEvents.FULLNAME, false);
|
this.submitUser(user, Constants.UserUpdateEvents.FULLNAME, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -189,6 +196,7 @@ class UserSettingsGeneralTab extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
user.email = email;
|
user.email = email;
|
||||||
|
trackEvent('settings', 'user_settings_update', {field: 'email'});
|
||||||
this.submitUser(user, Constants.UserUpdateEvents.EMAIL, true);
|
this.submitUser(user, Constants.UserUpdateEvents.EMAIL, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,6 +236,8 @@ class UserSettingsGeneralTab extends React.Component {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trackEvent('settings', 'user_settings_update', {field: 'picture'});
|
||||||
|
|
||||||
const {formatMessage} = this.props.intl;
|
const {formatMessage} = this.props.intl;
|
||||||
const picture = this.state.picture;
|
const picture = this.state.picture;
|
||||||
|
|
||||||
@@ -268,6 +278,8 @@ class UserSettingsGeneralTab extends React.Component {
|
|||||||
|
|
||||||
user.position = position;
|
user.position = position;
|
||||||
|
|
||||||
|
trackEvent('settings', 'user_settings_update', {field: 'position'});
|
||||||
|
|
||||||
this.submitUser(user, Constants.UserUpdateEvents.Position, false);
|
this.submitUser(user, Constants.UserUpdateEvents.Position, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import SearchBox from '../search_bar.jsx';
|
|||||||
import WebrtcHeader from './components/webrtc_header.jsx';
|
import WebrtcHeader from './components/webrtc_header.jsx';
|
||||||
import ConnectingScreen from 'components/loading_screen.jsx';
|
import ConnectingScreen from 'components/loading_screen.jsx';
|
||||||
|
|
||||||
|
import {trackEvent} from 'actions/diagnostics_actions.jsx';
|
||||||
import * as WebrtcActions from 'actions/webrtc_actions.jsx';
|
import * as WebrtcActions from 'actions/webrtc_actions.jsx';
|
||||||
|
|
||||||
import * as Utils from 'utils/utils.jsx';
|
import * as Utils from 'utils/utils.jsx';
|
||||||
@@ -600,6 +601,8 @@ export default class WebrtcController extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onFailed() {
|
onFailed() {
|
||||||
|
trackEvent('api', 'api_users_webrtc_failed');
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
isCalling: false,
|
isCalling: false,
|
||||||
isAnswering: false,
|
isAnswering: false,
|
||||||
@@ -733,6 +736,7 @@ export default class WebrtcController extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
doAnswer(jsep) {
|
doAnswer(jsep) {
|
||||||
|
trackEvent('api', 'api_users_webrtc_start');
|
||||||
this.videocall.createAnswer({
|
this.videocall.createAnswer({
|
||||||
jsep,
|
jsep,
|
||||||
stream: this.localMedia,
|
stream: this.localMedia,
|
||||||
@@ -747,6 +751,7 @@ export default class WebrtcController extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
doHangup(error, manual) {
|
doHangup(error, manual) {
|
||||||
|
trackEvent('api', 'api_users_webrtc_end');
|
||||||
if (this.videocall && this.state.callInProgress) {
|
if (this.videocall && this.state.callInProgress) {
|
||||||
this.videocall.send({message: {request: 'hangup'}});
|
this.videocall.send({message: {request: 'hangup'}});
|
||||||
this.videocall.hangup();
|
this.videocall.hangup();
|
||||||
|
|||||||
@@ -718,9 +718,6 @@
|
|||||||
"admin.service.readTimeoutDescription": "Maximum time allowed from when the connection is accepted to when the request body is fully read.",
|
"admin.service.readTimeoutDescription": "Maximum time allowed from when the connection is accepted to when the request body is fully read.",
|
||||||
"admin.service.securityDesc": "When true, System Administrators are notified by email if a relevant security fix alert has been announced in the last 12 hours. Requires email to be enabled.",
|
"admin.service.securityDesc": "When true, System Administrators are notified by email if a relevant security fix alert has been announced in the last 12 hours. Requires email to be enabled.",
|
||||||
"admin.service.securityTitle": "Enable Security Alerts: ",
|
"admin.service.securityTitle": "Enable Security Alerts: ",
|
||||||
"admin.service.segmentDescription": "Segment.com is an online service that can be optionally used to track detailed system statistics. You can obtain a key by signing-up for a free account at Segment.com.",
|
|
||||||
"admin.service.segmentExample": "E.g.: \"g3fgGOXJAQ43QV7rAh6iwQCkV4cA1Gs\"",
|
|
||||||
"admin.service.segmentTitle": "Segment Write Key:",
|
|
||||||
"admin.service.sessionCache": "Session Cache (minutes):",
|
"admin.service.sessionCache": "Session Cache (minutes):",
|
||||||
"admin.service.sessionCacheDesc": "The number of minutes to cache a session in memory.",
|
"admin.service.sessionCacheDesc": "The number of minutes to cache a session in memory.",
|
||||||
"admin.service.sessionDaysEx": "E.g.: \"30\"",
|
"admin.service.sessionDaysEx": "E.g.: \"30\"",
|
||||||
|
|||||||
@@ -896,7 +896,8 @@ export const Constants = {
|
|||||||
STATUS_INTERVAL: 60000,
|
STATUS_INTERVAL: 60000,
|
||||||
AUTOCOMPLETE_TIMEOUT: 100,
|
AUTOCOMPLETE_TIMEOUT: 100,
|
||||||
ANIMATION_TIMEOUT: 1000,
|
ANIMATION_TIMEOUT: 1000,
|
||||||
SEARCH_TIMEOUT_MILLISECONDS: 100
|
SEARCH_TIMEOUT_MILLISECONDS: 100,
|
||||||
|
DIAGNOSTICS_SEGMENT_KEY: 'fwb7VPbFeQ7SKp3wHm1RzFUuXZudqVok'
|
||||||
};
|
};
|
||||||
|
|
||||||
export default Constants;
|
export default Constants;
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user