diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 6af655c07..c50ae7d4a 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -856,6 +856,27 @@ + + csr + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + customerowing false @@ -1045,6 +1066,69 @@ + + kmin + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + kmout + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + loss_desc + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + owner false @@ -1150,6 +1234,48 @@ + + ponumber + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + referralsource + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + repairtotal false @@ -1318,6 +1444,27 @@ + + unitnumber + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + vehicle false diff --git a/client/src/components/jobs-detail-claims/jobs-detail-claims.component.jsx b/client/src/components/jobs-detail-claims/jobs-detail-claims.component.jsx index 3aec766b1..5d607eee3 100644 --- a/client/src/components/jobs-detail-claims/jobs-detail-claims.component.jsx +++ b/client/src/components/jobs-detail-claims/jobs-detail-claims.component.jsx @@ -1,44 +1,81 @@ +import { Form, Input, Switch } from "antd"; import React, { useContext } from "react"; -import { Form, Input } from "antd"; -import FormItemPhone from "../form-items-formatted/phone-form-item.component"; +import { useTranslation } from "react-i18next"; import JobDetailFormContext from "../../pages/jobs-detail/jobs-detail.page.context"; +import FormItemPhone from "../form-items-formatted/phone-form-item.component"; export default function JobsDetailClaims({ job }) { const form = useContext(JobDetailFormContext); - const { getFieldDecorator, isFieldTouched } = form; + const { getFieldDecorator } = form; + const { t } = useTranslation(); return (
-
- - {isFieldTouched("est_ct_ln") ? "Yes" : "No"} - {getFieldDecorator("est_ct_ln", { - initialValue: job.est_ct_ln - })()} - - - {getFieldDecorator("est_ct_fn", { - initialValue: job.est_ct_fn - })()} - - - {getFieldDecorator("est_ph1", { - initialValue: job.est_ph1 - })()} - - - {getFieldDecorator("est_ea", { - initialValue: job.est_ea, - - rules: [ - { - type: "email", - message: "This is not a valid email address." - } - ] - })()} - -
+ + {getFieldDecorator("csr", { + initialValue: job.csr + })()} + + + {getFieldDecorator("loss_desc", { + initialValue: job.loss_desc + })()} + + TODO: How to handle different taxes and marking them as exempt? + { + // + // {getFieldDecorator("exempt", { + // initialValue: job.exempt + // })()} + // + } + + {getFieldDecorator("po_number", { + initialValue: job.po_number + })()} + + + {getFieldDecorator("unit_number", { + initialValue: job.unit_number + })()} + + + {getFieldDecorator("special_coverage_policy", { + initialValue: job.special_coverage_policy, + valuePropName: "checked" + })()} + + + {getFieldDecorator("kmin", { + initialValue: job.kmin + })()} + + + {getFieldDecorator("kmout", { + initialValue: job.kmout + })()} + + + {getFieldDecorator("referral_source", { + initialValue: job.referral_source + })()} + + + {getFieldDecorator("est_ph1", { + initialValue: job.est_ph1 + })()} + + + {getFieldDecorator("est_ea", { + initialValue: job.est_ea, + rules: [ + { + type: "email", + message: "This is not a valid email address." + } + ] + })()} +
); } diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index 33f56e24b..93c36d10c 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -122,6 +122,13 @@ export const GET_JOB_BY_PK = gql` scheduled_completion scheduled_in service_car + csr + loss_desc + kmin + kmout + referral_source + unit_number + po_number special_coverage_policy scheduled_delivery job_status { diff --git a/client/src/pages/jobs-detail/jobs-detail.page.container.jsx b/client/src/pages/jobs-detail/jobs-detail.page.container.jsx index 7003ea7f0..e0c49840b 100644 --- a/client/src/pages/jobs-detail/jobs-detail.page.container.jsx +++ b/client/src/pages/jobs-detail/jobs-detail.page.container.jsx @@ -4,11 +4,7 @@ import { useMutation, useQuery } from "react-apollo"; import { useTranslation } from "react-i18next"; import AlertComponent from "../../components/alert/alert.component"; import SpinComponent from "../../components/loading-spinner/loading-spinner.component"; -import { - CONVERT_JOB_TO_RO, - GET_JOB_BY_PK, - UPDATE_JOB -} from "../../graphql/jobs.queries"; +import { CONVERT_JOB_TO_RO, GET_JOB_BY_PK, UPDATE_JOB } from "../../graphql/jobs.queries"; import JobsDetailPage from "./jobs-detail.page.component"; import JobDetailFormContext from "./jobs-detail.page.context"; @@ -24,12 +20,13 @@ function JobsDetailPageContainer({ match, form }) { const [mutationConvertJob] = useMutation(CONVERT_JOB_TO_RO); useEffect(() => { - document.title = - loading && !error - ? "..." - : t("titles.jobsdetail", { - ro_number: data.jobs_by_pk.ro_number - }); + document.title = loading + ? "..." + : error + ? t("titles.app") + : t("titles.jobsdetail", { + ro_number: data.jobs_by_pk.ro_number + }); }, [loading, data, t, error]); const handleSubmit = e => { @@ -58,6 +55,7 @@ function JobsDetailPageContainer({ match, form }) { if (loading) return ; if (error) return ; + return data.jobs_by_pk ? (