From a3c3b0b3009766a6b9ea7388a89ecb8bc111eac7 Mon Sep 17 00:00:00 2001 From: Kroell Date: Thu, 26 Jan 2023 15:02:16 -0500 Subject: [PATCH 01/13] start of address-vehicles page --- .../address-vehicles-question.vue | 82 ++++++ .../address-vehicles/address-vehicles.vue | 271 +++++++++++++++--- src/router/router-constants/routing-table.js | 9 + 3 files changed, 318 insertions(+), 44 deletions(-) create mode 100644 src/layouts/address-vehicles/address-vehicles-question/address-vehicles-question.vue diff --git a/src/layouts/address-vehicles/address-vehicles-question/address-vehicles-question.vue b/src/layouts/address-vehicles/address-vehicles-question/address-vehicles-question.vue new file mode 100644 index 00000000..538ee298 --- /dev/null +++ b/src/layouts/address-vehicles/address-vehicles-question/address-vehicles-question.vue @@ -0,0 +1,82 @@ + + + + \ No newline at end of file diff --git a/src/layouts/address-vehicles/address-vehicles.vue b/src/layouts/address-vehicles/address-vehicles.vue index b6e1835b..99cf1e58 100644 --- a/src/layouts/address-vehicles/address-vehicles.vue +++ b/src/layouts/address-vehicles/address-vehicles.vue @@ -2,66 +2,111 @@
- + - + -
-

Placeholder for address-vehicles page

