feature/IO-3255-simplified-parts-management - Checkpoint
This commit is contained in:
@@ -261,7 +261,18 @@ export function* signInSuccessSaga({ payload }) {
|
||||
const isParts = state?.application?.isPartsEntry === true;
|
||||
const instanceSeg = InstanceRenderManager({ imex: "imex", rome: "rome" });
|
||||
// Always ensure segments include instance + user, and append partsManagement if applicable
|
||||
const segs = [currentUserSegment, instanceSeg, ...(isParts ? ["partsManagement"] : [])];
|
||||
const segs = [
|
||||
currentUserSegment,
|
||||
instanceSeg,
|
||||
...(isParts
|
||||
? [
|
||||
InstanceRenderManager({
|
||||
imex: "ImexPartsManagement",
|
||||
rome: "RomePartsManagement"
|
||||
})
|
||||
]
|
||||
: [])
|
||||
];
|
||||
window.$crisp.push(["set", "session:segments", [segs]]);
|
||||
if (isParts) {
|
||||
window.$crisp.push(["do", "chat:hide"]);
|
||||
@@ -374,12 +385,14 @@ export function* SetAuthLevelFromShopDetails({ payload }) {
|
||||
|
||||
const regionSeg = payload.region_config ? `region:${payload.region_config}` : null;
|
||||
const segments = [instanceSeg, ...(regionSeg ? [regionSeg] : []), ...featureSegments];
|
||||
if (isParts) segments.push("partsManagement");
|
||||
if (isParts || payload.features.partsManagementOnly) {
|
||||
segments.push(InstanceRenderManager({ imex: "ImexPartsManagement", rome: "RomePartsManagement" }));
|
||||
}
|
||||
|
||||
window.$crisp.push(["set", "session:segments", [segments]]);
|
||||
|
||||
// Hide/show Crisp chat based on parts mode
|
||||
window.$crisp.push(["do", isParts ? "chat:hide" : "chat:show"]);
|
||||
// Hide/show Crisp chat based on parts mode or features
|
||||
window.$crisp.push(["do", isParts || payload.features.partsManagementOnly ? "chat:hide" : "chat:show"]);
|
||||
|
||||
InstanceRenderManager({
|
||||
executeFunction: true,
|
||||
@@ -389,10 +402,8 @@ export function* SetAuthLevelFromShopDetails({ payload }) {
|
||||
}
|
||||
});
|
||||
|
||||
//Set whether it is for parts management only.
|
||||
|
||||
// TODO: This is a temp fix we do not want to do a check on true
|
||||
yield put(setPartsManagementOnly(true));
|
||||
// Set whether it is for parts management only
|
||||
yield put(setPartsManagementOnly(isParts || payload.features.partsManagementOnly));
|
||||
} catch (error) {
|
||||
console.warn("Couldnt find $crisp.", error.message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user