Check for if 2nd tier should be shown wasn't being used. Fixed the preparation of the tiers so that it will be hidden when it should be.

This commit is contained in:
Jason Wheeler 2023-05-31 16:28:41 -04:00
parent 90d56cc741
commit 5c17e51124

View file

@ -63,20 +63,28 @@
}, },
servicePackageAnswers() { servicePackageAnswers() {
if (!this.cmsWidgetName) return []; if (!this.cmsWidgetName) return [];
const cmsAnswersContent = [ const cmsAnswersContent = [];
cmsAnswersContent.push(
{ {
Name: 'TierOne', Name: 'TierOne',
cmsWidgetName: 'EconomyServicePackage' cmsWidgetName: 'EconomyServicePackage'
}, }
{ );
Name: 'TierTwo', if(this.shouldDisplayTierTwoPackage)
cmsWidgetName: 'StandardServicePackage' {
}, cmsAnswersContent.push(
{
Name: 'TierTwo',
cmsWidgetName: 'StandardServicePackage'
},
);
}
cmsAnswersContent.push(
{ {
Name: 'TierThree', Name: 'TierThree',
cmsWidgetName: 'PremiumServicePackage' cmsWidgetName: 'PremiumServicePackage'
} }
]; );
//if cms content has not yet loaded, skip //if cms content has not yet loaded, skip
if (this.getCmsContent(cmsAnswersContent[0].cmsWidgetName, 'HeaderText') == '') { if (this.getCmsContent(cmsAnswersContent[0].cmsWidgetName, 'HeaderText') == '') {
return {}; return {};
@ -96,27 +104,18 @@
return this.lineItemsContainsPartType(partTypeStrings.RECALIBRATION); return this.lineItemsContainsPartType(partTypeStrings.RECALIBRATION);
}, },
frontWipersApplicableForTierTwo() { frontWipersApplicableForTierTwo() {
const store = useMainStore();
const frontWipersAreAvailable = this.lineItemsContainsPartType( const frontWipersAreAvailable = this.lineItemsContainsPartType(
partTypeStrings.FRONT_WIPER partTypeStrings.FRONT_WIPER
); );
const isRepair = store.order.damage.isRepair; const glassToReplaceContainsWindshield = this.glassToReplaceContainsGlassLocation(glassLocations.WINDSHIELD);
const glassToReplaceContainsWindshield = this.glassToReplaceContainsGlassLocation(
glassLocations.WINDSHIELD if(frontWipersAreAvailable && (useMainStore().order.damage.isRepair || glassToReplaceContainsWindshield))
); {
if (frontWipersAreAvailable) { return true;
if (isRepair) {
return true;
} else {
if (glassToReplaceContainsWindshield) {
return true;
} else {
return false;
}
}
} else {
return false;
} }
return false;
}, },
rearWiperApplicableForTierTwo() { rearWiperApplicableForTierTwo() {
const rearWiperIsAvailable = this.lineItemsContainsPartType(partTypeStrings.REAR_WIPER); const rearWiperIsAvailable = this.lineItemsContainsPartType(partTypeStrings.REAR_WIPER);