Compare commits
14 Commits
feature/IO
...
feature/IO
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
043471fdbc | ||
|
|
13a44b9a59 | ||
|
|
8e6c809fc6 | ||
|
|
41afedd02c | ||
|
|
11e0c3e507 | ||
|
|
6c1c7c9c2c | ||
|
|
e3df22160b | ||
|
|
34d70f6a18 | ||
|
|
fc1bf213c7 | ||
|
|
4dc72986d0 | ||
|
|
f19b9cb8e1 | ||
|
|
bdd5056c9a | ||
|
|
4f6db827e7 | ||
|
|
15792cb0ef |
@@ -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);
|
||||||
|
|||||||
@@ -15,21 +15,29 @@ export const EmailSettings = {
|
|||||||
|
|
||||||
export const TemplateList = (type, context) => {
|
export const TemplateList = (type, context) => {
|
||||||
//const { bodyshop } = store.getState().user;
|
//const { bodyshop } = store.getState().user;
|
||||||
|
|
||||||
|
const casl = InstanceRenderManager({
|
||||||
|
imex: {
|
||||||
|
casl_authorization: {
|
||||||
|
title: i18n.t("printcenter.jobs.casl_authorization"),
|
||||||
|
description: "",
|
||||||
|
subject: i18n.t("printcenter.jobs.casl_authorization"),
|
||||||
|
key: "casl_authorization",
|
||||||
|
disabled: false,
|
||||||
|
group: "authorization",
|
||||||
|
regions: {
|
||||||
|
CA: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
rome: {}
|
||||||
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
//If there's no type or the type is job, send it back.
|
//If there's no type or the type is job, send it back.
|
||||||
...(!type || type === "job"
|
...(!type || type === "job"
|
||||||
? {
|
? {
|
||||||
casl_authorization: {
|
...casl,
|
||||||
title: i18n.t("printcenter.jobs.casl_authorization"),
|
|
||||||
description: "",
|
|
||||||
subject: i18n.t("printcenter.jobs.casl_authorization"),
|
|
||||||
key: "casl_authorization",
|
|
||||||
disabled: false,
|
|
||||||
group: "authorization",
|
|
||||||
regions: {
|
|
||||||
CA: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fippa_authorization: {
|
fippa_authorization: {
|
||||||
title: i18n.t("printcenter.jobs.fippa_authorization"),
|
title: i18n.t("printcenter.jobs.fippa_authorization"),
|
||||||
description: "",
|
description: "",
|
||||||
|
|||||||
@@ -2902,6 +2902,7 @@ exports.GET_BODYSHOP_BY_ID = `
|
|||||||
intellipay_config
|
intellipay_config
|
||||||
state
|
state
|
||||||
notification_followers
|
notification_followers
|
||||||
|
timezone
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
@@ -2993,6 +2994,7 @@ query GET_JOBID_BY_MERCHANTID_RONUMBER($merchantID: String!, $roNumber: String!)
|
|||||||
id
|
id
|
||||||
intellipay_config
|
intellipay_config
|
||||||
email
|
email
|
||||||
|
timezone
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}`;
|
}`;
|
||||||
@@ -3002,6 +3004,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