+
-
-
+
+
@@ -25,14 +18,24 @@ import textboxQuestion from "@/common-components/textbox-question/textbox-questi
import vinInformation from "@/layouts/vin-lookup/vin-information/vin-information";
export default {
- name: "vin-lookup",
- components: {
- funnelHeader,
- vehicleBanner,
- funnelSubHeader,
- vinInformation,
- funnelFooter,
- },
+ name: "vin-lookup",
+ components: {
+ funnelHeader,
+ vehicleBanner,
+ funnelSubHeader,
+ vinInformation,
+ funnelFooter,
+ },
+ methods: {
+ arePagePrerequisitesValid() {
+ return true;
+ },
+ backButtonAction() {
+ if (this.$store.getters.vehicle.vin) {
+ this.$router.navigate(this.navigationScenarios.CLICKED_BACK_WITH_VIN, this.$route)
+ }
+ }
+ }
};
diff --git a/src/router/index.js b/src/router/index.js
index 778c55cfc..1759dec68 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -7,9 +7,9 @@ import { globalEvents, globalEventTypes } from "@/constants/events";
// Heritage integration
import { isSavedSessionStillActive } from "@/helpers/heritage-integration/session-helper";
-import { updateOrCreateFunnelCookie,getFunnelCookie } from "@/helpers/heritage-integration/cookie-helper";
+import { updateOrCreateFunnelCookie, getFunnelCookie } from "@/helpers/heritage-integration/cookie-helper";
import { loadOrderIfPresent, saveOrder } from "@/helpers/heritage-integration/order-helper";
-import { getPageToRouteExistingOrderTo, navigateToHeritageFunnel} from "@/helpers/heritage-integration/navigation-helper";
+import { getPageToRouteExistingOrderTo, navigateToHeritageFunnel } from "@/helpers/heritage-integration/navigation-helper";
import baseMixin from "@/mixins/base-mixin";
import eventBus from "@/helpers/event-bus/event-bus";
@@ -35,84 +35,79 @@ const routes = [
name: "root",
async beforeEnter(to, from, next) {
// If we have no query string, or we don't have the FmgPage query string.
- if (to.query.fmgPage === undefined) {
- await GoToFunnelStartOn404(next);
- } else {
- try {
+ try {
- // If the saved session has timed out, clear the session, execute 404 logic.
- if (getFunnelCookie() !== null && !isSavedSessionStillActive()) {
- await GoToFunnelStartOn404(next);
- }
-
-
-
- // On entering the funnel "fresh", read cookie information, decide what to do next.
- if (from.redirectedFrom === undefined) {
- const loadOrderResponse = await loadOrderIfPresent();
- const pageToRedirectTo = await getPageToRouteExistingOrderTo(to, loadOrderResponse);
-
- // If getPageToRouteExistingOrderTo determines that the return user needs to
- // go back to heritage funnel, send them there and stop our current navigation.
- if (pageToRedirectTo === 'heritage') {
- await navigateToHeritageFunnel();
- return next(false);
- }
-
- // Assign our fmgPage so it will load normally like the other pages.
- to.query.fmgPage = pageToRedirectTo;
- }
-
- // Process funnel cookie.
- updateOrCreateFunnelCookie();
-
- // If we already have our route, go to it.
- if (router.hasRoute(to.query.fmgPage)) {
- // Since our route is already in scope, we can grab the component from it and call the arePagePrerequisitesValid function.
- let component = router.getRoutes().filter((x) => x.name === to.query.fmgPage)[0].components;
-
- // If the component hasn't been loaded fully, load it before we check prerequisites.
- if (component.default.methods === undefined) {
- component = await component.default();
- }
-
- if (!arePagePrerequisitesValid(component)) {
- await GoToFunnelStartOn404(next);
- }
-
- return next({ name: to.query.fmgPage, query: to.query, params: to.params });
- }
-
- // Get route info for the given url. Names will have a 1:1 relationship with names in the Cms.
- const routeData = await GetRouteInfoFromPageName(to.query.fmgPage);
-
- // Add our dynamic route.
- router.addRoute({
- path: routeData[0].path, // Always the same path, because we control it with query strings.
- name: routeData[0].name,
- component: routeData[0].component,
- });
-
- // Call the next components arePagePrerequisitesValid method before load.
- // If it returns false, use the 404 logic.
- const nextComponent = await router.getRoutes().filter((x) => x.name === routeData[0].name)[0].components.default();
-
- if (!arePagePrerequisitesValid(nextComponent)) {
- await GoToFunnelStartOn404(next);
- }
-
- // Assign current query string parameters, as well as our fmgPage one.
- next({
- name: routeData[0].name,
- query: Object.assign(to.query, { fmgPage: routeData[0].name }),
- params: to.params
- });
- } catch (error) {
- console.log(error);
-
- // If we don't have a route, go to our 404 page.
+ // If the saved session has timed out, clear the session, execute 404 logic.
+ if (getFunnelCookie() !== null && !isSavedSessionStillActive()) {
await GoToFunnelStartOn404(next);
}
+
+ // On entering the funnel "fresh", read cookie information, decide what to do next.
+ if (from.redirectedFrom === undefined) {
+ const loadOrderResponse = await loadOrderIfPresent();
+ const pageToRedirectTo = await getPageToRouteExistingOrderTo(to, loadOrderResponse);
+
+ // If getPageToRouteExistingOrderTo determines that the return user needs to
+ // go back to heritage funnel, send them there and stop our current navigation.
+ if (pageToRedirectTo === 'heritage') {
+ await navigateToHeritageFunnel();
+ return next(false);
+ }
+
+
+ // Assign our fmgPage so it will load normally like the other pages.
+ to.query.fmgPage = pageToRedirectTo;
+ }
+
+ // Process funnel cookie.
+ updateOrCreateFunnelCookie();
+
+ // If we already have our route, go to it.
+ if (router.hasRoute(to.query.fmgPage)) {
+ // Since our route is already in scope, we can grab the component from it and call the arePagePrerequisitesValid function.
+ let component = router.getRoutes().filter((x) => x.name === to.query.fmgPage)[0].components;
+
+ // If the component hasn't been loaded fully, load it before we check prerequisites.
+ if (component.default.methods === undefined) {
+ component = await component.default();
+ }
+
+ if (!arePagePrerequisitesValid(component)) {
+ await GoToFunnelStartOn404(next);
+ }
+
+ return next({ name: to.query.fmgPage, query: to.query, params: to.params });
+ }
+
+ // Get route info for the given url. Names will have a 1:1 relationship with names in the Cms.
+ const routeData = await GetRouteInfoFromPageName(to.query.fmgPage);
+
+ // Add our dynamic route.
+ router.addRoute({
+ path: routeData[0].path, // Always the same path, because we control it with query strings.
+ name: routeData[0].name,
+ component: routeData[0].component,
+ });
+
+ // Call the next components arePagePrerequisitesValid method before load.
+ // If it returns false, use the 404 logic.
+ const nextComponent = await router.getRoutes().filter((x) => x.name === routeData[0].name)[0].components.default();
+
+ if (!arePagePrerequisitesValid(nextComponent)) {
+ await GoToFunnelStartOn404(next);
+ }
+
+ // Assign current query string parameters, as well as our fmgPage one.
+ next({
+ name: routeData[0].name,
+ query: Object.assign(to.query, { fmgPage: routeData[0].name }),
+ params: to.params
+ });
+ } catch (error) {
+ console.log(error);
+
+ // If we don't have a route, go to our 404 page.
+ await GoToFunnelStartOn404(next);
}
},
},
diff --git a/src/router/router-constants/fmgPage-values.js b/src/router/router-constants/fmgPage-values.js
index f3c811de3..9abb45cd2 100644
--- a/src/router/router-constants/fmgPage-values.js
+++ b/src/router/router-constants/fmgPage-values.js
@@ -11,6 +11,7 @@ const fmgPageValues = {
LICENSE_PLATE_LOOKUP: "license-plate-lookup",
REVEAL: "reveal",
ESTIMATE: "estimate",
+ ADDRESS_VEHICLES: "address-vehicles",
};
export { fmgPageValues };
diff --git a/src/router/router-constants/navigation-scenarios.js b/src/router/router-constants/navigation-scenarios.js
index da170da53..57f07a041 100644
--- a/src/router/router-constants/navigation-scenarios.js
+++ b/src/router/router-constants/navigation-scenarios.js
@@ -4,7 +4,9 @@ const navigationScenarios = {
SELECTED_MAKE: "SELECTED_MAKE",
SELECTED_STYLE: "SELECTED_STYLE",
CLICKED_BACK: "CLICKED_BACK",
+ CLICKED_BACK_WITH_VIN: "CLICKED_BACK_WITH_VIN",
CLICKED_FORWARD: "CLICKED_FORWARD",
+ CLICKED_FORWARD_WITH_VIN: "CLICKED_FORWARD_WITH_VIN",
SELECTED_PARTS: "SELECTED_PARTS",
SELECTED_DAMAGE_WITH_SINGLE_PART: "SELECTED_DAMAGE_WITH_SINGLE_PART",
SELECTED_DAMAGE_WITH_MULTIPLE_PARTS: "SELECTED_DAMAGE_WITH_MULTIPLE_PARTS",
diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js
index 99583b975..e5228ea4c 100644
--- a/src/router/router-constants/routing-table.js
+++ b/src/router/router-constants/routing-table.js
@@ -1,6 +1,5 @@
import { fmgPageValues } from "@/router/router-constants/fmgPage-values";
import { navigationScenarios } from "@/router/router-constants/navigation-scenarios";
-import { applicationConfig } from "@/constants/application-config";
const routingTable = [
{
@@ -58,6 +57,10 @@ const routingTable = [
scenario: navigationScenarios.CLICKED_BACK,
destinationFmgPageValue: fmgPageValues.VEHICLE_STYLE,
},
+ {
+ scenario: navigationScenarios.CLICKED_FORWARD_WITH_VIN,
+ destinationFmgPageValue: fmgPageValues.VIN_LOOKUP,
+ },
{
scenario: navigationScenarios.SELECTED_DAMAGE_WITH_SINGLE_PART,
destinationFmgPageValue: fmgPageValues.REVEAL
@@ -109,6 +112,10 @@ const routingTable = [
scenario: navigationScenarios.CLICKED_BACK,
destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE,
},
+ {
+ scenario: navigationScenarios.CLICKED_BACK_WITH_VIN,
+ destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE,
+ },
{
scenario: navigationScenarios.VIN_LOOKUP,
destinationFmgPageValue: fmgPageValues.PART_QUESTIONS,
diff --git a/src/store/index.js b/src/store/index.js
index b101d0524..0519fc0d2 100644
--- a/src/store/index.js
+++ b/src/store/index.js
@@ -45,6 +45,12 @@ const getDefaultState = () => {
glassParts: null,
otherParts: null
},
+ payment:{
+ isInsurance: null,
+ insuranceCoverage: {
+ isVerified: null
+ }
+ },
referralNumber: null,
referralDate: null,
referralCorrelationId: null,
@@ -120,6 +126,12 @@ export const mutations = {
updateParentAcctNumber(state, parentAcctNumber) {
state.order.parentAccountNumber = parentAcctNumber;
},
+ updateIsInsurance(state, isInsurance) {
+ state.order.payment.isInsurance = isInsurance;
+ },
+ updateInsuranceVerifiedStatus(state, isVerified) {
+ state.order.payment.insuranceCoverage.isVerified = isVerified;
+ },
// EVENT BUS MUTATIONS
@@ -176,6 +188,7 @@ export const mutations = {
state.order.referralNumber = orderInformation.referralNumber;
state.order.referralDate = orderInformation.referralDate;
state.order.referralCorrelationId = orderInformation.referralCorrelationId;
+
state.order.vehicle = Object.assign(state.order.vehicle, {
year: orderInformation.vehicle?.year,
make: orderInformation.vehicle?.make,
@@ -187,12 +200,17 @@ export const mutations = {
imageVifNumber: orderInformation.vehicle?.imageVifNumber,
imageColor: orderInformation.vehicle?.imageVifColor
});
+
state.order.damage.glassToReplace = orderInformation.glassToReplace;
state.order.damage.isRepair = orderInformation.isRepair;
state.order.damage.numberOfChips = orderInformation.numberOfChips;
+
state.order.lineItems.glassParts = orderInformation.parts;
state.order.parentAccountNumber = orderInformation.parentAccountNumber;
state.order.serviceLocation.zipCode = orderInformation.zipCode;
+
+ state.order.payment.isInsurance = orderInformation.IsInsuranceOrder;
+ state.order.payment.insuranceCoverage.isVerified = orderInformation?.insuranceInfo.coverageVerified;
}
}
@@ -210,11 +228,10 @@ export const getters = {
eventBus: (state) => state.applicationUser.eventBus,
damage: (state) => state.order.damage,
lineItems: (state) => state.order.lineItems,
- pageData: (state) => (page) => {
- return state.applicationUser.pageData[page];
- },
+ pageData: (state) => (page) => { return state.applicationUser.pageData[page]; },
applicationUser: (state) => state.applicationUser,
order: (state) => state.order,
+ payment: (state) => state.order.payment,
}
// Export Actions
diff --git a/src/ux-components/button-main/button-main.spec.js b/src/ux-components/button-main/button-main.spec.js
index ee5589a1d..7b99cfd04 100644
--- a/src/ux-components/button-main/button-main.spec.js
+++ b/src/ux-components/button-main/button-main.spec.js
@@ -22,7 +22,7 @@ describe("buttonMain.vue", () => {
// Act
const wrapper = shallowMount(buttonMain, {
propsData: {
- isDisabled: true,
+ isForwardActionDisabled: true,
},
});