Inversed ignoring of lines and included default filter. RPS-1 RPS-5

This commit is contained in:
Patrick Fic
2020-10-22 19:37:09 -07:00
parent e9e95935fc
commit 5ef32c5465
8 changed files with 58 additions and 16 deletions

View File

@@ -9,15 +9,16 @@ export default function IgnoreJobLineAtom({ ignore, lineId, line_desc }) {
const [updateJobLine] = useMutation(UPDATE_JOB_LINE);
const [loading, setLoading] = useState(false);
const handleChange = async (checked) => {
console.log("handleChange -> checked", checked);
setLoading(true);
ipcRenderer.send(ipcTypes.default.app.toMain.track, {
event: "TOGGLE_IGNORE_LINE",
line_desc: line_desc,
ignore: checked,
ignore: !checked,
});
const result = await updateJobLine({
variables: { lineId: lineId, line: { ignore: checked } },
variables: { lineId: lineId, line: { ignore: !checked } },
});
if (result.errors) {
message.error("Error updating line.");
@@ -27,5 +28,5 @@ export default function IgnoreJobLineAtom({ ignore, lineId, line_desc }) {
setLoading(false);
};
return <Switch checked={ignore} onChange={handleChange} loading={loading} />;
return <Switch checked={!ignore} onChange={handleChange} loading={loading} />;
}

View File

@@ -48,9 +48,6 @@ export default function JobPartsGraphAtom({
alignItems: "center",
}}
>
<Typography.Title level={4}>
{price === "act_price" ? "Actual Price" : "Database Price"}
</Typography.Title>
<ResponsiveContainer>
<PieChart>
<Pie
@@ -71,6 +68,9 @@ export default function JobPartsGraphAtom({
</Pie>
</PieChart>
</ResponsiveContainer>
<Typography.Title level={4}>
{price === "act_price" ? "Actual Price" : "Database Price"}
</Typography.Title>
</div>
);
}