IO-3020 IO-3036 Resolve identified bugs.

This commit is contained in:
Patrick Fic
2024-12-11 09:44:18 -08:00
parent a630fc5556
commit 53d15b0d45
7 changed files with 179 additions and 142 deletions

View File

@@ -1,5 +1,5 @@
import { useQuery } from "@apollo/client";
import { Col, Row, Typography } from "antd";
import { Card, Col, Row, Typography } from "antd";
import dayjs from "../../utils/day";
import React, { useEffect } from "react";
import { useTranslation } from "react-i18next";
@@ -14,6 +14,8 @@ import { QUERY_JOB_CHECKLISTS } from "../../graphql/jobs.queries";
import { setBreadcrumbs, setSelectedHeader } from "../../redux/application/application.actions";
import { selectBodyshop } from "../../redux/user/user.selectors";
import InstanceRenderManager from "../../utils/instanceRenderMgr";
import FeatureWrapperComponent from "../../components/feature-wrapper/feature-wrapper.component";
import UpsellComponent, { upsellEnum } from "../../components/upsell/upsell.component";
const mapStateToProps = createStructuredSelector({
//currentUser: selectCurrentUser
@@ -73,38 +75,47 @@ export function JobsChecklistViewContainer({ bodyshop, setBreadcrumbs, setSelect
);
return (
<RbacWrapper action="jobs:checklist-view">
<Row gutter={[16, 16]}>
<Col span={12}>
<Typography.Title level={4}>{t("jobs.labels.intakechecklist")}</Typography.Title>
{data.jobs_by_pk.intakechecklist && data.jobs_by_pk.intakechecklist.form && (
<>
<JobChecklistForm
formItems={data.jobs_by_pk.intakechecklist && data.jobs_by_pk.intakechecklist.form}
type="intake"
job={data.jobs_by_pk}
readOnly
/>
<CompletedBy checklist={data.jobs_by_pk.intakechecklist} />
</>
)}
</Col>
<Col span={12}>
<Typography.Title level={4}>{t("jobs.labels.deliverchecklist")}</Typography.Title>
{data.jobs_by_pk.deliverchecklist && data.jobs_by_pk.deliverchecklist.form && (
<>
<JobChecklistForm
formItems={data.jobs_by_pk.deliverchecklist && data.jobs_by_pk.deliverchecklist.form}
type="deliver"
job={data.jobs_by_pk}
readOnly
/>
<CompletedBy checklist={data.jobs_by_pk.deliverchecklist} />
</>
)}
</Col>
</Row>
</RbacWrapper>
<FeatureWrapperComponent
featureName="checklist"
noauth={
<Card>
<UpsellComponent upsell={upsellEnum().checklist.general} />
</Card>
}
>
<RbacWrapper action="jobs:checklist-view">
<Row gutter={[16, 16]}>
<Col span={12}>
<Typography.Title level={4}>{t("jobs.labels.intakechecklist")}</Typography.Title>
{data.jobs_by_pk.intakechecklist && data.jobs_by_pk.intakechecklist.form && (
<>
<JobChecklistForm
formItems={data.jobs_by_pk.intakechecklist && data.jobs_by_pk.intakechecklist.form}
type="intake"
job={data.jobs_by_pk}
readOnly
/>
<CompletedBy checklist={data.jobs_by_pk.intakechecklist} />
</>
)}
</Col>
<Col span={12}>
<Typography.Title level={4}>{t("jobs.labels.deliverchecklist")}</Typography.Title>
{data.jobs_by_pk.deliverchecklist && data.jobs_by_pk.deliverchecklist.form && (
<>
<JobChecklistForm
formItems={data.jobs_by_pk.deliverchecklist && data.jobs_by_pk.deliverchecklist.form}
type="deliver"
job={data.jobs_by_pk}
readOnly
/>
<CompletedBy checklist={data.jobs_by_pk.deliverchecklist} />
</>
)}
</Col>
</Row>
</RbacWrapper>
</FeatureWrapperComponent>
);
}