From 43b6bdb024f6081de445f6f8a37ecccb5052c764 Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Thu, 19 May 2022 11:08:12 -0700
Subject: [PATCH] IO-1896 Add remove from partst queue on parts order.
---
bodyshop_translations.babel | 21 +++++++++++++++++++
.../parts-order-modal.component.jsx | 11 ++++++++++
.../parts-order-modal.container.jsx | 15 ++++++++++++-
client/src/translations/en_us/common.json | 1 +
client/src/translations/es/common.json | 1 +
client/src/translations/fr/common.json | 1 +
6 files changed, 49 insertions(+), 1 deletion(-)
diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel
index 36716b308..1421c9116 100644
--- a/bodyshop_translations.babel
+++ b/bodyshop_translations.babel
@@ -33533,6 +33533,27 @@
+
+ removefrompartsqueue
+ false
+
+
+
+
+
+ en-US
+ false
+
+
+ es-MX
+ false
+
+
+ fr-CA
+ false
+
+
+
returnpartsorder
false
diff --git a/client/src/components/parts-order-modal/parts-order-modal.component.jsx b/client/src/components/parts-order-modal/parts-order-modal.component.jsx
index 8993a4654..4c1e01599 100644
--- a/client/src/components/parts-order-modal/parts-order-modal.component.jsx
+++ b/client/src/components/parts-order-modal/parts-order-modal.component.jsx
@@ -11,6 +11,7 @@ import {
Select,
Menu,
Dropdown,
+ Checkbox,
} from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
@@ -114,6 +115,15 @@ export function PartsOrderModalComponent({
)}
+ {!isReturn && (
+
+
+
+ )}
{t("parts_orders.labels.inthisorder")}
@@ -280,6 +290,7 @@ export function PartsOrderModalComponent({
>
+
setSendType(e.target.value)}
diff --git a/client/src/components/parts-order-modal/parts-order-modal.container.jsx b/client/src/components/parts-order-modal/parts-order-modal.container.jsx
index b449b3881..18bd94986 100644
--- a/client/src/components/parts-order-modal/parts-order-modal.container.jsx
+++ b/client/src/components/parts-order-modal/parts-order-modal.container.jsx
@@ -32,6 +32,7 @@ import PartsOrderModalComponent from "./parts-order-modal.component";
import axios from "axios";
import { useTreatments } from "@splitsoftware/splitio-react";
import _ from "lodash";
+import { UPDATE_JOB } from "../../graphql/jobs.queries";
const mapStateToProps = createStructuredSelector({
currentUser: selectCurrentUser,
@@ -90,8 +91,9 @@ export function PartsOrderModalContainer({
const [insertPartOrder] = useMutation(INSERT_NEW_PARTS_ORDERS);
const [updateJobLines] = useMutation(UPDATE_JOB_LINE_STATUS);
+ const [updateJob] = useMutation(UPDATE_JOB);
- const handleFinish = async (values) => {
+ const handleFinish = async ({ removefrompartsqueue, ...values }) => {
logImEXEvent("parts_order_insert");
setSaving(true);
const insertResult = await insertPartOrder({
@@ -128,6 +130,17 @@ export function PartsOrderModalContainer({
},
});
+ if (!isReturn && removefrompartsqueue) {
+ await updateJob({
+ variables: {
+ jobId: jobId,
+ job: {
+ queued_for_parts: false,
+ },
+ },
+ });
+ }
+
insertAuditTrail({
jobid: jobId,
operation: isReturn
diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json
index 934ea93f3..c48d4b09a 100644
--- a/client/src/translations/en_us/common.json
+++ b/client/src/translations/en_us/common.json
@@ -1980,6 +1980,7 @@
"parts_orders": "Parts Orders",
"print": "Show Printed Form",
"receive": "Receive Parts Order",
+ "removefrompartsqueue": "Remove from Parts Queue?",
"returnpartsorder": "Return Parts Order"
},
"successes": {
diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json
index ebe6acf2d..d29f4c642 100644
--- a/client/src/translations/es/common.json
+++ b/client/src/translations/es/common.json
@@ -1980,6 +1980,7 @@
"parts_orders": "",
"print": "Mostrar formulario impreso",
"receive": "",
+ "removefrompartsqueue": "",
"returnpartsorder": ""
},
"successes": {
diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json
index c6fd3677c..cd2e4daa7 100644
--- a/client/src/translations/fr/common.json
+++ b/client/src/translations/fr/common.json
@@ -1980,6 +1980,7 @@
"parts_orders": "",
"print": "Afficher le formulaire imprimé",
"receive": "",
+ "removefrompartsqueue": "",
"returnpartsorder": ""
},
"successes": {