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} 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 ( - ); 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}`;