Begin Audit Functionality testing.

This commit is contained in:
Patrick Fic
2024-04-18 14:25:41 -07:00
parent 60fa62fa77
commit cf14111a73
17 changed files with 2838 additions and 650 deletions

View File

@@ -4,7 +4,7 @@ import {
CloseOutlined,
BarChartOutlined,
FileAddFilled,
LogoutOutlined,
LogoutOutlined
} from "@ant-design/icons";
import { Menu } from "antd";
import React from "react";
@@ -26,28 +26,33 @@ export default function SiderMenuOrganism() {
{
key: "/",
icon: <PieChartOutlined />,
label: <Link to="/">Jobs</Link>,
label: <Link to="/">Jobs</Link>
},
{
key: "/scan",
icon: <FileAddFilled />,
label: <Link to="/scan">File Scan</Link>,
label: <Link to="/scan">File Scan</Link>
},
{
key: "/reporting",
icon: <BarChartOutlined />,
label: <Link to="/reporting">Reporting</Link>,
label: <Link to="/reporting">Reporting</Link>
},
{
key: "/audit",
icon: <BarChartOutlined />,
label: <Link to="/audit">Audit</Link>
},
{
key: "/settings",
icon: <SettingFilled />,
label: <Link to="/settings">Settings</Link>,
label: <Link to="/settings">Settings</Link>
},
{ type: "divider" },
{
key: "signout",
icon: <LogoutOutlined style={{ color: "tomato" }} />,
label: <SiderSignOut />,
label: <SiderSignOut />
},
{
key: "quit",
@@ -60,8 +65,8 @@ export default function SiderMenuOrganism() {
>
Quit
</span>
),
},
)
}
]}
/>
);

View File

@@ -0,0 +1,32 @@
import { Button } from "antd";
import React from "react";
import ipcTypes from "../../../ipc.types";
import ReportingDatesMolecule from "../../molecules/reporting-dates/reporting-dates.molecule";
import { connect } from "react-redux";
import { createStructuredSelector } from "reselect";
import { queryReportingData } from "../../../redux/reporting/reporting.actions";
import dayjs from "../../../util/day";
const { ipcRenderer } = window;
const mapStateToProps = createStructuredSelector({
//currentUser: selectCurrentUser
});
const mapDispatchToProps = (dispatch) => ({
queryReportingData: (dates) => dispatch(queryReportingData(dates))
});
export default connect(mapStateToProps, mapDispatchToProps)(AuditPage);
export function AuditPage({ queryReportingData }) {
const handleBrowseForFile = async () => {
queryReportingData({ startDate: dayjs("2024-03-01"), endDate: dayjs("2024-03-31") });
ipcRenderer.send(ipcTypes.audit.toMain.browseForFile);
};
return (
<div style={{ height: "100%" }}>
<ReportingDatesMolecule />
<Button onClick={handleBrowseForFile}>Add Path</Button>;
</div>
);
}

View File

@@ -14,6 +14,7 @@ import JobsPage from "../jobs/jobs.page";
import ReportingPage from "../reporting/reporting.page";
import ScanPage from "../scan/scan.page";
import SettingsPage from "../settings/settings.page";
import AuditPage from "../audit/audit.page";
const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop });
const mapDispatchToProps = (dispatch) => ({});
@@ -29,19 +30,16 @@ export function RoutesPage({ bodyshop }) {
return (
<Layout style={{ background: "#fff", height: "100vh" }} hasSider>
<Layout.Sider
style={{ background: "#fff" }}
collapsible
defaultCollapsed="true"
>
<Layout.Sider style={{ background: "#fff" }} collapsible defaultCollapsed="true">
<SiderMenuOrganism />
</Layout.Sider>
<Layout style={{ background: "#fff" }}>
<Layout.Content style={{ marginLeft: "1rem", height: "100%" }}>
<NotificationModalOrganism />
<NotificationModalOrganism />
<Routes>
<Route exact path="/settings" element={<SettingsPage />} />
<Route exact path="/reporting" element={<ReportingPage />} />
<Route exact path="/audit" element={<AuditPage />} />
<Route exact path="/scan" element={<ScanPage />} />
<Route exact path="/" element={<JobsPage />} />
</Routes>