chore: new analytic events (#699)

* feat: tracking events for issues marked as DONE, issue property update, issue moved to cycle, issue moved to modules

* fix: changed events names

* chore: sync analytic

* chore: new analytic events
This commit is contained in:
Dakshesh Jain 2023-04-06 12:08:52 +05:30 committed by GitHub
parent 65037b5031
commit cf662f6e6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 428 additions and 31 deletions

View file

@ -10,6 +10,7 @@ import { DragDropContext, DropResult } from "react-beautiful-dnd";
import issuesService from "services/issues.service";
import stateService from "services/state.service";
import modulesService from "services/modules.service";
import trackEventServices from "services/track-event.service";
// hooks
import useToast from "hooks/use-toast";
import useIssuesView from "hooks/use-issues-view";
@ -259,7 +260,22 @@ export const IssuesView: React.FC<Props> = ({
state: draggedItem.state,
sort_order: draggedItem.sort_order,
})
.then(() => {
.then((response) => {
const sourceStateBeforeDrag = states.find((state) => state.name === source.droppableId);
if (
sourceStateBeforeDrag?.group !== "completed" &&
response?.state_detail?.group === "completed"
)
trackEventServices.trackIssueMarkedAsDoneEvent({
workspaceSlug,
workspaceId: draggedItem.workspace_detail.id,
projectName: draggedItem.project_detail.name,
projectIdentifier: draggedItem.project_detail.identifier,
projectId,
issueId: draggedItem.id,
});
if (cycleId) {
mutate(CYCLE_ISSUES_WITH_PARAMS(cycleId as string, params));
mutate(CYCLE_DETAILS(cycleId as string));
@ -282,6 +298,7 @@ export const IssuesView: React.FC<Props> = ({
orderBy,
handleDeleteIssue,
params,
states,
]
);