Added first round of analytics and event tracking BOD-190

This commit is contained in:
Patrick Fic
2020-07-17 08:27:28 -07:00
parent 3f0394760a
commit a54a85b96c
73 changed files with 433 additions and 208 deletions

View File

@@ -4,6 +4,7 @@ import React from "react";
import { useTranslation } from "react-i18next";
import { UPDATE_JOB } from "../../graphql/jobs.queries";
import JobEmployeeAssignmentsComponent from "./job-employee-assignments.component";
import { logImEXEvent } from "../../firebase/firebase.utils";
export default function JobEmployeeAssignmentsContainer({ job }) {
const { t } = useTranslation();
@@ -11,6 +12,7 @@ export default function JobEmployeeAssignmentsContainer({ job }) {
const handleAdd = async (assignment) => {
const { operation, employeeid } = assignment;
logImEXEvent("job_assign_employee", { operation });
let empAssignment = determineFieldName(operation);
@@ -29,7 +31,8 @@ export default function JobEmployeeAssignmentsContainer({ job }) {
}
};
const handleRemove = async (operation) => {
console.log("handleRemove -> operation", operation);
logImEXEvent("job_unassign_employee", { operation });
let empAssignment = determineFieldName(operation);
const result = await updateJob({
variables: { jobId: job.id, job: { [empAssignment]: null } },