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

@@ -8,6 +8,8 @@ import { createStructuredSelector } from "reselect";
import { auth } from "../../firebase/firebase.utils";
import { UPDATE_JOB } from "../../graphql/jobs.queries";
import { selectBodyshop } from "../../redux/user/user.selectors";
import { logImEXEvent } from "../../firebase/firebase.utils";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
});
@@ -17,6 +19,8 @@ export function JobsCloseExportButton({ bodyshop, jobId, disabled }) {
const [updateJob] = useMutation(UPDATE_JOB);
const [loading, setLoading] = useState(false);
const handleQbxml = async () => {
logImEXEvent("jobs_close_export");
setLoading(true);
let QbXmlResponse;
try {
@@ -107,8 +111,7 @@ export function JobsCloseExportButton({ bodyshop, jobId, disabled }) {
onClick={handleQbxml}
loading={loading}
disabled={disabled}
type="dashed"
>
type='dashed'>
{t("jobs.actions.export")}
</Button>
);