From 37eec48173502fa619912e1f834d68e968c968a5 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Tue, 15 Nov 2022 09:52:06 -0500 Subject: [PATCH 1/8] Fix error styles on list-group. --- src/styles/common-error-styles.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/styles/common-error-styles.scss b/src/styles/common-error-styles.scss index f94c2cd0b..f7b8ce23e 100644 --- a/src/styles/common-error-styles.scss +++ b/src/styles/common-error-styles.scss @@ -19,6 +19,7 @@ html { box-shadow: 0 0 0 2.5px $red; } + .list-button-content, .list-button-horizontal-content { border: 1px solid $red; } @@ -28,6 +29,7 @@ html { box-shadow: 0 0 0 2.5px $red; } + input[type="radio"]:hover + .list-button-content, input[type="radio"]:hover + .list-button-horizontal-content { z-index: 5; box-shadow: none; From 66e4184bcacd95159e2be71148bfe630777381aa Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Tue, 15 Nov 2022 15:50:05 -0500 Subject: [PATCH 2/8] CSR-946 fix button state and disable loader for modal buttons. --- src/common-components/modal/modal.vue | 8 +++++++- src/ux-components/button-main/button-main.vue | 11 +++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/common-components/modal/modal.vue b/src/common-components/modal/modal.vue index aa88fe9ea..9a8e6c211 100644 --- a/src/common-components/modal/modal.vue +++ b/src/common-components/modal/modal.vue @@ -25,7 +25,7 @@ @@ -60,6 +60,12 @@ export default { return this.getCmsContent(this.cmsWidgetName, "FooterText"); }, }, + mounted() { + const modal = document.querySelector("#" + this.cmsWidgetName); + modal.addEventListener("hidden.bs.modal", (event) => { + this.$refs.buttonMain.resetButtonStyle(); + }); + }, components: { buttonMain, }, diff --git a/src/ux-components/button-main/button-main.vue b/src/ux-components/button-main/button-main.vue index 47d608b5b..5c705f49d 100644 --- a/src/ux-components/button-main/button-main.vue +++ b/src/ux-components/button-main/button-main.vue @@ -1,7 +1,7 @@ @@ -28,6 +28,7 @@ export default { loaderColor: String, loaderPosition: String, isFloat: Boolean, + suppressLoader: Boolean, }, data() { return { @@ -50,6 +51,12 @@ export default { this.$emit("click-event"); } }, + resetButtonStyle() { + this.isLoaderDisplayed = false; + }, + }, + mounted() { + this.isLoaderDisplayed = false; }, components: { loader, From 39966abc9f05fa331ec9601265685293cd3e39ad Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Wed, 16 Nov 2022 10:23:32 -0500 Subject: [PATCH 3/8] Update unit test. --- src/common-components/modal/modal.spec.js | 16 ++++++++++++++++ src/common-components/modal/modal.vue | 1 + 2 files changed, 17 insertions(+) diff --git a/src/common-components/modal/modal.spec.js b/src/common-components/modal/modal.spec.js index 85472d6eb..2664accfa 100644 --- a/src/common-components/modal/modal.spec.js +++ b/src/common-components/modal/modal.spec.js @@ -6,6 +6,10 @@ describe("modal.vue", () => { // Act const wrapper = shallowMount(Modal, { mixins: [mockMixin], + props: { + cmsWidgetName: "test", + }, + attachTo: document.body, }); expect(wrapper.html()).toEqual(expect.stringContaining(mockCmsContent["HeaderText"])); }); @@ -14,6 +18,10 @@ describe("modal.vue", () => { // Act const wrapper = shallowMount(Modal, { mixins: [mockMixin], + props: { + cmsWidgetName: "test", + }, + attachTo: document.body, }); expect(wrapper.html()).toEqual(expect.stringContaining(mockCmsContent["SubheaderText"])); }); @@ -22,6 +30,10 @@ describe("modal.vue", () => { // Act const wrapper = shallowMount(Modal, { mixins: [mockMixin], + props: { + cmsWidgetName: "test", + }, + attachTo: document.body, }); expect(wrapper.html()).toEqual(expect.stringContaining(mockCmsContent["Image"])); }); @@ -30,6 +42,10 @@ describe("modal.vue", () => { // Act const wrapper = shallowMount(Modal, { mixins: [mockMixin], + props: { + cmsWidgetName: "test", + }, + attachTo: document.body, }); expect(wrapper.html()).toEqual(expect.stringContaining(mockCmsContent["BodyText"])); }); diff --git a/src/common-components/modal/modal.vue b/src/common-components/modal/modal.vue index 9a8e6c211..d28e87bdd 100644 --- a/src/common-components/modal/modal.vue +++ b/src/common-components/modal/modal.vue @@ -61,6 +61,7 @@ export default { }, }, mounted() { + console.log("#1", document); const modal = document.querySelector("#" + this.cmsWidgetName); modal.addEventListener("hidden.bs.modal", (event) => { this.$refs.buttonMain.resetButtonStyle(); From daab9909421da0c698467be8376115611930a877 Mon Sep 17 00:00:00 2001 From: Katie Date: Wed, 16 Nov 2022 15:08:26 -0500 Subject: [PATCH 4/8] CSR-748 Update navigation-scenarios --- .../questions-page-layout.vue | 10 ++- .../address-lookup/address-lookup.spec.js | 4 +- src/layouts/address-lookup/address-lookup.vue | 4 +- .../capability-questions.vue | 2 +- src/layouts/estimate/estimate.vue | 2 +- .../molding-questions/molding-questions.vue | 2 +- src/layouts/part-questions/part-questions.vue | 2 +- src/layouts/quote/quote.vue | 2 +- .../vehicle-parts/vehicle-parts.spec.js | 2 +- src/layouts/vehicle-parts/vehicle-parts.vue | 2 +- src/layouts/vin-lookup/vin-lookup.spec.js | 2 +- src/layouts/vin-lookup/vin-lookup.vue | 2 +- src/mixins/vehicle-questions-mixin.js | 13 ++-- src/mixins/vehicle-questions-mixin.spec.js | 22 +++--- .../router-constants/navigation-scenarios.js | 30 ++++---- src/router/router-constants/routing-table.js | 68 +++++++++---------- 16 files changed, 91 insertions(+), 78 deletions(-) diff --git a/src/common-components/questions-page-layout/questions-page-layout.vue b/src/common-components/questions-page-layout/questions-page-layout.vue index f544fef53..b8411c755 100644 --- a/src/common-components/questions-page-layout/questions-page-layout.vue +++ b/src/common-components/questions-page-layout/questions-page-layout.vue @@ -1,5 +1,6 @@ diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index 50e9bd3fe..292a4bb0b 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -196,7 +196,7 @@ export default { this.displayNonServiceableZipAlert = false; return this.$router.navigateWithSaving( - this.navigationScenarios.HAS_NO_QUESTIONS, + this.navigationScenarios.CLICKED_FORWARD_WITH_NO_QUESTIONS , this.$route ); } diff --git a/src/layouts/molding-questions/molding-questions.vue b/src/layouts/molding-questions/molding-questions.vue index d7d0b0371..1efd0a795 100644 --- a/src/layouts/molding-questions/molding-questions.vue +++ b/src/layouts/molding-questions/molding-questions.vue @@ -9,7 +9,7 @@ :validationRules="questions - required" v-model="selectedAnswers" @forwardButtonAction="forwardButtonAction" - @backButtonAction="backButtonAction" + @back-click="navigateBack" :index="currentGlassIndex" /> diff --git a/src/layouts/part-questions/part-questions.vue b/src/layouts/part-questions/part-questions.vue index f370dde93..068a38b9f 100644 --- a/src/layouts/part-questions/part-questions.vue +++ b/src/layouts/part-questions/part-questions.vue @@ -9,7 +9,7 @@ :validationRules="questions - required" v-model="selectedAnswers" @forwardButtonAction="forwardButtonAction" - @backButtonAction="backButtonAction" + @back-click="navigateBack" :index="currentGlassIndex" /> diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index 43f24ae82..768826c27 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -157,7 +157,7 @@ export default { } }, backButtonAction() { - vehicleQuestionsMixin.methods.backButtonAction(this); + vehicleQuestionsMixin.methods.navigateBack(this); }, }, components: { diff --git a/src/layouts/vehicle-parts/vehicle-parts.spec.js b/src/layouts/vehicle-parts/vehicle-parts.spec.js index 064b0091c..74028e69f 100644 --- a/src/layouts/vehicle-parts/vehicle-parts.spec.js +++ b/src/layouts/vehicle-parts/vehicle-parts.spec.js @@ -497,7 +497,7 @@ describe("vehicle-parts.vue", () => { // TODO KO UNCOMMENT FOR QUOTE PAGES RELEASE // expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledWith( - // navigationScenarios.HAS_NO_MORE_QUESTIONS, + // navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS, // { query: { fmgPage: "vehicle-parts" } } // ); }); diff --git a/src/layouts/vehicle-parts/vehicle-parts.vue b/src/layouts/vehicle-parts/vehicle-parts.vue index 18a076b70..c3f06b645 100644 --- a/src/layouts/vehicle-parts/vehicle-parts.vue +++ b/src/layouts/vehicle-parts/vehicle-parts.vue @@ -35,7 +35,7 @@ ref="funnelFooter" :isForwardActionDisabled="isForwardActionDisabled" @tempButtonClicked="() => handleTempButtonClicked(this)" - @back-clicked="backButtonAction" + @back-click="navigateBack" @ForwardClicked="forwardButtonAction" /> diff --git a/src/layouts/vin-lookup/vin-lookup.spec.js b/src/layouts/vin-lookup/vin-lookup.spec.js index ba1343d7c..aca1b99c2 100644 --- a/src/layouts/vin-lookup/vin-lookup.spec.js +++ b/src/layouts/vin-lookup/vin-lookup.spec.js @@ -168,7 +168,7 @@ describe("vin-lookup.vue", () => { //Assert expect(wrapper.vm.$router.navigateWithSaving).toBeCalledTimes(1); expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledWith( - navigationScenarios.SELECTED_VIN_HAS_MISMATCHED_GLASS, + navigationScenarios.SELECTED_VIN_WITH_MISMATCHED_GLASS, wrapper.vm.$route, expect.anything(), expect.anything() diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index 3a52453b2..1548a74dc 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -368,7 +368,7 @@ export default { async navigateForward() { if (this.isCarIdDifferent && !this.isSelectedGlassAvailableForVehicle) { this.$router.navigateWithSaving( - this.navigationScenarios.SELECTED_VIN_HAS_MISMATCHED_GLASS, + this.navigationScenarios.SELECTED_VIN_WITH_MISMATCHED_GLASS, this.$route, {}, { [routerParams.DISPLAY_VEHICLE_CHANGE_ALERT]: true } diff --git a/src/mixins/vehicle-questions-mixin.js b/src/mixins/vehicle-questions-mixin.js index 0a3ce43f9..d90f5c0b6 100644 --- a/src/mixins/vehicle-questions-mixin.js +++ b/src/mixins/vehicle-questions-mixin.js @@ -378,7 +378,7 @@ export default { this.currentPageComesBeforePage(currentPage, fmgPageValues.PART_QUESTIONS) ) { self.$router.navigateWithSaving( - self.navigationScenarios.HAS_PART_QUESTIONS, + self.navigationScenarios.CLICKED_FORWARD_WITH_PART_QUESTIONS, self.$route, {}, {}, @@ -391,7 +391,7 @@ export default { // if multiple parts on any glass // go to vehicle-parts page and pass the partsData self.$router.navigateWithSaving( - self.navigationScenarios.HAS_MULTIPLE_PARTS_TO_CHOOSE, + self.navigationScenarios.CLICKED_FORWARD_WITH_MULTIPLE_PARTS_TO_CHOOSE, self.$route, {}, {}, @@ -404,7 +404,7 @@ export default { // if any childpart questions // go to molding-questions page and pass the partsData self.$router.navigateWithSaving( - self.navigationScenarios.HAS_MOLDING_QUESTIONS, + self.navigationScenarios.CLICKED_FORWARD_WITH_MOLDING_QUESTIONS, self.$route, {}, {}, @@ -444,7 +444,7 @@ export default { } self.$router.navigateWithSaving( - self.navigationScenarios.HAS_CAPABILITY_QUESTIONS, + self.navigationScenarios.CLICKED_FORWARD_WITH_CAPABILITY_QUESTIONS, self.$route, {}, {}, @@ -460,13 +460,14 @@ export default { shouldGoToHeritageQuote ? navigateToHeritageFunnel() : self.$router.navigateWithSaving( - self.navigationScenarios.HAS_NO_MORE_QUESTIONS, + self.navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS, self.$route ); } }, // Can't use `this` because navigateForward is also called from quote - backButtonAction(vm) { + navigateBack(vm) { + console.log("HIIII") const self = vm ?? this; const partsOrQuestions = ( self.$store.getters.pageData(fmgPageValues.PART_QUESTIONS) ?? diff --git a/src/mixins/vehicle-questions-mixin.spec.js b/src/mixins/vehicle-questions-mixin.spec.js index a156a0c66..5ab49bc1f 100644 --- a/src/mixins/vehicle-questions-mixin.spec.js +++ b/src/mixins/vehicle-questions-mixin.spec.js @@ -1261,7 +1261,7 @@ describe("vehicle-questions-mixin", () => { // Assert expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledTimes(1); expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledWith( - navigationScenarios.HAS_PART_QUESTIONS, + navigationScenarios.CLICKED_FORWARD_WITH_PART_QUESTIONS, wrapper.vm.$route, {}, {}, @@ -1376,7 +1376,7 @@ describe("vehicle-questions-mixin", () => { // Assert expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledTimes(1); expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledWith( - navigationScenarios.HAS_PART_QUESTIONS, + navigationScenarios.CLICKED_FORWARD_WITH_PART_QUESTIONS, wrapper.vm.$route, {}, {}, @@ -1483,7 +1483,7 @@ describe("vehicle-questions-mixin", () => { // Assert expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledTimes(1); expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledWith( - navigationScenarios.HAS_PART_QUESTIONS, + navigationScenarios.CLICKED_FORWARD_WITH_PART_QUESTIONS, wrapper.vm.$route, {}, {}, @@ -1638,7 +1638,7 @@ describe("vehicle-questions-mixin", () => { // Assert expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledTimes(1); expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledWith( - navigationScenarios.HAS_PART_QUESTIONS, + navigationScenarios.CLICKED_FORWARD_WITH_PART_QUESTIONS, wrapper.vm.$route, {}, {}, @@ -1686,7 +1686,7 @@ describe("vehicle-questions-mixin", () => { // Assert expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledTimes(1); expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledWith( - navigationScenarios.HAS_MULTIPLE_PARTS_TO_CHOOSE, + navigationScenarios.CLICKED_FORWARD_WITH_MULTIPLE_PARTS_TO_CHOOSE, wrapper.vm.$route, {}, {}, @@ -1798,7 +1798,7 @@ describe("vehicle-questions-mixin", () => { // Assert expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledTimes(1); expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledWith( - navigationScenarios.HAS_MULTIPLE_PARTS_TO_CHOOSE, + navigationScenarios.CLICKED_FORWARD_WITH_MULTIPLE_PARTS_TO_CHOOSE, wrapper.vm.$route, {}, {}, @@ -1976,7 +1976,7 @@ describe("vehicle-questions-mixin", () => { // Assert expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledTimes(1); expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledWith( - navigationScenarios.HAS_MULTIPLE_PARTS_TO_CHOOSE, + navigationScenarios.CLICKED_FORWARD_WITH_MULTIPLE_PARTS_TO_CHOOSE, wrapper.vm.$route, {}, {}, @@ -2035,7 +2035,7 @@ describe("vehicle-questions-mixin", () => { // Assert expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledTimes(1); expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledWith( - navigationScenarios.HAS_MOLDING_QUESTIONS, + navigationScenarios.CLICKED_FORWARD_WITH_MOLDING_QUESTIONS, wrapper.vm.$route, {}, {}, @@ -2077,7 +2077,7 @@ describe("vehicle-questions-mixin", () => { // Assert expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledTimes(1); expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledWith( - navigationScenarios.HAS_CAPABILITY_QUESTIONS, + navigationScenarios.CLICKED_FORWARD_WITH_CAPABILITY_QUESTIONS, wrapper.vm.$route, {}, {}, @@ -2124,7 +2124,7 @@ describe("vehicle-questions-mixin", () => { // Assert expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledTimes(1); expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledWith( - navigationScenarios.HAS_NO_MORE_QUESTIONS, + navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS, { query: { fmgPage: "vin-lookup" } } ); expect(wrapper.vm.$router.navigateWithoutSaving).not.toHaveBeenCalled(); @@ -2235,7 +2235,7 @@ describe("vehicle-questions-mixin", () => { ); expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledTimes(1); expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledWith( - navigationScenarios.HAS_NO_MORE_QUESTIONS, + navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS, { query: { fmgPage: "vin-lookup" } } ); expect(wrapper.vm.$router.navigateWithoutSaving).not.toHaveBeenCalled(); diff --git a/src/router/router-constants/navigation-scenarios.js b/src/router/router-constants/navigation-scenarios.js index bf7a6a052..6a1adf5da 100644 --- a/src/router/router-constants/navigation-scenarios.js +++ b/src/router/router-constants/navigation-scenarios.js @@ -1,3 +1,11 @@ +/** + * We want to name these to describe the scenario rather than what page(s) they're used on. + * + * Naming convention: [PAST_TENSE_VERB]_[DESCRIPTOR_OF_STATE] + * ex: Rather than "HAS_PART_QUESTIONS", we might name the + * scenario "CLICKED_FORWARD_WITH_PART_QUESTIONS" + */ + const navigationScenarios = { // General CLICKED_BACK: "CLICKED_BACK", @@ -9,29 +17,27 @@ const navigationScenarios = { SELECTED_MAKE: "SELECTED_MAKE", SELECTED_STYLE: "SELECTED_STYLE", - // Vin pages + // Vin selection CLICKED_BACK_WITH_VIN: "CLICKED_BACK_WITH_VIN", CLICKED_FORWARD_WITH_VIN: "CLICKED_FORWARD_WITH_VIN", CLICKED_FORWARD_WITHOUT_VIN: "CLICKED_FORWARD_WITHOUT_VIN", - CONTINUING_WITH_MULTIPLE_VEHICLES: "CONTINUING_WITH_MULTIPLE_VEHICLES", - SELECTED_VIN_HAS_MISMATCHED_GLASS: "SELECTED_VIN_HAS_MISMATCHED_GLASS", + CLICKED_FORWARD_WITH_MULTIPLE_VEHICLES: "CLICKED_FORWARD_WITH_MULTIPLE_VEHICLES", + SELECTED_VIN_WITH_MISMATCHED_GLASS: "SELECTED_VIN_WITH_MISMATCHED_GLASS", SELECTED_MANUAL_VIN: "SELECTED_MANUAL_VIN", SELECTED_LICENSE_PLATE: "SELECTED_LICENSE_PLATE", SELECTED_HOME_ADDRESS: "SELECTED_HOME_ADDRESS", - HAS_NO_QUESTIONS: "HAS_NO_QUESTIONS", + CLICKED_FORWARD_WITH_NO_QUESTIONS: "CLICKED_FORWARD_WITH_NO_QUESTIONS", - // Question pages - HAS_PART_QUESTIONS: "HAS_PART_QUESTIONS", - HAS_MULTIPLE_PARTS_TO_CHOOSE: "HAS_MULTIPLE_PARTS_TO_CHOOSE", - HAS_MOLDING_QUESTIONS: "HAS_MOLDING_QUESTIONS", - HAS_CAPABILITY_QUESTIONS: "HAS_CAPABILITY_QUESTIONS", - HAS_NO_MORE_QUESTIONS: "HAS_NO_MORE_QUESTIONS", + // Part selection + CLICKED_FORWARD_WITH_PART_QUESTIONS: "CLICKED_FORWARD_WITH_PART_QUESTIONS", + CLICKED_FORWARD_WITH_MULTIPLE_PARTS_TO_CHOOSE: "CLICKED_FORWARD_WITH_MULTIPLE_PARTS_TO_CHOOSE", + CLICKED_FORWARD_WITH_MOLDING_QUESTIONS: "CLICKED_FORWARD_WITH_MOLDING_QUESTIONS", + CLICKED_FORWARD_WITH_CAPABILITY_QUESTIONS: "CLICKED_FORWARD_WITH_CAPABILITY_QUESTIONS", + CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS: "CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS", CLICKED_BACK_WITH_PART_QUESTIONS: "CLICKED_BACK_WITH_PART_QUESTIONS", CLICKED_BACK_WITH_MULTIPLE_PARTS_TO_CHOOSE: "CLICKED_BACK_WITH_MULTIPLE_PARTS_TO_CHOOSE", CLICKED_BACK_WITH_MOLDING_QUESTIONS: "CLICKED_BACK_WITH_MOLDING_QUESTIONS", CLICKED_BACK_WITH_CAPABILITY_QUESTIONS: "CLICKED_BACK_WITH_CAPABILITY_QUESTIONS", - - // Quote CLICKED_BACK_WITH_VIN_AND_NO_MORE_QUESTIONS: "CLICKED_BACK_WITH_VIN_AND_NO_MORE_QUESTIONS", CLICKED_BACK_WITH_NO_VIN_NOR_QUESTIONS: "CLICKED_BACK_WITH_NO_VIN_NOR_QUESTIONS", }; diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index 5c76ef5e1..c991087d0 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -86,7 +86,7 @@ const routingTable = function (store) { destinationFmgPageValue: fmgPageValues.ESTIMATE, }, { - scenario: navigationScenarios.SELECTED_VIN_HAS_MISMATCHED_GLASS, + scenario: navigationScenarios.SELECTED_VIN_WITH_MISMATCHED_GLASS, destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE, }, { @@ -94,23 +94,23 @@ const routingTable = function (store) { destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE, }, { - scenario: navigationScenarios.HAS_PART_QUESTIONS, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_PART_QUESTIONS, destinationFmgPageValue: fmgPageValues.PART_QUESTIONS, }, { - scenario: navigationScenarios.HAS_MULTIPLE_PARTS_TO_CHOOSE, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_MULTIPLE_PARTS_TO_CHOOSE, destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS, }, { - scenario: navigationScenarios.HAS_MOLDING_QUESTIONS, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_MOLDING_QUESTIONS, destinationFmgPageValue: fmgPageValues.MOLDING_QUESTIONS, }, { - scenario: navigationScenarios.HAS_CAPABILITY_QUESTIONS, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_CAPABILITY_QUESTIONS, destinationFmgPageValue: fmgPageValues.CAPABILITY_QUESTIONS, }, { - scenario: navigationScenarios.HAS_NO_MORE_QUESTIONS, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS, destinationFmgPageValue: fmgPageValues.QUOTE, }, ], @@ -127,23 +127,23 @@ const routingTable = function (store) { destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE, }, { - scenario: navigationScenarios.HAS_PART_QUESTIONS, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_PART_QUESTIONS, destinationFmgPageValue: fmgPageValues.PART_QUESTIONS, }, { - scenario: navigationScenarios.HAS_MULTIPLE_PARTS_TO_CHOOSE, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_MULTIPLE_PARTS_TO_CHOOSE, destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS, }, { - scenario: navigationScenarios.HAS_MOLDING_QUESTIONS, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_MOLDING_QUESTIONS, destinationFmgPageValue: fmgPageValues.MOLDING_QUESTIONS, }, { - scenario: navigationScenarios.HAS_CAPABILITY_QUESTIONS, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_CAPABILITY_QUESTIONS, destinationFmgPageValue: fmgPageValues.CAPABILITY_QUESTIONS, }, { - scenario: navigationScenarios.HAS_NO_MORE_QUESTIONS, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS, destinationFmgPageValue: fmgPageValues.QUOTE, }, ], @@ -156,31 +156,31 @@ const routingTable = function (store) { destinationFmgPageValue: fmgPageValues.ESTIMATE, }, { - scenario: navigationScenarios.CONTINUING_WITH_MULTIPLE_VEHICLES, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_MULTIPLE_VEHICLES, destinationFmgPageValue: fmgPageValues.ADDRESS_VEHICLES, }, { - scenario: navigationScenarios.SELECTED_VIN_HAS_MISMATCHED_GLASS, + scenario: navigationScenarios.SELECTED_VIN_WITH_MISMATCHED_GLASS, destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE, }, { - scenario: navigationScenarios.HAS_PART_QUESTIONS, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_PART_QUESTIONS, destinationFmgPageValue: fmgPageValues.PART_QUESTIONS, }, { - scenario: navigationScenarios.HAS_MULTIPLE_PARTS_TO_CHOOSE, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_MULTIPLE_PARTS_TO_CHOOSE, destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS, }, { - scenario: navigationScenarios.HAS_MOLDING_QUESTIONS, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_MOLDING_QUESTIONS, destinationFmgPageValue: fmgPageValues.MOLDING_QUESTIONS, }, { - scenario: navigationScenarios.HAS_CAPABILITY_QUESTIONS, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_CAPABILITY_QUESTIONS, destinationFmgPageValue: fmgPageValues.CAPABILITY_QUESTIONS, }, { - scenario: navigationScenarios.HAS_NO_MORE_QUESTIONS, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS, destinationFmgPageValue: fmgPageValues.QUOTE, }, ], @@ -197,23 +197,23 @@ const routingTable = function (store) { destinationFmgPageValue: fmgPageValues.VEHICLE_DAMAGE, }, { - scenario: navigationScenarios.HAS_PART_QUESTIONS, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_PART_QUESTIONS, destinationFmgPageValue: fmgPageValues.PART_QUESTIONS, }, { - scenario: navigationScenarios.HAS_MULTIPLE_PARTS_TO_CHOOSE, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_MULTIPLE_PARTS_TO_CHOOSE, destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS, }, { - scenario: navigationScenarios.HAS_MOLDING_QUESTIONS, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_MOLDING_QUESTIONS, destinationFmgPageValue: fmgPageValues.MOLDING_QUESTIONS, }, { - scenario: navigationScenarios.HAS_CAPABILITY_QUESTIONS, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_CAPABILITY_QUESTIONS, destinationFmgPageValue: fmgPageValues.CAPABILITY_QUESTIONS, }, { - scenario: navigationScenarios.HAS_NO_MORE_QUESTIONS, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS, destinationFmgPageValue: fmgPageValues.QUOTE, }, ], @@ -238,7 +238,7 @@ const routingTable = function (store) { destinationFmgPageValue: fmgPageValues.ADDRESS_LOOKUP, }, { - scenario: navigationScenarios.HAS_NO_QUESTIONS, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_QUESTIONS , destinationFmgPageValue: fmgPageValues.QUOTE, }, ], @@ -255,19 +255,19 @@ const routingTable = function (store) { destinationFmgPageValue: fmgPageValues.ESTIMATE, }, { - scenario: navigationScenarios.HAS_MULTIPLE_PARTS_TO_CHOOSE, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_MULTIPLE_PARTS_TO_CHOOSE, destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS, }, { - scenario: navigationScenarios.HAS_MOLDING_QUESTIONS, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_MOLDING_QUESTIONS, destinationFmgPageValue: fmgPageValues.MOLDING_QUESTIONS, }, { - scenario: navigationScenarios.HAS_CAPABILITY_QUESTIONS, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_CAPABILITY_QUESTIONS, destinationFmgPageValue: fmgPageValues.CAPABILITY_QUESTIONS, }, { - scenario: navigationScenarios.HAS_NO_MORE_QUESTIONS, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS, destinationFmgPageValue: fmgPageValues.QUOTE, }, ], @@ -292,15 +292,15 @@ const routingTable = function (store) { destinationFmgPageValue: fmgPageValues.ESTIMATE, }, { - scenario: navigationScenarios.HAS_MOLDING_QUESTIONS, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_MOLDING_QUESTIONS, destinationFmgPageValue: fmgPageValues.MOLDING_QUESTIONS, }, { - scenario: navigationScenarios.HAS_CAPABILITY_QUESTIONS, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_CAPABILITY_QUESTIONS, destinationFmgPageValue: fmgPageValues.CAPABILITY_QUESTIONS, }, { - scenario: navigationScenarios.HAS_NO_MORE_QUESTIONS, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS, destinationFmgPageValue: fmgPageValues.QUOTE, }, ], @@ -325,11 +325,11 @@ const routingTable = function (store) { destinationFmgPageValue: fmgPageValues.VEHICLE_PARTS, }, { - scenario: navigationScenarios.HAS_CAPABILITY_QUESTIONS, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_CAPABILITY_QUESTIONS, destinationFmgPageValue: fmgPageValues.CAPABILITY_QUESTIONS, }, { - scenario: navigationScenarios.HAS_NO_MORE_QUESTIONS, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS, destinationFmgPageValue: fmgPageValues.QUOTE, }, ], @@ -358,7 +358,7 @@ const routingTable = function (store) { destinationFmgPageValue: fmgPageValues.MOLDING_QUESTIONS, }, { - scenario: navigationScenarios.HAS_NO_MORE_QUESTIONS, + scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_MORE_QUESTIONS, destinationFmgPageValue: fmgPageValues.QUOTE, }, ], From 4ec3cfb1b936319a8a73d1b4384f254c9799e83e Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Wed, 16 Nov 2022 19:58:48 -0500 Subject: [PATCH 5/8] Move text align to label from input. --- src/common-components/textbox-question/textbox-question.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common-components/textbox-question/textbox-question.vue b/src/common-components/textbox-question/textbox-question.vue index 05d17dcd4..8d08243b7 100644 --- a/src/common-components/textbox-question/textbox-question.vue +++ b/src/common-components/textbox-question/textbox-question.vue @@ -4,6 +4,7 @@ :for="inputId" :aria-label="questionText" class="form-label" + :class="[questionAlignment === 'center' ? 'text-center w-100' : '']" v-html="labelText">
Date: Wed, 16 Nov 2022 20:00:39 -0500 Subject: [PATCH 6/8] Remove errant console.log. --- src/common-components/modal/modal.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/common-components/modal/modal.vue b/src/common-components/modal/modal.vue index d28e87bdd..9a8e6c211 100644 --- a/src/common-components/modal/modal.vue +++ b/src/common-components/modal/modal.vue @@ -61,7 +61,6 @@ export default { }, }, mounted() { - console.log("#1", document); const modal = document.querySelector("#" + this.cmsWidgetName); modal.addEventListener("hidden.bs.modal", (event) => { this.$refs.buttonMain.resetButtonStyle(); From 33f58fda6d20fe6224e3060360d74a7548028e98 Mon Sep 17 00:00:00 2001 From: Katie Date: Wed, 16 Nov 2022 23:53:10 -0500 Subject: [PATCH 7/8] CSR-748 Fix tests and format --- src/layouts/estimate/estimate.vue | 2 +- src/layouts/vehicle-parts/vehicle-parts.spec.js | 8 ++++---- src/mixins/vehicle-questions-mixin.js | 1 - src/mixins/vehicle-questions-mixin.spec.js | 12 ++++++------ src/router/router-constants/routing-table.js | 2 +- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/layouts/estimate/estimate.vue b/src/layouts/estimate/estimate.vue index 292a4bb0b..523e0b103 100644 --- a/src/layouts/estimate/estimate.vue +++ b/src/layouts/estimate/estimate.vue @@ -196,7 +196,7 @@ export default { this.displayNonServiceableZipAlert = false; return this.$router.navigateWithSaving( - this.navigationScenarios.CLICKED_FORWARD_WITH_NO_QUESTIONS , + this.navigationScenarios.CLICKED_FORWARD_WITH_NO_QUESTIONS, this.$route ); } diff --git a/src/layouts/vehicle-parts/vehicle-parts.spec.js b/src/layouts/vehicle-parts/vehicle-parts.spec.js index 74028e69f..66b8996e7 100644 --- a/src/layouts/vehicle-parts/vehicle-parts.spec.js +++ b/src/layouts/vehicle-parts/vehicle-parts.spec.js @@ -196,7 +196,7 @@ describe("vehicle-parts.vue", () => { }); }); - test("User had part questions > BackButtonAction triggers a router.navigateWithoutSaving change with correct scenario", async () => { + test("User had part questions > navigateBack triggers a router.navigateWithoutSaving change with correct scenario", async () => { //Arrange const { wrapper } = setupMocks({ mountOptionsMockData: { @@ -248,7 +248,7 @@ describe("vehicle-parts.vue", () => { (c) => c(wrapper.vm) ); - wrapper.vm.backButtonAction(); + wrapper.vm.navigateBack(); //Assert expect(wrapper.vm.$router.navigateWithoutSaving).toHaveBeenCalledWith( @@ -257,7 +257,7 @@ describe("vehicle-parts.vue", () => { ); }); - test("User did not have part questions > BackButtonAction triggers a router.navigateWithoutSaving change with correct scenario", async () => { + test("User did not have part questions > navigateBack triggers a router.navigateWithoutSaving change with correct scenario", async () => { //Arrange const { wrapper } = setupMocks({ mountOptionsMockData: { @@ -294,7 +294,7 @@ describe("vehicle-parts.vue", () => { (c) => c(wrapper.vm) ); - wrapper.vm.backButtonAction(); + wrapper.vm.navigateBack(); //Assert expect(wrapper.vm.$router.navigateWithoutSaving).toHaveBeenCalledWith( diff --git a/src/mixins/vehicle-questions-mixin.js b/src/mixins/vehicle-questions-mixin.js index d90f5c0b6..0f8c73a88 100644 --- a/src/mixins/vehicle-questions-mixin.js +++ b/src/mixins/vehicle-questions-mixin.js @@ -467,7 +467,6 @@ export default { }, // Can't use `this` because navigateForward is also called from quote navigateBack(vm) { - console.log("HIIII") const self = vm ?? this; const partsOrQuestions = ( self.$store.getters.pageData(fmgPageValues.PART_QUESTIONS) ?? diff --git a/src/mixins/vehicle-questions-mixin.spec.js b/src/mixins/vehicle-questions-mixin.spec.js index 5ab49bc1f..4bfa9285c 100644 --- a/src/mixins/vehicle-questions-mixin.spec.js +++ b/src/mixins/vehicle-questions-mixin.spec.js @@ -2243,7 +2243,7 @@ describe("vehicle-questions-mixin", () => { }); }); - describe("backButtonAction", () => { + describe("navigateBack", () => { // TODO KO test.todo( "current page is quote, there are no questions, and we don't have their vin => go to estimate" @@ -2254,7 +2254,7 @@ describe("vehicle-questions-mixin", () => { const { wrapper } = setupMocks({ fmgPage: fmgPageValues.QUOTE, hasVin: true }); // Act - wrapper.vm.backButtonAction(); + wrapper.vm.navigateBack(); // Assert expect(wrapper.vm.$router.navigateWithoutSaving).toHaveBeenCalledWith( @@ -2269,7 +2269,7 @@ describe("vehicle-questions-mixin", () => { wrapper.vm.hasCapabilityQuestions = jest.fn().mockReturnValue(true); // Act - wrapper.vm.backButtonAction(); + wrapper.vm.navigateBack(); // Assert expect(wrapper.vm.$router.navigateWithoutSaving).toHaveBeenCalledWith( @@ -2285,7 +2285,7 @@ describe("vehicle-questions-mixin", () => { wrapper.vm.hasChildPartQuestions = jest.fn().mockReturnValue(true); // Act - wrapper.vm.backButtonAction(); + wrapper.vm.navigateBack(); // Assert expect(wrapper.vm.$router.navigateWithoutSaving).toHaveBeenCalledWith( @@ -2303,7 +2303,7 @@ describe("vehicle-questions-mixin", () => { wrapper.vm.hasCapabilityQuestions = jest.fn().mockReturnValue(true); // Act - wrapper.vm.backButtonAction(); + wrapper.vm.navigateBack(); // Assert expect(wrapper.vm.$router.navigateWithoutSaving).toHaveBeenCalledWith( @@ -2321,7 +2321,7 @@ describe("vehicle-questions-mixin", () => { wrapper.vm.hasCapabilityQuestions = jest.fn().mockReturnValue(true); // Act - wrapper.vm.backButtonAction(); + wrapper.vm.navigateBack(); // Assert expect(wrapper.vm.$router.navigateWithoutSaving).toHaveBeenCalledWith( diff --git a/src/router/router-constants/routing-table.js b/src/router/router-constants/routing-table.js index c991087d0..1c060b082 100644 --- a/src/router/router-constants/routing-table.js +++ b/src/router/router-constants/routing-table.js @@ -238,7 +238,7 @@ const routingTable = function (store) { destinationFmgPageValue: fmgPageValues.ADDRESS_LOOKUP, }, { - scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_QUESTIONS , + scenario: navigationScenarios.CLICKED_FORWARD_WITH_NO_QUESTIONS, destinationFmgPageValue: fmgPageValues.QUOTE, }, ], From 1f73c1fe1cdb885a0009f20fb415fc3922097ccc Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Thu, 17 Nov 2022 08:05:31 -0500 Subject: [PATCH 8/8] Update spacing to match Figma. --- src/common-components/textbox-question/textbox-question.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common-components/textbox-question/textbox-question.vue b/src/common-components/textbox-question/textbox-question.vue index 8d08243b7..1d8540075 100644 --- a/src/common-components/textbox-question/textbox-question.vue +++ b/src/common-components/textbox-question/textbox-question.vue @@ -4,7 +4,7 @@ :for="inputId" :aria-label="questionText" class="form-label" - :class="[questionAlignment === 'center' ? 'text-center w-100' : '']" + :class="[questionAlignment === 'center' ? 'text-center w-100 mb-5' : '']" v-html="labelText">