chore: add event for workspace environment type [no-ticket] (#7602)

* chore: add event for workspace environment type [no-ticket]

* fix lint
This commit is contained in:
Filipe Freire 2024-06-28 15:07:41 +01:00 committed by GitHub
parent 3ab6165f52
commit eab0e9c675
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 4 deletions

View File

@ -5,6 +5,7 @@ export enum SegmentEvent {
dataImport = 'Data Imported',
documentCreate = 'Document Created',
mockCreate = 'Mock Created',
environmentWorkspaceCreate = 'Environment Workspace Created',
loginSuccess = 'Login Success',
inviteTrigger = 'Invite Triggered From App',
exportAllCollections = 'Exported All Collections',

View File

@ -20,7 +20,7 @@ import { isRequestGroupMeta } from '../../models/request-group-meta';
import { UnitTest } from '../../models/unit-test';
import { UnitTestSuite } from '../../models/unit-test-suite';
import { WebSocketRequest } from '../../models/websocket-request';
import { isCollection, isMockServer, scopeToActivity, Workspace } from '../../models/workspace';
import { isCollection, isEnvironment, scopeToActivity, Workspace } from '../../models/workspace';
import { WorkspaceMeta } from '../../models/workspace-meta';
import { getSendRequestCallback } from '../../network/unit-test-feature';
import { initializeLocalBackendProjectAndMarkForSync } from '../../sync/vcs/initialize-backend-project';
@ -370,7 +370,9 @@ export const createNewWorkspaceAction: ActionFunction = async ({
workspace,
});
}
window.main.trackSegmentEvent({
event: SegmentEvent.mockCreate,
});
return redirect(`/organization/${organizationId}/project/${projectId}/workspace/${workspace._id}/${scopeToActivity(workspace.scope)}`);
}
@ -398,8 +400,8 @@ export const createNewWorkspaceAction: ActionFunction = async ({
if (isCollection(workspace)) {
event = SegmentEvent.collectionCreate;
} else if (isMockServer(workspace)) {
event = SegmentEvent.mockCreate;
} else if (isEnvironment(workspace)) {
event = SegmentEvent.environmentWorkspaceCreate;
}
window.main.trackSegmentEvent({