From ec9584135b6b443115623199e1aa8e6597727ce0 Mon Sep 17 00:00:00 2001 From: Leah Schumann Date: Wed, 2 Aug 2023 09:31:45 -0400 Subject: [PATCH] Persistence Code for Customer Details --- src/constants/store-actions.js | 1 + src/constants/store-mutations.js | 4 +- .../textarea-question/textarea-question.vue | 2 +- .../customer-details/customer-details.spec.js | 2 +- .../customer-details/customer-details.vue | 59 ++++++++++++++++--- src/store/index.js | 26 ++++---- 6 files changed, 73 insertions(+), 21 deletions(-) diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index 9d7d3ea6a..c2a297823 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -85,6 +85,7 @@ const storeActions = { "saveSupportingItemsSuppressingStateResetting", SAVE_VAPS: "saveVaps", SAVE_CUSTOMER_DETAILS: "saveCustomerDetails", + SAVE_SERVICE_LOCATION_TECH_NOTES: "saveServiceLocationTechNotes", }; export { storeActions }; diff --git a/src/constants/store-mutations.js b/src/constants/store-mutations.js index 76d510507..7b57187c2 100644 --- a/src/constants/store-mutations.js +++ b/src/constants/store-mutations.js @@ -34,11 +34,13 @@ const storeMutations = { UPDATE_SERVICE_ZIP: "updateServiceZip", UPDATE_SERVICE_LOCATION: "updateServiceLocation", + UPDATE_SERVICE_LOCATION_TECH_NOTES: "updateServiceLocationTechNotes", + UPDATE_TECH_NOTES: "updateTechNotes", UPDATE_SCHEDULE: "updateSchedule", UPDATE_CUSTOMER_EMAIL_ADDRESS: "updateCustomerEmailAddress", - //CUSTOMER MUTATIONS + // CUSTOMER MUTATIONS UPDATE_CUSTOMER_DETAILS: "updateCustomerDetails", // ORDER MUTATIONS diff --git a/src/digital-components/textarea-question/textarea-question.vue b/src/digital-components/textarea-question/textarea-question.vue index 0ffe5ec0a..83d718976 100644 --- a/src/digital-components/textarea-question/textarea-question.vue +++ b/src/digital-components/textarea-question/textarea-question.vue @@ -54,7 +54,7 @@ export default { }, }, remainingCount() { - return this.maxLength - this.value.length; + return this.maxLength - (this.value?.length ?? 0); }, urgentCountdown() { return this.remainingCount <= this.maxLength * 0.1 ? true : false; diff --git a/src/layouts/customer-details/customer-details.spec.js b/src/layouts/customer-details/customer-details.spec.js index af43c1930..450339f4c 100644 --- a/src/layouts/customer-details/customer-details.spec.js +++ b/src/layouts/customer-details/customer-details.spec.js @@ -36,7 +36,7 @@ describe("customer-details.vue", () => { await wrapper.vm.forwardButtonAction(); // Assert - expect(navigateToHeritage.navigateToHeritageFunnel).toHaveBeenCalled(); + expect(wrapper.vm.$router.navigateWithoutSaving).toHaveBeenCalled(); }); }); }); diff --git a/src/layouts/customer-details/customer-details.vue b/src/layouts/customer-details/customer-details.vue index 9a0d7e554..06694586a 100644 --- a/src/layouts/customer-details/customer-details.vue +++ b/src/layouts/customer-details/customer-details.vue @@ -32,7 +32,7 @@ + v-model="isSmsOptin" />