IO-1047 IO-1046 IO-1045 Add production alert everywhere

This commit is contained in:
Patrick Fic
2021-05-07 15:41:40 -07:00
parent 49c3a512c0
commit 529c12e4ee
5 changed files with 49 additions and 18 deletions

View File

@@ -70,6 +70,25 @@ export function JobsDetailHeaderActions({
);
}, [job.status, bodyshop.md_ro_statuses.post_production_statuses]);
const handleAlertToggle = (e) => {
logImEXEvent("production_toggle_alert");
//e.stopPropagation();
updateJob({
variables: {
jobId: job.id,
job: {
production_vars: {
...job.production_vars,
alert:
!!job.production_vars && !!job.production_vars.alert
? !job.production_vars.alert
: true,
},
},
},
});
};
const statusmenu = (
<Menu key="popovermenu">
<Menu.Item
@@ -176,6 +195,12 @@ export function JobsDetailHeaderActions({
{t("jobs.actions.addtoproduction")}
</Menu.Item>
)}
<Menu.Item key="toggleAlert" onClick={handleAlertToggle}>
{job.production_vars && job.production_vars.alert
? t("production.labels.alertoff")
: t("production.labels.alerton")}
</Menu.Item>
<Menu.SubMenu title={t("menus.jobsactions.duplicate")}>
<Menu.Item>
<Popconfirm