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