Merge branch 'master' of github.com:appsmithorg/appsmith

This commit is contained in:
Nikhil Nandagopal 2020-10-14 12:36:15 +05:30
commit 862fc9d828
2 changed files with 15 additions and 10 deletions

View File

@ -36,6 +36,7 @@ import { INVITE_USERS_TO_ORG_FORM } from "constants/forms";
import PerformanceTracker, {
PerformanceTransactionName,
} from "utils/PerformanceTracker";
import { ANONYMOUS_USERNAME } from "constants/userConstants";
export function* createUserSaga(
action: ReduxActionWithPromise<CreateUserRequest>,
@ -84,7 +85,10 @@ export function* getCurrentUserSaga() {
const isValidResponse = yield validateResponse(response);
if (isValidResponse) {
if (!response.data.isAnonymous) {
if (
!response.data.isAnonymous &&
response.data.username !== ANONYMOUS_USERNAME
) {
AnalyticsUtil.identifyUser(response.data.username, response.data);
}
if (window.location.pathname === BASE_URL) {

View File

@ -4,7 +4,7 @@ import FeatureFlag from "./featureFlags";
import smartlookClient from "smartlook-client";
import { getAppsmithConfigs } from "configs";
import * as Sentry from "@sentry/react";
import { User } from "../constants/userConstants";
import { ANONYMOUS_USERNAME, User } from "../constants/userConstants";
export type EventLocation =
| "LIGHTNING_MENU"
@ -172,15 +172,16 @@ class AnalyticsUtil {
const app = (userData.applications || []).find(
(app: any) => app.id === appId,
);
const user = {
userId: userData.username,
email: userData.email,
currentOrgId: userData.currentOrganizationId,
appId: appId,
appName: app ? app.name : undefined,
};
finalEventData = {
...finalEventData,
userData: {
userId: userData.username,
email: userData.email,
currentOrgId: userData.currentOrganizationId,
appId: appId,
appName: app ? app.name : undefined,
},
...eventData,
userData: user.userId === ANONYMOUS_USERNAME ? undefined : user,
};
}
if (windowDoc.analytics) {