Merge remote-tracking branch 'origin/feature/CASH-185' into feature/CASH-185

This commit is contained in:
Johnny shultz 2025-02-24 13:32:47 -05:00
commit 3dda9b65d0
8 changed files with 29 additions and 37 deletions

View file

@ -22,7 +22,7 @@ resources:
- container: awscli - container: awscli
image: packagerepository.sagaws.net:8082/safelite/awscli2-build:3.9 image: packagerepository.sagaws.net:8082/safelite/awscli2-build:3.9
- container: prettier-node - container: prettier-node
image: packagerepository.sagaws.net:8082/safelite/prettier-node-build:18 image: packagerepository.sagaws.net:8082/safelite/prettier-node-build:23
repositories: repositories:
- repository: AzureDevOps - repository: AzureDevOps
type: github type: github

View file

@ -2,6 +2,7 @@ const partNumberStrings = {
// Recalibration // Recalibration
MOBILE_STATIC_RECAL_FEE: "RECAL MOBILE", MOBILE_STATIC_RECAL_FEE: "RECAL MOBILE",
MOBILE_DUAL_RECAL_FEE: "RECAL MOBILEDUAL", MOBILE_DUAL_RECAL_FEE: "RECAL MOBILEDUAL",
DONATION: "DONATION",
}; };
export { partNumberStrings }; export { partNumberStrings };

View file

@ -130,10 +130,6 @@ export default {
}, },
methods: { methods: {
handleDonationAction(submitEvent) { handleDonationAction(submitEvent) {
console.log(
"running handleDonationAction(), submitEvent.target.elements.amount.value: ",
submitEvent.target.elements.amount.value
);
this.selectedValue = submitEvent.target.elements.amount.value; this.selectedValue = submitEvent.target.elements.amount.value;
}, },
}, },

View file

@ -1,10 +1,9 @@
<template> <template>
<baseInputButton v-bind="$props" @buttonClicked="handleAnswerChange" v-model="selectedValue"> <baseInputButton v-bind="$props" @buttonClicked="handleAnswerChange" v-model="selectedValue">
<div <div
class="package-label" class="package-label pricing-by-day-pkg-lbl"
:class="[ :class="[
this.buttonLabelSubCopy ? 'has-subheader' : '', this.buttonLabelSubCopy ? 'has-subheader' : '',
this.isInsuranceSelected ? 'pricing-by-day-pkg-lbl-ins' : 'pricing-by-day-pkg-lbl',
!this.additionalButtonData.servicePackageDiscount ? 'adjust-top' : '', !this.additionalButtonData.servicePackageDiscount ? 'adjust-top' : '',
]" ]"
for="testradio"> for="testradio">
@ -21,9 +20,7 @@
</div> </div>
<span class="col md-6 service-package-discount-pricing-by-day"> <span class="col md-6 service-package-discount-pricing-by-day">
<div> <div>
<span v-if="!isInsuranceSelected" class="caption pricing-by-day"> <span class="caption pricing-by-day">as low as</span>
as low as
</span>
<div <div
class="strikethrough-discount-price" class="strikethrough-discount-price"
v-if="shouldDisplayStrikeThroughPrice" v-if="shouldDisplayStrikeThroughPrice"
@ -36,9 +33,7 @@
<p class="m-0"> <p class="m-0">
<span v-html="this.buttonLabel"></span> <span v-html="this.buttonLabel"></span>
<span class="pricing-info-pricing-by-day"> <span class="pricing-info-pricing-by-day">
<span v-if="!isInsuranceSelected" class="caption pricing-by-day"> <span class="caption pricing-by-day">as low as</span>
as low as
</span>
<span <span
class="strikethrough-price" class="strikethrough-price"
v-if="shouldDisplayStrikeThroughPrice" v-if="shouldDisplayStrikeThroughPrice"

View file

