Added filtering for jobs with no close date on search. RPS-58

This commit is contained in:
Patrick Fic
2020-11-25 11:11:36 -08:00
parent 5555365863
commit d1c654617d
3 changed files with 31 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
New Features:
- Added a reference guide for MPI Grouping Guidelines next to the Group Descriptor on the estimate screen.
- Added ability to filter for jobs with no close date on job search.
Bug Fixes:
- Added better error handling on reporting for jobs that did not have a group set.

View File

@@ -1,8 +1,9 @@
import { SearchOutlined } from "@ant-design/icons";
import { Button, DatePicker, Form, Input } from "antd";
import { Button, Checkbox, DatePicker, Form, Input } from "antd";
import React from "react";
import ipcTypes from "../../../ipc.types";
const { ipcRenderer } = window;
export default function JobsSearchFieldsMolecule({ callSearchQuery }) {
const [form] = Form.useForm();
@@ -17,6 +18,9 @@ export default function JobsSearchFieldsMolecule({ callSearchQuery }) {
search: values.search || "",
startDate: (values.dateRange && values.dateRange[0]) || null,
endDate: (values.dateRange && values.dateRange[1]) || null,
...(values.closeDateIsNull
? { closeDateIsNull: values.closeDateIsNull }
: {}),
},
});
};
@@ -35,10 +39,29 @@ export default function JobsSearchFieldsMolecule({ callSearchQuery }) {
<Form.Item name="dateRange" rules={[{ type: "array" }]}>
<DatePicker.RangePicker />
</Form.Item>
<Button type="primary" htmlType="submit" onClick={() => form.submit()}>
<SearchOutlined />
Search
</Button>
<Form.Item name="closeDateIsNull" valuePropName="checked">
<Checkbox>Only Jobs with No Close Date</Checkbox>
</Form.Item>
<Form.Item shouldUpdate>
{() => {
const disabled =
!!!form.getFieldValue("search") &&
!!!form.getFieldValue("dateRange") &&
!form.getFieldValue("closeDateIsNull");
return (
<Button
type="primary"
disabled={disabled}
htmlType="submit"
onClick={() => form.submit()}
>
<SearchOutlined />
Search
</Button>
);
}}
</Form.Item>
</Form>
</div>
);

View File

@@ -44,11 +44,13 @@ export const SEARCH_JOBS_PAGINATED = gql`
$search: String
$startDate: date
$endDate: date
$closeDateIsNull: Boolean
) {
search_jobs(
offset: $offset
limit: $limit
args: { enddate: $endDate, search: $search, startdate: $startDate }
where: { close_date: { _is_null: $closeDateIsNull } }
) {
ownr_fn
ownr_ln