diff --git a/client/src/components/jobs-close-export-button/jobs-close-export-button.component.jsx b/client/src/components/jobs-close-export-button/jobs-close-export-button.component.jsx index 75b00bde4..1c0f106e1 100644 --- a/client/src/components/jobs-close-export-button/jobs-close-export-button.component.jsx +++ b/client/src/components/jobs-close-export-button/jobs-close-export-button.component.jsx @@ -14,7 +14,7 @@ import { import { logImEXEvent } from "../../firebase/firebase.utils"; import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries"; import { useHistory } from "react-router-dom"; -import { useCookies } from "react-cookie"; + const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, @@ -33,7 +33,6 @@ export function JobsCloseExportButton({ const [updateJob] = useMutation(UPDATE_JOB); const [insertExportLog] = useMutation(INSERT_EXPORT_LOG); const [loading, setLoading] = useState(false); - const [cookies] = useCookies(); const handleQbxml = async () => { //Check if it's a CDK setup. diff --git a/client/src/components/jobs-export-all-button/jobs-export-all-button.component.jsx b/client/src/components/jobs-export-all-button/jobs-export-all-button.component.jsx index 8fc8e8c42..71098b524 100644 --- a/client/src/components/jobs-export-all-button/jobs-export-all-button.component.jsx +++ b/client/src/components/jobs-export-all-button/jobs-export-all-button.component.jsx @@ -11,9 +11,8 @@ import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries"; import { UPDATE_JOBS } from "../../graphql/jobs.queries"; import { selectBodyshop, - selectCurrentUser, + selectCurrentUser } from "../../redux/user/user.selectors"; -import { useCookies } from "react-cookie"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, @@ -31,7 +30,7 @@ export function JobsExportAllButton({ const { t } = useTranslation(); const [updateJob] = useMutation(UPDATE_JOBS); const [insertExportLog] = useMutation(INSERT_EXPORT_LOG); - const [cookies] = useCookies(); + const [loading, setLoading] = useState(false); const handleQbxml = async () => { diff --git a/client/src/components/payable-export-all-button/payable-export-all-button.component.jsx b/client/src/components/payable-export-all-button/payable-export-all-button.component.jsx index 09a60be98..ea02a4293 100644 --- a/client/src/components/payable-export-all-button/payable-export-all-button.component.jsx +++ b/client/src/components/payable-export-all-button/payable-export-all-button.component.jsx @@ -14,7 +14,7 @@ import { import { logImEXEvent } from "../../firebase/firebase.utils"; import _ from "lodash"; import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries"; -import { useCookies } from "react-cookie"; + const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, @@ -33,7 +33,7 @@ export function PayableExportAll({ const [updateBill] = useMutation(UPDATE_BILLS); const [loading, setLoading] = useState(false); const [insertExportLog] = useMutation(INSERT_EXPORT_LOG); - const [cookies] = useCookies(); + const handleQbxml = async () => { logImEXEvent("accounting_payables_export_all"); diff --git a/client/src/components/payable-export-button/payable-export-button.component.jsx b/client/src/components/payable-export-button/payable-export-button.component.jsx index 1d01a248e..a43a93f39 100644 --- a/client/src/components/payable-export-button/payable-export-button.component.jsx +++ b/client/src/components/payable-export-button/payable-export-button.component.jsx @@ -13,7 +13,7 @@ import { } from "../../redux/user/user.selectors"; import { logImEXEvent } from "../../firebase/firebase.utils"; import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries"; -import { useCookies } from "react-cookie"; + const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, @@ -32,7 +32,7 @@ export function PayableExportButton({ const [updateBill] = useMutation(UPDATE_BILLS); const [loading, setLoading] = useState(false); const [insertExportLog] = useMutation(INSERT_EXPORT_LOG); - const [cookies] = useCookies(); + const handleQbxml = async () => { logImEXEvent("accounting_export_payable"); diff --git a/client/src/components/payment-export-button/payment-export-button.component.jsx b/client/src/components/payment-export-button/payment-export-button.component.jsx index 942b89288..f57864818 100644 --- a/client/src/components/payment-export-button/payment-export-button.component.jsx +++ b/client/src/components/payment-export-button/payment-export-button.component.jsx @@ -8,7 +8,7 @@ import { createStructuredSelector } from "reselect"; import { auth, logImEXEvent } from "../../firebase/firebase.utils"; import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries"; import { UPDATE_PAYMENTS } from "../../graphql/payments.queries"; -import { useCookies } from "react-cookie"; + import { selectBodyshop, @@ -32,7 +32,7 @@ export function PaymentExportButton({ const [updatePayment] = useMutation(UPDATE_PAYMENTS); const [loading, setLoading] = useState(false); const [insertExportLog] = useMutation(INSERT_EXPORT_LOG); - const [cookies] = useCookies(); + const handleQbxml = async () => { logImEXEvent("accounting_payment_export"); diff --git a/client/src/components/payments-export-all-button/payments-export-all-button.component.jsx b/client/src/components/payments-export-all-button/payments-export-all-button.component.jsx index 2da147876..a70cd6d0c 100644 --- a/client/src/components/payments-export-all-button/payments-export-all-button.component.jsx +++ b/client/src/components/payments-export-all-button/payments-export-all-button.component.jsx @@ -8,7 +8,7 @@ import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries"; import { UPDATE_PAYMENTS } from "../../graphql/payments.queries"; -import { useCookies } from "react-cookie"; + import { selectBodyshop, @@ -31,7 +31,7 @@ export function PaymentsExportAllButton({ const [updatePayments] = useMutation(UPDATE_PAYMENTS); const [loading, setLoading] = useState(false); const [insertExportLog] = useMutation(INSERT_EXPORT_LOG); - const [cookies] = useCookies(); + const handleQbxml = async () => { setLoading(true); diff --git a/client/src/components/qbo-authorize/qbo-authorize.component.jsx b/client/src/components/qbo-authorize/qbo-authorize.component.jsx index 31b08b130..8d333a989 100644 --- a/client/src/components/qbo-authorize/qbo-authorize.component.jsx +++ b/client/src/components/qbo-authorize/qbo-authorize.component.jsx @@ -1,4 +1,4 @@ -import { Space, Tag } from "antd"; +import { Space } from "antd"; import Axios from "axios"; import queryString from "query-string"; import React, { useEffect } from "react"; @@ -9,7 +9,7 @@ import QboSignIn from "../../assets/qbo/C2QB_green_btn_med_default.svg"; export default function QboAuthorizeComponent() { const location = useLocation(); const history = useHistory(); - const [cookies, setCookie] = useCookies(["access_token", "refresh_token"]); + const [, setCookie] = useCookies(["access_token", "refresh_token"]); const handleQbSignIn = async () => { const result = await Axios.post("/qbo/authorize");