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

@@ -3,15 +3,18 @@ import { Button, notification } from "antd";
import { useTranslation } from "react-i18next";
import { useMutation } from "@apollo/react-hooks";
import { UPDATE_JOBS } from "../../graphql/jobs.queries";
import { logImEXEvent } from "../../firebase/firebase.utils";
export default function OwnerDetailUpdateJobsComponent({
owner,
selectedJobs,
disabled
disabled,
}) {
const { t } = useTranslation();
const [updateJobs] = useMutation(UPDATE_JOBS);
const handlecClick = e => {
const handlecClick = (e) => {
logImEXEvent("owner_update_jobs", { count: selectedJobs.length });
updateJobs({
variables: {
jobIds: selectedJobs,
@@ -28,16 +31,16 @@ export default function OwnerDetailUpdateJobsComponent({
ownr_ph2: owner["ownr_ph2"],
ownr_st: owner["ownr_st"],
ownr_title: owner["ownr_title"],
ownr_zip: owner["ownr_zip"]
}
}
ownr_zip: owner["ownr_zip"],
},
},
})
.then(response => {
.then((response) => {
notification["success"]({ message: t("jobs.successes.updated") });
})
.catch(error => {
.catch((error) => {
notification["error"]({
message: t("jobs.errors.updating", { error: JSON.stringify(error) })
message: t("jobs.errors.updating", { error: JSON.stringify(error) }),
});
});
};