Inversed ignoring of lines and included default filter. RPS-1 RPS-5
This commit is contained in:
@@ -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} />;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user