From ef698529d776ac042e5101dbef55686201e499de Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Fri, 5 Apr 2024 10:21:31 -0400 Subject: [PATCH] - Changes required by ESLint. Signed-off-by: Dave Richer --- .../job-search-select.component.jsx | 69 +++++++++++-------- 1 file changed, 39 insertions(+), 30 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 117d0f407..be1075034 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 @@ -1,25 +1,34 @@ -import { useLazyQuery } from "@apollo/client"; -import { Select, Space, Spin, Tag } from "antd"; +import {useLazyQuery} from "@apollo/client"; +import {Select, Space, Spin, Tag} from "antd"; import _ from "lodash"; -import React, { forwardRef, useEffect, useState } from "react"; -import { useTranslation } from "react-i18next"; -import { SEARCH_JOBS_BY_ID_FOR_AUTOCOMPLETE, SEARCH_JOBS_FOR_AUTOCOMPLETE } from "../../graphql/jobs.queries"; +import React, {forwardRef, useEffect, useState} from "react"; +import {useTranslation} from "react-i18next"; +import { + SEARCH_JOBS_BY_ID_FOR_AUTOCOMPLETE, + SEARCH_JOBS_FOR_AUTOCOMPLETE +} from "../../graphql/jobs.queries"; import AlertComponent from "../alert/alert.component"; -import { OwnerNameDisplayFunction } from "../owner-name-display/owner-name-display.component"; -import { SearchOutlined } from "@ant-design/icons"; -import { LoadingOutlined } from "@ant-design/icons"; +import {OwnerNameDisplayFunction} from "../owner-name-display/owner-name-display.component"; +import {LoadingOutlined} from "@ant-design/icons"; -const { Option } = Select; +const {Option} = Select; const JobSearchSelect = ( - { disabled, convertedOnly = false, notInvoiced = false, notExported = true, clm_no = false, ...restProps }, + { + disabled, + convertedOnly = false, + notInvoiced = false, + notExported = true, + clm_no = false, + ...restProps + }, ref ) => { - const { t } = useTranslation(); + const {t} = useTranslation(); const [theOptions, setTheOptions] = useState([]); - const [callSearch, { loading, error, data }] = useLazyQuery(SEARCH_JOBS_FOR_AUTOCOMPLETE, {}); + const [callSearch, {loading, error, data}] = useLazyQuery(SEARCH_JOBS_FOR_AUTOCOMPLETE, {}); - const [callIdSearch, { loading: idLoading, error: idError, data: idData }] = useLazyQuery( + const [callIdSearch, {loading: idLoading, error: idError, data: idData}] = useLazyQuery( SEARCH_JOBS_BY_ID_FOR_AUTOCOMPLETE ); @@ -34,10 +43,10 @@ const JobSearchSelect = ( search: value, ...(convertedOnly || notExported ? { - ...(convertedOnly ? { isConverted: true } : {}), - ...(notExported ? { notExported: true } : {}), - ...(notInvoiced ? { notInvoiced: true } : {}) - } + ...(convertedOnly ? {isConverted: true} : {}), + ...(notExported ? {notExported: true} : {}), + ...(notInvoiced ? {notInvoiced: true} : {}) + } : {}) } }); @@ -45,7 +54,7 @@ const JobSearchSelect = ( useEffect(() => { if (restProps.value) { - callIdSearch({ variables: { id: restProps.value } }); // Sometimes results in a no-op. Not sure how to fix. + callIdSearch({variables: {id: restProps.value}}); // Sometimes results in a no-op. Not sure how to fix. } }, [restProps.value, callIdSearch]); @@ -75,14 +84,14 @@ const JobSearchSelect = ( filterOption={false} onSearch={handleSearch} //loading={loading || idLoading} - suffixIcon={loading && } - notFoundContent={loading ? : null} + suffixIcon={(loading || idLoading) && } + notFoundContent={loading ? : null} {...restProps} > {theOptions ? theOptions.map((o) => ( - + )) : null} - {error ? : null} - {idError ? : null} + {error ? : null} + {idError ? : null} ); };