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