Merge pull request #282 from Safelite/feature/Digital/SSR-315

Modified to conform to SSR-315
This commit is contained in:
DavidAtSafelite 2023-05-02 18:13:02 -04:00 committed by GitHub
commit 5f25a30fb3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -54,7 +54,7 @@
},
servicePackageAnswers() {
if (!this.cmsWidgetName) return [];
const cmsAnswersContent = [
let cmsAnswersContent = [
{
Name: 'TierOne',
cmsWidgetName: 'EconomyServicePackage'
@ -72,6 +72,10 @@
if (this.getCmsContent(cmsAnswersContent[0].cmsWidgetName, 'HeaderText') == '') {
return {};
}
if (!this.shouldDisplayTierTwoPackage) {
cmsAnswersContent = cmsAnswersContent.filter((answer) => answer.Name != packageNames.TIER_TWO);
}
const modifiedAnswers = cmsAnswersContent.map((answer) => ({
value: answer.Name,
buttonLabel: this.getHeaderTextFromCms(answer.cmsWidgetName),
@ -88,13 +92,9 @@
},
frontWipersApplicableForTierTwo() {
const store = useMainStore();
const frontWipersAreAvailable = this.lineItemsContainsPartType(
partTypeStrings.FRONT_WIPER
);
const frontWipersAreAvailable = this.lineItemsContainsPartType(partTypeStrings.FRONT_WIPER);
const isRepair = store.order.damage.isRepair;
const glassToReplaceContainsWindshield = this.glassToReplaceContainsGlassLocation(
glassLocations.WINDSHIELD
);
const glassToReplaceContainsWindshield = this.glassToReplaceContainsGlassLocation(glassLocations.WINDSHIELD);
if (frontWipersAreAvailable) {
if (isRepair) {
return true;
@ -162,7 +162,7 @@
},
getPackagePriceString(packageName) {
const formattedPriceFloat = parseFloat(this.getPackagePrice(packageName)).toFixed(2);
return '$' + formattedPriceFloat;
return '+$' + formattedPriceFloat;
},
getPackagePrice(packageName) {
let priceFloat = 0;
@ -178,11 +178,9 @@
const priceFrontWipers = this.frontWipersApplicableForTierTwo;
const priceRearWipers = this.rearWiperApplicableForTierTwo;
this.nullSafeAvailableLineItems.forEach((item) => {
if (
(priceFrontWipers &&
item.partType.toUpperCase() === partTypeStrings.FRONT_WIPER) ||
(priceRearWipers && item.partType.toUpperCase() === partTypeStrings.REAR_WIPER)
) {
if ((priceFrontWipers &&
item.partType.toUpperCase() === partTypeStrings.FRONT_WIPER) ||
(priceRearWipers && item.partType.toUpperCase() === partTypeStrings.REAR_WIPER)) {
vapsPrice += this.getTotalLineItemPrice(item);
}
});