CSR-1520 | Formatting
This commit is contained in:
parent
abd09c48a8
commit
3d9c1b97fb
3 changed files with 12 additions and 12 deletions
|
|
@ -22,9 +22,7 @@ export function getPromosWithAddableVaps(promoList) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
return promoList.filter((promo) =>
|
return promoList.filter((promo) => addableVapsPromoPartNumbers.includes(promo.partNumber));
|
||||||
addableVapsPromoPartNumbers.includes(promo.partNumber)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getLineItemsThatMatchPromos(promos, availableLineItems) {
|
export function getLineItemsThatMatchPromos(promos, availableLineItems) {
|
||||||
|
|
@ -32,9 +30,7 @@ export function getLineItemsThatMatchPromos(promos, availableLineItems) {
|
||||||
promos.forEach((promo) => {
|
promos.forEach((promo) => {
|
||||||
promo.discountedLineItemIds.forEach((discountedLineItemId) => {
|
promo.discountedLineItemIds.forEach((discountedLineItemId) => {
|
||||||
matchingLineItems.push(
|
matchingLineItems.push(
|
||||||
...availableLineItems.filter(
|
...availableLineItems.filter((lineItem) => lineItem.id === discountedLineItemId)
|
||||||
(lineItem) => lineItem.id === discountedLineItemId
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -223,9 +223,15 @@ export default {
|
||||||
},
|
},
|
||||||
selectDefaultPackage() {
|
selectDefaultPackage() {
|
||||||
const promosWithAddableVaps = getPromosWithAddableVaps(this.activePromos);
|
const promosWithAddableVaps = getPromosWithAddableVaps(this.activePromos);
|
||||||
const vapsThatMatchPromos = getLineItemsThatMatchPromos(promosWithAddableVaps, this.nullSafeAvailableLineItems);
|
const vapsThatMatchPromos = getLineItemsThatMatchPromos(
|
||||||
|
promosWithAddableVaps,
|
||||||
|
this.nullSafeAvailableLineItems
|
||||||
|
);
|
||||||
const vapsFromStore = this.$store.getters.lineItems.vaps ?? [];
|
const vapsFromStore = this.$store.getters.lineItems.vaps ?? [];
|
||||||
const vapsToUseForDefaultPackageSelection = this.combineLineItemsWithoutDuplicates(vapsThatMatchPromos, vapsFromStore);
|
const vapsToUseForDefaultPackageSelection = this.combineLineItemsWithoutDuplicates(
|
||||||
|
vapsThatMatchPromos,
|
||||||
|
vapsFromStore
|
||||||
|
);
|
||||||
|
|
||||||
this.selectedPackageName = getHighestRequiredTier(
|
this.selectedPackageName = getHighestRequiredTier(
|
||||||
this.glassToReplace,
|
this.glassToReplace,
|
||||||
|
|
@ -256,9 +262,7 @@ export default {
|
||||||
const combinedLineItemArray = [...lineItemsTwo];
|
const combinedLineItemArray = [...lineItemsTwo];
|
||||||
lineItemsOne.forEach((lineItemOne) => {
|
lineItemsOne.forEach((lineItemOne) => {
|
||||||
if (
|
if (
|
||||||
!lineItemsTwo.filter(
|
!lineItemsTwo.filter((lineItemTwo) => lineItemTwo.id === lineItemOne.id).length
|
||||||
(lineItemTwo) => lineItemTwo.id === lineItemOne.id
|
|
||||||
).length
|
|
||||||
) {
|
) {
|
||||||
combinedLineItemArray.push(lineItemOne);
|
combinedLineItemArray.push(lineItemOne);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ const mockProps = {
|
||||||
"<ul><li>buttonBodyCopy test copy</li><li>2</li><li>3</li><li>4</li><li>5</li></ul>",
|
"<ul><li>buttonBodyCopy test copy</li><li>2</li><li>3</li><li>4</li><li>5</li></ul>",
|
||||||
buttonFooterCopy: "buttonFooterCopy test copy",
|
buttonFooterCopy: "buttonFooterCopy test copy",
|
||||||
buttonAuxillaryCopy: "buttonAuxillaryCopy test copy",
|
buttonAuxillaryCopy: "buttonAuxillaryCopy test copy",
|
||||||
additionalButtonData: { strikeThroughPrice: "strikeThroughPrice test copy"},
|
additionalButtonData: { strikeThroughPrice: "strikeThroughPrice test copy" },
|
||||||
};
|
};
|
||||||
|
|
||||||
function setupMocks({ mountOptionsMockData = {} }) {
|
function setupMocks({ mountOptionsMockData = {} }) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue