Added first round of analytics and event tracking BOD-190
This commit is contained in:
@@ -2,11 +2,14 @@ import { Button } from "antd";
|
||||
import axios from "axios";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||
|
||||
export default function JobsDocumentsDownloadButton({ galleryImages }) {
|
||||
const { t } = useTranslation();
|
||||
const imagesToDownload = galleryImages.filter((image) => image.isSelected);
|
||||
const handleDelete = () => {
|
||||
const handleDownload = () => {
|
||||
logImEXEvent("jobs_documents_download");
|
||||
|
||||
axios
|
||||
.post("/media/download", {
|
||||
ids: imagesToDownload.map((_) => _.key),
|
||||
@@ -17,7 +20,7 @@ export default function JobsDocumentsDownloadButton({ galleryImages }) {
|
||||
};
|
||||
|
||||
return (
|
||||
<Button disabled={imagesToDownload.length < 1} onClick={handleDelete}>
|
||||
<Button disabled={imagesToDownload.length < 1} onClick={handleDownload}>
|
||||
{t("documents.actions.download")}
|
||||
</Button>
|
||||
);
|
||||
|
||||
@@ -4,6 +4,7 @@ import { useTranslation } from "react-i18next";
|
||||
import axios from "axios";
|
||||
import { useMutation } from "@apollo/react-hooks";
|
||||
import { DELETE_DOCUMENT } from "../../graphql/documents.queries";
|
||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||
|
||||
export default function JobsDocumentsDeleteButton({
|
||||
galleryImages,
|
||||
@@ -13,6 +14,8 @@ export default function JobsDocumentsDeleteButton({
|
||||
const [deleteDocument] = useMutation(DELETE_DOCUMENT);
|
||||
const imagesToDelete = galleryImages.filter((image) => image.isSelected);
|
||||
const handleDelete = () => {
|
||||
logImEXEvent("job_documents_delete", { count: imagesToDelete.length });
|
||||
|
||||
imagesToDelete.forEach((image) => {
|
||||
let timestamp = Math.floor(Date.now() / 1000);
|
||||
let public_id = image.key;
|
||||
|
||||
Reference in New Issue
Block a user