From a56b720e09cd0feeb29c845cc4d291abe95385e7 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Wed, 23 Apr 2025 09:51:44 -0700 Subject: [PATCH 1/3] IO-3215 Employee Assignment Timeticket Modal Signed-off-by: Allan Carr --- .../time-ticket-modal.component.jsx | 13 ++++++---- .../time-ticket-modal.container.jsx | 9 +++---- client/src/graphql/jobs-lines.queries.js | 24 +++++++++++++++++++ 3 files changed, 38 insertions(+), 8 deletions(-) diff --git a/client/src/components/time-ticket-modal/time-ticket-modal.component.jsx b/client/src/components/time-ticket-modal/time-ticket-modal.component.jsx index 7f2a1df72..84dbe8caa 100644 --- a/client/src/components/time-ticket-modal/time-ticket-modal.component.jsx +++ b/client/src/components/time-ticket-modal/time-ticket-modal.component.jsx @@ -1,7 +1,6 @@ import { useLazyQuery } from "@apollo/client"; import { useSplitTreatments } from "@splitsoftware/splitio-react"; -import { Form, Input, InputNumber, Select, Switch } from "antd"; -import React from "react"; +import { Card, Form, Input, InputNumber, Select, Space, Switch } from "antd"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; @@ -19,6 +18,7 @@ import LayoutFormRow from "../layout-form-row/layout-form-row.component"; import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component"; import { HasRbacAccess } from "../rbac-wrapper/rbac-wrapper.component"; import TimeTicketList from "../time-ticket-list/time-ticket-list.component"; +import JobEmployeeAssignmentsContainer from "./../job-employee-assignments/job-employee-assignments.container"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, @@ -319,10 +319,15 @@ export function TimeTicketModalComponent({ } export function LaborAllocationContainer({ jobid, loading, lineTicketData, hideTimeTickets = false }) { + const { t } = useTranslation(); if (loading) return ; if (!lineTicketData) return null; + if (!jobid) return null; return ( -
+ + + + )} -
+ ); } diff --git a/client/src/components/time-ticket-modal/time-ticket-modal.container.jsx b/client/src/components/time-ticket-modal/time-ticket-modal.container.jsx index 5e0393e10..bfbdc77cf 100644 --- a/client/src/components/time-ticket-modal/time-ticket-modal.container.jsx +++ b/client/src/components/time-ticket-modal/time-ticket-modal.container.jsx @@ -2,10 +2,11 @@ import { PageHeader } from "@ant-design/pro-layout"; import { useMutation, useQuery } from "@apollo/client"; import { useSplitTreatments } from "@splitsoftware/splitio-react"; import { Button, Form, Modal, Space } from "antd"; -import React, { useEffect, useState } from "react"; +import { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; +import { useNotification } from "../../contexts/Notifications/notificationContext.jsx"; import { QUERY_ACTIVE_EMPLOYEES } from "../../graphql/employees.queries"; import { INSERT_NEW_TIME_TICKET, UPDATE_TIME_TICKET } from "../../graphql/timetickets.queries"; import { toggleModalVisible } from "../../redux/modals/modals.actions"; @@ -14,7 +15,6 @@ import { selectBodyshop } from "../../redux/user/user.selectors"; import dayjs from "../../utils/day"; import TimeTicketsCommitToggleComponent from "../time-tickets-commit-toggle/time-tickets-commit-toggle.component"; import TimeTicketModalComponent from "./time-ticket-modal.component"; -import { useNotification } from "../../contexts/Notifications/notificationContext.jsx"; const mapStateToProps = createStructuredSelector({ timeTicketModal: selectTimeTicket, @@ -81,7 +81,7 @@ export function TimeTicketModalContainer({ timeTicketModal, toggleModalVisible, } }; - const handleMutationSuccess = (response) => { + const handleMutationSuccess = () => { notification["success"]({ message: t("timetickets.successes.created") }); @@ -123,7 +123,7 @@ export function TimeTicketModalContainer({ timeTicketModal, toggleModalVisible, if (timeTicketModal.open) form.resetFields(); }, [timeTicketModal.open, form]); - const handleFieldsChange = (changedFields, allFields) => { + const handleFieldsChange = (changedFields) => { if (!!changedFields.employeeid && !!EmployeeAutoCompleteData) { const emps = EmployeeAutoCompleteData.employees.filter((e) => e.id === changedFields.employeeid); form.setFieldsValue({ @@ -182,6 +182,7 @@ export function TimeTicketModalContainer({ timeTicketModal, toggleModalVisible, } destroyOnClose + id="time-ticket-modal" >
Date: Wed, 23 Apr 2025 13:10:42 -0700 Subject: [PATCH 2/3] IO-3212 ACV Amount Signed-off-by: Allan Carr --- .../jobs-detail-general/jobs-detail-general.component.jsx | 3 +++ client/src/translations/en_us/common.json | 1 + client/src/translations/es/common.json | 1 + client/src/translations/fr/common.json | 1 + hasura/metadata/tables.yaml | 6 ++++++ .../down.sql | 4 ++++ .../up.sql | 2 ++ 7 files changed, 18 insertions(+) create mode 100644 hasura/migrations/1745438734125_alter_table_public_jobs_add_column_acv_amount/down.sql create mode 100644 hasura/migrations/1745438734125_alter_table_public_jobs_add_column_acv_amount/up.sql diff --git a/client/src/components/jobs-detail-general/jobs-detail-general.component.jsx b/client/src/components/jobs-detail-general/jobs-detail-general.component.jsx index f36269c83..e31a5e528 100644 --- a/client/src/components/jobs-detail-general/jobs-detail-general.component.jsx +++ b/client/src/components/jobs-detail-general/jobs-detail-general.component.jsx @@ -188,6 +188,9 @@ export function JobsDetailGeneral({ bodyshop, jobRO, job, form }) { + + + diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 0a1ec198a..2637d6986 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -1636,6 +1636,7 @@ "actual_completion": "Actual Completion", "actual_delivery": "Actual Delivery", "actual_in": "Actual In", + "acv_amount": "ACV Amount", "adjustment_bottom_line": "Adjustments", "adjustmenthours": "Adjustment Hours", "alt_transport": "Alt. Trans.", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 820fd2973..e51739dd6 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -1636,6 +1636,7 @@ "actual_completion": "Realización real", "actual_delivery": "Entrega real", "actual_in": "Real en", + "acv_amount": "", "adjustment_bottom_line": "Ajustes", "adjustmenthours": "", "alt_transport": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index cd799fec9..8f4f0ce39 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -1637,6 +1637,7 @@ "actual_completion": "Achèvement réel", "actual_delivery": "Livraison réelle", "actual_in": "En réel", + "acv_amount": "", "adjustment_bottom_line": "Ajustements", "adjustmenthours": "", "alt_transport": "", diff --git a/hasura/metadata/tables.yaml b/hasura/metadata/tables.yaml index 0e8cbb888..32108a1b7 100644 --- a/hasura/metadata/tables.yaml +++ b/hasura/metadata/tables.yaml @@ -3595,6 +3595,7 @@ - actual_completion - actual_delivery - actual_in + - acv_amount - adj_g_disc - adj_strdis - adj_towdis @@ -3700,6 +3701,7 @@ - federal_tax_rate - flat_rate_ats - g_bett_amt + - hit_and_run - id - inproduction - ins_addr1 @@ -3866,6 +3868,7 @@ - actual_completion - actual_delivery - actual_in + - acv_amount - adj_g_disc - adj_strdis - adj_towdis @@ -3972,6 +3975,7 @@ - federal_tax_rate - flat_rate_ats - g_bett_amt + - hit_and_run - id - inproduction - ins_addr1 @@ -4150,6 +4154,7 @@ - actual_completion - actual_delivery - actual_in + - acv_amount - adj_g_disc - adj_strdis - adj_towdis @@ -4256,6 +4261,7 @@ - federal_tax_rate - flat_rate_ats - g_bett_amt + - hit_and_run - id - inproduction - ins_addr1 diff --git a/hasura/migrations/1745438734125_alter_table_public_jobs_add_column_acv_amount/down.sql b/hasura/migrations/1745438734125_alter_table_public_jobs_add_column_acv_amount/down.sql new file mode 100644 index 000000000..61e405200 --- /dev/null +++ b/hasura/migrations/1745438734125_alter_table_public_jobs_add_column_acv_amount/down.sql @@ -0,0 +1,4 @@ +-- Could not auto-generate a down migration. +-- Please write an appropriate down migration for the SQL below: +-- alter table "public"."jobs" add column "acv_amount" numeric +-- null; diff --git a/hasura/migrations/1745438734125_alter_table_public_jobs_add_column_acv_amount/up.sql b/hasura/migrations/1745438734125_alter_table_public_jobs_add_column_acv_amount/up.sql new file mode 100644 index 000000000..14af4c806 --- /dev/null +++ b/hasura/migrations/1745438734125_alter_table_public_jobs_add_column_acv_amount/up.sql @@ -0,0 +1,2 @@ +alter table "public"."jobs" add column "acv_amount" numeric + null; From 55944257aa89b35479a5f377d83ce15767619e8d Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Wed, 23 Apr 2025 13:16:49 -0700 Subject: [PATCH 3/3] IO-3212 ACV Amount Signed-off-by: Allan Carr --- client/src/graphql/jobs.queries.js | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index b31c5c17a..2c5dcd314 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -423,6 +423,7 @@ export const GET_JOB_BY_PK = gql` actual_completion actual_delivery actual_in + acv_amount adjustment_bottom_line alt_transport area_of_damage