Implemented BOD-22 removing from production board. No automation surrounding it at this time.

This commit is contained in:
Patrick Fic
2020-04-27 15:22:22 -07:00
parent f04a6fc2af
commit c3d618e239
7 changed files with 91 additions and 14 deletions

View File

@@ -11221,6 +11221,27 @@
</translation>
</translations>
</concept_node>
<concept_node>
<name>remove</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>removecolumn</name>
<definition_loaded>false</definition_loaded>
@@ -11265,6 +11286,32 @@
</concept_node>
</children>
</folder_node>
<folder_node>
<name>errors</name>
<children>
<concept_node>
<name>removing</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>
<folder_node>
<name>labels</name>
<children>

View File

@@ -1,16 +1,7 @@
import React, { useState } from "react";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { selectBodyshop } from "../../redux/user/user.selectors";
import { Pie } from "@nivo/pie";
import { useTranslation } from "react-i18next";
import React from "react";
const mapStateToProps = createStructuredSelector({
bodyshop: selectBodyshop,
});
export function PartsStatusPie({ partsList }) {
const { t } = useTranslation();
export default function PartsStatusPie({ partsList }) {
//const [pieData, setPieData] = useState([]);
const result = partsList
@@ -40,4 +31,3 @@ export function PartsStatusPie({ partsList }) {
return <Pie {...commonProperties} data={pieData} innerRadius={0.5} />;
}
export default connect(mapStateToProps, null)(PartsStatusPie);

View File

@@ -5,6 +5,7 @@ import CurrencyFormatter from "../../utils/CurrencyFormatter";
import { DateFormatter } from "../../utils/DateFormatter";
import PartsPieGraph from "../parts-status-pie/parts-status-pie.component";
import Barcode from "react-barcode";
import ProductionRemoveButton from "../production-remove-button/production-remove-button.component";
export default function ProductionListDetail({ selected, setSelected, jobs }) {
const { t } = useTranslation();
@@ -14,7 +15,7 @@ export default function ProductionListDetail({ selected, setSelected, jobs }) {
<Drawer
title={t("production.labels.jobdetail")}
placement='right'
width={"25%"}
width={"33%"}
onClose={() => setSelected(null)}
visible={!!selected}>
<div>
@@ -52,6 +53,7 @@ export default function ProductionListDetail({ selected, setSelected, jobs }) {
<PartsPieGraph partsList={theJob.partcount} />
</Descriptions.Item>
</Descriptions>
<ProductionRemoveButton jobId={theJob.id} />
</div>
</Drawer>
);

View File

@@ -0,0 +1,26 @@
import React from "react";
import { useMutation } from "@apollo/react-hooks";
import { UPDATE_JOB } from "../../graphql/jobs.queries";
import { Button, notification } from "antd";
import { useTranslation } from "react-i18next";
export default function ProductionRemoveButton({ jobId }) {
const [removeJobFromProduction] = useMutation(UPDATE_JOB);
const { t } = useTranslation();
const handleRemoveFromProd = () => {
removeJobFromProduction({
variables: { jobId: jobId, job: { inproduction: false } },
}).catch((error) => {
notification["error"]({
message: t("production.errors.removing", {
error: JSON.stringify(error),
}),
});
});
};
return (
<Button onClick={handleRemoveFromProd} type={"danger"}>
{t("production.actions.remove")}
</Button>
);
}

View File

@@ -61,7 +61,7 @@
"created": "Time",
"operation": "Operation",
"useremail": "User",
"values": ""
"values": "Values"
}
},
"bodyshop": {
@@ -729,9 +729,13 @@
"bodypriority-set": "Set Body Priority",
"paintpriority-clear": "Clear Paint Priority",
"paintpriority-set": "Set Paint Priority",
"remove": "Remove from Production",
"removecolumn": "Remove Column",
"saveconfig": "Save Configuration"
},
"errors": {
"removing": "Error removing from production board. {{error}}"
},
"labels": {
"alert": "Alert",
"alertoff": "Remove alert from job",

View File

@@ -729,9 +729,13 @@
"bodypriority-set": "",
"paintpriority-clear": "",
"paintpriority-set": "",
"remove": "",
"removecolumn": "",
"saveconfig": ""
},
"errors": {
"removing": ""
},
"labels": {
"alert": "",
"alertoff": "",

View File

@@ -729,9 +729,13 @@
"bodypriority-set": "",
"paintpriority-clear": "",
"paintpriority-set": "",
"remove": "",
"removecolumn": "",
"saveconfig": ""
},
"errors": {
"removing": ""
},
"labels": {
"alert": "",
"alertoff": "",