- - + + +
+ + + {{ getRouterLinkDisplayTextFromCopy(copy) }} + + +
+
+ diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index 2e2c9d19..566457d1 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -321,6 +321,15 @@ const routingTable = function(store) { }, ], }, + { + issPageValue: issPageValues.ADDRESS_VEHICLES, + maps: [ + { + scenario: navigationScenarios.CLICKED_BACK, + destinationIssPageValue: issPageValues.ADDRESS_LOOKUP, + }, + ], + }, { issPageValue: issPageValues.WELCOME_PAGE, maps: [ From 962dadf78f76ee079a274d066d21ece164833b5d Mon Sep 17 00:00:00 2001 From: "US\\katie.kroell" Date: Thu, 26 Jan 2023 16:55:39 -0500 Subject: [PATCH 02/13] EOD commit - address-vehicles --- .../address-vehicles/address-vehicles.vue | 52 ++++++------------- src/router/router-constants/routing-table.js | 24 +++++++++ src/store/index.js | 13 +++++ 3 files changed, 52 insertions(+), 37 deletions(-) diff --git a/src/layouts/address-vehicles/address-vehicles.vue b/src/layouts/address-vehicles/address-vehicles.vue index 99cf1e58..9d61a08e 100644 --- a/src/layouts/address-vehicles/address-vehicles.vue +++ b/src/layouts/address-vehicles/address-vehicles.vue @@ -21,15 +21,6 @@ manualCopy="" v-bind:isDismissible="false" /> - {{ getRouterLinkDisplayTextFromCopy(copy) }} { this.$refs.siteFooter.removeLoader(); }); @@ -214,9 +191,7 @@ export default { this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId( vinLookup.data.carId ); - await this.dispatchStoreAction( - storeActions.SAVE_VIN, - { + await useMainStore().saveVin({ vehicleInfo: Object.assign(this.selectedVehicle.vehicle, { vin: this.selectedVehicle.vin, }), @@ -225,12 +200,15 @@ export default { }, false ); - return await this.navigateForward(); + + return await this.navigateForwardWithSingleCarMatch(); }, async navigateForward() { + // If the vehicle selected on this page is different from the one originally entered and the selected glass is not available + // for that vehicle, then navigate back to "vehicle-damage" and display vehicle changed alert on that page. if (this.isCarIdDifferent && !this.isSelectedGlassAvailableForVehicle) { - this.$router.navigateWithSaving( - this.navigationScenarios.CLICKED_FORWARD, + this.$router.navigate( + this.navigationScenarios.SELECTED_VIN_WITH_MISMATCHED_GLASS, this.$route, {}, { [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: true } diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index 566457d1..342ef39a 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -328,6 +328,30 @@ const routingTable = function(store) { scenario: navigationScenarios.CLICKED_BACK, destinationIssPageValue: issPageValues.ADDRESS_LOOKUP, }, + { + scenario: navigationScenarios.SELECTED_VIN_WITH_MISMATCHED_GLASS, + destinationIssPageValue: issPageValues.VEHICLE_DAMAGE, + }, + { + scenario: navigationScenarios.CLICKED_FORWARD_WITH_PART_QUESTIONS, + destinationIssPageValue: issPageValues.PART_QUESTIONS, + }, + { + scenario: navigationScenarios.CLICKED_FORWARD_WITH_MULTIPLE_PARTS_TO_CHOOSE, + destinationIssPageValue: issPageValues.VEHICLE_PARTS, + }, + { + scenario: navigationScenarios.CLICKED_FORWARD_WITH_MOLDING_QUESTIONS, + destinationIssPageValue: issPageValues.MOLDING_QUESTIONS, + }, + { + scenario: navigationScenarios.CLICKED_FORWARD_WITH_CAPABILITY_QUESTIONS, + destinationIssPageValue: issPageValues.CAPABILITY_QUESTIONS, + }, + { + scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS, + destinationIssPageValue: issPageValues.COVERAGE_STATEMENT, + }, ], }, { diff --git a/src/store/index.js b/src/store/index.js index 56b11746..9961442c 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -896,7 +896,20 @@ export const useMainStore = defineStore({ this.updateRegistration(registrationInfo); } }, + saveVin({ isSelectedGlassAvailableForVehicle, vehicleInfo }) { + //Reset dependent state when changing + if (vehicleInfo.vin !== this.order.vehicle.vin) { + this.resetRegistrationAndDependencies(); + if (!isSelectedGlassAvailableForVehicle) { + this.resetDamageAndDependencies(); + this.resetPartsAndDependencies(); + + //Save new values + this.updateVehicle(vehicleInfo); + } + } + }, saveRegistrationLicensePlateLookup({ isSelectedGlassAvailableForVehicle, vehicleInfo, registrationInfo }) { //Reset dependent state when changing if From 3b0245833510c9a2fcb74f0f2e8f0a593b47780a Mon Sep 17 00:00:00 2001 From: Kroell Date: Mon, 30 Jan 2023 16:43:43 -0500 Subject: [PATCH 03/13] commit - update to navigation --- src/layouts/address-vehicles/address-vehicles.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/layouts/address-vehicles/address-vehicles.vue b/src/layouts/address-vehicles/address-vehicles.vue index 9d61a08e..c65c9547 100644 --- a/src/layouts/address-vehicles/address-vehicles.vue +++ b/src/layouts/address-vehicles/address-vehicles.vue @@ -201,7 +201,7 @@ export default { false ); - return await this.navigateForwardWithSingleCarMatch(); + return await this.navigateForward(); }, async navigateForward() { // If the vehicle selected on this page is different from the one originally entered and the selected glass is not available @@ -211,7 +211,7 @@ export default { this.navigationScenarios.SELECTED_VIN_WITH_MISMATCHED_GLASS, this.$route, {}, - { [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: true } + { [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: true }, ); } else { await this.navigateForwardWithSingleCarMatch(); From c195cd9778967d8c2e4c545a1e828961fbd2c1ee Mon Sep 17 00:00:00 2001 From: Kroell Date: Tue, 31 Jan 2023 11:22:24 -0500 Subject: [PATCH 04/13] styling fix, update to store method --- .../address-vehicles/address-vehicles.vue | 17 +++++++++++++++++ src/store/index.js | 6 +++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/layouts/address-vehicles/address-vehicles.vue b/src/layouts/address-vehicles/address-vehicles.vue index c65c9547..59f1d903 100644 --- a/src/layouts/address-vehicles/address-vehicles.vue +++ b/src/layouts/address-vehicles/address-vehicles.vue @@ -20,6 +20,7 @@ :manualHeadline="AlertFoundMultipleVehiclesHeader" manualCopy="" v-bind:isDismissible="false" + id="multiple-vehicles-alert" /> + + \ No newline at end of file diff --git a/src/store/index.js b/src/store/index.js index 9961442c..372c0935 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -904,10 +904,10 @@ export const useMainStore = defineStore({ if (!isSelectedGlassAvailableForVehicle) { this.resetDamageAndDependencies(); this.resetPartsAndDependencies(); - - //Save new values - this.updateVehicle(vehicleInfo); } + + //Save new values + this.updateVehicle(vehicleInfo); } }, saveRegistrationLicensePlateLookup({ isSelectedGlassAvailableForVehicle, vehicleInfo, registrationInfo }) { From d2c09c6be3f7e2cf9d1beb3047d4eff020b85ae9 Mon Sep 17 00:00:00 2001 From: Kroell Date: Tue, 31 Jan 2023 14:04:46 -0500 Subject: [PATCH 05/13] move alert from bottom of page --- .../address-vehicles/address-vehicles.vue | 67 +++++++++++++------ 1 file changed, 48 insertions(+), 19 deletions(-) diff --git a/src/layouts/address-vehicles/address-vehicles.vue b/src/layouts/address-vehicles/address-vehicles.vue index 59f1d903..2d22b2d0 100644 --- a/src/layouts/address-vehicles/address-vehicles.vue +++ b/src/layouts/address-vehicles/address-vehicles.vue @@ -20,7 +20,18 @@ :manualHeadline="AlertFoundMultipleVehiclesHeader" manualCopy="" v-bind:isDismissible="false" - id="multiple-vehicles-alert" + id="address-vehicles-alert" + /> +
{ - this.$refs.siteFooter.removeLoader(); - }); + const vinLookup = await useMainStore() + .lookupVehicleByVin(this.selectedVehicle.vin) + .catch(() => { + this.$refs.siteFooter.removeLoader(); + }); if (!vinLookup) { return; } this.isSelectedGlassAvailableForVehicle = await isGlassAvailableForCarId( vinLookup.data.carId ); - await useMainStore().saveVin({ + await useMainStore().saveVin( + { vehicleInfo: Object.assign(this.selectedVehicle.vehicle, { vin: this.selectedVehicle.vin, }), @@ -205,14 +235,14 @@ export default { return await this.navigateForward(); }, async navigateForward() { - // If the vehicle selected on this page is different from the one originally entered and the selected glass is not available + // If the vehicle selected on this page is different from the one originally entered and the selected glass is not available // for that vehicle, then navigate back to "vehicle-damage" and display vehicle changed alert on that page. if (this.isCarIdDifferent && !this.isSelectedGlassAvailableForVehicle) { this.$router.navigate( this.navigationScenarios.SELECTED_VIN_WITH_MISMATCHED_GLASS, this.$route, {}, - { [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: true }, + { [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: true } ); } else { await this.navigateForwardWithSingleCarMatch(); @@ -252,16 +282,15 @@ export default { \ No newline at end of file From 91f2a31d6b4cb74783040223ab50ec01aca9d950 Mon Sep 17 00:00:00 2001 From: Kroell Date: Tue, 31 Jan 2023 14:18:51 -0500 Subject: [PATCH 06/13] changes to alert --- .../address-vehicles-question.vue | 22 ++++++----- .../address-vehicles/address-vehicles.vue | 39 +++---------------- 2 files changed, 18 insertions(+), 43 deletions(-) diff --git a/src/layouts/address-vehicles/address-vehicles-question/address-vehicles-question.vue b/src/layouts/address-vehicles/address-vehicles-question/address-vehicles-question.vue index 538ee298..bf89ece0 100644 --- a/src/layouts/address-vehicles/address-vehicles-question/address-vehicles-question.vue +++ b/src/layouts/address-vehicles/address-vehicles-question/address-vehicles-question.vue @@ -1,4 +1,14 @@