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 { useMutation, useQuery, useApolloClient } from "@apollo/client";
|
||||
import { useMutation, useQuery } from "@apollo/client";
|
||||
import { Button, Dropdown, Space } from "antd";
|
||||
import { PageHeader } from "@ant-design/pro-layout";
|
||||
import { useMemo, useState, useEffect } from "react";
|
||||
@@ -33,7 +33,6 @@ const mapDispatchToProps = () => ({
|
||||
|
||||
export function DashboardGridComponent({ currentUser }) {
|
||||
const { t } = useTranslation();
|
||||
const client = useApolloClient();
|
||||
const notification = useNotification();
|
||||
|
||||
// Constants for layout defaults
|
||||
@@ -114,11 +113,6 @@ export function DashboardGridComponent({ currentUser }) {
|
||||
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;
|
||||
} catch (err) {
|
||||
console.error(`Dashboard ${errorContext} failed`, err);
|
||||
@@ -202,7 +196,7 @@ export function DashboardGridComponent({ currentUser }) {
|
||||
<PageHeader
|
||||
extra={
|
||||
<Space>
|
||||
<Button onClick={refetch}>
|
||||
<Button onClick={() => refetch()}>
|
||||
<SyncOutlined />
|
||||
</Button>
|
||||
<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,
|
||||
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,
|
||||
op_code: line.lbr_op || null,
|
||||
op_code_desc: generateOpCodeDescription(line.lbr_op),
|
||||
lbr_ty: generateLaborType(line.mod_lbr_ty),
|
||||
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,
|
||||
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,
|
||||
op_code: line.lbr_op || 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_hrs: line.mod_lb_hrs || 0,
|
||||
|
||||
@@ -905,6 +905,7 @@ exports.CARFAX_QUERY = `query CARFAX_EXPORT($start: timestamptz, $bodyshopid: uu
|
||||
line_desc
|
||||
mod_lb_hrs
|
||||
mod_lbr_ty
|
||||
lbr_op
|
||||
oem_partno
|
||||
op_code_desc
|
||||
part_type
|
||||
@@ -2906,6 +2907,7 @@ exports.GET_BODYSHOP_BY_ID = `
|
||||
intellipay_config
|
||||
state
|
||||
notification_followers
|
||||
timezone
|
||||
}
|
||||
}
|
||||
`;
|
||||
@@ -2997,6 +2999,7 @@ query GET_JOBID_BY_MERCHANTID_RONUMBER($merchantID: String!, $roNumber: String!)
|
||||
id
|
||||
intellipay_config
|
||||
email
|
||||
timezone
|
||||
}
|
||||
}
|
||||
}`;
|
||||
@@ -3006,6 +3009,7 @@ query GET_BODYSHOP_BY_MERCHANTID($merchantID: String!) {
|
||||
bodyshops(where: {intellipay_merchant_id: {_eq: $merchantID}}) {
|
||||
id
|
||||
email
|
||||
timezone
|
||||
}
|
||||
}`;
|
||||
|
||||
|
||||
@@ -48,7 +48,9 @@ const handleCommentBasedPayment = async (values, decodedComment, logger, logMeta
|
||||
payer: "Customer",
|
||||
type: getPaymentType(ipMapping, values.cardtype),
|
||||
jobid: p.jobid,
|
||||
date: moment(Date.now()),
|
||||
date: moment()
|
||||
.tz(bodyshop?.bodyshops_by_pk?.timezone ?? "UTC")
|
||||
.format("YYYY-MM-DD"),
|
||||
payment_responses: {
|
||||
data: {
|
||||
amount: values.total,
|
||||
|
||||
@@ -97,7 +97,9 @@ const handleInvoiceBasedPayment = async (values, logger, logMeta, res) => {
|
||||
payer: "Customer",
|
||||
type: getPaymentType(ipMapping, values.cardtype),
|
||||
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",
|
||||
{ jobId, recipients },
|
||||
{
|
||||
jobId: `consolidate:${jobId}`,
|
||||
jobId: `consolidate-${jobId}`,
|
||||
delay: APP_CONSOLIDATION_DELAY,
|
||||
attempts: 3,
|
||||
backoff: LOCK_EXPIRATION
|
||||
@@ -288,7 +288,7 @@ const dispatchAppsToQueue = async ({ appsToDispatch }) => {
|
||||
await appQueue.add(
|
||||
"add-notification",
|
||||
{ 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`);
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ const loadEmailQueue = async ({ pubClient, logger }) => {
|
||||
"consolidate-emails",
|
||||
{ jobId, jobRoNumber, bodyShopName, bodyShopTimezone },
|
||||
{
|
||||
jobId: `consolidate:${jobId}`,
|
||||
jobId: `consolidate-${jobId}`,
|
||||
delay: EMAIL_CONSOLIDATION_DELAY,
|
||||
attempts: 3,
|
||||
backoff: LOCK_EXPIRATION
|
||||
@@ -252,7 +252,7 @@ const dispatchEmailsToQueue = async ({ emailsToDispatch, logger }) => {
|
||||
await emailAddQueue.add(
|
||||
"add-email-notification",
|
||||
{ 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`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user