Added remove from production button to kanban card. BOD-261
This commit is contained in:
@@ -7383,6 +7383,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>view</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>yes</name>
|
<name>yes</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -10321,6 +10342,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>viewdetail</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>
|
||||||
</children>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
<folder_node>
|
<folder_node>
|
||||||
@@ -19424,6 +19466,32 @@
|
|||||||
</concept_node>
|
</concept_node>
|
||||||
</children>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
|
<folder_node>
|
||||||
|
<name>successes</name>
|
||||||
|
<children>
|
||||||
|
<concept_node>
|
||||||
|
<name>removed</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>
|
||||||
|
</children>
|
||||||
|
</folder_node>
|
||||||
</children>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
<folder_node>
|
<folder_node>
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ export default function GlobalSearch() {
|
|||||||
vehicle.v_model_yr || ""
|
vehicle.v_model_yr || ""
|
||||||
} ${vehicle.v_make_desc || ""} ${
|
} ${vehicle.v_make_desc || ""} ${
|
||||||
vehicle.v_model_desc || ""
|
vehicle.v_model_desc || ""
|
||||||
}`}</span>
|
} - ${vehicle.plate_no} - ${vehicle.v_vin}`}</span>
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -49,7 +49,13 @@ export function InvoiceDetailEditContainer({ bodyshop }) {
|
|||||||
delete il.__typename;
|
delete il.__typename;
|
||||||
updates.push(
|
updates.push(
|
||||||
updateInvoiceLine({
|
updateInvoiceLine({
|
||||||
variables: { invoicelineId: il.id, invoiceLine: il },
|
variables: {
|
||||||
|
invoicelineId: il.id,
|
||||||
|
invoiceLine: {
|
||||||
|
...il,
|
||||||
|
joblineid: il.joblineid === "noline" ? null : il.joblineid,
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,24 +1,25 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
export default function PartsStatusPie({ partsList }) {
|
export default function PartsStatusPie({ partsList }) {
|
||||||
|
return <div>Parts Pie</div>;
|
||||||
//const [pieData, setPieData] = useState([]);
|
//const [pieData, setPieData] = useState([]);
|
||||||
|
|
||||||
const result = partsList
|
// const result = partsList
|
||||||
? partsList.reduce((names, name) => {
|
// ? partsList.reduce((names, name) => {
|
||||||
const val = name || "?";
|
// const val = name || "?";
|
||||||
const count = names[val] || 0;
|
// const count = names[val] || 0;
|
||||||
names[val] = count + 1;
|
// names[val] = count + 1;
|
||||||
return names;
|
// return names;
|
||||||
}, {})
|
// }, {})
|
||||||
: {};
|
// : {};
|
||||||
|
|
||||||
const pieData = Object.keys(result).map((i) => {
|
// const pieData = Object.keys(result).map((i) => {
|
||||||
return {
|
// return {
|
||||||
id: i,
|
// id: i,
|
||||||
label: i,
|
// label: i,
|
||||||
value: result[i],
|
// value: result[i],
|
||||||
};
|
// };
|
||||||
});
|
// });
|
||||||
|
|
||||||
return <div>{JSON.stringify(pieData)}</div>;
|
// return <div>{JSON.stringify(pieData)}</div>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,74 +1,87 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { Card, Row, Col } from "antd";
|
import { Card, Row, Col, Dropdown } from "antd";
|
||||||
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
||||||
import ProductionAlert from "../production-list-columns/production-list-columns.alert.component";
|
import ProductionAlert from "../production-list-columns/production-list-columns.alert.component";
|
||||||
import { EyeFilled } from "@ant-design/icons";
|
import { EyeFilled } from "@ant-design/icons";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import "./production-board-card.styles.scss";
|
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) {
|
export default function ProductionBoardCard(card) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const menu = (
|
||||||
|
<div>
|
||||||
|
<Card title={t("general.labels.actions")}>
|
||||||
|
<ProductionRemoveButton jobId={card.id} />
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Dropdown overlay={menu} trigger={["contextMenu"]}>
|
||||||
className="react-kanban-card imex-kanban-card tight-antd-rows"
|
<Card
|
||||||
style={{ margin: ".2rem 0rem" }}
|
className="react-kanban-card imex-kanban-card tight-antd-rows"
|
||||||
size="small"
|
style={{ margin: ".2rem 0rem" }}
|
||||||
title={`${card.ro_number || card.est_number} - ${card.v_model_yr} ${
|
size="small"
|
||||||
card.v_make_desc || ""
|
title={`${card.ro_number || card.est_number} - ${card.v_model_yr} ${
|
||||||
} ${card.v_model_desc || ""}`}
|
card.v_make_desc || ""
|
||||||
>
|
} ${card.v_model_desc || ""}`}
|
||||||
<Row>
|
>
|
||||||
<Col span={24}>
|
<Row>
|
||||||
<div className="ellipses">{`${card.ownr_fn || ""} ${
|
<Col span={24}>
|
||||||
card.ownr_ln || ""
|
<div className="ellipses">{`${card.ownr_fn || ""} ${
|
||||||
} ${card.ownr_co_nm || ""}`}</div>
|
card.ownr_ln || ""
|
||||||
</Col>
|
} ${card.ownr_co_nm || ""}`}</div>
|
||||||
</Row>
|
</Col>
|
||||||
<Row>
|
</Row>
|
||||||
<Col span={12}>
|
<Row>
|
||||||
<div className="ellipses">{card.clm_no || ""}</div>
|
<Col span={12}>
|
||||||
</Col>
|
<div className="ellipses">{card.clm_no || ""}</div>
|
||||||
<Col span={12}>
|
</Col>
|
||||||
<div className="ellipses">{card.ins_co_nm || ""}</div>
|
<Col span={12}>
|
||||||
</Col>
|
<div className="ellipses">{card.ins_co_nm || ""}</div>
|
||||||
</Row>
|
</Col>
|
||||||
<Row>
|
</Row>
|
||||||
<Col span={24}>
|
<Row>
|
||||||
<div className="imex-flex-row imex-flex-row__flex-space-around">
|
<Col span={24}>
|
||||||
<div className="mex-flex-row__margin">
|
<div className="imex-flex-row imex-flex-row__flex-space-around">
|
||||||
<div>{`B: ${card.labhrs.aggregate.sum.mod_lb_hrs || "?"}`}</div>
|
<div className="mex-flex-row__margin">
|
||||||
<div>{`R: ${card.larhrs.aggregate.sum.mod_lb_hrs || "?"}`}</div>
|
<div>{`B: ${card.labhrs.aggregate.sum.mod_lb_hrs || "?"}`}</div>
|
||||||
|
<div>{`R: ${card.larhrs.aggregate.sum.mod_lb_hrs || "?"}`}</div>
|
||||||
|
</div>
|
||||||
|
<div className="mex-flex-row__margin">
|
||||||
|
<div>{`B: ${
|
||||||
|
card.employee_body_rel
|
||||||
|
? `${card.employee_body_rel.first_name} ${card.employee_body_rel.last_name}`
|
||||||
|
: ""
|
||||||
|
}`}</div>
|
||||||
|
<div>{`P: ${
|
||||||
|
card.employee_prep_rel
|
||||||
|
? `${card.employee_prep_rel.first_name} ${card.employee_prep_rel.last_name}`
|
||||||
|
: ""
|
||||||
|
}`}</div>
|
||||||
|
<div>{`R: ${
|
||||||
|
card.employee_refinish_rel
|
||||||
|
? `${card.employee_refinish_rel.first_name} ${card.employee_refinish_rel.last_name}`
|
||||||
|
: ""
|
||||||
|
}`}</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="mex-flex-row__margin">
|
</Col>
|
||||||
<div>{`B: ${
|
</Row>
|
||||||
card.employee_body_rel
|
<Row>
|
||||||
? `${card.employee_body_rel.first_name} ${card.employee_body_rel.last_name}`
|
<Col span={24}>
|
||||||
: ""
|
<DateTimeFormatter>{card.scheduled_completion}</DateTimeFormatter>
|
||||||
}`}</div>
|
</Col>
|
||||||
<div>{`P: ${
|
</Row>
|
||||||
card.employee_prep_rel
|
<div className="imex-flex-row imex-flex-row__flex-space-around">
|
||||||
? `${card.employee_prep_rel.first_name} ${card.employee_prep_rel.last_name}`
|
<ProductionAlert record={card} key="alert" />
|
||||||
: ""
|
<Link to={`/manage/jobs/${card.id}`}>
|
||||||
}`}</div>
|
<EyeFilled key="setting" />
|
||||||
<div>{`R: ${
|
</Link>
|
||||||
card.employee_refinish_rel
|
</div>
|
||||||
? `${card.employee_refinish_rel.first_name} ${card.employee_refinish_rel.last_name}`
|
</Card>
|
||||||
: ""
|
</Dropdown>
|
||||||
}`}</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</Col>
|
|
||||||
</Row>
|
|
||||||
<Row>
|
|
||||||
<Col span={24}>
|
|
||||||
<DateTimeFormatter>{card.scheduled_completion}</DateTimeFormatter>
|
|
||||||
</Col>
|
|
||||||
</Row>
|
|
||||||
<div className="imex-flex-row imex-flex-row__flex-space-around">
|
|
||||||
<ProductionAlert record={card} key="alert" />
|
|
||||||
<Link to={`/manage/jobs/${card.id}`}>
|
|
||||||
<EyeFilled key="setting" />
|
|
||||||
</Link>
|
|
||||||
</div>
|
|
||||||
</Card>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +1,36 @@
|
|||||||
import React from "react";
|
|
||||||
import { useMutation } from "@apollo/react-hooks";
|
import { useMutation } from "@apollo/react-hooks";
|
||||||
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
|
||||||
import { Button, notification } from "antd";
|
import { Button, notification } from "antd";
|
||||||
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
|
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||||
|
|
||||||
export default function ProductionRemoveButton({ jobId }) {
|
export default function ProductionRemoveButton({ jobId }) {
|
||||||
const [removeJobFromProduction] = useMutation(UPDATE_JOB);
|
const [removeJobFromProduction] = useMutation(UPDATE_JOB);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const handleRemoveFromProd = () => {
|
const [loading, setLoading] = useState(false);
|
||||||
logImEXEvent("production_remove_job");
|
|
||||||
|
|
||||||
removeJobFromProduction({
|
const handleRemoveFromProd = async () => {
|
||||||
|
logImEXEvent("production_remove_job");
|
||||||
|
setLoading(true);
|
||||||
|
const result = await removeJobFromProduction({
|
||||||
variables: { jobId: jobId, job: { inproduction: false } },
|
variables: { jobId: jobId, job: { inproduction: false } },
|
||||||
}).catch((error) => {
|
});
|
||||||
|
|
||||||
|
if (!!!result.errors) {
|
||||||
|
notification["success"]({ message: t("production.successes.removed") });
|
||||||
|
} else {
|
||||||
notification["error"]({
|
notification["error"]({
|
||||||
message: t("production.errors.removing", {
|
message: t("production.errors.removing", {
|
||||||
error: JSON.stringify(error),
|
error: JSON.stringify(result.errors),
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
setLoading(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Button onClick={handleRemoveFromProd} type={"danger"}>
|
<Button loading={loading} onClick={handleRemoveFromProd} type={"danger"}>
|
||||||
{t("production.actions.remove")}
|
{t("production.actions.remove")}
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ export const GLOBAL_SEARCH_QUERY = gql`
|
|||||||
v_model_desc
|
v_model_desc
|
||||||
v_make_desc
|
v_make_desc
|
||||||
v_color
|
v_color
|
||||||
|
v_vin
|
||||||
|
plate_no
|
||||||
}
|
}
|
||||||
search_payments(args: { search: $search }) {
|
search_payments(args: { search: $search }) {
|
||||||
id
|
id
|
||||||
|
|||||||
@@ -474,6 +474,7 @@
|
|||||||
"text": "Text",
|
"text": "Text",
|
||||||
"unknown": "Unknown",
|
"unknown": "Unknown",
|
||||||
"username": "Username",
|
"username": "Username",
|
||||||
|
"view": "View",
|
||||||
"yes": "Yes"
|
"yes": "Yes"
|
||||||
},
|
},
|
||||||
"languages": {
|
"languages": {
|
||||||
@@ -664,7 +665,8 @@
|
|||||||
"recalculate": "Recalculate",
|
"recalculate": "Recalculate",
|
||||||
"reconcile": "Reconcile",
|
"reconcile": "Reconcile",
|
||||||
"schedule": "Schedule",
|
"schedule": "Schedule",
|
||||||
"sendcsi": "Send CSI"
|
"sendcsi": "Send CSI",
|
||||||
|
"viewdetail": "View Details"
|
||||||
},
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
"addingtoproduction": "Error adding to production. {{error}}",
|
"addingtoproduction": "Error adding to production. {{error}}",
|
||||||
@@ -1190,6 +1192,9 @@
|
|||||||
"note": "Production Note",
|
"note": "Production Note",
|
||||||
"paintpriority": "P/P",
|
"paintpriority": "P/P",
|
||||||
"refinishhours": "R"
|
"refinishhours": "R"
|
||||||
|
},
|
||||||
|
"successes": {
|
||||||
|
"removed": "Job removed from production."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"profile": {
|
"profile": {
|
||||||
|
|||||||
@@ -474,6 +474,7 @@
|
|||||||
"text": "",
|
"text": "",
|
||||||
"unknown": "Desconocido",
|
"unknown": "Desconocido",
|
||||||
"username": "",
|
"username": "",
|
||||||
|
"view": "",
|
||||||
"yes": ""
|
"yes": ""
|
||||||
},
|
},
|
||||||
"languages": {
|
"languages": {
|
||||||
@@ -664,7 +665,8 @@
|
|||||||
"recalculate": "",
|
"recalculate": "",
|
||||||
"reconcile": "",
|
"reconcile": "",
|
||||||
"schedule": "Programar",
|
"schedule": "Programar",
|
||||||
"sendcsi": ""
|
"sendcsi": "",
|
||||||
|
"viewdetail": ""
|
||||||
},
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
"addingtoproduction": "",
|
"addingtoproduction": "",
|
||||||
@@ -1190,6 +1192,9 @@
|
|||||||
"note": "",
|
"note": "",
|
||||||
"paintpriority": "",
|
"paintpriority": "",
|
||||||
"refinishhours": ""
|
"refinishhours": ""
|
||||||
|
},
|
||||||
|
"successes": {
|
||||||
|
"removed": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"profile": {
|
"profile": {
|
||||||
|
|||||||
@@ -474,6 +474,7 @@
|
|||||||
"text": "",
|
"text": "",
|
||||||
"unknown": "Inconnu",
|
"unknown": "Inconnu",
|
||||||
"username": "",
|
"username": "",
|
||||||
|
"view": "",
|
||||||
"yes": ""
|
"yes": ""
|
||||||
},
|
},
|
||||||
"languages": {
|
"languages": {
|
||||||
@@ -664,7 +665,8 @@
|
|||||||
"recalculate": "",
|
"recalculate": "",
|
||||||
"reconcile": "",
|
"reconcile": "",
|
||||||
"schedule": "Programme",
|
"schedule": "Programme",
|
||||||
"sendcsi": ""
|
"sendcsi": "",
|
||||||
|
"viewdetail": ""
|
||||||
},
|
},
|
||||||
"errors": {
|
"errors": {
|
||||||
"addingtoproduction": "",
|
"addingtoproduction": "",
|
||||||
@@ -1190,6 +1192,9 @@
|
|||||||
"note": "",
|
"note": "",
|
||||||
"paintpriority": "",
|
"paintpriority": "",
|
||||||
"refinishhours": ""
|
"refinishhours": ""
|
||||||
|
},
|
||||||
|
"successes": {
|
||||||
|
"removed": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"profile": {
|
"profile": {
|
||||||
|
|||||||
Reference in New Issue
Block a user