From e109b5102cb42a7a2abfb8bf27aa32b4f9b2d682 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Mon, 6 Jun 2022 13:53:09 -0700 Subject: [PATCH] IO-1920 Add ability to directly post tickets from tech console. --- bodyshop_translations.babel | 26 ++++++++++++++++++ .../tech-job-clock-in-form.container.jsx | 27 ++++++++++++++++--- .../time-ticket-modal.component.jsx | 2 ++ .../time-ticket-modal.container.jsx | 6 +++++ client/src/translations/en_us/common.json | 3 +++ client/src/translations/es/common.json | 3 +++ client/src/translations/fr/common.json | 3 +++ 7 files changed, 67 insertions(+), 3 deletions(-) diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index b0565a686..516cab7d9 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -5691,6 +5691,32 @@ + + inventory + + + list + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + jobs diff --git a/client/src/components/tech-job-clock-in-form/tech-job-clock-in-form.container.jsx b/client/src/components/tech-job-clock-in-form/tech-job-clock-in-form.container.jsx index cae229746..4144d06d3 100644 --- a/client/src/components/tech-job-clock-in-form/tech-job-clock-in-form.container.jsx +++ b/client/src/components/tech-job-clock-in-form/tech-job-clock-in-form.container.jsx @@ -11,13 +11,21 @@ import { selectBodyshop } from "../../redux/user/user.selectors"; import TechClockInComponent from "./tech-job-clock-in-form.component"; import TechJobPrintTickets from "../tech-job-print-tickets/tech-job-print-tickets.component"; import moment from "moment"; +import { setModalContext } from "../../redux/modals/modals.actions"; const mapStateToProps = createStructuredSelector({ technician: selectTechnician, bodyshop: selectBodyshop, }); - -export function TechClockInContainer({ technician, bodyshop }) { +const mapDispatchToProps = (dispatch) => ({ + setTimeTicketContext: (context) => + dispatch(setModalContext({ context: context, modal: "timeTicket" })), +}); +export function TechClockInContainer({ + setTimeTicketContext, + technician, + bodyshop, +}) { const [form] = Form.useForm(); const [loading, setLoading] = useState(false); const [insertTimeTicket] = useMutation(INSERT_NEW_TIME_TICKET, { @@ -75,6 +83,16 @@ export function TechClockInContainer({ technician, bodyshop }) { title={t("timetickets.labels.clockintojob")} extra={ +