From ef03a6cd423c213488adf9f5f743bfa56749888e Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Thu, 4 Feb 2021 18:15:00 -0800 Subject: [PATCH] Resolved issues on time ticket modal IO-563 --- .../job-search-select.component.jsx | 8 +------- .../labor-allocations-table.component.jsx | 4 ++-- .../labor-allocations-table.utility.js | 2 +- .../time-ticket-modal.component.jsx | 12 +++++++----- .../time-ticket-modal.container.jsx | 3 ++- 5 files changed, 13 insertions(+), 16 deletions(-) diff --git a/client/src/components/job-search-select/job-search-select.component.jsx b/client/src/components/job-search-select/job-search-select.component.jsx index 728f82109..332c7eb4b 100644 --- a/client/src/components/job-search-select/job-search-select.component.jsx +++ b/client/src/components/job-search-select/job-search-select.component.jsx @@ -6,7 +6,7 @@ import React, { forwardRef, useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import { SEARCH_JOBS_BY_ID_FOR_AUTOCOMPLETE, - SEARCH_JOBS_FOR_AUTOCOMPLETE + SEARCH_JOBS_FOR_AUTOCOMPLETE, } from "../../graphql/jobs.queries"; import AlertComponent from "../alert/alert.component"; const { Option } = Select; @@ -61,12 +61,6 @@ const JobSearchSelect = ( } }, [value, option, callIdSearch]); - // useEffect(() => { - // if (value !== option && onChange) { - // onChange(option); - // } - // }, [value, option, onChange]); - const handleSelect = (value) => { setOption(value); if (value !== option && onChange) { diff --git a/client/src/components/labor-allocations-table/labor-allocations-table.component.jsx b/client/src/components/labor-allocations-table/labor-allocations-table.component.jsx index 127ad163a..a38194761 100644 --- a/client/src/components/labor-allocations-table/labor-allocations-table.component.jsx +++ b/client/src/components/labor-allocations-table/labor-allocations-table.component.jsx @@ -21,7 +21,6 @@ export function LaborAllocationsTable({ adjustments, }) { const { t } = useTranslation(); - const [totals, setTotals] = useState([]); useEffect(() => { if (!!joblines && !!timetickets && !!bodyshop); @@ -33,7 +32,8 @@ export function LaborAllocationsTable({ adjustments ) ); - }, [joblines, timetickets, bodyshop, adjustments]); + if (!jobId) setTotals([]); + }, [joblines, timetickets, bodyshop, adjustments, jobId]); return (