From 78a8474a242c3a27dcb334e92c7b3ed698cb17b8 Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Tue, 25 Nov 2025 17:56:19 -0800 Subject: [PATCH 1/2] IO-3450 Additional Crisp Segments Signed-off-by: Allan Carr --- client/src/redux/user/user.sagas.js | 48 +++++++++++++++++++---------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/client/src/redux/user/user.sagas.js b/client/src/redux/user/user.sagas.js index c508bf96e..12533865c 100644 --- a/client/src/redux/user/user.sagas.js +++ b/client/src/redux/user/user.sagas.js @@ -50,7 +50,7 @@ import { } from "./user.actions"; import UserActionTypes from "./user.types"; //import * as amplitude from '@amplitude/analytics-browser'; -import posthog from 'posthog-js'; +import posthog from "posthog-js"; const fpPromise = FingerprintJS.load(); @@ -269,11 +269,11 @@ export function* signInSuccessSaga({ payload }) { instanceSeg, ...(isParts ? [ - InstanceRenderManager({ - imex: "ImexPartsManagement", - rome: "RomePartsManagement" - }) - ] + InstanceRenderManager({ + imex: "ImexPartsManagement", + rome: "RomePartsManagement" + }) + ] : []) ]; window.$crisp.push(["set", "session:segments", [segs]]); @@ -375,17 +375,31 @@ export function* SetAuthLevelFromShopDetails({ payload }) { const isParts = yield select((state) => state.application.isPartsEntry === true); const instanceSeg = InstanceRenderManager({ imex: "imex", rome: "rome" }); - let featureSegments; - if (payload.features?.allAccess === true) { - featureSegments = ["allAccess"]; - } else { - const featureKeys = Object.keys(payload.features).filter( - (key) => - payload.features[key] === true || - (typeof payload.features[key] === "string" && !isNaN(Date.parse(payload.features[key]))) - ); - featureSegments = ["basic", ...featureKeys]; - } + const featureSegments = + payload.features?.allAccess === true + ? ["allAccess"] + : [ + "basic", + ...Object.keys(payload.features).filter( + (key) => + payload.features[key] === true || + (typeof payload.features[key] === "string" && !isNaN(Date.parse(payload.features[key]))) + ) + ]; + + const additionalSegments = [ + payload.cdk_dealerid && "CDK", + payload.pbs_serialnumber && "PBS", + // payload.rr_dealerid && "Reynolds", + payload.accountingconfig.qbo === true && "QBO", + payload.accountingconfig.qbo === false && + !payload.cdk_dealerid && + !payload.pbs_serialnumber && + // !payload.rr_dealerid && + "QBD" + ].filter(Boolean); + + featureSegments.push(...additionalSegments); const regionSeg = payload.region_config ? `region:${payload.region_config}` : null; const segments = [instanceSeg, ...(regionSeg ? [regionSeg] : []), ...featureSegments]; From dafe9de7532bcc70fe0456d579d54bec057fe97e Mon Sep 17 00:00:00 2001 From: Allan Carr Date: Tue, 25 Nov 2025 18:10:10 -0800 Subject: [PATCH 2/2] IO-3450 Grammer Correction Signed-off-by: Allan Carr --- server/notifications/scenarioBuilders.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/notifications/scenarioBuilders.js b/server/notifications/scenarioBuilders.js index d1bdb22a0..ec24e1804 100644 --- a/server/notifications/scenarioBuilders.js +++ b/server/notifications/scenarioBuilders.js @@ -81,8 +81,8 @@ const alternateTransportChangedBuilder = (data) => { * @returns {{app: {jobId, jobRoNumber: *, bodyShopId: *, key: string, body: string, variables: Object, recipients: *[]}, email: {jobId, jobRoNumber: *, bodyShopName: *, body: string, recipients: *[]}, fcm: {recipients: *[]}}} */ const billPostedBuilder = (data) => { - const facing = data?.data?.isinhouse ? "in-house" : "vendor"; - const body = `An ${facing} ${data?.data?.is_credit_memo ? "credit memo" : "bill"} has been posted.`.trim(); + const facing = data?.data?.isinhouse ? "An In House" : "A Vendor"; + const body = `${facing} ${data?.data?.is_credit_memo ? "credit memo" : "bill"} has been posted.`.trim(); return buildNotification(data, "notifications.job.billPosted", body, { isInHouse: data?.data?.isinhouse,