From c9b63be29f49012d0d61db443cae3fdcf6b5523f Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 22 Apr 2024 08:43:41 -0700 Subject: [PATCH 01/11] Hardcore generic template for ProManager. --- client/src/utils/RenderTemplate.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/client/src/utils/RenderTemplate.js b/client/src/utils/RenderTemplate.js index 8fb1480cb..1deb8e76d 100644 --- a/client/src/utils/RenderTemplate.js +++ b/client/src/utils/RenderTemplate.js @@ -10,6 +10,7 @@ import client from "../utils/GraphQLClient"; import cleanAxios from "./CleanAxios"; import { TemplateList } from "./TemplateConstants"; import { generateTemplate } from "./graphQLmodifier"; +import InstanceRenderManager from "./instanceRenderMgr"; const server = import.meta.env.VITE_APP_REPORTS_SERVER_URL; jsreport.serverUrl = server; @@ -71,8 +72,8 @@ export default async function RenderTemplate( ...contextData, ...templateObject.variables, ...templateObject.context, - headerpath: `/${bodyshop.imexshopid}/header.html`, - footerpath: `/${bodyshop.imexshopid}/footer.html`, + headerpath: `/${InstanceRenderManager({ imex: bodyshop.imexshopid, rome: bodyshop.imexshopid, promanager: "GENERIC" })}/header.html`, + footerpath: `/${InstanceRenderManager({ imex: bodyshop.imexshopid, rome: bodyshop.imexshopid, promanager: "GENERIC" })}/footer.html`, bodyshop: bodyshop, filters: templateObject?.filters, sorters: templateObject?.sorters, From cc9f342575e4c980321dee17cf44c6b12fd22a15 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 8 May 2024 15:16:03 -0700 Subject: [PATCH 02/11] Update expired page, remove RBAC, and prevent sign in. --- .../shop-info/shop-info.general.component.jsx | 791 ++++++++--------- .../shop-info/shop-info.rbac.component.jsx | 792 +++++++++--------- .../shop-info.rostatus.component.jsx | 4 +- .../shop-sub-status.component.jsx | 18 +- client/src/pages/shop/shop.page.component.jsx | 15 +- client/src/redux/user/user.sagas.js | 32 +- 6 files changed, 837 insertions(+), 815 deletions(-) diff --git a/client/src/components/shop-info/shop-info.general.component.jsx b/client/src/components/shop-info/shop-info.general.component.jsx index a961c33e9..20cc88d36 100644 --- a/client/src/components/shop-info/shop-info.general.component.jsx +++ b/client/src/components/shop-info/shop-info.general.component.jsx @@ -13,6 +13,7 @@ import PhoneFormItem, { PhoneItemFormatterValidation } from "../form-items-forma import FormListMoveArrows from "../form-list-move-arrows/form-list-move-arrows.component"; import LayoutFormRow from "../layout-form-row/layout-form-row.component"; import InstanceRenderManager from "../../utils/instanceRenderMgr"; +import FeatureWrapper, { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component"; // TODO: Client Update, this might break const timeZonesList = Intl.supportedValuesOf("timeZone"); const mapStateToProps = createStructuredSelector({ @@ -144,285 +145,289 @@ export function ShopInfoGeneral({ form, bodyshop }) { - - - - - {InstanceRenderManager({ - imex: ( - - {() => ( + null}> + + + + + {InstanceRenderManager({ + imex: ( + + {() => ( + + + + )} + + ) + })} + + + + + + 2 + 3 + + + + {() => { + return ( - + + {t("bodyshop.labels.2tiername")} + {t("bodyshop.labels.2tiersource")} + - )} - - ) - })} - - - - - - 2 - 3 - - - - {() => { - return ( + ); + }} + + + + + + + + + + + + + + {InstanceRenderManager({ + imex: ( + + + + ) + })} + + + + {InstanceRenderManager({ + imex: ( - - {t("bodyshop.labels.2tiername")} - {t("bodyshop.labels.2tiersource")} - + - ); - }} - - - - - - - - - - - - - - {InstanceRenderManager({ - imex: ( - - - - ) - })} - - - - {InstanceRenderManager({ - imex: ( - - - - ) - })} - - - - - - - - - - - - - - {ReceivableCustomFieldSelect} - - - {ReceivableCustomFieldSelect} - - - {ReceivableCustomFieldSelect} - - { - return { - required: getFieldValue("enforce_class"), + ) + })} + + + + + + + - + + + + + {ClosingPeriod.treatment === "on" && ( + <> + + + + + )} + + + null}> + + + + - - - + + + - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + null}> + + + {(fields, { add, remove, move }) => { + return ( +
+ {fields.map((field, index) => ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - { - remove(field.name); - }} - /> - - - + + { + remove(field.name); + }} + /> + + + + + ))} + + - ))} - - - -
- ); - }} -
-
+ + ); + }} + +
+ + {(fields, { add, remove, move }) => { diff --git a/client/src/components/shop-info/shop-info.rbac.component.jsx b/client/src/components/shop-info/shop-info.rbac.component.jsx index f26dc1938..8be57a559 100644 --- a/client/src/components/shop-info/shop-info.rbac.component.jsx +++ b/client/src/components/shop-info/shop-info.rbac.component.jsx @@ -1,12 +1,13 @@ +import { useSplitTreatments } from "@splitsoftware/splitio-react"; import { Form, InputNumber } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { selectBodyshop } from "../../redux/user/user.selectors"; +import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component"; import LayoutFormRow from "../layout-form-row/layout-form-row.component"; import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component"; -import { useSplitTreatments } from "@splitsoftware/splitio-react"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop @@ -29,210 +30,227 @@ export function ShopInfoRbacComponent({ form, bodyshop }) { return ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + {HasFeatureAccess({ featureName: "export", bodyshop }) && ( + <> + + + + + + + + + + + + + + )} + {HasFeatureAccess({ featureName: "bills", bodyshop }) && ( + <> + + + + + + + + + + + + + + + + + )} + + {HasFeatureAccess({ featureName: "courtesycars", bodyshop }) && ( + <> + + + + + + + + + + + + + + + + + + + + )} + {HasFeatureAccess({ featureName: "csi", bodyshop }) && ( + <> + + + + + + + + )} - - - - - - + {HasFeatureAccess({ featureName: "visualboard", bodyshop }) && ( + + + + )} + - - - - - - - - - - - - - - - - - - - - - - - - + {HasFeatureAccess({ featureName: "scoreboard", bodyshop }) && ( + + + + )} + {HasFeatureAccess({ featureName: "timetickets", bodyshop }) && ( + <> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + )} - - - - - - - - - - - - - - - - - - - - + */} + {HasFeatureAccess({ featureName: "media", bodyshop }) && ( + + + + )} + { return (
- + {fields.map((field, index) => ( @@ -386,7 +386,7 @@ export function ShopInfoROStatusComponent({ bodyshop, form }) { ))} - + - } - /> - ); + return ; } diff --git a/client/src/pages/shop/shop.page.component.jsx b/client/src/pages/shop/shop.page.component.jsx index 19991f62f..97f34ea95 100644 --- a/client/src/pages/shop/shop.page.component.jsx +++ b/client/src/pages/shop/shop.page.component.jsx @@ -72,10 +72,17 @@ export function ShopPage({ bodyshop, setSelectedHeader, setBreadcrumbs }) { }); } - items.push({ - key: "licensing", - label: t("bodyshop.labels.licensing"), - children: + InstanceRenderManager({ + executeFunction: true, + args: [], + imex: () => { + items.push({ + key: "licensing", + label: t("bodyshop.labels.licensing"), + children: + }); + }, + rome: "USE_IMEX" }); if (HasFeatureAccess({ featureName: "csi", bodyshop })) { diff --git a/client/src/redux/user/user.sagas.js b/client/src/redux/user/user.sagas.js index 0c5aae651..283d8c48e 100644 --- a/client/src/redux/user/user.sagas.js +++ b/client/src/redux/user/user.sagas.js @@ -15,6 +15,7 @@ import { getToken } from "firebase/messaging"; import i18next from "i18next"; import LogRocket from "logrocket"; import { all, call, delay, put, select, takeLatest } from "redux-saga/effects"; +import { Userpilot } from "userpilot"; import { factory } from "../../App/App.container"; import { analytics, @@ -25,6 +26,10 @@ import { messaging, updateCurrentUser } from "../../firebase/firebase.utils"; +import { QUERY_EULA } from "../../graphql/bodyshop.queries"; +import client from "../../utils/GraphQLClient"; +import day from "../../utils/day"; +import InstanceRenderManager from "../../utils/instanceRenderMgr"; import { checkInstanceId, sendPasswordResetFailure, @@ -43,11 +48,6 @@ import { validatePasswordResetSuccess } from "./user.actions"; import UserActionTypes from "./user.types"; -import client from "../../utils/GraphQLClient"; -import { QUERY_EULA } from "../../graphql/bodyshop.queries"; -import day from "../../utils/day"; -import InstanceRenderManager from "../../utils/instanceRenderMgr"; -import { Userpilot } from "userpilot"; const fpPromise = FingerprintJS.load(); @@ -310,10 +310,28 @@ export function* SetAuthLevelFromShopDetails({ payload }) { updateUserDetailsSuccess(authRecord[0] ? { validemail: authRecord[0].user.validemail } : { validemail: false }) ); + const user = yield select((state) => state.user.currentUser); if (payload.features.singleDeviceOnly) { - const user = yield select((state) => state.user.currentUser); + if (!(user.email.includes("@imex.") || user.email.includes("@rome.") || user.email.includes("@promanager."))) + yield put(setInstanceId(user.uid)); + } - if (!(user.email.includes("@imex.") || user.email.includes("@rome."))) yield put(setInstanceId(user.uid)); + //For Rome, check to make sure it's not a PM shop. + try { + InstanceRenderManager({ + executeFunction: true, + args: [], + rome: () => { + if ( + payload.imexshopid.toLowerCase().startsWith("pm_") && + !(user.email.includes("@imex.") || user.email.includes("@rome.") || user.email.includes("@promanager.")) + ) { + throw new Error("You are not authorized to use this application."); + } + } + }); + } catch (error) { + yield put(setInstanceConflict()); } try { From dc367e1a308de95b362702a7206e52feac405310 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Fri, 10 May 2024 08:08:15 -0700 Subject: [PATCH 03/11] Add PAE Part Tax type for USA. --- server/job/job-totals-USA.js | 1 + 1 file changed, 1 insertion(+) diff --git a/server/job/job-totals-USA.js b/server/job/job-totals-USA.js index 7617099ff..c8bcdf2a8 100644 --- a/server/job/job-totals-USA.js +++ b/server/job/job-totals-USA.js @@ -718,6 +718,7 @@ function CalculateTaxesTotals(job, otherTotals) { const taxableAmounts = { PAA: Dinero(), + PAE: Dinero(), PAN: Dinero(), PAL: Dinero(), PAR: Dinero(), From 51d1f926c225bcbf6d1d8bab17ad153937da03e6 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Fri, 10 May 2024 08:29:52 -0700 Subject: [PATCH 04/11] Improve spread for feature wrapped RBAC items. --- .../jobs-list/jobs-list.component.jsx | 2 - .../shop-info/shop-info.rbac.component.jsx | 678 +++++++++--------- 2 files changed, 334 insertions(+), 346 deletions(-) diff --git a/client/src/components/jobs-list/jobs-list.component.jsx b/client/src/components/jobs-list/jobs-list.component.jsx index 81273a7e5..e82961cdf 100644 --- a/client/src/components/jobs-list/jobs-list.component.jsx +++ b/client/src/components/jobs-list/jobs-list.component.jsx @@ -18,8 +18,6 @@ import ChatOpenButton from "../chat-open-button/chat-open-button.component"; import OwnerNameDisplay from "../owner-name-display/owner-name-display.component"; import { setJoyRideSteps } from "../../redux/application/application.actions"; import { OwnerNameDisplayFunction } from "./../owner-name-display/owner-name-display.component"; -import InstanceRenderManager from "../../utils/instanceRenderMgr"; - const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop }); diff --git a/client/src/components/shop-info/shop-info.rbac.component.jsx b/client/src/components/shop-info/shop-info.rbac.component.jsx index 8be57a559..050449097 100644 --- a/client/src/components/shop-info/shop-info.rbac.component.jsx +++ b/client/src/components/shop-info/shop-info.rbac.component.jsx @@ -30,227 +30,219 @@ export function ShopInfoRbacComponent({ form, bodyshop }) { return ( - {HasFeatureAccess({ featureName: "export", bodyshop }) && ( - <> - - - - - - - - - - - - - - )} - {HasFeatureAccess({ featureName: "bills", bodyshop }) && ( - <> - - - - - - - - - - - - - - - - - )} + {...HasFeatureAccess({ featureName: "export", bodyshop }) && [ + + + , + + + , + + + , + + + + ]} + {...HasFeatureAccess({ featureName: "bills", bodyshop }) && [ + + + , + + + , + + + , + + + , + + + + ]} - {HasFeatureAccess({ featureName: "courtesycars", bodyshop }) && ( - <> - - - - - - - - - - - - - - - - - - - - )} - {HasFeatureAccess({ featureName: "csi", bodyshop }) && ( - <> - - - - - - - - )} + {...HasFeatureAccess({ featureName: "courtesycars", bodyshop }) && [ + + + , + + + , + + + , + + + , + + + , + + + + ]} + {...HasFeatureAccess({ featureName: "csi", bodyshop }) && [ + + + , + + + + ]} )} - {HasFeatureAccess({ featureName: "timetickets", bodyshop }) && ( - <> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - )} + {...HasFeatureAccess({ featureName: "timetickets", bodyshop }) && [ + + + , + + + , + + + , + + + , + + + , + + + , + + + , + + + , + + + , + + + + ]} Date: Fri, 10 May 2024 15:35:26 -0700 Subject: [PATCH 05/11] Fix RBAC spread. --- .../shop-info/shop-info.rbac.component.jsx | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/client/src/components/shop-info/shop-info.rbac.component.jsx b/client/src/components/shop-info/shop-info.rbac.component.jsx index 050449097..8291c9c4f 100644 --- a/client/src/components/shop-info/shop-info.rbac.component.jsx +++ b/client/src/components/shop-info/shop-info.rbac.component.jsx @@ -30,7 +30,7 @@ export function ShopInfoRbacComponent({ form, bodyshop }) { return ( - {...HasFeatureAccess({ featureName: "export", bodyshop }) && [ + {...HasFeatureAccess({ featureName: "export", bodyshop }) ? [ - ]} - {...HasFeatureAccess({ featureName: "bills", bodyshop }) && [ + ]:[]} + {...HasFeatureAccess({ featureName: "bills", bodyshop }) ? [ - ]} + ]:[]} - {...HasFeatureAccess({ featureName: "courtesycars", bodyshop }) && [ + {...HasFeatureAccess({ featureName: "courtesycars", bodyshop }) ? [ - ]} - {...HasFeatureAccess({ featureName: "csi", bodyshop }) && [ + ]:[]} + {...HasFeatureAccess({ featureName: "csi", bodyshop }) ? [ - ]} + ]:[]} )} - {...HasFeatureAccess({ featureName: "timetickets", bodyshop }) && [ + {...HasFeatureAccess({ featureName: "timetickets", bodyshop }) ? [ - ]} + ]:[]} Date: Mon, 13 May 2024 08:25:45 -0700 Subject: [PATCH 06/11] Resolve instance conflict for promanager. --- client/src/redux/user/user.sagas.js | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/client/src/redux/user/user.sagas.js b/client/src/redux/user/user.sagas.js index 283d8c48e..99ba30225 100644 --- a/client/src/redux/user/user.sagas.js +++ b/client/src/redux/user/user.sagas.js @@ -312,7 +312,14 @@ export function* SetAuthLevelFromShopDetails({ payload }) { const user = yield select((state) => state.user.currentUser); if (payload.features.singleDeviceOnly) { - if (!(user.email.includes("@imex.") || user.email.includes("@rome.") || user.email.includes("@promanager."))) + if ( + !( + user.email.includes("@imex.") || + user.email.includes("@rome.") || + user.email.includes("@rometech.") || + user.email.includes("@promanager.") + ) + ) yield put(setInstanceId(user.uid)); } @@ -324,11 +331,17 @@ export function* SetAuthLevelFromShopDetails({ payload }) { rome: () => { if ( payload.imexshopid.toLowerCase().startsWith("pm_") && - !(user.email.includes("@imex.") || user.email.includes("@rome.") || user.email.includes("@promanager.")) + !( + user.email.includes("@imex.") || + user.email.includes("@rome.") || + user.email.includes("@rometech.") || + user.email.includes("@promanager.") + ) ) { throw new Error("You are not authorized to use this application."); } - } + }, + promanager: () => {} }); } catch (error) { yield put(setInstanceConflict()); From f4be3e966879fc037d251e4f89e9ac03c3dc2b6c Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Tue, 14 May 2024 12:20:49 -0400 Subject: [PATCH 07/11] Fix issue with global search --- .../global-search/global-search-os.component.jsx | 10 +--------- .../global-search/global-search.component.jsx | 9 +-------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/client/src/components/global-search/global-search-os.component.jsx b/client/src/components/global-search/global-search-os.component.jsx index 62e44da5f..fbe2efad1 100644 --- a/client/src/components/global-search/global-search-os.component.jsx +++ b/client/src/components/global-search/global-search-os.component.jsx @@ -178,15 +178,7 @@ export default function GlobalSearchOs() { }; return ( - { - history(opt.label.props.to); - }} - onClear={() => setData([])} - > + setData([])}> ; return ( - { - history(opt.label.props.to); - }} - > + Date: Tue, 14 May 2024 12:38:56 -0400 Subject: [PATCH 08/11] Fix eslint regression Signed-off-by: Dave Richer --- .../components/global-search/global-search-os.component.jsx | 3 +-- .../src/components/global-search/global-search.component.jsx | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/client/src/components/global-search/global-search-os.component.jsx b/client/src/components/global-search/global-search-os.component.jsx index fbe2efad1..f46a4c811 100644 --- a/client/src/components/global-search/global-search-os.component.jsx +++ b/client/src/components/global-search/global-search-os.component.jsx @@ -3,14 +3,13 @@ import axios from "axios"; import _ from "lodash"; import React, { useState } from "react"; import { useTranslation } from "react-i18next"; -import { Link, useNavigate } from "react-router-dom"; +import { Link } from "react-router-dom"; import PhoneNumberFormatter from "../../utils/PhoneFormatter"; import OwnerNameDisplay, { OwnerNameDisplayFunction } from "../owner-name-display/owner-name-display.component"; import VehicleVinDisplay from "../vehicle-vin-display/vehicle-vin-display.component"; export default function GlobalSearchOs() { const { t } = useTranslation(); - const history = useNavigate(); const [loading, setLoading] = useState(false); const [data, setData] = useState(false); diff --git a/client/src/components/global-search/global-search.component.jsx b/client/src/components/global-search/global-search.component.jsx index e16e663c7..37b94f46c 100644 --- a/client/src/components/global-search/global-search.component.jsx +++ b/client/src/components/global-search/global-search.component.jsx @@ -3,7 +3,7 @@ import { AutoComplete, Divider, Input, Space } from "antd"; import _ from "lodash"; import React from "react"; import { useTranslation } from "react-i18next"; -import { Link, useNavigate } from "react-router-dom"; +import { Link } from "react-router-dom"; import { GLOBAL_SEARCH_QUERY } from "../../graphql/search.queries"; import PhoneNumberFormatter from "../../utils/PhoneFormatter"; import AlertComponent from "../alert/alert.component"; @@ -12,7 +12,6 @@ import VehicleVinDisplay from "../vehicle-vin-display/vehicle-vin-display.compon export default function GlobalSearch() { const { t } = useTranslation(); - const history = useNavigate(); const [callSearch, { loading, error, data }] = useLazyQuery(GLOBAL_SEARCH_QUERY); const executeSearch = (v) => { From f4511556890513f250720c2b938679a26861254d Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 15 May 2024 10:27:42 -0700 Subject: [PATCH 09/11] Add Firebase Service Worker to public. --- client/public/firebase-messaging-sw.js | 56 ++++++++++++++++++++++++++ client/src/utils/fcm-handler.js | 1 + 2 files changed, 57 insertions(+) create mode 100644 client/public/firebase-messaging-sw.js diff --git a/client/public/firebase-messaging-sw.js b/client/public/firebase-messaging-sw.js new file mode 100644 index 000000000..7ee3f3d98 --- /dev/null +++ b/client/public/firebase-messaging-sw.js @@ -0,0 +1,56 @@ +// Scripts for firebase and firebase messaging +importScripts("https://www.gstatic.com/firebasejs/8.2.0/firebase-app.js"); +importScripts("https://www.gstatic.com/firebasejs/8.2.0/firebase-messaging.js"); + +// Initialize the Firebase app in the service worker by passing the generated config +let firebaseConfig; +switch (this.location.hostname) { + case "localhost": + firebaseConfig = { + apiKey: "AIzaSyDPLT8GiDHDR1R4nI66Qi0BY1aYviDPioc", + authDomain: "imex-dev.firebaseapp.com", + databaseURL: "https://imex-dev.firebaseio.com", + projectId: "imex-dev", + storageBucket: "imex-dev.appspot.com", + messagingSenderId: "759548147434", + appId: "1:759548147434:web:e8239868a48ceb36700993", + measurementId: "G-K5XRBVVB4S", + }; + break; + case "test.imex.online": + firebaseConfig = { + apiKey: "AIzaSyBw7_GTy7GtQyfkIRPVrWHEGKfcqeyXw0c", + authDomain: "imex-test.firebaseapp.com", + projectId: "imex-test", + storageBucket: "imex-test.appspot.com", + messagingSenderId: "991923618608", + appId: "1:991923618608:web:633437569cdad78299bef5", + // measurementId: "${config.measurementId}", + }; + break; + case "imex.online": + default: + firebaseConfig = { + apiKey: "AIzaSyDSezy-jGJreo7ulgpLdlpOwAOrgcaEkhU", + authDomain: "imex-prod.firebaseapp.com", + databaseURL: "https://imex-prod.firebaseio.com", + projectId: "imex-prod", + storageBucket: "imex-prod.appspot.com", + messagingSenderId: "253497221485", + appId: "1:253497221485:web:3c81c483b94db84b227a64", + measurementId: "G-NTWBKG2L0M", + }; +} + +firebase.initializeApp(firebaseConfig); + +// Retrieve firebase messaging +const messaging = firebase.messaging(); + +messaging.onBackgroundMessage(function (payload) { + // Customize notification here + const channel = new BroadcastChannel("imex-sw-messages"); + channel.postMessage(payload); + + //self.registration.showNotification(notificationTitle, notificationOptions); +}); diff --git a/client/src/utils/fcm-handler.js b/client/src/utils/fcm-handler.js index 0b44abb49..c6284c764 100644 --- a/client/src/utils/fcm-handler.js +++ b/client/src/utils/fcm-handler.js @@ -1,4 +1,5 @@ export default async function FcmHandler({ client, payload }) { + console.log("FCM", payload); switch (payload.type) { case "messaging-inbound": client.cache.modify({ From 168d4246afcaaead674b0e29446da1a13a9555db Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Wed, 22 May 2024 11:43:19 -0700 Subject: [PATCH 10/11] IO-2785 AIO IO Header Rescue Link Signed-off-by: Allan Carr --- .../components/header/header.component.jsx | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/client/src/components/header/header.component.jsx b/client/src/components/header/header.component.jsx index c99b94cbb..160dd8770 100644 --- a/client/src/components/header/header.component.jsx +++ b/client/src/components/header/header.component.jsx @@ -32,6 +32,7 @@ import React, { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import { BsKanban } from "react-icons/bs"; import { FaCalendarAlt, FaCarCrash, FaCreditCard, FaFileInvoiceDollar, FaTasks } from "react-icons/fa"; +import { FiLogOut } from "react-icons/fi"; import { GiPayMoney, GiPlayerTime, GiSettingsKnobs } from "react-icons/gi"; import { IoBusinessOutline } from "react-icons/io5"; import { RiSurveyLine } from "react-icons/ri"; @@ -42,7 +43,6 @@ import { selectRecentItems, selectSelectedHeader } from "../../redux/application import { setModalContext } from "../../redux/modals/modals.actions"; import { signOutStart } from "../../redux/user/user.actions"; import { selectBodyshop, selectCurrentUser } from "../../redux/user/user.selectors"; -import { FiLogOut } from "react-icons/fi"; import { checkBeta, handleBeta, setBeta } from "../../utils/betaHandler"; import InstanceRenderManager from "../../utils/instanceRenderMgr"; import { HasFeatureAccess } from "../feature-wrapper/feature-wrapper.component"; @@ -604,14 +604,22 @@ function Header({ ); } }, - // { - // key: 'rescue', - // icon: , - // label: t("menus.header.rescueme"), - // onClick: () => { - // window.open("https://imexrescue.com/", "_blank"); - // } - // }, + ...(InstanceRenderManager({ + imex: true, + rome: false, + promanager: false + }) + ? [ + { + key: "rescue", + icon: , + label: t("menus.header.rescueme"), + onClick: () => { + window.open("https://imexrescue.com/", "_blank"); + } + } + ] + : []), ...(InstanceRenderManager({ imex: true, From 2bceba948d9f4ad4b96c2d9acc22397b0a3c3d89 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 23 May 2024 10:57:39 -0700 Subject: [PATCH 11/11] Resolve postback logging. --- server/intellipay/intellipay.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/server/intellipay/intellipay.js b/server/intellipay/intellipay.js index c7cc7d365..bebc05ade 100644 --- a/server/intellipay/intellipay.js +++ b/server/intellipay/intellipay.js @@ -145,19 +145,19 @@ exports.generate_payment_url = async (req, res) => { }; exports.postback = async (req, res) => { - logger.log("intellipay-postback", "DEBUG", req.user?.email, null, req.body); - const { body: values } = req; - - const comment = Buffer.from(values?.comment, "base64").toString(); - - if ((!values.invoice || values.invoice === "") && !comment) { - //invoice is specified through the pay link. Comment by IO. - logger.log("intellipay-postback-ignored", "DEBUG", req.user?.email, null, req.body); - res.sendStatus(200); - return; - } - try { + logger.log("intellipay-postback", "DEBUG", req.user?.email, null, req.body); + const { body: values } = req; + + const comment = Buffer.from(values?.comment, "base64").toString(); + + if ((!values.invoice || values.invoice === "") && !comment) { + //invoice is specified through the pay link. Comment by IO. + logger.log("intellipay-postback-ignored", "DEBUG", req.user?.email, null, req.body); + res.sendStatus(200); + return; + } + if (values.invoice) { //This is a link email that's been sent out. const job = await gqlClient.request(queries.GET_JOB_BY_PK, {