Minor fixed + refactored job details screens based on review.
This commit is contained in:
@@ -1,19 +1,8 @@
|
||||
import { DownCircleFilled, PrinterFilled } from "@ant-design/icons";
|
||||
import {
|
||||
Button,
|
||||
Checkbox,
|
||||
Descriptions,
|
||||
Dropdown,
|
||||
Menu,
|
||||
notification,
|
||||
PageHeader,
|
||||
Tag,
|
||||
} from "antd";
|
||||
import { Button, Dropdown, Menu, notification, PageHeader, Tag } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import Moment from "react-moment";
|
||||
import { connect } from "react-redux";
|
||||
import { Link } from "react-router-dom";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
@@ -21,9 +10,8 @@ import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||
import JobsDetailHeaderActions from "../jobs-detail-header-actions/jobs-detail-header-actions.component";
|
||||
import OwnerTagPopoverComponent from "../owner-tag-popover/owner-tag-popover.component";
|
||||
import VehicleTagPopoverComponent from "../vehicle-tag-popover/vehicle-tag-popover.component";
|
||||
import JobEmployeeAssignments from "../job-employee-assignments/job-employee-assignments.container";
|
||||
import "./jobs-detail-header.styles.scss";
|
||||
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
||||
import JobEmployeeAssignments from "../job-employee-assignments/job-employee-assignments.container";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
@@ -136,67 +124,22 @@ export function JobsDetailHeader({
|
||||
>
|
||||
{t("jobs.labels.inproduction")}
|
||||
</Tag>,
|
||||
<Tag title={t("jobs.fields.repairtotal")} key="total" color="green">
|
||||
<CurrencyFormatter>{job.clm_total}</CurrencyFormatter>
|
||||
</Tag>,
|
||||
<Tag
|
||||
title={t("jobs.fields.customerowing")}
|
||||
key="custowing"
|
||||
color="green"
|
||||
>
|
||||
<CurrencyFormatter>{job.owner_owing}</CurrencyFormatter>
|
||||
</Tag>,
|
||||
]}
|
||||
extra={menuExtra}
|
||||
>
|
||||
<Descriptions
|
||||
size="small"
|
||||
column={{ xs: 1, sm: 1, md: 2, lg: 3, xl: 3, xxl: 6 }}
|
||||
>
|
||||
<Descriptions.Item key="total" label={t("jobs.fields.repairtotal")}>
|
||||
<CurrencyFormatter>{job.clm_total}</CurrencyFormatter>
|
||||
</Descriptions.Item>
|
||||
|
||||
<Descriptions.Item
|
||||
key="custowing"
|
||||
label={t("jobs.fields.customerowing")}
|
||||
>
|
||||
<CurrencyFormatter>{job.owner_owing}</CurrencyFormatter>
|
||||
</Descriptions.Item>
|
||||
|
||||
<Descriptions.Item
|
||||
key="scp"
|
||||
label={t("jobs.fields.specialcoveragepolicy")}
|
||||
>
|
||||
<Checkbox checked={job.special_coverage_policy} />
|
||||
</Descriptions.Item>
|
||||
|
||||
<Descriptions.Item
|
||||
key="sched_comp"
|
||||
label={t("jobs.fields.scheduled_completion")}
|
||||
>
|
||||
{job.scheduled_completion ? (
|
||||
<Moment format="MM/DD/YYYY">{job.scheduled_completion}</Moment>
|
||||
) : null}
|
||||
</Descriptions.Item>
|
||||
|
||||
<Descriptions.Item key="servicecar" label={t("jobs.fields.servicecar")}>
|
||||
{job.cccontracts &&
|
||||
job.cccontracts.map((item) => (
|
||||
<Link
|
||||
key={item.id}
|
||||
to={`/manage/courtesycars/contracts/${item.id}`}
|
||||
>
|
||||
<div>
|
||||
<div>{`${item.courtesycar.year} ${item.courtesycar.make} ${item.courtesycar.model} (${item.courtesycar.plate})`}</div>
|
||||
<div style={{ display: "inline-block" }}>
|
||||
<DateTimeFormatter>{item.start}</DateTimeFormatter>
|
||||
<span> -- </span>
|
||||
<DateTimeFormatter>
|
||||
{item.scheduledreturn}
|
||||
</DateTimeFormatter>
|
||||
</div>
|
||||
</div>
|
||||
</Link>
|
||||
))}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item
|
||||
key="assignments"
|
||||
label={t("jobs.labels.employeeassignments")}
|
||||
>
|
||||
<JobEmployeeAssignments job={job} />
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
<div style={{ display: "flex", justifyContent: "flex-end" }}>
|
||||
<JobEmployeeAssignments job={job} />
|
||||
</div>
|
||||
</PageHeader>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user