@@ -249,15 +249,17 @@ function createTray() {
|
||||
// autoUpdater.on("checking-for-update", () => {
|
||||
// log.log("Checking for update...");
|
||||
// });
|
||||
// autoUpdater.on("update-available", (ev, info) => {
|
||||
// log.log("Update available.");
|
||||
// });
|
||||
// autoUpdater.on("update-not-available", (ev, info) => {
|
||||
// log.log("Update not available.");
|
||||
// });
|
||||
// autoUpdater.on("error", (ev, err) => {
|
||||
// log.log("Error in auto-updater.");
|
||||
// });
|
||||
autoUpdater.on("update-available", (ev) => {
|
||||
log.log("Update available.", ev);
|
||||
mainWindow.webContents.send(ipcTypes.app.toRenderer.updateAvailable, ev);
|
||||
});
|
||||
autoUpdater.on("update-not-available", (ev) => {
|
||||
log.log("Update not available.", ev);
|
||||
});
|
||||
|
||||
autoUpdater.on("error", (ev, err) => {
|
||||
log.log("Error in auto-updater.", ev, err);
|
||||
});
|
||||
|
||||
// // autoUpdater.on("update-downloaded", (ev, info) => {
|
||||
// // console.log("Update downloaded; will install in 5 seconds");
|
||||
@@ -326,15 +328,16 @@ autoUpdater.on("update-downloaded", (ev, info) => {
|
||||
async function checkForUpdates() {
|
||||
try {
|
||||
log.info("Checking for updates.");
|
||||
const result = await autoUpdater.checkForUpdates();
|
||||
const { updateInfo } = result;
|
||||
//const result = await
|
||||
autoUpdater.checkForUpdates();
|
||||
// const { updateInfo } = result;
|
||||
|
||||
if (updateInfo.version !== app.getVersion()) {
|
||||
mainWindow.webContents.send(
|
||||
ipcTypes.app.toRenderer.updateAvailable,
|
||||
updateInfo
|
||||
);
|
||||
}
|
||||
// if (updateInfo.version !== app.getVersion()) {
|
||||
// mainWindow.webContents.send(
|
||||
// ipcTypes.app.toRenderer.updateAvailable,
|
||||
// updateInfo
|
||||
// );
|
||||
// }
|
||||
} catch (error) {
|
||||
log.error("Error while checking for update", error);
|
||||
}
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
endpoint: https://rps.bodyshop.app
|
||||
#endpoint: https://rps.bodyshop.app
|
||||
endpoint: https://db.rps.imex.online
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: ALTER TABLE "public"."bodyshops" DROP COLUMN "ppd_diff_alert";
|
||||
type: run_sql
|
||||
@@ -0,0 +1,6 @@
|
||||
- args:
|
||||
cascade: false
|
||||
read_only: false
|
||||
sql: ALTER TABLE "public"."bodyshops" ADD COLUMN "ppd_diff_alert" numeric NULL
|
||||
DEFAULT .05;
|
||||
type: run_sql
|
||||
@@ -0,0 +1,28 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: bodyshops
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: false
|
||||
columns:
|
||||
- accepted_ins_co
|
||||
- created_at
|
||||
- groups
|
||||
- id
|
||||
- shopname
|
||||
- targets
|
||||
- updated_at
|
||||
computed_fields: []
|
||||
filter:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
role: user
|
||||
table:
|
||||
name: bodyshops
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,29 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: bodyshops
|
||||
schema: public
|
||||
type: drop_select_permission
|
||||
- args:
|
||||
permission:
|
||||
allow_aggregations: false
|
||||
columns:
|
||||
- accepted_ins_co
|
||||
- created_at
|
||||
- groups
|
||||
- id
|
||||
- ppd_diff_alert
|
||||
- shopname
|
||||
- targets
|
||||
- updated_at
|
||||
computed_fields: []
|
||||
filter:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
role: user
|
||||
table:
|
||||
name: bodyshops
|
||||
schema: public
|
||||
type: create_select_permission
|
||||
@@ -0,0 +1,24 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: bodyshops
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
- args:
|
||||
permission:
|
||||
columns:
|
||||
- accepted_ins_co
|
||||
- groups
|
||||
- shopname
|
||||
- targets
|
||||
filter:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: bodyshops
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
@@ -0,0 +1,25 @@
|
||||
- args:
|
||||
role: user
|
||||
table:
|
||||
name: bodyshops
|
||||
schema: public
|
||||
type: drop_update_permission
|
||||
- args:
|
||||
permission:
|
||||
columns:
|
||||
- accepted_ins_co
|
||||
- groups
|
||||
- ppd_diff_alert
|
||||
- shopname
|
||||
- targets
|
||||
filter:
|
||||
associations:
|
||||
user:
|
||||
authid:
|
||||
_eq: X-Hasura-User-Id
|
||||
set: {}
|
||||
role: user
|
||||
table:
|
||||
name: bodyshops
|
||||
schema: public
|
||||
type: create_update_permission
|
||||
@@ -46,6 +46,7 @@ tables:
|
||||
- created_at
|
||||
- groups
|
||||
- id
|
||||
- ppd_diff_alert
|
||||
- shopname
|
||||
- targets
|
||||
- updated_at
|
||||
@@ -60,6 +61,7 @@ tables:
|
||||
columns:
|
||||
- accepted_ins_co
|
||||
- groups
|
||||
- ppd_diff_alert
|
||||
- shopname
|
||||
- targets
|
||||
filter:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"productName": "ImEX RPS",
|
||||
"author": "ImEX Systems Inc. <support@thinkimex.com>",
|
||||
"description": "ImEX RPS",
|
||||
"version": "1.0.7",
|
||||
"version": "1.0.8",
|
||||
"main": "electron/main.js",
|
||||
"homepage": "./",
|
||||
"dependencies": {
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
||||
|
||||
<!--
|
||||
<script data-jsd-embedded data-key="51adb36e-ee16-46b1-a4c6-4b6d5fcd8530" data-base-url="https://jsd-widget.atlassian.com" src="https://jsd-widget.atlassian.com/assets/embed.js"></script>
|
||||
-->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="theme-color" content="#002366" />
|
||||
<meta
|
||||
|
||||
@@ -3,13 +3,16 @@ import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { selectSelectedJobTargetPc } from "../../../redux/application/application.selectors";
|
||||
import { selectBodyshop } from "../../../redux/user/user.selectors";
|
||||
import "./price-diff-pc-formatter.styles.scss";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
selectedJobTargetPc: selectSelectedJobTargetPc,
|
||||
bodyshop: selectBodyshop,
|
||||
});
|
||||
|
||||
export function PriceDiffPcFormatterAtom({
|
||||
bodyshop,
|
||||
price_diff_pc,
|
||||
selectedJobTargetPc,
|
||||
}) {
|
||||
@@ -22,7 +25,8 @@ export function PriceDiffPcFormatterAtom({
|
||||
}}
|
||||
>
|
||||
{(price_diff_pc * 100).toFixed(1)}%
|
||||
{price_diff_pc === 1 ? (
|
||||
{price_diff_pc === 1 ||
|
||||
(price_diff_pc <= bodyshop.ppd_diff_alert && price_diff_pc > 0) ? (
|
||||
<AlertFilled style={{ color: "tomato" }} className="blink_me" />
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { selectUpdateAvailable } from "../../../redux/application/application.selectors";
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
//scanLoading: selectScanLoading,
|
||||
updateAvailable: selectUpdateAvailable,
|
||||
});
|
||||
const mapDispatchToProps = (dispatch) => ({});
|
||||
|
||||
export function UpdateAvailableAtom({ available }) {
|
||||
return <div>Update Available!</div>;
|
||||
}
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(UpdateAvailableAtom);
|
||||
@@ -1,3 +1,4 @@
|
||||
import { WarningOutlined } from "@ant-design/icons";
|
||||
import { List } from "antd";
|
||||
import React from "react";
|
||||
import { connect } from "react-redux";
|
||||
@@ -6,7 +7,6 @@ import { setSelectedJobId } from "../../../redux/application/application.actions
|
||||
import { selectSelectedJobId } from "../../../redux/application/application.selectors";
|
||||
import TimeAgoFormatter from "../../atoms/time-ago-formatter/time-ago-formatter.atom";
|
||||
import "./jobs-list-item.styles.scss";
|
||||
import { WarningOutlined } from "@ant-design/icons";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
selectedJobId: selectSelectedJobId,
|
||||
@@ -19,11 +19,24 @@ export function JobsListItemMolecule({
|
||||
selectedJobId,
|
||||
setSelectedJobId,
|
||||
item,
|
||||
refetch,
|
||||
}) {
|
||||
const handleSelect = (jobId) => {
|
||||
setSelectedJobId(jobId);
|
||||
};
|
||||
|
||||
if (item.isRefresh)
|
||||
return (
|
||||
<List.Item
|
||||
className="jobs-list-item-refresh"
|
||||
key="refreshItem"
|
||||
onClick={() => {
|
||||
refetch();
|
||||
}}
|
||||
>
|
||||
<div className="jobs-list-item-refresh-content">Refresh All</div>
|
||||
</List.Item>
|
||||
);
|
||||
return (
|
||||
<List.Item
|
||||
className="jobs-list-item"
|
||||
|
||||
@@ -19,3 +19,18 @@
|
||||
background-color: #e6f7ff;
|
||||
}
|
||||
}
|
||||
.jobs-list-item-refresh {
|
||||
padding: 0.1rem !important;
|
||||
margin: 0;
|
||||
border-bottom: 0.8rem solid #f0f0f0 !important;
|
||||
&-content {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
cursor: pointer;
|
||||
&:hover {
|
||||
background-color: #e6f7ff;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,9 @@ export function ReportingDatesMolecule({ queryReportingData }) {
|
||||
<DatePicker.RangePicker
|
||||
ranges={{
|
||||
Today: [moment(), moment()],
|
||||
"Last 7 days": [moment().subtract(7, "days"), moment()],
|
||||
"Next 7 days": [moment(), moment().add(7, "days")],
|
||||
"Next 14 days": [moment(), moment().add(14, "days")],
|
||||
"Last Month": [
|
||||
moment().startOf("month").subtract(1, "month"),
|
||||
moment().startOf("month").subtract(1, "month").endOf("month"),
|
||||
@@ -48,7 +51,6 @@ export function ReportingDatesMolecule({ queryReportingData }) {
|
||||
moment().startOf("month").add(1, "month"),
|
||||
moment().startOf("month").add(1, "month").endOf("month"),
|
||||
],
|
||||
"Last 7 days": [moment().subtract(7, "days"), moment()],
|
||||
}}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
@@ -11,6 +11,8 @@ import {
|
||||
selectReportLoading,
|
||||
selectScorecard,
|
||||
} from "../../../redux/reporting/reporting.selectors";
|
||||
import { alphaSort } from "../../../util/sorters";
|
||||
import moment from "moment";
|
||||
|
||||
const { ipcRenderer } = window;
|
||||
|
||||
@@ -41,21 +43,34 @@ export function ReportingJobsListMolecule({
|
||||
{text}
|
||||
</Link>
|
||||
),
|
||||
sorter: (a, b) => alphaSort(a.clm_no, b.clm_no),
|
||||
},
|
||||
{
|
||||
title: "Close Date",
|
||||
dataIndex: "close_date",
|
||||
key: "close_date",
|
||||
render: (text, record) => moment(record.close_date).format("MM/DD/yyyy"),
|
||||
defaultSortOrder: "ascend",
|
||||
sorter: (a, b) =>
|
||||
moment(a.close_date).unix() - moment(b.close_date).unix(),
|
||||
},
|
||||
{
|
||||
title: "Ins Co.",
|
||||
dataIndex: "ins_co_nm",
|
||||
key: "ins_co_nm",
|
||||
sorter: (a, b) => alphaSort(a.ins_co_nm, b.ins_co_nm),
|
||||
},
|
||||
{
|
||||
title: "First Name",
|
||||
dataIndex: "ownr_fn",
|
||||
key: "ownr_fn",
|
||||
sorter: (a, b) => alphaSort(a.ownr_fn, b.ownr_fn),
|
||||
},
|
||||
{
|
||||
title: "Last Name",
|
||||
dataIndex: "ownr_ln",
|
||||
key: "ownr_ln",
|
||||
sorter: (a, b) => alphaSort(a.ownr_ln, b.ownr_ln),
|
||||
},
|
||||
{
|
||||
title: "Vehicle",
|
||||
@@ -72,12 +87,14 @@ export function ReportingJobsListMolecule({
|
||||
title: "Database Price Sum",
|
||||
dataIndex: "dbPriceSum",
|
||||
key: "dbPriceSum",
|
||||
sorter: (a, b) => a.dbPriceSum.getAmount() - b.dbPriceSum.getAmount(),
|
||||
render: (text, record) => record.dbPriceSum.toFormat(),
|
||||
},
|
||||
{
|
||||
title: "Actual Price Sum ",
|
||||
dataIndex: "actPriceSum",
|
||||
key: "actPriceSum",
|
||||
sorter: (a, b) => a.actPriceSum.getAmount() - b.actPriceSum.getAmount(),
|
||||
render: (text, record) => record.actPriceSum.toFormat(),
|
||||
},
|
||||
{
|
||||
@@ -104,7 +121,7 @@ export function ReportingJobsListMolecule({
|
||||
color: record.jobRpsPc > record.jobTarget ? "seagreen" : "tomato",
|
||||
}}
|
||||
>
|
||||
{`${(record.jobRpsPc * 100).toFixed(1)}% / ${(
|
||||
{`${(record.jobRpsPc * 100 || 0).toFixed(1)}% / ${(
|
||||
record.jobTarget * 100
|
||||
).toFixed(1)}%`}
|
||||
</span>
|
||||
@@ -159,14 +176,13 @@ export function ReportingJobsListMolecule({
|
||||
<Table.Summary.Cell index={2}></Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={3}></Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={4}></Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={5}>
|
||||
<Table.Summary.Cell index={5}></Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={6}>
|
||||
{scoreCard && scoreCard.allJobsSumDbPrice.toFormat()}
|
||||
</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={6}>
|
||||
{" "}
|
||||
<Table.Summary.Cell index={7}>
|
||||
{scoreCard && scoreCard.allJobsSumActPrice.toFormat()}
|
||||
</Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={7}></Table.Summary.Cell>
|
||||
<Table.Summary.Cell index={8}></Table.Summary.Cell>
|
||||
</Table.Summary.Row>
|
||||
)}
|
||||
|
||||
@@ -60,6 +60,18 @@ export default function ShopSettingsFormMolecule({ form, saveLoading }) {
|
||||
>
|
||||
<Select mode="tags" onBlur={handleBlur} />
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="Alert when Parts Price Difference Less Than"
|
||||
name="ppd_diff_alert"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
},
|
||||
]}
|
||||
>
|
||||
<InputNumber />
|
||||
</Form.Item>
|
||||
</LayoutFormRow>
|
||||
<Typography.Title level={4}>Group Definitions</Typography.Title>
|
||||
<Form.List name={["targets"]}>
|
||||
|
||||
@@ -32,32 +32,33 @@ export default function JobsTableOrganism() {
|
||||
);
|
||||
|
||||
const handleInfiniteOnLoad = (page) => {
|
||||
fetchMore({
|
||||
variables: {
|
||||
offset: limit * page,
|
||||
},
|
||||
updateQuery: (prev, { fetchMoreResult }) => {
|
||||
if (!fetchMoreResult) {
|
||||
console.log("No more results. Fetch More was empty.");
|
||||
setState({ ...state, hasMore: false });
|
||||
return prev;
|
||||
}
|
||||
fetchMore &&
|
||||
fetchMore({
|
||||
variables: {
|
||||
offset: limit * page,
|
||||
},
|
||||
updateQuery: (prev, { fetchMoreResult }) => {
|
||||
if (!fetchMoreResult) {
|
||||
console.log("No more results. Fetch More was empty.");
|
||||
setState({ ...state, hasMore: false });
|
||||
return prev;
|
||||
}
|
||||
|
||||
const newCache = Object.assign({}, prev, {
|
||||
jobs: [...prev.jobs, ...fetchMoreResult.jobs],
|
||||
});
|
||||
const newCache = Object.assign({}, prev, {
|
||||
jobs: [...prev.jobs, ...fetchMoreResult.jobs],
|
||||
});
|
||||
|
||||
if (
|
||||
newCache.jobs.length >= data &&
|
||||
data.jobs_aggregate.aggregate.count
|
||||
) {
|
||||
console.log("No more results.");
|
||||
setState({ ...state, hasMore: false });
|
||||
}
|
||||
if (
|
||||
newCache.jobs.length >= data &&
|
||||
data.jobs_aggregate.aggregate.count
|
||||
) {
|
||||
console.log("No more results.");
|
||||
setState({ ...state, hasMore: false });
|
||||
}
|
||||
|
||||
return newCache;
|
||||
},
|
||||
});
|
||||
return newCache;
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
if (error)
|
||||
@@ -80,8 +81,10 @@ export default function JobsTableOrganism() {
|
||||
<Dropdown overlay={menu} trigger={["contextMenu"]}>
|
||||
<List
|
||||
bordered
|
||||
dataSource={data ? data.jobs : []}
|
||||
renderItem={(item) => <JobsListItemMolecule item={item} />}
|
||||
dataSource={data ? [{ isRefresh: true }, ...data.jobs] : []}
|
||||
renderItem={(item) => (
|
||||
<JobsListItemMolecule item={item} refetch={refetch} />
|
||||
)}
|
||||
>
|
||||
{loading && state.hasMore && (
|
||||
<div>
|
||||
@@ -92,9 +95,11 @@ export default function JobsTableOrganism() {
|
||||
</Dropdown>
|
||||
</InfiniteScroll>
|
||||
</div>
|
||||
{`${data ? data.jobs.length : 0} jobs loaded. ${
|
||||
data ? data.jobs_aggregate.aggregate.count : 0
|
||||
} total jobs.`}
|
||||
<div>
|
||||
{`${data ? data.jobs.length : 0} jobs loaded. ${
|
||||
data ? data.jobs_aggregate.aggregate.count : 0
|
||||
} total jobs.`}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,11 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
});
|
||||
|
||||
export function UpdateManagerOrganism({ updateAvailable, updateProgress }) {
|
||||
console.log(
|
||||
"UpdateManagerOrganism -> updateAvailable, updateProgress",
|
||||
updateAvailable,
|
||||
updateProgress
|
||||
);
|
||||
if (!updateAvailable) return null;
|
||||
return (
|
||||
<Layout.Footer>
|
||||
|
||||
@@ -7,6 +7,7 @@ export const QUERY_BODYSHOP = gql`
|
||||
targets
|
||||
accepted_ins_co
|
||||
groups
|
||||
ppd_diff_alert
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -20,6 +21,7 @@ export const UPDATE_SHOP = gql`
|
||||
targets
|
||||
accepted_ins_co
|
||||
groups
|
||||
ppd_diff_alert
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user