@ -14,6 +14,19 @@ import { experimentSettings } from "@/constants/experiments";
const mockExperimentSettings = experimentSettings; const mockExperimentSettings = experimentSettings;
jest.mock("@/mixins/experiment-mixin.js", () => ({
methods: {
getSettingValue(settingName) {
if (settingName === mockExperimentSettings.RECAL_PRICE_REMOVE) {
return true;
}
},
hasSettingEqualTo(settingName, settingValue) {
return true;
},
},
}));
// Mock our module for promises. // Mock our module for promises.
jest.mock("@/helpers/layout-helper.js", () => ({ jest.mock("@/helpers/layout-helper.js", () => ({
settleAllPromises: jest.fn(), settleAllPromises: jest.fn(),
@ -572,13 +585,6 @@ function setupMocks({ customMountOptions }) {
getCmsContent: jest.fn().mockImplementation(() => { getCmsContent: jest.fn().mockImplementation(() => {
return wordingText; return wordingText;
}), }),
getSettingValue: jest.fn((settingName) => {
if (settingName === experimentSettings.RECAL_PRICE_REMOVE) {
return "true";
}
return "false";
}),
}, },
}, },
]; ];

View file

@ -64,7 +64,7 @@
:isItac="isItac" :isItac="isItac"
:isNoComp="isNoComp" /> :isNoComp="isNoComp" />
<div class="mt-3" v-if="displayFosterLove"> <div class="mt-3" v-if="DisplayFosterLove">
<donationBlock <donationBlock
cmsWidgetName="DonationWidget" cmsWidgetName="DonationWidget"
v-model="donationAmount" v-model="donationAmount"
@ -73,10 +73,6 @@
:showDonationError="showDonationError" /> :showDonationError="showDonationError" />
</div> </div>
<!-- <button type="button" @click="addDonation(3)">
Add Donation of $3
</button> -->
<hr class="mb-5" /> <hr class="mb-5" />
<div class="emailtext" v-html="ConfirmationEmailText"></div> <div class="emailtext" v-html="ConfirmationEmailText"></div>
@ -122,6 +118,7 @@ import { partTypeStrings } from "@/constants/part-type-strings";
import { containsLineItemWithPartType } from "@/helpers/service-package-helper"; import { containsLineItemWithPartType } from "@/helpers/service-package-helper";
import { containsRecalParts } from "@/helpers/recal-helper.js"; import { containsRecalParts } from "@/helpers/recal-helper.js";
import donationBlock from "@/experiment-components/donation-block.vue"; import donationBlock from "@/experiment-components/donation-block.vue";
import { partNumberStrings } from "@/constants/part-number-strings";
export default { export default {
name: "confirmation", name: "confirmation",
@ -219,7 +216,7 @@ export default {
}; };
const donationItems = lineItemsFromSubmittedOrder.supportingItems?.filter( const donationItems = lineItemsFromSubmittedOrder.supportingItems?.filter(
(item) => item.partNumber === "DONATION" (item) => item.partNumber === partNumberStrings.DONATION
); );
const donationAmount = donationItems?.length > 0 ? donationItems[0].sellingPrice : 0; const donationAmount = donationItems?.length > 0 ? donationItems[0].sellingPrice : 0;
@ -532,13 +529,9 @@ export default {
"test", "test",
false false
).catch((error) => { ).catch((error) => {
// this.$refs.navbar.removeLoader();
console.error("Error!!! error: ", error);
return error; return error;
}); });
console.log("ran addDonation()... (*fake call*) donationResponse: ", donationResponse);
if (donationResponse?.status == "200") { if (donationResponse?.status == "200") {
this.showDonationSuccess = true; this.showDonationSuccess = true;
this.showDonationError = false; this.showDonationError = false;
@ -561,7 +554,6 @@ export default {
watch: { watch: {
donationAmount(newValue) { donationAmount(newValue) {
newValue = parseInt(newValue); newValue = parseInt(newValue);
console.log("WATCHED donationAmount changed: ", newValue);
// this.addDonation(newValue); // this.addDonation(newValue);
// TODO - when backend code is final, then remove the below and restore the line above // TODO - when backend code is final, then remove the below and restore the line above

View file

@ -35,7 +35,7 @@ jest.mock("@/mixins/experiment-mixin.js", () => ({
} }
}, },
hasSettingEqualTo(settingName, settingValue) { hasSettingEqualTo(settingName, settingValue) {
return true; return false;
}, },
}, },
})); }));

View file

@ -227,11 +227,9 @@ export default {
methods: { methods: {
processIfStatements, processIfStatements,
hasPricingByDay() { hasPricingByDay() {
return ( return experimentMixin.methods.hasSettingEqualTo(
experimentMixin.methods.hasSettingEqualTo(
experimentSettings.PRICING_BY_DAY, experimentSettings.PRICING_BY_DAY,
"true" "true"
) && !this.isInsuranceSelected
); );
}, },
getHeaderTextFromCms(cmsWidgetName) { getHeaderTextFromCms(cmsWidgetName) {
@ -264,6 +262,10 @@ export default {
servicePackageDiscount, servicePackageDiscount,
}) })
).toFixed(2); ).toFixed(2);
if (this.hasPricingByDay()) {
return "$" + formattedPriceFloat;
}
return (this.isInsuranceSelected ? "As little as $" : "$") + formattedPriceFloat; return (this.isInsuranceSelected ? "As little as $" : "$") + formattedPriceFloat;
}, },
getPackagePrice(packageName, { discountedPrice = false, servicePackageDiscount = false }) { getPackagePrice(packageName, { discountedPrice = false, servicePackageDiscount = false }) {