Changed logic to allow job intake IO-430

This commit is contained in:
Patrick Fic
2020-12-01 22:21:54 -08:00
parent 3e24fdd6f5
commit f89f385a4b
2 changed files with 5 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@@ -60,17 +60,18 @@ export function JobsIntakeContainer({
if (loading) return <LoadingSpinner />;
if (error) return <AlertComponent message={error.message} type="error" />;
if (data && !!!data.bodyshops_by_pk.intakechecklist)
return (
<AlertComponent message={t("intake.errors.nochecklist")} type="error" />
);
return (
<RbacWrapper action="jobs:intake">
<div>
{!!data.jobs_by_pk.intakechecklist ||
!(
data.jobs_by_pk.status === bodyshop.md_ro_statuses.default_open ||
data.jobs_by_pk.status === bodyshop.md_ro_statuses.default_scheduled
!bodyshop.md_ro_statuses.pre_production_statuses.includes(
data.jobs_by_pk.status
) ? (
<Result status="warning" title={t("jobs.errors.cannotintake")} />
) : (