- the great reformat

Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
Dave Richer
2024-02-06 18:20:58 -05:00
parent 30c530bcc4
commit e83badb454
912 changed files with 108516 additions and 107493 deletions

View File

@@ -1,44 +1,45 @@
import { useLazyQuery } from "@apollo/client";
import { Button, notification } from "antd";
import React, { useEffect } from "react";
import { useTranslation } from "react-i18next";
import { GET_JOB_FOR_CC_CONTRACT } from "../../graphql/jobs.queries";
export default function ContractCreateJobPrefillComponent({ jobId, form }) {
const [call, { loading, error, data }] = useLazyQuery(
GET_JOB_FOR_CC_CONTRACT
);
const { t } = useTranslation();
import {useLazyQuery} from "@apollo/client";
import {Button, notification} from "antd";
import React, {useEffect} from "react";
import {useTranslation} from "react-i18next";
import {GET_JOB_FOR_CC_CONTRACT} from "../../graphql/jobs.queries";
const handleClick = () => {
call({ variables: { id: jobId } });
};
export default function ContractCreateJobPrefillComponent({jobId, form}) {
const [call, {loading, error, data}] = useLazyQuery(
GET_JOB_FOR_CC_CONTRACT
);
const {t} = useTranslation();
useEffect(() => {
if (data) {
form.setFieldsValue({
driver_dlst: data.jobs_by_pk.ownr_ast,
driver_fn: data.jobs_by_pk.ownr_fn,
driver_ln: data.jobs_by_pk.ownr_ln,
driver_addr1: data.jobs_by_pk.ownr_addr1,
driver_state: data.jobs_by_pk.ownr_st,
driver_city: data.jobs_by_pk.ownr_city,
driver_zip: data.jobs_by_pk.ownr_zip,
driver_ph1: data.jobs_by_pk.ownr_ph1,
});
const handleClick = () => {
call({variables: {id: jobId}});
};
useEffect(() => {
if (data) {
form.setFieldsValue({
driver_dlst: data.jobs_by_pk.ownr_ast,
driver_fn: data.jobs_by_pk.ownr_fn,
driver_ln: data.jobs_by_pk.ownr_ln,
driver_addr1: data.jobs_by_pk.ownr_addr1,
driver_state: data.jobs_by_pk.ownr_st,
driver_city: data.jobs_by_pk.ownr_city,
driver_zip: data.jobs_by_pk.ownr_zip,
driver_ph1: data.jobs_by_pk.ownr_ph1,
});
}
}, [data, form]);
if (error) {
notification["error"]({
message: t("contracts.errors.fetchingjobinfo", {
error: JSON.stringify(error),
}),
});
}
}, [data, form]);
if (error) {
notification["error"]({
message: t("contracts.errors.fetchingjobinfo", {
error: JSON.stringify(error),
}),
});
}
return (
<Button onClick={handleClick} disabled={!jobId} loading={loading}>
{t("contracts.labels.populatefromjob")}
</Button>
);
return (
<Button onClick={handleClick} disabled={!jobId} loading={loading}>
{t("contracts.labels.populatefromjob")}
</Button>
);
}