Added tab control for job detail page. No attached user story.
This commit is contained in:
@@ -44,9 +44,9 @@ export default connect(
|
|||||||
const tombstoneTitle = (
|
const tombstoneTitle = (
|
||||||
<div>
|
<div>
|
||||||
<Avatar size="large" alt="Vehicle Image" src={CarImage} />
|
<Avatar size="large" alt="Vehicle Image" src={CarImage} />
|
||||||
{`${t("jobs.fields.ro_number")} ${
|
{job.ro_number
|
||||||
job.ro_number ? job.ro_number : t("general.labels.na")
|
? `${t("jobs.fields.ro_number")} ${job.ro_number}`
|
||||||
}`}
|
: `EST-${job.est_number}`}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import Icon, {
|
|||||||
FileImageFilled,
|
FileImageFilled,
|
||||||
ToolFilled
|
ToolFilled
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
|
import { useHistory, useLocation } from "react-router-dom";
|
||||||
import { Form, notification, Tabs } from "antd";
|
import { Form, notification, Tabs } from "antd";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import React, { lazy, Suspense } from "react";
|
import React, { lazy, Suspense } from "react";
|
||||||
@@ -82,11 +83,15 @@ export default function JobsDetailPage({
|
|||||||
handleSubmit,
|
handleSubmit,
|
||||||
refetch,
|
refetch,
|
||||||
scheduleModalState,
|
scheduleModalState,
|
||||||
updateJobStatus
|
updateJobStatus,
|
||||||
|
tab
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
const history = useHistory();
|
||||||
|
|
||||||
|
console.log("history, location", history);
|
||||||
|
// history.replace();
|
||||||
const formItemLayout = {
|
const formItemLayout = {
|
||||||
labelCol: {
|
labelCol: {
|
||||||
xs: { span: 12 },
|
xs: { span: 12 },
|
||||||
@@ -166,7 +171,12 @@ export default function JobsDetailPage({
|
|||||||
scheduleModalState={scheduleModalState}
|
scheduleModalState={scheduleModalState}
|
||||||
updateJobStatus={updateJobStatus}
|
updateJobStatus={updateJobStatus}
|
||||||
/>
|
/>
|
||||||
<Tabs defaultActiveKey="claimdetail">
|
<Tabs
|
||||||
|
defaultActiveKey={history.location.search.substring(1) || null}
|
||||||
|
onChange={key =>
|
||||||
|
history.replace({ ...history.location, search: `?${key}` })
|
||||||
|
}
|
||||||
|
>
|
||||||
<Tabs.TabPane
|
<Tabs.TabPane
|
||||||
tab={
|
tab={
|
||||||
<span>
|
<span>
|
||||||
@@ -267,20 +277,17 @@ export default function JobsDetailPage({
|
|||||||
<JobNotesContainer jobId={job.id} />
|
<JobNotesContainer jobId={job.id} />
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
|
|
||||||
|
|
||||||
<Tabs.TabPane
|
<Tabs.TabPane
|
||||||
tab={
|
tab={
|
||||||
<span>
|
<span>
|
||||||
<Icon component={FaHistory} />
|
<Icon component={FaHistory} />
|
||||||
{t("jobs.labels.audit")}
|
{t("jobs.labels.audit")}
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
key="audit"
|
key="audit"
|
||||||
>
|
>
|
||||||
<JobsDetailAuditContainer recordId={job.id }/>
|
<JobsDetailAuditContainer recordId={job.id} />
|
||||||
</Tabs.TabPane>
|
</Tabs.TabPane>
|
||||||
|
|
||||||
|
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</Form>
|
</Form>
|
||||||
</Suspense>
|
</Suspense>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
import JobsDetailPage from "./jobs-detail.page.component";
|
import JobsDetailPage from "./jobs-detail.page.component";
|
||||||
|
|
||||||
function JobsDetailPageContainer({ match }) {
|
function JobsDetailPageContainer({ match }) {
|
||||||
const { jobId } = match.params;
|
const { jobId, tab } = match.params;
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const scheduleModalState = useState(false);
|
const scheduleModalState = useState(false);
|
||||||
@@ -62,6 +62,7 @@ function JobsDetailPageContainer({ match }) {
|
|||||||
refetch={refetch}
|
refetch={refetch}
|
||||||
scheduleModalState={scheduleModalState}
|
scheduleModalState={scheduleModalState}
|
||||||
updateJobStatus={updateJobStatus}
|
updateJobStatus={updateJobStatus}
|
||||||
|
tab={tab}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<AlertComponent message={t("jobs.errors.noaccess")} type="error" />
|
<AlertComponent message={t("jobs.errors.noaccess")} type="error" />
|
||||||
|
|||||||
@@ -81,11 +81,6 @@ export default function Manage({ match }) {
|
|||||||
path={`${match.path}/jobs/:jobId`}
|
path={`${match.path}/jobs/:jobId`}
|
||||||
component={JobsDetailPage}
|
component={JobsDetailPage}
|
||||||
/>
|
/>
|
||||||
<Route
|
|
||||||
exact
|
|
||||||
path={`${match.path}/jobs/:jobId/documents`}
|
|
||||||
component={JobsDocumentsPage}
|
|
||||||
/>
|
|
||||||
<Route
|
<Route
|
||||||
exact
|
exact
|
||||||
path={`${match.path}/profile`}
|
path={`${match.path}/profile`}
|
||||||
|
|||||||
Reference in New Issue
Block a user