CSR-2179: Wrapped Remove Recal Experiment conditions around previous payment-method changes from CSR-2115

This commit is contained in:
Adam Caouette 2024-09-10 14:33:13 -04:00
parent b2a2184200
commit beef51aa7c

View file

@ -46,14 +46,14 @@
v-bind:isDismissible="false" /> v-bind:isDismissible="false" />
</div> </div>
<div v-if="hasRecal && !isInsurance" class="questions-about-service my-5"> <div v-if="!isInsurance" class="questions-about-service my-5">
<textBlock <textBlock
cmsWidgetName="QuestionsAboutYourServiceWidget" cmsWidgetName="QuestionsAboutYourServiceWidget"
justifyText="left" justifyText="left"
class="service-questions" /> class="service-questions" />
<textBlock cmsWidgetName="CallOrTextWidget" justifyText="left" /> <textBlock cmsWidgetName="CallOrTextWidget" justifyText="left" />
<hr class="my-5" /> <hr class="my-5" />
<div class="d-flex flex-row checkbox-group"> <div class="d-flex flex-row checkbox-group" v-if="isRecalibrationOnOrder && shouldHideRecalibration">
<checkboxQuestion <checkboxQuestion
cmsWidgetName="RecalConfirmWidget" cmsWidgetName="RecalConfirmWidget"
class="mb-5" class="mb-5"
@ -124,6 +124,7 @@ import {
} from "@/helpers/cms-content-helper"; } from "@/helpers/cms-content-helper";
import { paymentMethods } from "@/constants/payment-method-constants"; import { paymentMethods } from "@/constants/payment-method-constants";
import { experimentSettings } from "@/constants/experiments"; import { experimentSettings } from "@/constants/experiments";
import experimentMixin from "@/mixins/experiment-mixin.js";
import { import {
revalidatePromosAndValidateQueryStringPromo, revalidatePromosAndValidateQueryStringPromo,
buildToastMessagesFromRevalidateOrValidatePromoResponse, buildToastMessagesFromRevalidateOrValidatePromoResponse,
@ -147,6 +148,7 @@ import { AppointmentTypeStrings } from "@/constants/schedule-constants";
import { partTypeStrings } from "@/constants/part-type-strings"; import { partTypeStrings } from "@/constants/part-type-strings";
import { mapTaxedLineItemsToStoreFormat } from "../../store"; import { mapTaxedLineItemsToStoreFormat } from "../../store";
import { coverageStatus } from "@/constants/insurance"; import { coverageStatus } from "@/constants/insurance";
import { containsLineItemWithPartType } from "@/helpers/service-package-helper";
defineRule("payment-method-required", required(errorMessages.OPTION_REQUIRED)); defineRule("payment-method-required", required(errorMessages.OPTION_REQUIRED));
defineRule("recal-ack-required", required(errorMessages.RECAL_ACK_REQUIRED)); defineRule("recal-ack-required", required(errorMessages.RECAL_ACK_REQUIRED));
@ -578,15 +580,17 @@ export default {
}, },
}, },
computed: { computed: {
hasRecal() { isRecalibrationOnOrder() {
const recalLineItem = this.$store.getters.order.lineItems?.supportingItems?.find( return containsLineItemWithPartType(
(lineItem) => lineItem.partType.indexOf(partTypeStrings.RECALIBRATION) !== -1 partTypeStrings.RECALIBRATION,
this.$store.getters.order.lineItems?.supportingItems
); );
},
if (recalLineItem) { shouldHideRecalibration() {
return true; const recalSettingValue = experimentMixin.methods.getSettingValue(
} experimentSettings.RECAL_PRICE_REMOVE
return false; );
return recalSettingValue;
}, },
showApplePay() { showApplePay() {
return baseMixin.methods.showApplePay(); return baseMixin.methods.showApplePay();
@ -658,7 +662,7 @@ export default {
return true; return true;
} }
} else { } else {
if (this.isPiaEnabled && this.totalAmountDue > 0 && !this.hasRecal) { if (this.isPiaEnabled && this.totalAmountDue > 0 && !this.isRecalibrationOnOrder) {
return true; return true;
} }
} }