diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 525f35692..e1889fd73 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -7383,6 +7383,27 @@ + + view + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + yes false @@ -10321,6 +10342,27 @@ + + viewdetail + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + @@ -19424,6 +19466,32 @@ + + successes + + + removed + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + diff --git a/client/src/components/global-search/global-search.component.jsx b/client/src/components/global-search/global-search.component.jsx index 95063d636..7af1fc6b2 100644 --- a/client/src/components/global-search/global-search.component.jsx +++ b/client/src/components/global-search/global-search.component.jsx @@ -106,7 +106,7 @@ export default function GlobalSearch() { vehicle.v_model_yr || "" } ${vehicle.v_make_desc || ""} ${ vehicle.v_model_desc || "" - }`} + } - ${vehicle.plate_no} - ${vehicle.v_vin}`} ), diff --git a/client/src/components/invoice-detail-edit/invoice-detail-edit.container.jsx b/client/src/components/invoice-detail-edit/invoice-detail-edit.container.jsx index 39434fbe6..c1408d4ed 100644 --- a/client/src/components/invoice-detail-edit/invoice-detail-edit.container.jsx +++ b/client/src/components/invoice-detail-edit/invoice-detail-edit.container.jsx @@ -49,7 +49,13 @@ export function InvoiceDetailEditContainer({ bodyshop }) { delete il.__typename; updates.push( updateInvoiceLine({ - variables: { invoicelineId: il.id, invoiceLine: il }, + variables: { + invoicelineId: il.id, + invoiceLine: { + ...il, + joblineid: il.joblineid === "noline" ? null : il.joblineid, + }, + }, }) ); }); diff --git a/client/src/components/parts-status-pie/parts-status-pie.component.jsx b/client/src/components/parts-status-pie/parts-status-pie.component.jsx index d3603b662..1afe6abc6 100644 --- a/client/src/components/parts-status-pie/parts-status-pie.component.jsx +++ b/client/src/components/parts-status-pie/parts-status-pie.component.jsx @@ -1,24 +1,25 @@ import React from "react"; export default function PartsStatusPie({ partsList }) { + return
Parts Pie
; //const [pieData, setPieData] = useState([]); - const result = partsList - ? partsList.reduce((names, name) => { - const val = name || "?"; - const count = names[val] || 0; - names[val] = count + 1; - return names; - }, {}) - : {}; + // const result = partsList + // ? partsList.reduce((names, name) => { + // const val = name || "?"; + // const count = names[val] || 0; + // names[val] = count + 1; + // return names; + // }, {}) + // : {}; - const pieData = Object.keys(result).map((i) => { - return { - id: i, - label: i, - value: result[i], - }; - }); + // const pieData = Object.keys(result).map((i) => { + // return { + // id: i, + // label: i, + // value: result[i], + // }; + // }); - return
{JSON.stringify(pieData)}
; + // return
{JSON.stringify(pieData)}
; } diff --git a/client/src/components/production-board-kanban-card/production-board-kanban-card.component.jsx b/client/src/components/production-board-kanban-card/production-board-kanban-card.component.jsx index 20965eaf3..245789a50 100644 --- a/client/src/components/production-board-kanban-card/production-board-kanban-card.component.jsx +++ b/client/src/components/production-board-kanban-card/production-board-kanban-card.component.jsx @@ -1,74 +1,87 @@ import React from "react"; -import { Card, Row, Col } from "antd"; +import { Card, Row, Col, Dropdown } from "antd"; import { DateTimeFormatter } from "../../utils/DateFormatter"; import ProductionAlert from "../production-list-columns/production-list-columns.alert.component"; import { EyeFilled } from "@ant-design/icons"; import { Link } from "react-router-dom"; import "./production-board-card.styles.scss"; +import ProductionRemoveButton from "../production-remove-button/production-remove-button.component"; +import { useTranslation } from "react-i18next"; export default function ProductionBoardCard(card) { + const { t } = useTranslation(); + const menu = ( +
+ + + +
+ ); + return ( - - - -
{`${card.ownr_fn || ""} ${ - card.ownr_ln || "" - } ${card.ownr_co_nm || ""}`}
- -
- - -
{card.clm_no || ""}
- - -
{card.ins_co_nm || ""}
- -
- - -
-
-
{`B: ${card.labhrs.aggregate.sum.mod_lb_hrs || "?"}`}
-
{`R: ${card.larhrs.aggregate.sum.mod_lb_hrs || "?"}`}
+ + + + +
{`${card.ownr_fn || ""} ${ + card.ownr_ln || "" + } ${card.ownr_co_nm || ""}`}
+ +
+ + +
{card.clm_no || ""}
+ + +
{card.ins_co_nm || ""}
+ +
+ + +
+
+
{`B: ${card.labhrs.aggregate.sum.mod_lb_hrs || "?"}`}
+
{`R: ${card.larhrs.aggregate.sum.mod_lb_hrs || "?"}`}
+
+
+
{`B: ${ + card.employee_body_rel + ? `${card.employee_body_rel.first_name} ${card.employee_body_rel.last_name}` + : "" + }`}
+
{`P: ${ + card.employee_prep_rel + ? `${card.employee_prep_rel.first_name} ${card.employee_prep_rel.last_name}` + : "" + }`}
+
{`R: ${ + card.employee_refinish_rel + ? `${card.employee_refinish_rel.first_name} ${card.employee_refinish_rel.last_name}` + : "" + }`}
+
-
-
{`B: ${ - card.employee_body_rel - ? `${card.employee_body_rel.first_name} ${card.employee_body_rel.last_name}` - : "" - }`}
-
{`P: ${ - card.employee_prep_rel - ? `${card.employee_prep_rel.first_name} ${card.employee_prep_rel.last_name}` - : "" - }`}
-
{`R: ${ - card.employee_refinish_rel - ? `${card.employee_refinish_rel.first_name} ${card.employee_refinish_rel.last_name}` - : "" - }`}
-
-
- - - - - {card.scheduled_completion} - - -
- - - - -
- + + + + + {card.scheduled_completion} + + +
+ + + + +
+ + ); } diff --git a/client/src/components/production-remove-button/production-remove-button.component.jsx b/client/src/components/production-remove-button/production-remove-button.component.jsx index 53c3c86fb..83d67cd5d 100644 --- a/client/src/components/production-remove-button/production-remove-button.component.jsx +++ b/client/src/components/production-remove-button/production-remove-button.component.jsx @@ -1,28 +1,36 @@ -import React from "react"; import { useMutation } from "@apollo/react-hooks"; -import { UPDATE_JOB } from "../../graphql/jobs.queries"; import { Button, notification } from "antd"; +import React, { useState } from "react"; import { useTranslation } from "react-i18next"; import { logImEXEvent } from "../../firebase/firebase.utils"; +import { UPDATE_JOB } from "../../graphql/jobs.queries"; export default function ProductionRemoveButton({ jobId }) { const [removeJobFromProduction] = useMutation(UPDATE_JOB); const { t } = useTranslation(); - const handleRemoveFromProd = () => { - logImEXEvent("production_remove_job"); + const [loading, setLoading] = useState(false); - removeJobFromProduction({ + const handleRemoveFromProd = async () => { + logImEXEvent("production_remove_job"); + setLoading(true); + const result = await removeJobFromProduction({ variables: { jobId: jobId, job: { inproduction: false } }, - }).catch((error) => { + }); + + if (!!!result.errors) { + notification["success"]({ message: t("production.successes.removed") }); + } else { notification["error"]({ message: t("production.errors.removing", { - error: JSON.stringify(error), + error: JSON.stringify(result.errors), }), }); - }); + } + setLoading(false); }; + return ( - ); diff --git a/client/src/graphql/search.queries.js b/client/src/graphql/search.queries.js index 897a75235..aece6edaf 100644 --- a/client/src/graphql/search.queries.js +++ b/client/src/graphql/search.queries.js @@ -29,6 +29,8 @@ export const GLOBAL_SEARCH_QUERY = gql` v_model_desc v_make_desc v_color + v_vin + plate_no } search_payments(args: { search: $search }) { id diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 34808f65c..b2e450d6a 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -474,6 +474,7 @@ "text": "Text", "unknown": "Unknown", "username": "Username", + "view": "View", "yes": "Yes" }, "languages": { @@ -664,7 +665,8 @@ "recalculate": "Recalculate", "reconcile": "Reconcile", "schedule": "Schedule", - "sendcsi": "Send CSI" + "sendcsi": "Send CSI", + "viewdetail": "View Details" }, "errors": { "addingtoproduction": "Error adding to production. {{error}}", @@ -1190,6 +1192,9 @@ "note": "Production Note", "paintpriority": "P/P", "refinishhours": "R" + }, + "successes": { + "removed": "Job removed from production." } }, "profile": { diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 7201b5da6..a6538b63c 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -474,6 +474,7 @@ "text": "", "unknown": "Desconocido", "username": "", + "view": "", "yes": "" }, "languages": { @@ -664,7 +665,8 @@ "recalculate": "", "reconcile": "", "schedule": "Programar", - "sendcsi": "" + "sendcsi": "", + "viewdetail": "" }, "errors": { "addingtoproduction": "", @@ -1190,6 +1192,9 @@ "note": "", "paintpriority": "", "refinishhours": "" + }, + "successes": { + "removed": "" } }, "profile": { diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 0e66c4c2e..e3eb27fb6 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -474,6 +474,7 @@ "text": "", "unknown": "Inconnu", "username": "", + "view": "", "yes": "" }, "languages": { @@ -664,7 +665,8 @@ "recalculate": "", "reconcile": "", "schedule": "Programme", - "sendcsi": "" + "sendcsi": "", + "viewdetail": "" }, "errors": { "addingtoproduction": "", @@ -1190,6 +1192,9 @@ "note": "", "paintpriority": "", "refinishhours": "" + }, + "successes": { + "removed": "" } }, "profile": {