CSR-2234: implement new externalParameter constants
This commit is contained in:
parent
6cfba7e431
commit
b48a62b3fc
2 changed files with 16 additions and 14 deletions
|
|
@ -136,6 +136,8 @@ import { nextTick } from "vue";
|
|||
import { packageNames } from "@/constants/package-names";
|
||||
import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
|
||||
import { containsRecalParts } from "@/helpers/recal-helper";
|
||||
import { externalParameterStatus } from "@/constants/external-parameters";
|
||||
|
||||
defineRule("option-required", required(errorMessages.OPTION_REQUIRED));
|
||||
|
||||
const INSURANCE_TAB_TO_DISPLAY_THRESHOLD_DEFAULT = 300;
|
||||
|
|
@ -339,9 +341,17 @@ export default {
|
|||
|
||||
const isExternalParameter = store.getters.externalParameterState?.isExternalParameter;
|
||||
|
||||
if (isExternalParameter !== undefined) {
|
||||
// user is from an external source (either has value or is null)
|
||||
if (isExternalParameter === externalParameterStatus.NOT_SET) {
|
||||
// there are no active or inactive external parameters; use internal threshold
|
||||
if (internalThreshold) thresholdToUse = internalThreshold;
|
||||
|
||||
vm.isInsuranceSelected = getIsInsuranceSelectedValue(
|
||||
vm.availableLineItems,
|
||||
thresholdToUse
|
||||
);
|
||||
baseMixin.methods.ResetExternalParamsAndHideModal();
|
||||
} else {
|
||||
// user came from an external source
|
||||
if (store.getters.externalParameterQuote.isInsurance == true) {
|
||||
// did user intentionally select insurance?
|
||||
vm.isInsuranceSelected = true;
|
||||
|
|
@ -365,15 +375,6 @@ export default {
|
|||
);
|
||||
baseMixin.methods.ResetExternalParamsAndHideModal();
|
||||
}
|
||||
} else {
|
||||
// there are no external parameters; use internal threshold
|
||||
if (internalThreshold) thresholdToUse = internalThreshold;
|
||||
|
||||
vm.isInsuranceSelected = getIsInsuranceSelectedValue(
|
||||
vm.availableLineItems,
|
||||
thresholdToUse
|
||||
);
|
||||
baseMixin.methods.ResetExternalParamsAndHideModal();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import { getQuerystringParameter } from "@/helpers/querystring-helper";
|
|||
import { getDeviceIdValue } from "@/helpers/heritage-integration/cookie-helper";
|
||||
import { showFmgLoadingModal } from "@/helpers/loading-modal-helper";
|
||||
import { fmgPageValues, funnelStartPageName } from "@/router/router-constants/fmgPage-values";
|
||||
import { externalParameterStatus } from "@/constants/external-parameters";
|
||||
|
||||
// Heritage integration
|
||||
import { isSavedSessionStillActive } from "@/helpers/heritage-integration/session-helper";
|
||||
|
|
@ -264,7 +265,7 @@ router.beforeEach(async (to, from, next) => {
|
|||
);
|
||||
// If alert event is on the bus, then display the alert
|
||||
if (alertEvent !== undefined || unknownAlertEvent !== undefined) {
|
||||
store.commit(storeMutations.UPDATE_IS_EXTERNAL_PARAMETER, false);
|
||||
store.commit(storeMutations.UPDATE_IS_EXTERNAL_PARAMETER, externalParameterStatus.INACTIVE);
|
||||
}
|
||||
}
|
||||
// fromPaymentToConfirmation workaround for navigating from an iframe but
|
||||
|
|
@ -540,7 +541,7 @@ async function DisplayPageError() {
|
|||
type: globalEventTypes.Danger,
|
||||
}
|
||||
);
|
||||
store.commit(storeMutations.UPDATE_IS_EXTERNAL_PARAMETER, false);
|
||||
store.commit(storeMutations.UPDATE_IS_EXTERNAL_PARAMETER, externalParameterStatus.INACTIVE);
|
||||
baseMixin.methods.dispatchStoreAction(storeActions.RESET_SAVE_SESSION_PROMISE);
|
||||
const pageError = getQuerystringParameter(queryStrings.PAGE_ERROR);
|
||||
|
||||
|
|
@ -639,7 +640,7 @@ function updateExternalParameterState() {
|
|||
externalParameterModel &&
|
||||
externalParameterStyle
|
||||
) {
|
||||
store.commit(storeMutations.UPDATE_IS_EXTERNAL_PARAMETER, true);
|
||||
store.commit(storeMutations.UPDATE_IS_EXTERNAL_PARAMETER, externalParameterStatus.ACTIVE);
|
||||
store.commit(storeMutations.UPDATE_EXTERNAL_PARAMETER_YEAR, externalParameterYear);
|
||||
store.commit(storeMutations.UPDATE_EXTERNAL_PARAMETER_MAKE, externalParameterMake);
|
||||
store.commit(storeMutations.UPDATE_EXTERNAL_PARAMETER_MODEL, externalParameterModel);
|
||||
|
|
|
|||
Loading…
Reference in a new issue