Merge pull request #1452 from Safelite/feature/CSR-1392

Feature/csr 1392
This commit is contained in:
CarlNation 2023-10-25 13:29:44 -04:00 committed by GitHub
commit dd83c34b98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,5 @@
<template>
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }">
<Form>
<loadingModal notFullScreen ref="loadingModal" />
<div class="container-fluid page-container-grouped-styles">
<div class="row justify-content-center">
@ -23,11 +23,10 @@
<div class="fade-on-route-transition sub-container make-tall">
<navbar
cmsWidgetName="FunnelFooterWidget"
:isForwardActionDisabled="!meta.valid"
isForwardActionDisabled="true"
:isBackButtonHidden="shouldHideBackButton"
isSubmitHidden="true"
@back-clicked="backButtonAction"
@ForwardClicked="forwardButtonAction" />
@back-clicked="backButtonAction" />
</div>
</div>
</div>
@ -172,7 +171,6 @@ import { paymentMethods } from "@/constants/payment-method-constants";
import baseMixin from "@/mixins/base-mixin.js";
// Validation
import { Form } from "vee-validate";
export default {
name: "payment",
@ -311,26 +309,24 @@ export default {
return "";
},
getPiaLineItems() {
const itemsClone = { ...store.getters.order.lineItems };
delete itemsClone.serverData;
var itemsForPia = "";
for (var propertyName in itemsClone) {
for (var item in itemsClone[propertyName]) {
var amount =
+itemsClone[propertyName][item].laborAmount +
+itemsClone[propertyName][item].sellingPrice;
itemsForPia += itemsClone[propertyName][item].partType + "|" + amount + "|1|";
}
var glassParts = store.getters.order.lineItems.glassParts;
var supportingItems = store.getters.order.lineItems.supportingItems;
var vaps = store.getters.order.lineItems.vaps;
const items = [...(glassParts ?? []), ...(supportingItems ?? []), ...(vaps ?? [])];
for (var i = 0; i < items.length; i++) {
var amount = items[i].laborAmount + items[i].sellingPrice;
itemsForPia += items[i].partType + "|" + amount + "|1|";
}
return itemsForPia;
},
getAmountDue() {
return 2;
return 1600;
//return baseMixin.methods.getAmountDue(store.getters.order.lineItems);
},
getDisplayAmountDue() {
return "$2.00";
return "$1600.00";
//return baseMixin.methods.getDisplayAmountDue(store.getters.order.lineItems);
},
isPaypal() {
@ -340,9 +336,17 @@ export default {
return false;
},
backButtonAction() {
this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route);
// The only way I could figure out how to get navigation to work on a page with the iframe.
// This is also how a cancel from Paypal would work. Just a redirect to the payment-method page.
// The normal navigation sort of works but the page does not render. The "next" callback function does not get
// invoked in payment-method's beforeroute enter. I also spotted an error in vue-router.esm-bundler.js when this
// happens but was unable to ignore it with a try catch. The navigation guard error is:
// Error: Redirected from "/?fmgPage=payment-method" to "{ params: {isSavingNation: "false"}, query: "fmgPage: "payment-method"}"
// I don't know if the navigation guard thinks the to and from are the same page.
// Also tried overriding with a $router.push
window.location = applicationConfig.PIA_CANCEL_URL;
//this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route);
},
forwardButtonAction() {},
async fetchSignatureInfo() {
if (this.isPaypal()) {
this.$refs.loadingModal.showModal();
@ -371,7 +375,6 @@ export default {
components: {
funnelHeader,
navbar,
Form,
loadingModal,
},
};