Basic reporting completed.
This commit is contained in:
@@ -3,6 +3,7 @@ import { DatePicker, message, Spin } from "antd";
|
||||
import moment from "moment";
|
||||
import React, { useState } from "react";
|
||||
import { UPDATE_JOB } from "../../../graphql/jobs.queries";
|
||||
import { DateFormat } from "../../../util/constants";
|
||||
|
||||
export default function CloseDateDisplayMolecule({ jobId, close_date }) {
|
||||
const [editMode, setEditMode] = useState(false);
|
||||
@@ -38,7 +39,7 @@ export default function CloseDateDisplayMolecule({ jobId, close_date }) {
|
||||
|
||||
return (
|
||||
<div style={{ cursor: "pointer" }} onClick={() => setEditMode(true)}>
|
||||
{value && value.isValid() ? value.format("MM/DD/yyyy") : "No date set"}
|
||||
{value && value.isValid() ? value.format(DateFormat) : "No date set"}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import React from "react";
|
||||
import CurrencyFormatterAtom from "../../atoms/currency-formatter/currency-formatter.atom";
|
||||
import ErrorResultAtom from "../../atoms/error-result/error-result.atom";
|
||||
import CloseDateDisplayMolecule from "../close-date-display/close-date-display.molecule";
|
||||
import TimeAgoFormatter from "../../atoms/time-ago-formatter/time-ago-formatter.atom";
|
||||
|
||||
export default function JobsDetailDescriptionMolecule({ loading, job }) {
|
||||
if (loading) return <Skeleton active />;
|
||||
@@ -26,6 +27,9 @@ export default function JobsDetailDescriptionMolecule({ loading, job }) {
|
||||
close_date={job.close_date}
|
||||
/>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="Last Updated">
|
||||
<TimeAgoFormatter>{job.updated_at}</TimeAgoFormatter>
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</PageHeader>
|
||||
</div>
|
||||
|
||||
@@ -1,29 +1,26 @@
|
||||
import { Input, Table } from "antd";
|
||||
import React, { useState } from "react";
|
||||
import CurrencyFormatterAtom from "../../atoms/currency-formatter/currency-formatter.atom";
|
||||
import IgnoreJobLine from "../../atoms/ignore-job-line/ignore-job-line.atom";
|
||||
import partTypeConverterAtom from "../../atoms/part-type-converter/part-type-converter.atom";
|
||||
import PriceDiffPcFormatterAtom from "../../atoms/price-diff-pc-formatter/price-diff-pc-formatter.atom";
|
||||
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import {
|
||||
selectReportData,
|
||||
selectReportLoading,
|
||||
} from "../../../redux/reporting/reporting.selectors";
|
||||
import { setSelectedJobId } from "../../../redux/application/application.actions";
|
||||
import { Link } from "react-router-dom";
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
reportingLoading: selectReportLoading,
|
||||
reportData: selectReportData,
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||
setSelectedJobId: (id) => dispatch(setSelectedJobId(id)),
|
||||
});
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(ReportingJobsListMolecule);
|
||||
|
||||
export function ReportingJobsListMolecule({ reportingLoading, reportData }) {
|
||||
export function ReportingJobsListMolecule({
|
||||
reportingLoading,
|
||||
reportData,
|
||||
setSelectedJobId,
|
||||
}) {
|
||||
const [searchText, setSearchText] = useState("");
|
||||
|
||||
const columns = [
|
||||
@@ -31,6 +28,11 @@ export function ReportingJobsListMolecule({ reportingLoading, reportData }) {
|
||||
title: "Claim No.",
|
||||
dataIndex: "clm_no",
|
||||
key: "clm_no",
|
||||
render: (text, record) => (
|
||||
<Link onClick={() => setSelectedJobId(record.id)} to={"/"}>
|
||||
{text}
|
||||
</Link>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: "Ins Co.",
|
||||
@@ -138,3 +140,8 @@ export function ReportingJobsListMolecule({ reportingLoading, reportData }) {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(ReportingJobsListMolecule);
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Skeleton, Statistic } from "antd";
|
||||
import React, { useCallback } from "react";
|
||||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { selectSelectedJobTargetPc } from "../../../redux/application/application.selectors";
|
||||
import {
|
||||
selectReportLoading,
|
||||
selectScorecard,
|
||||
|
||||
Reference in New Issue
Block a user