Working ANTD5 and major updates without DayJS
This commit is contained in:
@@ -8,7 +8,7 @@ export default function DeleteAllEmsAtom() {
|
||||
<Popconfirm
|
||||
title="Are you sure you want to delete all EMS files? This cannot be undone."
|
||||
onConfirm={() =>
|
||||
ipcRenderer.send(ipcTypes.default.fileScan.toMain.deleteAllEms)
|
||||
ipcRenderer.send(ipcTypes.fileScan.toMain.deleteAllEms)
|
||||
}
|
||||
>
|
||||
<Button>Delete All EMS</Button>
|
||||
|
||||
@@ -20,7 +20,7 @@ export function DeleteJobAtom({ setSelectedJobId, jobId }) {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const handleDelete = async () => {
|
||||
setLoading(true);
|
||||
ipcRenderer.send(ipcTypes.default.app.toMain.track, {
|
||||
ipcRenderer.send(ipcTypes.app.toMain.track, {
|
||||
event: "DELETE_JOB",
|
||||
});
|
||||
const result = await deleteJob({
|
||||
|
||||
@@ -8,7 +8,7 @@ export default function ErrorResultAtom({
|
||||
errorMessage,
|
||||
tryAgainCallback,
|
||||
}) {
|
||||
ipcRenderer.send(ipcTypes.default.app.toMain.track, {
|
||||
ipcRenderer.send(ipcTypes.app.toMain.track, {
|
||||
event: "ERROR_RESULT_ATOM_DISPLAYED",
|
||||
title,
|
||||
errorMessage,
|
||||
|
||||
@@ -11,7 +11,7 @@ export default function IgnoreJobLineAtom({ ignore, lineId, line_desc }) {
|
||||
const handleChange = async (checked) => {
|
||||
console.log("handleChange -> checked", checked);
|
||||
setLoading(true);
|
||||
ipcRenderer.send(ipcTypes.default.app.toMain.track, {
|
||||
ipcRenderer.send(ipcTypes.app.toMain.track, {
|
||||
event: "TOGGLE_IGNORE_LINE",
|
||||
line_desc: line_desc,
|
||||
ignore: !checked,
|
||||
|
||||
@@ -17,12 +17,12 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
|
||||
export function NotificationsToggleAtom({ appSettings }) {
|
||||
const handleChange = (val) => {
|
||||
ipcRenderer.send(ipcTypes.default.app.toMain.track, {
|
||||
ipcRenderer.send(ipcTypes.app.toMain.track, {
|
||||
event: "TOGGLE_NOTIFICATION",
|
||||
enabled: val,
|
||||
});
|
||||
|
||||
ipcRenderer.send(ipcTypes.default.store.set, {
|
||||
ipcRenderer.send(ipcTypes.store.set, {
|
||||
enableNotifications: val,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -17,12 +17,12 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
|
||||
export function WatcherStartupAtom({ appSettings }) {
|
||||
const handleChange = (val) => {
|
||||
ipcRenderer.send(ipcTypes.default.app.toMain.track, {
|
||||
ipcRenderer.send(ipcTypes.app.toMain.track, {
|
||||
event: "TOGGLE_WATCHER_ON_STARTUP",
|
||||
enabled: val,
|
||||
});
|
||||
|
||||
ipcRenderer.send(ipcTypes.default.store.set, {
|
||||
ipcRenderer.send(ipcTypes.store.set, {
|
||||
runWatcherOnStartup: val,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -15,7 +15,7 @@ export default function CloseDateDisplayMolecule({ job, jobId, close_date }) {
|
||||
const [updateJob] = useMutation(UPDATE_JOB);
|
||||
|
||||
const handleChange = async (newDate) => {
|
||||
ipcRenderer.send(ipcTypes.default.app.toMain.track, {
|
||||
ipcRenderer.send(ipcTypes.app.toMain.track, {
|
||||
event: "SET_CLOSED_DATE",
|
||||
});
|
||||
setLoading(true);
|
||||
|
||||
@@ -5,7 +5,7 @@ const { ipcRenderer } = window;
|
||||
|
||||
export default function FilepathAddMolecule() {
|
||||
const handleClick = () => {
|
||||
ipcRenderer.send(ipcTypes.default.fileWatcher.toMain.addPath);
|
||||
ipcRenderer.send(ipcTypes.fileWatcher.toMain.addPath);
|
||||
};
|
||||
return <Button onClick={handleClick}>Add Path</Button>;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ const { ipcRenderer } = window;
|
||||
|
||||
export default function FilePathMolecule(item, index) {
|
||||
const handleClick = () => {
|
||||
ipcRenderer.send(ipcTypes.default.fileWatcher.toMain.removePath, item);
|
||||
ipcRenderer.send(ipcTypes.fileWatcher.toMain.removePath, item);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -25,7 +25,7 @@ export function JobGroupMolecule({ bodyshop, jobId, group, job }) {
|
||||
const [updateJob] = useMutation(UPDATE_JOB);
|
||||
|
||||
const handleMenuClick = async (value) => {
|
||||
ipcRenderer.send(ipcTypes.default.app.toMain.track, {
|
||||
ipcRenderer.send(ipcTypes.app.toMain.track, {
|
||||
event: "CHANGE_VEHICLE_GROUP",
|
||||
vehicle: `${job.v_model_yr} ${job.v_makedesc} ${job.v_model} (${job.v_type})`,
|
||||
oldGroup: group,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Alert, Descriptions, PageHeader, Skeleton, Tooltip } from "antd";
|
||||
import { Alert, Descriptions, Skeleton, Tooltip } from "antd";
|
||||
import React from "react";
|
||||
import CurrencyFormatterAtom from "../../atoms/currency-formatter/currency-formatter.atom";
|
||||
import ErrorResultAtom from "../../atoms/error-result/error-result.atom";
|
||||
@@ -9,16 +9,14 @@ import DeleteJobAtom from "../../atoms/delete-job/delete-job.atom";
|
||||
import VehicleGroupAlertAtom from "../../atoms/vehicle-group-alert/vehicle-group-alert.atom";
|
||||
import { DateFormat } from "../../../util/constants";
|
||||
import moment from "moment";
|
||||
import { PageHeader } from "@ant-design/pro-layout";
|
||||
|
||||
export default function JobsDetailDescriptionMolecule({ loading, job }) {
|
||||
if (loading) return <Skeleton active />;
|
||||
|
||||
if (!job)
|
||||
return (
|
||||
<ErrorResultAtom
|
||||
title="Error displaying job header data."
|
||||
errorMessage="It looks like this job doesn't exist."
|
||||
/>
|
||||
<ErrorResultAtom title="Error displaying job header data." errorMessage="It looks like this job doesn't exist." />
|
||||
);
|
||||
|
||||
return (
|
||||
@@ -40,7 +38,7 @@ export default function JobsDetailDescriptionMolecule({ loading, job }) {
|
||||
/>
|
||||
</Tooltip>
|
||||
),
|
||||
<DeleteJobAtom key="delete" jobId={job.id} />,
|
||||
<DeleteJobAtom key="delete" jobId={job.id} />
|
||||
]}
|
||||
>
|
||||
<Descriptions column={{ xxl: 5, xl: 4, lg: 3, md: 3, sm: 2, xs: 1 }}>
|
||||
@@ -62,24 +60,16 @@ export default function JobsDetailDescriptionMolecule({ loading, job }) {
|
||||
</Tooltip>
|
||||
}
|
||||
>
|
||||
<CloseDateDisplayMolecule
|
||||
job={job}
|
||||
jobId={job.id}
|
||||
close_date={job.close_date}
|
||||
/>
|
||||
<CloseDateDisplayMolecule job={job} jobId={job.id} close_date={job.close_date} />
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="Last Updated">
|
||||
<TimeAgoFormatter>{job.updated_at}</TimeAgoFormatter>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="# RPS Eligible Parts">
|
||||
{job &&
|
||||
job.joblines.filter((i) => !i.ignore && i.db_ref !== "900511")
|
||||
.length}
|
||||
{job && job.joblines.filter((i) => !i.ignore && i.db_ref !== "900511").length}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="Loss Date">
|
||||
{job.loss_date
|
||||
? moment(job.loss_date).format(DateFormat)
|
||||
: "No Loss Date"}
|
||||
{job.loss_date ? moment(job.loss_date).format(DateFormat) : "No Loss Date"}
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</PageHeader>
|
||||
|
||||
@@ -148,7 +148,7 @@ export default function JobLinesTableMolecule({ loading, job }) {
|
||||
<Input.Search
|
||||
placeholder="Search"
|
||||
onSearch={(val) => {
|
||||
ipcRenderer.send(ipcTypes.default.app.toMain.track, {
|
||||
ipcRenderer.send(ipcTypes.app.toMain.track, {
|
||||
event: "JOB_LINES_SEARCH",
|
||||
query: val,
|
||||
});
|
||||
|
||||
@@ -8,7 +8,7 @@ export default function JobsSearchFieldsMolecule({ callSearchQuery }) {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
const handleFinish = (values) => {
|
||||
ipcRenderer.send(ipcTypes.default.app.toMain.track, {
|
||||
ipcRenderer.send(ipcTypes.app.toMain.track, {
|
||||
event: "SEARCH_JOBS",
|
||||
query: values.search,
|
||||
datesIncluded: !!values.dateRange,
|
||||
|
||||
@@ -18,11 +18,11 @@ export function ReleaseNotes({ releaseNotes, setReleaseNotes }) {
|
||||
console.log("ReleaseNotes -> releaseNotes", releaseNotes);
|
||||
|
||||
useEffect(() => {
|
||||
ipcRenderer.send(ipcTypes.default.app.toMain.getReleaseNotes);
|
||||
ipcRenderer.send(ipcTypes.app.toMain.getReleaseNotes);
|
||||
}, []);
|
||||
|
||||
const handleOk = () => {
|
||||
ipcRenderer.send(ipcTypes.default.store.set, { showChangeLog: false });
|
||||
ipcRenderer.send(ipcTypes.store.set, { showChangeLog: false });
|
||||
setReleaseNotes(null);
|
||||
};
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ export function ReportingJobsListMolecule({
|
||||
<Input.Search
|
||||
placeholder="Search"
|
||||
onSearch={(val) => {
|
||||
ipcRenderer.send(ipcTypes.default.app.toMain.track, {
|
||||
ipcRenderer.send(ipcTypes.app.toMain.track, {
|
||||
event: "REPORTS_LIST_SEARCH",
|
||||
query: val,
|
||||
});
|
||||
|
||||
@@ -70,7 +70,7 @@ export function ScanEstimateListMolecule({ scanLoading, estimates }) {
|
||||
onClick={() => {
|
||||
message.info("Attempting to import job...");
|
||||
ipcRenderer.send(
|
||||
ipcTypes.default.fileScan.toMain.importJob,
|
||||
ipcTypes.fileScan.toMain.importJob,
|
||||
record.filepath
|
||||
);
|
||||
}}
|
||||
|
||||
@@ -17,10 +17,10 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
|
||||
export function WatcherPollingMolecule({ appSettings }) {
|
||||
const handlePollingToggle = (val) => {
|
||||
ipcRenderer.send(ipcTypes.default.store.set, { "polling.enabled": val });
|
||||
ipcRenderer.send(ipcTypes.store.set, { "polling.enabled": val });
|
||||
};
|
||||
const handleIntervalChange = (val) => {
|
||||
ipcRenderer.send(ipcTypes.default.store.set, {
|
||||
ipcRenderer.send(ipcTypes.store.set, {
|
||||
"polling.pollingInterval": val,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -5,7 +5,7 @@ const { ipcRenderer } = window;
|
||||
|
||||
export default function WatcherStartMolecule() {
|
||||
const handleClick = () => {
|
||||
ipcRenderer.send(ipcTypes.default.fileWatcher.toMain.start);
|
||||
ipcRenderer.send(ipcTypes.fileWatcher.toMain.start);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -5,7 +5,7 @@ const { ipcRenderer } = window;
|
||||
|
||||
export default function WatcherStopMolecule() {
|
||||
const handleClick = () => {
|
||||
ipcRenderer.send(ipcTypes.default.fileWatcher.toMain.stop);
|
||||
ipcRenderer.send(ipcTypes.fileWatcher.toMain.stop);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -18,7 +18,7 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
export function FilePathsList({ watchedPaths }) {
|
||||
//On Rdner, send request to get file paths to main.
|
||||
useEffect(() => {
|
||||
ipcRenderer.send(ipcTypes.default.fileWatcher.toMain.filepathsGet);
|
||||
ipcRenderer.send(ipcTypes.fileWatcher.toMain.filepathsGet);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
||||
@@ -23,7 +23,7 @@ export default function JobsTableOrganism() {
|
||||
|
||||
const handleInfiniteOnLoad = async (page) => {
|
||||
if (fetchMore) {
|
||||
// ipcRenderer.send(ipcTypes.default.app.toMain.track, {
|
||||
// ipcRenderer.send(ipcTypes.app.toMain.track, {
|
||||
// event: "FETCH_MORE_JOBS",
|
||||
// });
|
||||
await fetchMore({
|
||||
|
||||
@@ -29,7 +29,7 @@ export function ShopSettingsOrganism({ setBodyshop }) {
|
||||
|
||||
const handleFinish = async (values) => {
|
||||
setSaveLoading(true);
|
||||
ipcRenderer.send(ipcTypes.default.app.toMain.track, {
|
||||
ipcRenderer.send(ipcTypes.app.toMain.track, {
|
||||
event: "UPDATE_SHOP_DETAILS",
|
||||
});
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ export default function SiderMenuOrganism() {
|
||||
label: (
|
||||
<span
|
||||
onClick={() => {
|
||||
ipcRenderer.send(ipcTypes.default.quit);
|
||||
ipcRenderer.send(ipcTypes.quit);
|
||||
}}
|
||||
>
|
||||
Quit
|
||||
|
||||
@@ -46,7 +46,7 @@ export function UpdateManagerOrganism({ updateAvailable, updateProgress }) {
|
||||
type="primary"
|
||||
style={{ margin: "0rem .5rem" }}
|
||||
onClick={() =>
|
||||
ipcRenderer.send(ipcTypes.default.app.toMain.downloadUpdates)
|
||||
ipcRenderer.send(ipcTypes.app.toMain.downloadUpdates)
|
||||
}
|
||||
>
|
||||
Download
|
||||
@@ -75,7 +75,7 @@ export function UpdateManagerOrganism({ updateAvailable, updateProgress }) {
|
||||
type="primary"
|
||||
style={{ margin: "0rem .5rem" }}
|
||||
onClick={() =>
|
||||
ipcRenderer.send(ipcTypes.default.app.toMain.installUpdates)
|
||||
ipcRenderer.send(ipcTypes.app.toMain.installUpdates)
|
||||
}
|
||||
>
|
||||
Install
|
||||
|
||||
@@ -11,7 +11,7 @@ const { ipcRenderer } = window;
|
||||
|
||||
export default function SettingsPage() {
|
||||
useEffect(() => {
|
||||
ipcRenderer.send(ipcTypes.default.store.getAll);
|
||||
ipcRenderer.send(ipcTypes.store.getAll);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user