diff --git a/src/helpers/heritage-integration/order-helper.js b/src/helpers/heritage-integration/order-helper.js index addca2d41..cb80cba86 100644 --- a/src/helpers/heritage-integration/order-helper.js +++ b/src/helpers/heritage-integration/order-helper.js @@ -72,6 +72,13 @@ export async function saveSession({ pageNameToLog, shouldAwaitSaveSessionQueue = } } +export async function submitWorkOrder({ pageNameToLog }) { + await saveSession({ + pageNameToLog: pageNameToLog, + shouldAwaitSaveSessionQueue: true, + }); +} + // PRIVATE FUNCTIONS // /* diff --git a/src/layouts/confirmation/confirmation.vue b/src/layouts/confirmation/confirmation.vue index 6c4645901..6e913fdf5 100644 --- a/src/layouts/confirmation/confirmation.vue +++ b/src/layouts/confirmation/confirmation.vue @@ -77,7 +77,9 @@ export default { return serviceLocationReqs && scheduleReqs; }, - forwardButtonAction() {}, + forwardButtonAction() { + window.location.replace("https://safelite.com"); + }, }, components: { funnelHeader, diff --git a/src/layouts/customer-details/customer-details.vue b/src/layouts/customer-details/customer-details.vue index 03de9ff97..34a585c1e 100644 --- a/src/layouts/customer-details/customer-details.vue +++ b/src/layouts/customer-details/customer-details.vue @@ -82,7 +82,6 @@ import { routerParams } from "@/router/router-constants/router-params"; import { required, regex } from "@/helpers/validation-rules"; import { Form, defineRule } from "vee-validate"; import { useField, validate } from "vee-validate"; -import { navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper"; import store from "@/store"; // DEFINE VALIDATION RULES @@ -178,7 +177,6 @@ export default { false ); - this.dispatchStoreAction(this.storeActions.SAVE_WORK_ORDER_FLAG, true, false); this.$router.navigateWithSaving(this.navigationScenarios.CLICKED_FORWARD, this.$route); }, }, diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index f261c9c1f..78dbc3718 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -22,6 +22,7 @@ import funnelHeader from "@/fmg-components/funnel-header/funnel-header"; import navbar from "@/fmg-components/nav-bar/nav-bar"; import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header"; +import { submitWorkOrder } from "@/helpers/heritage-integration/order-helper.js"; import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { settleAllPromises } from "@/helpers/layout-helper"; @@ -58,9 +59,13 @@ export default { // TODO return true; }, - backButtonAction() {}, - forwardButtonAction() { - this.$router.navigateWithSaving(this.navigationScenarios.CLICKED_FORWARD, this.$route); + backButtonAction() { + this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route); + }, + async forwardButtonAction() { + this.dispatchStoreAction(this.storeActions.SAVE_WORK_ORDER_FLAG, true, false); + await submitWorkOrder({ pageNameToLog: "payment-method" }); + this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_FORWARD, this.$route); }, }, components: { diff --git a/src/layouts/review/review.vue b/src/layouts/review/review.vue index 639fd0fd5..f30f6f6ac 100644 --- a/src/layouts/review/review.vue +++ b/src/layouts/review/review.vue @@ -125,6 +125,9 @@ import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; import { settleAllPromises } from "@/helpers/layout-helper"; import store from "@/store"; +// Validation +import { Form } from "vee-validate"; + export default { name: "review", async beforeRouteEnter(to, from, next) { @@ -231,7 +234,12 @@ export default { backButtonAction() { this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route); }, - forwardButtonAction() {}, + forwardButtonAction() { + this.$router.navigateWithoutSaving( + this.navigationScenarios.CLICKED_FORWARD, + this.$route + ); + }, editVehicle() { this.$router.navigateWithoutSaving( this.navigationScenarios.CLICKED_VEHICLE_EDIT, @@ -310,6 +318,7 @@ export default { serviceLocationReview, scheduleReview, customerReview, + Form, }, }; diff --git a/src/mixins/base-mixin.js b/src/mixins/base-mixin.js index b1678fa25..b984bc565 100644 --- a/src/mixins/base-mixin.js +++ b/src/mixins/base-mixin.js @@ -91,7 +91,6 @@ export default { lineItem.partType != partTypeStrings.RAIN_DEFENSE ); }); - console.log("step one", lineItemsToPrice); let totalPrice = this.getTotalPriceOfAllLineItemsAndChildParts(lineItemsToPrice); return totalPrice; }, @@ -113,14 +112,7 @@ export default { lineItem.childParts ); } - console.log( - "step two, lineItem name: ", - lineItem.partNumber, - " / totalPrice: ", - totalPrice - ); }); - console.log("step three", totalPrice); return totalPrice; }, getTotalLineItemPrice(lineItem) { diff --git a/src/router/index.js b/src/router/index.js index eadf3b9f6..04772febd 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -29,14 +29,7 @@ import analyticsMixin from "@/mixins/analytics-mixin"; import { experimentTriggers } from "../constants/experiments"; import { applicationConfig } from "../constants/application-config"; -import review from "@/layouts/review/review"; -import paymentMethod from "@/layouts/payment-method/payment-method"; const routes = [ - { - path: "/payment-method", // This is a temporary route for testing. - name: "payment-method", - component: paymentMethod, - }, { path: "/", name: "root", diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index a2796ed0e..141186d23 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -465,11 +465,19 @@ const routingTable = function (store) { scenario: navigationScenarios.CLICKED_CUSTOMER_EDIT, destinationFmgPageValue: fmgPageValues.CUSTOMER_DETAILS, }, + { + scenario: navigationScenarios.CLICKED_FORWARD, + destinationFmgPageValue: fmgPageValues.PAYMENT_METHOD, + }, ], }, { fmgPageValue: fmgPageValues.PAYMENT_METHOD, maps: [ + { + scenario: navigationScenarios.CLICKED_BACK, + destinationFmgPageValue: fmgPageValues.REVIEW, + }, { scenario: navigationScenarios.CLICKED_FORWARD, destinationFmgPageValue: fmgPageValues.CONFIRMATION, diff --git a/src/store/index.js b/src/store/index.js index 0c9a55c41..23e8ca8e0 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -504,6 +504,7 @@ export const mutations = { // Export Getters export const getters = { + submitAfterSave: (state) => state.submitAfterSave, vehicle: (state) => state.order.vehicle, eventBusItem: (state) => (eventCategory, eventSubCategory) => { const matchedEvent = state.applicationUser.eventBus.find(