WIP Payroll Commit process.

This commit is contained in:
Patrick Fic
2023-04-25 10:24:26 -07:00
parent ad9868b575
commit 6ca773050f
15 changed files with 350 additions and 59 deletions

View File

@@ -1,4 +1,4 @@
import { EditFilled } from "@ant-design/icons";
import { SyncOutlined, EditFilled } from "@ant-design/icons";
import { Button, Card, Space, Table, Tag } from "antd";
import Dinero from "dinero.js";
import moment from "moment";
@@ -210,6 +210,9 @@ export function TtApprovalsListComponent({
completedCallback={setSelectedTickets}
refetch={refetch}
/>
<Button onClick={() => refetch()}>
<SyncOutlined />
</Button>
</Space>
}
>

View File

@@ -28,26 +28,29 @@ export function TimeTicketsContainer({
const searchParams = queryString.parse(useLocation().search);
const { page, sortcolumn, sortorder, search, searchObj } = searchParams;
const { loading, error, data } = useQuery(QUERY_ALL_TT_APPROVALS_PAGINATED, {
fetchPolicy: "network-only",
nextFetchPolicy: "network-only",
variables: {
search: search || "",
offset: page ? (page - 1) * 25 : 0,
limit: 25,
order: [
searchObj
? JSON.parse(searchObj)
: {
[sortcolumn || "date"]: sortorder
? sortorder === "descend"
? "desc"
: "asc"
: "desc",
},
],
},
});
const { loading, error, data, refetch } = useQuery(
QUERY_ALL_TT_APPROVALS_PAGINATED,
{
fetchPolicy: "network-only",
nextFetchPolicy: "network-only",
variables: {
search: search || "",
offset: page ? (page - 1) * 25 : 0,
limit: 25,
order: [
searchObj
? JSON.parse(searchObj)
: {
[sortcolumn || "date"]: sortorder
? sortorder === "descend"
? "desc"
: "asc"
: "desc",
},
],
},
}
);
if (error) return <AlertComponent message={error.message} type="error" />;
@@ -56,6 +59,7 @@ export function TimeTicketsContainer({
loading={loading}
tt_approval_queue={data ? data.tt_approval_queue : []}
total={data ? data.tt_approval_queue_aggregate.aggregate.count : 0}
refetch={refetch}
/>
);
}