WIP for Reporting. Pulled out calculations to utility functions.

This commit is contained in:
Patrick Fic
2020-10-20 13:55:35 -07:00
parent 4290c8c497
commit 045346ce48
18 changed files with 345 additions and 57 deletions

View File

@@ -0,0 +1,44 @@
import { Button, DatePicker, Form } from "antd";
import React from "react";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { queryReportingData } from "../../../redux/reporting/reporting.actions";
const mapStateToProps = createStructuredSelector({
//currentUser: selectCurrentUser
});
const mapDispatchToProps = (dispatch) => ({
queryReportingData: (dates) => dispatch(queryReportingData(dates)),
});
export default connect(
mapStateToProps,
mapDispatchToProps
)(ReportingDatesMolecule);
export function ReportingDatesMolecule({ queryReportingData }) {
const [form] = Form.useForm();
const handleFinish = (values) => {
console.log("values", values);
queryReportingData({
startDate: values.dateRange[0],
endDate: values.dateRange[1],
});
};
return (
<Form form={form} onFinish={handleFinish}>
<div style={{ display: "flex" }}>
<Form.Item
label="Close Date Between"
name="dateRange"
rules={[{ type: "array", required: true }]}
>
<DatePicker.RangePicker />
</Form.Item>
<Button type="primary" htmlType="submit">
Run Search
</Button>
</div>
</Form>
);
}