Merge remote-tracking branch 'origin/release/2025-10-17' into feature/IO-3357-Reynolds-and-Reynolds-DMS-API-Integration
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import Icon, { SyncOutlined } from "@ant-design/icons";
|
import Icon, { SyncOutlined } from "@ant-design/icons";
|
||||||
import { useMutation, useQuery, useApolloClient } from "@apollo/client";
|
import { useMutation, useQuery } from "@apollo/client";
|
||||||
import { Button, Dropdown, Space } from "antd";
|
import { Button, Dropdown, Space } from "antd";
|
||||||
import { PageHeader } from "@ant-design/pro-layout";
|
import { PageHeader } from "@ant-design/pro-layout";
|
||||||
import { useMemo, useState, useEffect } from "react";
|
import { useMemo, useState, useEffect } from "react";
|
||||||
@@ -33,7 +33,6 @@ const mapDispatchToProps = () => ({
|
|||||||
|
|
||||||
export function DashboardGridComponent({ currentUser }) {
|
export function DashboardGridComponent({ currentUser }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const client = useApolloClient();
|
|
||||||
const notification = useNotification();
|
const notification = useNotification();
|
||||||
|
|
||||||
// Constants for layout defaults
|
// Constants for layout defaults
|
||||||
@@ -114,11 +113,6 @@ export function DashboardGridComponent({ currentUser }) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note: Removed Apollo cache update to prevent triggering unwanted Redux actions
|
|
||||||
// Instead, evict the dashboard bodyshop query from cache to ensure fresh data on next fetch
|
|
||||||
client.cache.evict({ fieldName: "dashboard_bodyshops" });
|
|
||||||
client.cache.gc();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(`Dashboard ${errorContext} failed`, err);
|
console.error(`Dashboard ${errorContext} failed`, err);
|
||||||
@@ -202,7 +196,7 @@ export function DashboardGridComponent({ currentUser }) {
|
|||||||
<PageHeader
|
<PageHeader
|
||||||
extra={
|
extra={
|
||||||
<Space>
|
<Space>
|
||||||
<Button onClick={refetch}>
|
<Button onClick={() => refetch()}>
|
||||||
<SyncOutlined />
|
<SyncOutlined />
|
||||||
</Button>
|
</Button>
|
||||||
<Dropdown menu={menu} trigger={["click"]}>
|
<Dropdown menu={menu} trigger={["click"]}>
|
||||||
|
|||||||
@@ -277,6 +277,7 @@ const GenerateDetailLines = (line) => {
|
|||||||
line_desc: line.line_desc ? line.line_desc.replace(NON_ASCII_REGEX, "") : null,
|
line_desc: line.line_desc ? line.line_desc.replace(NON_ASCII_REGEX, "") : null,
|
||||||
oem_partno: line.oem_partno ? line.oem_partno.replace(NON_ASCII_REGEX, "") : null,
|
oem_partno: line.oem_partno ? line.oem_partno.replace(NON_ASCII_REGEX, "") : null,
|
||||||
alt_partno: line.alt_partno ? line.alt_partno.replace(NON_ASCII_REGEX, "") : null,
|
alt_partno: line.alt_partno ? line.alt_partno.replace(NON_ASCII_REGEX, "") : null,
|
||||||
|
op_code: line.lbr_op || null,
|
||||||
op_code_desc: generateOpCodeDescription(line.lbr_op),
|
op_code_desc: generateOpCodeDescription(line.lbr_op),
|
||||||
lbr_ty: generateLaborType(line.mod_lbr_ty),
|
lbr_ty: generateLaborType(line.mod_lbr_ty),
|
||||||
lbr_hrs: line.mod_lb_hrs || 0,
|
lbr_hrs: line.mod_lb_hrs || 0,
|
||||||
|
|||||||
@@ -336,6 +336,7 @@ const GenerateDetailLines = (line) => {
|
|||||||
line_desc: line.line_desc ? line.line_desc.replace(NON_ASCII_REGEX, "") : null,
|
line_desc: line.line_desc ? line.line_desc.replace(NON_ASCII_REGEX, "") : null,
|
||||||
oem_partno: line.oem_partno ? line.oem_partno.replace(NON_ASCII_REGEX, "") : null,
|
oem_partno: line.oem_partno ? line.oem_partno.replace(NON_ASCII_REGEX, "") : null,
|
||||||
alt_partno: line.alt_partno ? line.alt_partno.replace(NON_ASCII_REGEX, "") : null,
|
alt_partno: line.alt_partno ? line.alt_partno.replace(NON_ASCII_REGEX, "") : null,
|
||||||
|
op_code: line.lbr_op || null,
|
||||||
op_code_desc: line.op_code_desc ? line.op_code_desc.replace(NON_ASCII_REGEX, "") : null,
|
op_code_desc: line.op_code_desc ? line.op_code_desc.replace(NON_ASCII_REGEX, "") : null,
|
||||||
lbr_ty: generateLaborType(line.mod_lbr_ty),
|
lbr_ty: generateLaborType(line.mod_lbr_ty),
|
||||||
lbr_hrs: line.mod_lb_hrs || 0,
|
lbr_hrs: line.mod_lb_hrs || 0,
|
||||||
|
|||||||
@@ -905,6 +905,7 @@ exports.CARFAX_QUERY = `query CARFAX_EXPORT($start: timestamptz, $bodyshopid: uu
|
|||||||
line_desc
|
line_desc
|
||||||
mod_lb_hrs
|
mod_lb_hrs
|
||||||
mod_lbr_ty
|
mod_lbr_ty
|
||||||
|
lbr_op
|
||||||
oem_partno
|
oem_partno
|
||||||
op_code_desc
|
op_code_desc
|
||||||
part_type
|
part_type
|
||||||
@@ -2906,6 +2907,7 @@ exports.GET_BODYSHOP_BY_ID = `
|
|||||||
intellipay_config
|
intellipay_config
|
||||||
state
|
state
|
||||||
notification_followers
|
notification_followers
|
||||||
|
timezone
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
@@ -2997,6 +2999,7 @@ query GET_JOBID_BY_MERCHANTID_RONUMBER($merchantID: String!, $roNumber: String!)
|
|||||||
id
|
id
|
||||||
intellipay_config
|
intellipay_config
|
||||||
email
|
email
|
||||||
|
timezone
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}`;
|
}`;
|
||||||
@@ -3006,6 +3009,7 @@ query GET_BODYSHOP_BY_MERCHANTID($merchantID: String!) {
|
|||||||
bodyshops(where: {intellipay_merchant_id: {_eq: $merchantID}}) {
|
bodyshops(where: {intellipay_merchant_id: {_eq: $merchantID}}) {
|
||||||
id
|
id
|
||||||
email
|
email
|
||||||
|
timezone
|
||||||
}
|
}
|
||||||
}`;
|
}`;
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,9 @@ const handleCommentBasedPayment = async (values, decodedComment, logger, logMeta
|
|||||||
payer: "Customer",
|
payer: "Customer",
|
||||||
type: getPaymentType(ipMapping, values.cardtype),
|
type: getPaymentType(ipMapping, values.cardtype),
|
||||||
jobid: p.jobid,
|
jobid: p.jobid,
|
||||||
date: moment(Date.now()),
|
date: moment()
|
||||||
|
.tz(bodyshop?.bodyshops_by_pk?.timezone ?? "UTC")
|
||||||
|
.format("YYYY-MM-DD"),
|
||||||
payment_responses: {
|
payment_responses: {
|
||||||
data: {
|
data: {
|
||||||
amount: values.total,
|
amount: values.total,
|
||||||
|
|||||||
@@ -97,7 +97,9 @@ const handleInvoiceBasedPayment = async (values, logger, logMeta, res) => {
|
|||||||
payer: "Customer",
|
payer: "Customer",
|
||||||
type: getPaymentType(ipMapping, values.cardtype),
|
type: getPaymentType(ipMapping, values.cardtype),
|
||||||
jobid: job.id,
|
jobid: job.id,
|
||||||
date: moment(Date.now())
|
date: moment()
|
||||||
|
.tz(bodyshop?.timezone ?? "UTC")
|
||||||
|
.format("YYYY-MM-DD")
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ const loadAppQueue = async ({ pubClient, logger, redisHelpers, ioRedis }) => {
|
|||||||
"consolidate-notifications",
|
"consolidate-notifications",
|
||||||
{ jobId, recipients },
|
{ jobId, recipients },
|
||||||
{
|
{
|
||||||
jobId: `consolidate:${jobId}`,
|
jobId: `consolidate-${jobId}`,
|
||||||
delay: APP_CONSOLIDATION_DELAY,
|
delay: APP_CONSOLIDATION_DELAY,
|
||||||
attempts: 3,
|
attempts: 3,
|
||||||
backoff: LOCK_EXPIRATION
|
backoff: LOCK_EXPIRATION
|
||||||
@@ -288,7 +288,7 @@ const dispatchAppsToQueue = async ({ appsToDispatch }) => {
|
|||||||
await appQueue.add(
|
await appQueue.add(
|
||||||
"add-notification",
|
"add-notification",
|
||||||
{ jobId, bodyShopId, key, variables, recipients, body, jobRoNumber },
|
{ jobId, bodyShopId, key, variables, recipients, body, jobRoNumber },
|
||||||
{ jobId: `${jobId}:${Date.now()}` }
|
{ jobId: `${jobId}-${Date.now()}` }
|
||||||
);
|
);
|
||||||
devDebugLogger(`Added notification to queue for jobId ${jobId} with ${recipients.length} recipients`);
|
devDebugLogger(`Added notification to queue for jobId ${jobId} with ${recipients.length} recipients`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ const loadEmailQueue = async ({ pubClient, logger }) => {
|
|||||||
"consolidate-emails",
|
"consolidate-emails",
|
||||||
{ jobId, jobRoNumber, bodyShopName, bodyShopTimezone },
|
{ jobId, jobRoNumber, bodyShopName, bodyShopTimezone },
|
||||||
{
|
{
|
||||||
jobId: `consolidate:${jobId}`,
|
jobId: `consolidate-${jobId}`,
|
||||||
delay: EMAIL_CONSOLIDATION_DELAY,
|
delay: EMAIL_CONSOLIDATION_DELAY,
|
||||||
attempts: 3,
|
attempts: 3,
|
||||||
backoff: LOCK_EXPIRATION
|
backoff: LOCK_EXPIRATION
|
||||||
@@ -252,7 +252,7 @@ const dispatchEmailsToQueue = async ({ emailsToDispatch, logger }) => {
|
|||||||
await emailAddQueue.add(
|
await emailAddQueue.add(
|
||||||
"add-email-notification",
|
"add-email-notification",
|
||||||
{ jobId, jobRoNumber, bodyShopName, bodyShopTimezone, body, recipients },
|
{ jobId, jobRoNumber, bodyShopName, bodyShopTimezone, body, recipients },
|
||||||
{ jobId: `${jobId}:${Date.now()}` }
|
{ jobId: `${jobId}-${Date.now()}` }
|
||||||
);
|
);
|
||||||
devDebugLogger(`Added email notification to queue for jobId ${jobId} with ${recipients.length} recipients`);
|
devDebugLogger(`Added email notification to queue for jobId ${jobId} with ${recipients.length} recipients`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user