Automatically search for claim number on supplement as a part of BOD-41
This commit is contained in:
@@ -16,7 +16,6 @@ export default function JobsAvailableSupplementComponent({
|
||||
data,
|
||||
refetch,
|
||||
deleteJob,
|
||||
updateJob,
|
||||
onModalOk,
|
||||
onModalCancel,
|
||||
modalVisible,
|
||||
@@ -27,6 +26,7 @@ export default function JobsAvailableSupplementComponent({
|
||||
loadEstData,
|
||||
estData,
|
||||
importOptionsState,
|
||||
modalSearchState,
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -131,7 +131,7 @@ export default function JobsAvailableSupplementComponent({
|
||||
{
|
||||
title: t("general.labels.actions"),
|
||||
key: "actions",
|
||||
render: (text, record) => (
|
||||
render: (text, record, index) => (
|
||||
<span>
|
||||
<Button
|
||||
onClick={() => {
|
||||
@@ -147,14 +147,13 @@ export default function JobsAvailableSupplementComponent({
|
||||
<Button
|
||||
onClick={() => {
|
||||
loadEstData({ variables: { id: record.id } });
|
||||
modalSearchState[1](record.clm_no);
|
||||
setModalVisible(true);
|
||||
}}>
|
||||
<PlusCircleFilled />
|
||||
</Button>
|
||||
</span>
|
||||
),
|
||||
//width: "12%",
|
||||
//ellipsis: true
|
||||
},
|
||||
];
|
||||
|
||||
@@ -186,6 +185,7 @@ export default function JobsAvailableSupplementComponent({
|
||||
visible={modalVisible}
|
||||
onOk={onModalOk}
|
||||
onCancel={onModalCancel}
|
||||
modalSearchState={modalSearchState}
|
||||
/>
|
||||
<Table
|
||||
loading={loading}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useMutation, useQuery, useApolloClient } from "@apollo/react-hooks";
|
||||
import { useApolloClient, useMutation, useQuery } from "@apollo/react-hooks";
|
||||
import { notification } from "antd";
|
||||
import { gql } from "apollo-boost";
|
||||
import React, { useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
@@ -15,9 +16,8 @@ import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import AlertComponent from "../alert/alert.component";
|
||||
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
||||
import JobsAvailableSupplementComponent from "./jobs-available-supplement.component";
|
||||
import HeaderFields from "./jobs-available-supplement.headerfields";
|
||||
import { GetSupplementDelta } from "./jobs-available-supplement.estlines.util";
|
||||
import { gql } from "apollo-boost";
|
||||
import HeaderFields from "./jobs-available-supplement.headerfields";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
@@ -29,10 +29,7 @@ export function JobsAvailableSupplementContainer({
|
||||
bodyshop,
|
||||
}) {
|
||||
const { loading, error, data, refetch } = useQuery(
|
||||
QUERY_AVAILABLE_SUPPLEMENT_JOBS,
|
||||
{
|
||||
fetchPolicy: "network-only",
|
||||
}
|
||||
QUERY_AVAILABLE_SUPPLEMENT_JOBS
|
||||
);
|
||||
const { t } = useTranslation();
|
||||
const history = useHistory();
|
||||
@@ -42,6 +39,7 @@ export function JobsAvailableSupplementContainer({
|
||||
const [modalVisible, setModalVisible] = useState(false);
|
||||
const [selectedJob, setSelectedJob] = useState(null);
|
||||
const [insertLoading, setInsertLoading] = useState(false);
|
||||
const modalSearchState = useState("");
|
||||
const [updateJob] = useMutation(UPDATE_JOB);
|
||||
const [loadEstData, estData] = estDataLazyLoad;
|
||||
const importOptionsState = useState({ overrideHeaders: false });
|
||||
@@ -135,6 +133,7 @@ export function JobsAvailableSupplementContainer({
|
||||
|
||||
const onModalCancel = () => {
|
||||
setModalVisible(false);
|
||||
modalSearchState[1]("");
|
||||
setSelectedJob(null);
|
||||
};
|
||||
|
||||
@@ -159,6 +158,7 @@ export function JobsAvailableSupplementContainer({
|
||||
loadEstData={loadEstData}
|
||||
estData={estData}
|
||||
importOptionsState={importOptionsState}
|
||||
modalSearchState={modalSearchState}
|
||||
/>
|
||||
</LoadingSpinner>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user