Merge pull request #877 from Safelite/feature/CSR-747-integration
Feature/csr 747 integration
This commit is contained in:
commit
6d9ddc78bb
5 changed files with 32 additions and 10 deletions
|
|
@ -14,7 +14,7 @@ import { storeMutations } from "@/constants/store-mutations";
|
||||||
it will reset the state and go back to the start of the funnel.
|
it will reset the state and go back to the start of the funnel.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
export async function loadSessionIfPresent() {
|
export async function loadSessionIfPresent(isConceptInsurance) {
|
||||||
const funnelCookie = getFunnelCookie();
|
const funnelCookie = getFunnelCookie();
|
||||||
|
|
||||||
// Do nothing if there is no cookie or session to use for loading.
|
// Do nothing if there is no cookie or session to use for loading.
|
||||||
|
|
@ -35,7 +35,8 @@ export async function loadSessionIfPresent() {
|
||||||
funnelCookie.SavedSessionId,
|
funnelCookie.SavedSessionId,
|
||||||
funnelCookie.ReferralNumber,
|
funnelCookie.ReferralNumber,
|
||||||
funnelCookie.ReferralParentAccountNumber,
|
funnelCookie.ReferralParentAccountNumber,
|
||||||
funnelCookie.ReferralCorrelationId
|
funnelCookie.ReferralCorrelationId,
|
||||||
|
isConceptInsurance
|
||||||
)
|
)
|
||||||
).data;
|
).data;
|
||||||
}
|
}
|
||||||
|
|
@ -68,9 +69,16 @@ export async function saveSession() {
|
||||||
Calls API to load session given the referral number, referralDate, and referralCorrelationId
|
Calls API to load session given the referral number, referralDate, and referralCorrelationId
|
||||||
and returns the response.
|
and returns the response.
|
||||||
*/
|
*/
|
||||||
async function loadSession(savedSessionId, referralNumber, accountNumber, referralCorrelationId) {
|
async function loadSession(
|
||||||
|
savedSessionId,
|
||||||
|
referralNumber,
|
||||||
|
accountNumber,
|
||||||
|
referralCorrelationId,
|
||||||
|
isConceptInsurance
|
||||||
|
) {
|
||||||
// await the saveSessionPromise in the store to make sure we're loading up to date information
|
// await the saveSessionPromise in the store to make sure we're loading up to date information
|
||||||
await store.getters.applicationUser.saveSessionPromise;
|
await store.getters.applicationUser.saveSessionPromise;
|
||||||
|
|
||||||
const response = await baseMixin.methods.dispatchStoreAction(
|
const response = await baseMixin.methods.dispatchStoreAction(
|
||||||
storeActions.LOAD_SESSION,
|
storeActions.LOAD_SESSION,
|
||||||
{
|
{
|
||||||
|
|
@ -78,6 +86,7 @@ async function loadSession(savedSessionId, referralNumber, accountNumber, referr
|
||||||
referralNumber,
|
referralNumber,
|
||||||
accountNumber,
|
accountNumber,
|
||||||
referralCorrelationId,
|
referralCorrelationId,
|
||||||
|
isConceptInsurance,
|
||||||
},
|
},
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -149,10 +149,7 @@ export default {
|
||||||
|
|
||||||
const glassPartsForStore = partsLookup.data.glassPieceParts;
|
const glassPartsForStore = partsLookup.data.glassPieceParts;
|
||||||
|
|
||||||
// this.navigateForward(glassPartsForStore);
|
this.navigateForward(glassPartsForStore);
|
||||||
|
|
||||||
// TODO KO delete for quote mvp
|
|
||||||
this.navigateForward(glassPartsForStore, null, this.shouldGoToHeritageQuote);
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
|
|
||||||
|
|
@ -148,8 +148,13 @@ export default {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
getDefaultIsInsuranceSelectedValue(availableLineItems) {
|
getDefaultIsInsuranceSelectedValue(availableLineItems) {
|
||||||
|
// Override if coming back from QuoteDetails. Remove override after Quote release
|
||||||
|
const isInsuranceOverrideValue = this.$route.query?.isInsurance;
|
||||||
|
|
||||||
const defaultIsInsuranceSelectedValue = this.$store.getters.order.payment.isInsurance;
|
const defaultIsInsuranceSelectedValue = this.$store.getters.order.payment.isInsurance;
|
||||||
if (defaultIsInsuranceSelectedValue != null) {
|
if (isInsuranceOverrideValue != null) {
|
||||||
|
return isInsuranceOverrideValue == "true";
|
||||||
|
} else if (defaultIsInsuranceSelectedValue != null) {
|
||||||
return defaultIsInsuranceSelectedValue;
|
return defaultIsInsuranceSelectedValue;
|
||||||
} else {
|
} else {
|
||||||
return availableLineItems
|
return availableLineItems
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,15 @@ const routes = [
|
||||||
// the saveSessionPromise will no longer point to a valid promise
|
// the saveSessionPromise will no longer point to a valid promise
|
||||||
baseMixin.methods.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE);
|
baseMixin.methods.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE);
|
||||||
|
|
||||||
const loadSessionResponse = await loadSessionIfPresent();
|
// Remove the parameter after quote release
|
||||||
|
const loadSessionResponse = await loadSessionIfPresent(
|
||||||
|
to.query.isInsurance != null
|
||||||
|
? to.query.isInsurance == "true"
|
||||||
|
? true
|
||||||
|
: false
|
||||||
|
: null
|
||||||
|
);
|
||||||
|
|
||||||
const pageToRedirectTo = await getPageToRouteExistingOrderTo(
|
const pageToRedirectTo = await getPageToRouteExistingOrderTo(
|
||||||
to,
|
to,
|
||||||
loadSessionResponse
|
loadSessionResponse
|
||||||
|
|
|
||||||
|
|
@ -1039,7 +1039,10 @@ export const actions = {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
loadSession(context, { savedSessionId, referralNumber, referralCorrelationId, accountNumber }) {
|
loadSession(
|
||||||
|
context,
|
||||||
|
{ savedSessionId, referralNumber, referralCorrelationId, accountNumber, isConceptInsurance }
|
||||||
|
) {
|
||||||
const order = context.state.order;
|
const order = context.state.order;
|
||||||
|
|
||||||
return globalMethods
|
return globalMethods
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue