CSR-2179: pass experiment boolean via prop from /quote & refactor
This commit is contained in:
parent
a4a25ad547
commit
7cfcf07dd6
2 changed files with 11 additions and 9 deletions
|
|
@ -31,6 +31,8 @@
|
||||||
groupName="ServicePackageQuestion"
|
groupName="ServicePackageQuestion"
|
||||||
:availableLineItems="availableLineItems"
|
:availableLineItems="availableLineItems"
|
||||||
:isInsuranceSelected="isInsuranceSelected"
|
:isInsuranceSelected="isInsuranceSelected"
|
||||||
|
:isRecalibrationOnOrder="isRecalibrationOnOrder"
|
||||||
|
:shouldHideRecalibration="shouldHideRecalibration"
|
||||||
@vapsItemsSelected="vapsItemsSelectedAction"
|
@vapsItemsSelected="vapsItemsSelectedAction"
|
||||||
@servicePackageDiscountSelected="servicePackageDiscountSelectedAction"
|
@servicePackageDiscountSelected="servicePackageDiscountSelectedAction"
|
||||||
:servicePackage="servicePackage"
|
:servicePackage="servicePackage"
|
||||||
|
|
@ -336,10 +338,13 @@ export default {
|
||||||
return recalSettingValue;
|
return recalSettingValue;
|
||||||
},
|
},
|
||||||
showAfterpayBanner() {
|
showAfterpayBanner() {
|
||||||
return !this.isInsuranceSelected && (!this.isRecalibrationOnOrder || !this.shouldHideRecalibration)
|
return (
|
||||||
|
!this.isInsuranceSelected &&
|
||||||
|
(!this.isRecalibrationOnOrder || !this.shouldHideRecalibration)
|
||||||
|
);
|
||||||
},
|
},
|
||||||
showRecalDisclaimer() {
|
showRecalDisclaimer() {
|
||||||
return this.isRecalibrationOnOrder && this.shouldHideRecalibration
|
return this.isRecalibrationOnOrder && this.shouldHideRecalibration;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,8 @@ export default {
|
||||||
availableLineItems: null,
|
availableLineItems: null,
|
||||||
activePromos: null,
|
activePromos: null,
|
||||||
servicePackage: null,
|
servicePackage: null,
|
||||||
|
isRecalibrationOnOrder: Boolean,
|
||||||
|
shouldHideRecalibration: Boolean,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
|
@ -141,12 +143,6 @@ export default {
|
||||||
}));
|
}));
|
||||||
return modifiedAnswers;
|
return modifiedAnswers;
|
||||||
},
|
},
|
||||||
isRecalibrationOnOrder() {
|
|
||||||
return containsLineItemWithPartType(
|
|
||||||
partTypeStrings.RECALIBRATION,
|
|
||||||
this.nullSafeAvailableLineItems
|
|
||||||
);
|
|
||||||
},
|
|
||||||
isServicePackageDiscountOnOrder() {
|
isServicePackageDiscountOnOrder() {
|
||||||
return containsLineItemWithPartType(
|
return containsLineItemWithPartType(
|
||||||
partTypeStrings.SERVICE_PACKAGE_DISCOUNT,
|
partTypeStrings.SERVICE_PACKAGE_DISCOUNT,
|
||||||
|
|
@ -242,7 +238,8 @@ export default {
|
||||||
},
|
},
|
||||||
getPackagePrice(packageName, { discountedPrice = false, servicePackageDiscount = false }) {
|
getPackagePrice(packageName, { discountedPrice = false, servicePackageDiscount = false }) {
|
||||||
var lineItemsToPrice = [...this.nullSafeAvailableLineItems];
|
var lineItemsToPrice = [...this.nullSafeAvailableLineItems];
|
||||||
if (this.isRecalibrationOnOrder) {
|
|
||||||
|
if (this.isRecalibrationOnOrder && this.shouldHideRecalibration) {
|
||||||
lineItemsToPrice = lineItemsToPrice.filter((item) => {
|
lineItemsToPrice = lineItemsToPrice.filter((item) => {
|
||||||
return item.partType != partTypeStrings.RECALIBRATION;
|
return item.partType != partTypeStrings.RECALIBRATION;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue