From dc234e4d72a3d8b3fee177a8d11bfc5c24f49475 Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Tue, 11 Mar 2025 13:57:05 -0400 Subject: [PATCH 1/3] IO-3166-Global-Notifications-Part-2: checkpoint --- client/src/contexts/Notifications/notificationContext.jsx | 1 + server/notifications/scenarioBuilders.js | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/client/src/contexts/Notifications/notificationContext.jsx b/client/src/contexts/Notifications/notificationContext.jsx index 52fd4eeeb..e2dda9db8 100644 --- a/client/src/contexts/Notifications/notificationContext.jsx +++ b/client/src/contexts/Notifications/notificationContext.jsx @@ -23,6 +23,7 @@ export const useNotification = () => { export const NotificationProvider = ({ children }) => { const [api, contextHolder] = notification.useNotification({ placement: "bottomRight", + bottom: 70, showProgress: true }); diff --git a/server/notifications/scenarioBuilders.js b/server/notifications/scenarioBuilders.js index 276cff882..a9dd54d2d 100644 --- a/server/notifications/scenarioBuilders.js +++ b/server/notifications/scenarioBuilders.js @@ -261,12 +261,13 @@ const newMediaAddedReassignedBuilder = (data) => { // Determine the action let action; + if (data?.data?._documentMoved) { - action = "moved to another Job"; // Special case for document moved from this job + action = "moved to another job"; // Special case for document moved from this job } else if (data.isNew) { action = "added"; // New media } else if (data.changedFields?.jobid && data.changedFields.jobid.old !== data.changedFields.jobid.new) { - action = "moved to this Job"; + action = "moved to this job"; } else { action = "updated"; } @@ -416,7 +417,6 @@ const partMarkedBackOrderedBuilder = (data) => { */ const paymentCollectedCompletedBuilder = (data) => { const momentFormat = "MM/DD/YYYY"; - const timezone = data.bodyShopTimezone; // Format amount using Dinero.js const amountDinero = Dinero({ @@ -427,7 +427,7 @@ const paymentCollectedCompletedBuilder = (data) => { const payer = data.data.payer; const paymentType = data.data.type; - const paymentDate = moment(data.data.date).tz(timezone).format(momentFormat); + const paymentDate = moment(data.data.date).format(momentFormat); const body = `Payment of ${amountFormatted} has been collected from ${payer} via ${paymentType} on ${paymentDate}`; From 85929b0bb1137d927b4328962e43e98f4cfb25d6 Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Tue, 11 Mar 2025 14:09:35 -0400 Subject: [PATCH 2/3] IO-3166-Global-Notifications-Part-2: checkpoint --- .../job-detail-cards.component.jsx | 16 ++++++++++++++-- .../production-list-detail.component.jsx | 10 +++++++++- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/client/src/components/job-detail-cards/job-detail-cards.component.jsx b/client/src/components/job-detail-cards/job-detail-cards.component.jsx index 33315f959..ea66c9112 100644 --- a/client/src/components/job-detail-cards/job-detail-cards.component.jsx +++ b/client/src/components/job-detail-cards/job-detail-cards.component.jsx @@ -21,6 +21,8 @@ import JobDetailCardsInsuranceComponent from "./job-detail-cards.insurance.compo import JobDetailCardsNotesComponent from "./job-detail-cards.notes.component"; import JobDetailCardsPartsComponent from "./job-detail-cards.parts.component"; import JobDetailCardsTotalsComponent from "./job-detail-cards.totals.component"; +import JobWatcherToggleContainer from "../job-watcher-toggle/job-watcher-toggle.container.jsx"; +import { useSocket } from "../../contexts/SocketIO/useSocket.jsx"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop @@ -37,6 +39,7 @@ const span = { }; export function JobDetailCards({ bodyshop, setPrintCenterContext }) { + const { scenarioNotificationsOn } = useSocket(); const selectedBreakpoint = Object.entries(Grid.useBreakpoint()) .filter((screen) => !!screen[1]) .slice(-1)[0]; @@ -78,7 +81,12 @@ export function JobDetailCards({ bodyshop, setPrintCenterContext }) { {data ? ( {data.jobs_by_pk.ro_number || t("general.labels.na")} + + {scenarioNotificationsOn && } + + {data.jobs_by_pk.ro_number || t("general.labels.na")} + + } extra={ @@ -122,7 +130,11 @@ export function JobDetailCards({ bodyshop, setPrintCenterContext }) { {!bodyshop.uselocalmediaserver && ( - + )} diff --git a/client/src/components/production-list-detail/production-list-detail.component.jsx b/client/src/components/production-list-detail/production-list-detail.component.jsx index a5b06d109..ea2d6ef67 100644 --- a/client/src/components/production-list-detail/production-list-detail.component.jsx +++ b/client/src/components/production-list-detail/production-list-detail.component.jsx @@ -27,6 +27,8 @@ import ScoreboardAddButton from "../job-scoreboard-add-button/job-scoreboard-add import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component"; import OwnerNameDisplay from "../owner-name-display/owner-name-display.component"; import ProductionRemoveButton from "../production-remove-button/production-remove-button.component"; +import JobWatcherToggleContainer from "../job-watcher-toggle/job-watcher-toggle.container.jsx"; +import { useSocket } from "../../contexts/SocketIO/useSocket.jsx"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, @@ -41,6 +43,7 @@ export function ProductionListDetail({ bodyshop, jobs, setPrintCenterContext, te const search = queryString.parse(useLocation().search); const history = useNavigate(); const { selected } = search; + const { scenarioNotificationsOn } = useSocket(); const { t } = useTranslation(); const theJob = jobs.find((j) => j.id === selected) || {}; @@ -60,7 +63,12 @@ export function ProductionListDetail({ bodyshop, jobs, setPrintCenterContext, te + {!technician && scenarioNotificationsOn && } + {theJob.ro_number} + + } extra={ {!technician ? : null} From 029fb58f48bf68ca2084817a38035f0f06850f27 Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Tue, 11 Mar 2025 14:47:54 -0400 Subject: [PATCH 3/3] IO-3166-Global-Notifications-Part-2: checkpoint --- .../production-remove-button.component.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/production-remove-button/production-remove-button.component.jsx b/client/src/components/production-remove-button/production-remove-button.component.jsx index 9e13689f9..432136478 100644 --- a/client/src/components/production-remove-button/production-remove-button.component.jsx +++ b/client/src/components/production-remove-button/production-remove-button.component.jsx @@ -39,7 +39,7 @@ export default function ProductionRemoveButton({ jobId }) { }; return ( - );