diff --git a/src/constants/endpoints.js b/src/constants/endpoints.js index 89e1f1fc..642fc752 100644 --- a/src/constants/endpoints.js +++ b/src/constants/endpoints.js @@ -19,6 +19,10 @@ const endpoints = { url: "/vehicle/api/v1/vehicle/makes/", method: "GET", }, + GetVehicleModels: { + url: "/vehicle/api/v1/vehicle/Models", + method: "GET", + } }; export { endpoints }; diff --git a/src/helpers/cms-content-helper.js b/src/helpers/cms-content-helper.js index 45f7943c..356ffb76 100644 --- a/src/helpers/cms-content-helper.js +++ b/src/helpers/cms-content-helper.js @@ -89,7 +89,7 @@ function mapStringToState(str) { const regexMatches = [...str.matchAll(regexExp)]; const globalStateMatches = regexMatches.filter(match => { return match[1] === dynamicStrings.GLOBAL_STATE; - }) + }); // Our final string value that will be built from the matches. let stringBuilder = ""; diff --git a/src/layouts/vehicle-model/model-question/model-question.vue b/src/layouts/vehicle-model/model-question/model-question.vue new file mode 100644 index 00000000..064007e0 --- /dev/null +++ b/src/layouts/vehicle-model/model-question/model-question.vue @@ -0,0 +1,56 @@ + + + + \ No newline at end of file diff --git a/src/layouts/vehicle-model/vehicle-model.vue b/src/layouts/vehicle-model/vehicle-model.vue new file mode 100644 index 00000000..76bb35b2 --- /dev/null +++ b/src/layouts/vehicle-model/vehicle-model.vue @@ -0,0 +1,103 @@ + + + + \ No newline at end of file diff --git a/src/router/router-constants/issPage-values.js b/src/router/router-constants/issPage-values.js index 8bdc935c..1fe10c52 100644 --- a/src/router/router-constants/issPage-values.js +++ b/src/router/router-constants/issPage-values.js @@ -3,5 +3,6 @@ export const issPageValues = { WELCOME_PAGE: "welcome-page", VEHICLE_MAKE: "vehicle-make", VEHICLE_YEAR: "vehicle-year", + VEHICLE_MODEL: "vehicle-model" }; \ No newline at end of file diff --git a/src/router/router-constants/navigation-scenarios.js b/src/router/router-constants/navigation-scenarios.js index bcfd87d4..01a1d7a8 100644 --- a/src/router/router-constants/navigation-scenarios.js +++ b/src/router/router-constants/navigation-scenarios.js @@ -6,6 +6,8 @@ const navigationScenarios = { // YMMS SELECTED_YEAR: "SELECTED_YEAR", SELECTED_MAKE: "SELECTED_MAKE", + SELECTED_MODEL: "SELECTED_MODEL", + // TESTING CLICKED_TEST: "CLICKED_TEST" }; diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index b97dfb13..106a103f 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -26,10 +26,23 @@ const routingTable = function(store) { }, { scenario: navigationScenarios.SELECTED_MAKE, - destinationIssPageValue: issPageValues.WELCOME_PAGE + destinationIssPageValue: issPageValues.VEHICLE_MODEL }, ], }, + { + issPageValue: issPageValues.VEHICLE_MODEL, + maps: [ + { + scenario: navigationScenarios.CLICKED_BACK, + destinationIssPageValue: issPageValues.VEHICLE_MAKE, + }, + { + scenario: navigationScenarios.SELECTED_MODEL, + destinationUrl: "https://www.google.com" + } + ] + }, { issPageValue: issPageValues.WELCOME_PAGE, maps: [ diff --git a/src/store/index.js b/src/store/index.js index 7d3dca5b..769a36fd 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1,4 +1,4 @@ -import { defineStore, createPinia } from "pinia"; +import { defineStore } from "pinia"; import { endpoints } from "@/constants/endpoints.js"; import globalMethods from "@/global-methods"; import { applicationConfig } from "@/constants/application-config"; @@ -91,6 +91,14 @@ export const useMainStore = defineStore({ }); }, + getVehicleModels() { + return globalMethods.callHttpClient({ + method: endpoints.GetVehicleModels.method, + endpoint: `${endpoints.GetVehicleModels.url}/${this.order.vehicle.year}/${this.order.vehicle.make}`, + payload: {}, + }); + }, + // Vehicle API Actions updateVehicleYear(year) { @@ -106,6 +114,13 @@ export const useMainStore = defineStore({ } }, + updateVehicleModel(model) + { + if (this.order.vehicle.model !== model) { + this.order.vehicle.model = model; + } + }, + // populate initial state populateInitialState() {