Add null coalesce.

This commit is contained in:
Patrick FIc
2026-04-24 11:23:01 -07:00
parent 69e017ca7d
commit 59962f6c38
7 changed files with 8 additions and 8 deletions

View File

@@ -3,7 +3,7 @@
"productName": "ImEX RPS",
"author": "ImEX Systems Inc. <support@thinkimex.com>",
"description": "ImEX RPS",
"version": "1.6.0-alpha.8",
"version": "1.6.0-alpha.9",
"main": "electron/main.js",
"homepage": "./",
"dependencies": {

View File

@@ -74,7 +74,7 @@ export function JobGroupMolecule({ bodyshop, jobId, group, job }) {
<Menu
onClick={handleMenuClick}
//disabled
items={[{ label: "Default", key: "Default", value: "Default" }]}
items={[{ label: "N/A", key: "Default", value: "Default" }]}
></Menu>
);
@@ -98,7 +98,7 @@ export function JobGroupMolecule({ bodyshop, jobId, group, job }) {
<GroupVerifySwitch job={job} loading={loading} loadingCallback={setLoading} />
</div>
)}
{bodyshop.ins_rule_set === "MPI" && <JobsGroupModalMolecule job={job} />}
{bodyshop?.ins_rule_set === "MPI" && <JobsGroupModalMolecule job={job} />}
{loading && <LoadingOutlined />}
</Space>

View File

@@ -139,7 +139,7 @@ export function JobsDetailDescriptionMolecule({ bodyshop, loading, job, jobDetai
<Descriptions.Item label="Mileage">
<Space size="small">
{job.v_mileage}
{bodyshop.ins_rule_set === "MPI" && MPIRulesetToApply === "V3" && job.v_mileage < 20000 && (
{bodyshop?.ins_rule_set === "MPI" && MPIRulesetToApply === "V3" && job.v_mileage < 20000 && (
<Tooltip title="Vehicle is under 20,000 KMs. No expected savings.">
<WarningOutlined style={{ color: "seagreen" }} />
</Tooltip>

View File

@@ -39,7 +39,7 @@ export function RoutesPage({ bodyshop, darkMode }) {
<NotificationModalOrganism />
{bodyshop?.ins_rule_set === "SGI" && (
<Alert
message="SGI has not yet released savings targets or eligibility rules. Targets will be displayed as $0. MPI eligibility rules have been applied and may be incorrect."
message="SGI has not yet released eligibility rules. MPI eligibility rules have been applied and may be incorrect."
type="warning"
showIcon
style={{ marginBottom: "1rem" }}

View File

@@ -304,7 +304,7 @@ const DetermineVehicleGroup = async (job) => {
job.v_type ? job.v_type.toUpperCase() : null
);
//Need to add a ruleset check here. If using V3, then we need to check against a different table.
const ins_rule_set = store.getState().user.bodyshop.ins_rule_set;
const ins_rule_set = store.getState().user?.bodyshop?.ins_rule_set;
switch (ins_rule_set) {
case "SGI":

View File

@@ -3,7 +3,7 @@ import { store } from "../redux/store";
import { WhichMPIRulesetToApply } from "./constants";
export default function GetJobTarget({ group, v_age, targets, close_date, v_mileage, job }) {
const ins_rule_set = store.getState().user.bodyshop.ins_rule_set;
const ins_rule_set = store.getState().user?.bodyshop?.ins_rule_set;
switch (ins_rule_set) {
case "SGI":

View File

@@ -1,7 +1,7 @@
import { store } from "../redux/store";
export function getDecimalPrecision() {
const ins_rule_set = store.getState().user.bodyshop.ins_rule_set;
const ins_rule_set = store.getState().user.bodyshop?.ins_rule_set;
return ins_rule_set === "SGI" ? 2 : 1;
}