feature/IO-3123-Code-Review-Adjustments: Make Code review adjustments
This commit is contained in:
@@ -134,10 +134,10 @@ export function JobsDetailHeaderActions({
|
||||
const notification = useNotification();
|
||||
|
||||
const {
|
||||
treatments: { ImEXPay, Share_To_Teams }
|
||||
treatments: { ImEXPay }
|
||||
} = useSplitTreatments({
|
||||
attributes: {},
|
||||
names: ["ImEXPay", "Share_To_Teams"],
|
||||
names: ["ImEXPay"],
|
||||
splitKey: bodyshop && bodyshop.imexshopid
|
||||
});
|
||||
|
||||
@@ -202,7 +202,10 @@ export function JobsDetailHeaderActions({
|
||||
message: t("appointments.successes.created")
|
||||
});
|
||||
} catch (error) {
|
||||
notification.open({ type: "error", message: t("appointments.errors.saving", { error: error.message }) });
|
||||
notification.open({
|
||||
type: "error",
|
||||
message: t("appointments.errors.saving", { error: error.message })
|
||||
});
|
||||
} finally {
|
||||
setLoading(false);
|
||||
setVisibility(false);
|
||||
@@ -839,7 +842,7 @@ export function JobsDetailHeaderActions({
|
||||
id: "job-actions-addtoproduction",
|
||||
disabled: !job.converted,
|
||||
label: t("jobs.actions.addtoproduction"),
|
||||
onClick: () => AddToProduction(client, job.id, refetch, notification)
|
||||
onClick: () => AddToProduction(client, job.id, refetch, false, notification)
|
||||
}
|
||||
);
|
||||
|
||||
@@ -972,7 +975,7 @@ export function JobsDetailHeaderActions({
|
||||
}
|
||||
);
|
||||
|
||||
if (Share_To_Teams?.treatment === "on") {
|
||||
if (bodyshop?.md_functionality_toggles?.teams) {
|
||||
menuItems.push({
|
||||
key: "sharetoteams",
|
||||
id: "job-actions-sharetoteams",
|
||||
|
||||
@@ -13,6 +13,7 @@ import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||
import { DateTimeFormatterFunction } from "../../utils/DateFormatter";
|
||||
import FormDateTimePickerComponent from "../form-date-time-picker/form-date-time-picker.component";
|
||||
import { useNotification } from "../../contexts/Notifications/notificationContext.jsx";
|
||||
import LoadingSpinner from "../loading-spinner/loading-spinner.component.jsx";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
//currentUser: selectCurrentUser,
|
||||
@@ -39,7 +40,7 @@ export function JobsDetailHeaderActionsToggleProduction({
|
||||
const [form] = Form.useForm();
|
||||
const notification = useNotification();
|
||||
|
||||
const [getJobDetails] = useLazyQuery(GET_JOB_BY_PK_QUICK_INTAKE, {
|
||||
const [getJobDetails, { loading: jobDetailsLoading }] = useLazyQuery(GET_JOB_BY_PK_QUICK_INTAKE, {
|
||||
variables: { id: job.id },
|
||||
onCompleted: (data) => {
|
||||
if (data?.jobs_by_pk) {
|
||||
@@ -109,65 +110,69 @@ export function JobsDetailHeaderActionsToggleProduction({
|
||||
|
||||
const popMenu = (
|
||||
<div onClick={(e) => e.stopPropagation()}>
|
||||
<Form layout="vertical" form={form} onFinish={handleConvert}>
|
||||
{scenario === "pre" && (
|
||||
<>
|
||||
<Form.Item
|
||||
name={["actual_in"]}
|
||||
label={t("jobs.fields.actual_in")}
|
||||
rules={[
|
||||
{
|
||||
required: true
|
||||
//message: t("general.validation.required"),
|
||||
}
|
||||
]}
|
||||
>
|
||||
<FormDateTimePickerComponent disabled={jobRO} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name={["scheduled_completion"]}
|
||||
label={t("jobs.fields.scheduled_completion")}
|
||||
rules={[
|
||||
{
|
||||
required: true
|
||||
//message: t("general.validation.required"),
|
||||
}
|
||||
]}
|
||||
>
|
||||
<FormDateTimePickerComponent disabled={jobRO} />
|
||||
</Form.Item>
|
||||
<Form.Item name={["scheduled_delivery"]} label={t("jobs.fields.scheduled_delivery")}>
|
||||
<FormDateTimePickerComponent disabled={jobRO} />
|
||||
</Form.Item>
|
||||
</>
|
||||
)}
|
||||
{scenario === "prod" && (
|
||||
<>
|
||||
<Form.Item
|
||||
name={["actual_completion"]}
|
||||
label={t("jobs.fields.actual_completion")}
|
||||
rules={[
|
||||
{
|
||||
required: true
|
||||
//message: t("general.validation.required"),
|
||||
}
|
||||
]}
|
||||
>
|
||||
<FormDateTimePickerComponent disabled={jobRO} />
|
||||
</Form.Item>
|
||||
{jobDetailsLoading ? (
|
||||
<LoadingSpinner />
|
||||
) : (
|
||||
<Form layout="vertical" form={form} onFinish={handleConvert}>
|
||||
{scenario === "pre" && (
|
||||
<>
|
||||
<Form.Item
|
||||
name={["actual_in"]}
|
||||
label={t("jobs.fields.actual_in")}
|
||||
rules={[
|
||||
{
|
||||
required: true
|
||||
//message: t("general.validation.required"),
|
||||
}
|
||||
]}
|
||||
>
|
||||
<FormDateTimePickerComponent disabled={jobRO} />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name={["scheduled_completion"]}
|
||||
label={t("jobs.fields.scheduled_completion")}
|
||||
rules={[
|
||||
{
|
||||
required: true
|
||||
//message: t("general.validation.required"),
|
||||
}
|
||||
]}
|
||||
>
|
||||
<FormDateTimePickerComponent disabled={jobRO} />
|
||||
</Form.Item>
|
||||
<Form.Item name={["scheduled_delivery"]} label={t("jobs.fields.scheduled_delivery")}>
|
||||
<FormDateTimePickerComponent disabled={jobRO} />
|
||||
</Form.Item>
|
||||
</>
|
||||
)}
|
||||
{scenario === "prod" && (
|
||||
<>
|
||||
<Form.Item
|
||||
name={["actual_completion"]}
|
||||
label={t("jobs.fields.actual_completion")}
|
||||
rules={[
|
||||
{
|
||||
required: true
|
||||
//message: t("general.validation.required"),
|
||||
}
|
||||
]}
|
||||
>
|
||||
<FormDateTimePickerComponent disabled={jobRO} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item name={["actual_delivery"]} label={t("jobs.fields.actual_delivery")}>
|
||||
<FormDateTimePickerComponent disabled={jobRO} />
|
||||
</Form.Item>
|
||||
</>
|
||||
)}
|
||||
<Form.Item name={["actual_delivery"]} label={t("jobs.fields.actual_delivery")}>
|
||||
<FormDateTimePickerComponent disabled={jobRO} />
|
||||
</Form.Item>
|
||||
</>
|
||||
)}
|
||||
|
||||
<Space wrap>
|
||||
<Button type="primary" onClick={() => form.submit()} loading={loading}>
|
||||
{t("general.actions.save")}
|
||||
</Button>
|
||||
</Space>
|
||||
</Form>
|
||||
<Space wrap>
|
||||
<Button type="primary" onClick={() => form.submit()} loading={loading}>
|
||||
{t("general.actions.save")}
|
||||
</Button>
|
||||
</Space>
|
||||
</Form>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user