Added manual parts queue action IO-542
This commit is contained in:
@@ -13028,6 +13028,27 @@
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>addtopartsqueue</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>addtoproduction</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
@@ -19577,6 +19598,27 @@
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>partsqueue</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>save</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
|
||||
@@ -7,7 +7,7 @@ import { connect } from "react-redux";
|
||||
import { Link, useHistory } from "react-router-dom";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||
import { DELETE_JOB } from "../../graphql/jobs.queries";
|
||||
import { DELETE_JOB, UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
@@ -44,6 +44,7 @@ export function JobsDetailHeaderActions({
|
||||
const client = useApolloClient();
|
||||
const history = useHistory();
|
||||
const [deleteJob] = useMutation(DELETE_JOB);
|
||||
const [updateJob] = useMutation(UPDATE_JOB);
|
||||
const jobInProduction = useMemo(() => {
|
||||
return bodyshop.md_ro_statuses.production_statuses.includes(job.status);
|
||||
}, [job, bodyshop.md_ro_statuses.production_statuses]);
|
||||
@@ -213,6 +214,32 @@ export function JobsDetailHeaderActions({
|
||||
>
|
||||
{t("jobs.actions.postbills")}
|
||||
</Menu.Item>
|
||||
<Menu.Item
|
||||
key="addtopartsqueue"
|
||||
disabled={!job.converted || !jobInProduction || jobRO}
|
||||
onClick={async () => {
|
||||
const result = await updateJob({
|
||||
variables: {
|
||||
jobId: job.id,
|
||||
job: { queued_for_parts: true },
|
||||
},
|
||||
});
|
||||
|
||||
if (!!!result.errors) {
|
||||
notification["success"]({
|
||||
message: t("jobs.successes.partsqueue"),
|
||||
});
|
||||
} else {
|
||||
notification["error"]({
|
||||
message: t("jobs.errors.saving", {
|
||||
error: JSON.stringify(result.errors),
|
||||
}),
|
||||
});
|
||||
}
|
||||
}}
|
||||
>
|
||||
{t("jobs.actions.addtopartsqueue")}
|
||||
</Menu.Item>
|
||||
<Menu.Item
|
||||
disabled={!!job.date_invoiced || !jobInPostProduction || jobRO}
|
||||
key="closejob"
|
||||
|
||||
@@ -845,6 +845,7 @@
|
||||
"actions": {
|
||||
"addDocuments": "Add Job Documents",
|
||||
"addNote": "Add Note",
|
||||
"addtopartsqueue": "Add to Parts Queue",
|
||||
"addtoproduction": "Add to Production",
|
||||
"addtoscoreboard": "Add to Scoreboard",
|
||||
"allocate": "Allocate",
|
||||
@@ -1178,6 +1179,7 @@
|
||||
"duplicated": "Job duplicated successfully. ",
|
||||
"exported": "Job exported successfully. ",
|
||||
"invoiced": "Job closed and invoiced successfully.",
|
||||
"partsqueue": "Job added to parts queue.",
|
||||
"save": "Job saved successfully.",
|
||||
"savetitle": "Record saved successfully.",
|
||||
"supplemented": "Job supplemented successfully. ",
|
||||
|
||||
@@ -845,6 +845,7 @@
|
||||
"actions": {
|
||||
"addDocuments": "Agregar documentos de trabajo",
|
||||
"addNote": "Añadir la nota",
|
||||
"addtopartsqueue": "",
|
||||
"addtoproduction": "",
|
||||
"addtoscoreboard": "",
|
||||
"allocate": "",
|
||||
@@ -1178,6 +1179,7 @@
|
||||
"duplicated": "",
|
||||
"exported": "",
|
||||
"invoiced": "",
|
||||
"partsqueue": "",
|
||||
"save": "Trabajo guardado con éxito.",
|
||||
"savetitle": "Registro guardado con éxito.",
|
||||
"supplemented": "Trabajo complementado con éxito.",
|
||||
|
||||
@@ -845,6 +845,7 @@
|
||||
"actions": {
|
||||
"addDocuments": "Ajouter des documents de travail",
|
||||
"addNote": "Ajouter une note",
|
||||
"addtopartsqueue": "",
|
||||
"addtoproduction": "",
|
||||
"addtoscoreboard": "",
|
||||
"allocate": "",
|
||||
@@ -1178,6 +1179,7 @@
|
||||
"duplicated": "",
|
||||
"exported": "",
|
||||
"invoiced": "",
|
||||
"partsqueue": "",
|
||||
"save": "Le travail a été enregistré avec succès.",
|
||||
"savetitle": "Enregistrement enregistré avec succès.",
|
||||
"supplemented": "Travail complété avec succès.",
|
||||
|
||||
Reference in New Issue
Block a user