From 0293b27ced33f142223db8276e3f182b4752b9ef Mon Sep 17 00:00:00 2001 From: Michaela Brydon Date: Mon, 22 Jan 2024 16:52:03 -0500 Subject: [PATCH 1/4] Fixing routing --- src/layouts/tpa-submit/tpa-submit.vue | 5 ++++- src/router/router-constants/navigation-scenarios.js | 1 + src/router/router-constants/routing-table.js | 6 +++++- src/store/index.js | 1 + 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/layouts/tpa-submit/tpa-submit.vue b/src/layouts/tpa-submit/tpa-submit.vue index 8a241e05..9886298f 100644 --- a/src/layouts/tpa-submit/tpa-submit.vue +++ b/src/layouts/tpa-submit/tpa-submit.vue @@ -242,8 +242,11 @@ export default { methods: { setSections() { + const vehicleScenario = useMainStore().isPolicyVehicle + ? this.navigationScenarios.EDIT_POLICY_VEHICLE + : this.navigationScenarios.EDIT_VEHICLE; this.sections = [ - this.getSection(this.widget.subheader.vehicle, this.getVehicleLines, this.navigationScenarios.EDIT_VEHICLE), + this.getSection(this.widget.subheader.vehicle, this.getVehicleLines, vehicleScenario), this.getSection(this.widget.subheader.damage, this.getDamageLines, this.navigationScenarios.EDIT_DAMAGE), this.getSection(this.widget.subheader.shop, this.getPreferredShopLines, this.navigationScenarios.EDIT_PREFERRED_SHOP), // eslint-disable-next-line max-len diff --git a/src/router/router-constants/navigation-scenarios.js b/src/router/router-constants/navigation-scenarios.js index 0d4376aa..f71a452a 100644 --- a/src/router/router-constants/navigation-scenarios.js +++ b/src/router/router-constants/navigation-scenarios.js @@ -69,6 +69,7 @@ const navigationScenarios = Object.freeze({ CLICKED_FORWARD_WITH_NON_SAFELITE_SHOP: 'CLICKED_FORWARD_WITH_NON_SAFELITE_SHOP', // TPA Submit + EDIT_POLICY_VEHICLE: 'EDIT_POLICY_VEHICLE', EDIT_VEHICLE: 'EDIT_VEHICLE', EDIT_DAMAGE: 'EDIT_DAMAGE', EDIT_PREFERRED_SHOP: 'EDIT_PREFERRED_SHOP', diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index 43371dbe..22488935 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -641,6 +641,10 @@ const routingTable = () => [ { issPageValue: issPageValues.TPA_SUBMIT, maps: [ + { + scenario: navigationScenarios.EDIT_POLICY_VEHICLE, + destinationIssPageValue: issPageValues.POLICY_VEHICLES + }, { scenario: navigationScenarios.EDIT_VEHICLE, destinationIssPageValue: issPageValues.VEHICLE_SELECTION @@ -651,7 +655,7 @@ const routingTable = () => [ }, { scenario: navigationScenarios.EDIT_PREFERRED_SHOP, - destinationIssPageValue: issPageValues.TPA_SEARCH + destinationIssPageValue: issPageValues.PROVIDER_PREFERENCE }, { scenario: navigationScenarios.EDIT_CONTACT_DETAILS, diff --git a/src/store/index.js b/src/store/index.js index facfa026..e82cc2ab 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -220,6 +220,7 @@ export const useMainStore = defineStore({ payment: (state) => state.order.payment, policy: (state) => state.order.policy, hasExactlyOneChip: () => state.order.damage.numberOfChips === 1, + isPolicyVehicle: () => state.order.vehicle.policyVehicleId != null, hasAnyNonWindshieldGlassParts: (s) => !s.order.policy.isDamageGlassOnly, isMobileAppointment: (state) => state.order.serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE || state.order.serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE_NOT_ITAC_AND_NOT_NOCOMP, From ad0c9c9c2d48052240c3df6d8a0592f417994f77 Mon Sep 17 00:00:00 2001 From: Michaela Brydon Date: Mon, 22 Jan 2024 16:56:23 -0500 Subject: [PATCH 2/4] Updating contact info routing --- src/router/router-constants/routing-table.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index 22488935..03860dee 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -659,7 +659,7 @@ const routingTable = () => [ }, { scenario: navigationScenarios.EDIT_CONTACT_DETAILS, - destinationIssPageValue: issPageValues.CONTACT_DETAILS + destinationIssPageValue: issPageValues.POLICY_HOLDER_DETAILS }, { scenario: navigationScenarios.CLICKED_BACK, From ad938af5d42f7c09277e6a1c26e6189766fdc51c Mon Sep 17 00:00:00 2001 From: Michaela Brydon Date: Mon, 22 Jan 2024 17:10:19 -0500 Subject: [PATCH 3/4] Fixing safelite shop bug --- src/layouts/tpa-search/tpa-search.vue | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/layouts/tpa-search/tpa-search.vue b/src/layouts/tpa-search/tpa-search.vue index 25610da5..fbeb101d 100644 --- a/src/layouts/tpa-search/tpa-search.vue +++ b/src/layouts/tpa-search/tpa-search.vue @@ -354,7 +354,7 @@ export default { addressLine2 += zipCode; } - const addressLine1 = this.toTitleCase(provider?.address?.streetAddress); + const addressLine1 = toTitleCase(provider?.address?.streetAddress); const joinString = addressLine1.length > 0 && addressLine2.length > 0 ? ', ' : ''; return [addressLine1, addressLine2].join(joinString); }, @@ -390,7 +390,7 @@ export default { } }, getShopButtonDataFromProvider(provider) { - const cellNumber = this.toDisplayPhoneNumber(provider?.phoneNumber); + const cellNumber = toDisplayPhoneNumber(provider?.phoneNumber); const distance = provider?.distanceInMiles !== null && !Number.isNaN(parseFloat(provider?.distanceInMiles)) ? +provider.distanceInMiles.toFixed(1) : null; @@ -403,9 +403,7 @@ export default { buttonBodyCopy: `${this.getProviderAddress(provider)}
${cellNumber ?? ''}`, value: provider?.providerNumber ?? '' }; - }, - toDisplayPhoneNumber, - toTitleCase + } } }; From fe59bab8324ca60f3ab6c5e089863595ca6244fa Mon Sep 17 00:00:00 2001 From: Michaela Brydon Date: Mon, 22 Jan 2024 17:15:11 -0500 Subject: [PATCH 4/4] Setting isSafeliteShop to true when appropriate --- src/layouts/tpa-search/tpa-search.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/layouts/tpa-search/tpa-search.vue b/src/layouts/tpa-search/tpa-search.vue index fbeb101d..449de6ca 100644 --- a/src/layouts/tpa-search/tpa-search.vue +++ b/src/layouts/tpa-search/tpa-search.vue @@ -376,6 +376,9 @@ export default { this.mapZipCode = this.zipCode; }, forwardButtonAction() { + if (this.selectedProviderIsSafeliteShop) { + useMainStore().updateIsSafeliteProvider(true); + } const scenario = this.selectedProviderIsSafeliteShop ? this.navigationScenarios.CLICKED_FORWARD_WITH_SAFELITE_SHOP : this.navigationScenarios.CLICKED_FORWARD_WITH_NON_SAFELITE_SHOP;