CSR-2166: change all instances of hide recal setting from experiments to compare strings not boolean / reformatting
This commit is contained in:
parent
00f34b7c3c
commit
53d4a09a52
4 changed files with 46 additions and 29 deletions
|
|
@ -170,7 +170,10 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
shouldHideRecalibration() {
|
||||
return this.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE);
|
||||
const recalSettingValue =
|
||||
this.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE)?.toLowerCase() ===
|
||||
"true";
|
||||
return recalSettingValue;
|
||||
},
|
||||
ShowCart() {
|
||||
if (this.isPia && this.submittedOrder?.settledTenderAmount == 0) {
|
||||
|
|
|
|||
|
|
@ -594,7 +594,10 @@ export default {
|
|||
);
|
||||
},
|
||||
shouldHideRecalibration() {
|
||||
return this.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE);
|
||||
const recalSettingValue =
|
||||
this.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE)?.toLowerCase() ===
|
||||
"true";
|
||||
return recalSettingValue;
|
||||
},
|
||||
showApplePay() {
|
||||
return baseMixin.methods.showApplePay();
|
||||
|
|
|
|||
|
|
@ -304,9 +304,10 @@ export default {
|
|||
// Override if coming back from QuoteDetails. Remove override after Quote release
|
||||
const isInsuranceOverrideValue = to.query?.isInsurance;
|
||||
const defaultIsInsuranceSelectedValue = store.getters.order.payment.isInsurance;
|
||||
const hideRecalCost = experimentMixin.methods.getSettingValue(
|
||||
experimentSettings.RECAL_PRICE_REMOVE
|
||||
);
|
||||
const hideRecalCost =
|
||||
experimentMixin.methods
|
||||
.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE)
|
||||
?.toLowerCase() === "true";
|
||||
|
||||
//Default to Insurance Tab if user Service zip is from certain States
|
||||
if (
|
||||
|
|
@ -320,17 +321,20 @@ export default {
|
|||
return defaultIsInsuranceSelectedValue;
|
||||
} else {
|
||||
if (availableLineItems) {
|
||||
const lineItemsForCalculatingPrice = hideRecalCost
|
||||
? baseMixin.methods.filterOutFees(
|
||||
baseMixin.methods.filterOutRecalibration(availableLineItems) // Strip out recal before filtering out fees
|
||||
)
|
||||
: baseMixin.methods.filterOutFees(availableLineItems);
|
||||
|
||||
const lineItemsForCalculatingPrice =
|
||||
(hideRecalCost === "true") ?
|
||||
baseMixin.methods.filterOutFees(
|
||||
baseMixin.methods.filterOutRecalibration(availableLineItems) // Strip out recal before filtering out fees
|
||||
) :
|
||||
baseMixin.methods.filterOutFees(availableLineItems);
|
||||
let tierOnePackagePriceTemp = baseMixin.methods.getTierOnePackagePrice(
|
||||
lineItemsForCalculatingPrice
|
||||
); // TEMP, FOR TESTING /// TODO AJC: TIGHTEN THIS BACK UP AFTER TESTING
|
||||
|
||||
let tierOnePackagePriceTemp = baseMixin.methods.getTierOnePackagePrice(lineItemsForCalculatingPrice); // TEMP, FOR TESTING /// TODO AJC: TIGHTEN THIS BACK UP AFTER TESTING
|
||||
|
||||
return baseMixin.methods.getTierOnePackagePrice(lineItemsForCalculatingPrice) > insuranceThreshold; // compare base price vs arbitrary threshold (representing insurance price)
|
||||
return (
|
||||
baseMixin.methods.getTierOnePackagePrice(lineItemsForCalculatingPrice) >
|
||||
insuranceThreshold
|
||||
); // compare base price vs arbitrary threshold (representing insurance price)
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
|
@ -341,15 +345,20 @@ export default {
|
|||
experimentSettings.INSURANCE_TAB_TO_DISPLAY_THRESHOLD_INTERNAL
|
||||
);
|
||||
|
||||
if (!store.getters.externalParameterState?.isExternalParameter) { // there are no external parameters
|
||||
if (!store.getters.externalParameterState?.isExternalParameter) {
|
||||
// there are no external parameters
|
||||
|
||||
if (internalThreshold) thresholdToUse = internalThreshold;
|
||||
vm.isInsuranceSelected = getIsInsuranceSelectedValue(vm.availableLineItems, thresholdToUse);
|
||||
vm.isInsuranceSelected = getIsInsuranceSelectedValue(
|
||||
vm.availableLineItems,
|
||||
thresholdToUse
|
||||
);
|
||||
baseMixin.methods.ResetExternalParamsAndHideModal();
|
||||
} else {
|
||||
// there ARE external parameters
|
||||
|
||||
} else { // there ARE external parameters
|
||||
|
||||
if (store.getters.externalParameterQuote.isInsurance == true) { // did user intentionally select insurance?
|
||||
if (store.getters.externalParameterQuote.isInsurance == true) {
|
||||
// did user intentionally select insurance?
|
||||
vm.isInsuranceSelected = true;
|
||||
vm.servicePackage = store.getters.externalParameterQuote.servicePackage;
|
||||
await nextTick();
|
||||
|
|
@ -361,7 +370,9 @@ export default {
|
|||
}
|
||||
} else {
|
||||
// did user come from external source (LeadGen)?
|
||||
let externalSource = store.getters.externalParameterSource ? store.getters.externalParameterSource : null;
|
||||
let externalSource = store.getters.externalParameterSource
|
||||
? store.getters.externalParameterSource
|
||||
: null;
|
||||
|
||||
vm.externalSource = externalSource; // TEMP 9/23
|
||||
|
||||
|
|
@ -374,10 +385,12 @@ export default {
|
|||
} else {
|
||||
if (internalThreshold) thresholdToUse = internalThreshold;
|
||||
}
|
||||
vm.isInsuranceSelected = getIsInsuranceSelectedValue(vm.availableLineItems, thresholdToUse);
|
||||
vm.isInsuranceSelected = getIsInsuranceSelectedValue(
|
||||
vm.availableLineItems,
|
||||
thresholdToUse
|
||||
);
|
||||
baseMixin.methods.ResetExternalParamsAndHideModal();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
vm.thresholdToUse = thresholdToUse;
|
||||
|
|
@ -408,9 +421,10 @@ export default {
|
|||
);
|
||||
},
|
||||
shouldHideRecalibration() {
|
||||
const recalSettingValue = experimentMixin.methods.getSettingValue(
|
||||
experimentSettings.RECAL_PRICE_REMOVE
|
||||
)?.toLowerCase() === "true";
|
||||
const recalSettingValue =
|
||||
experimentMixin.methods
|
||||
.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE)
|
||||
?.toLowerCase() === "true";
|
||||
return recalSettingValue;
|
||||
},
|
||||
showAfterpayBanner() {
|
||||
|
|
|
|||
|
|
@ -683,10 +683,7 @@ function updateExternalParameterState() {
|
|||
);
|
||||
}
|
||||
if (externalParameterSource) {
|
||||
store.commit(
|
||||
storeMutations.UPDATE_EXTERNAL_PARAMETER_SOURCE,
|
||||
externalParameterSource
|
||||
);
|
||||
store.commit(storeMutations.UPDATE_EXTERNAL_PARAMETER_SOURCE, externalParameterSource);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue