CASH-1524: WIP

This commit is contained in:
credelinghuys 2026-07-24 16:12:22 -04:00
parent e986fc5a3c
commit bfbfb24033
9 changed files with 16 additions and 8 deletions

View file

@ -9,7 +9,11 @@ export function isPhoneContactMethod(contactMethod) {
return contactMethod === saveProgressPopupContactMethods.PHONE;
}
export function hasSaveProgressContactInStore(customer = {}) {
export function hasSaveProgressContactInStore(customer) {
if (!customer) {
return false;
}
const hasEmail = Boolean(customer.emailAddress?.length > 0);
const hasPhone = Boolean(customer.phoneNumber?.length > 0);

View file

@ -21,6 +21,10 @@ describe("save-progress-popup-contact-helper", () => {
expect(hasSaveProgressContactInStore({ phoneNumber: "5551234567" })).toBe(true);
});
it("should return false when customer is undefined", () => {
expect(hasSaveProgressContactInStore(undefined)).toBe(false);
});
it("should return false when neither email nor phone is saved", () => {
expect(hasSaveProgressContactInStore({})).toBe(false);
expect(hasSaveProgressContactInStore({ emailAddress: "", phoneNumber: null })).toBe(

View file

@ -63,7 +63,7 @@ export default {
// Call the "next" function to complete the transition to this page.
next(async (vm) => {
vm.setCmsContent(resultMap.cmsContent);
vm.showSaveProgressModal = !hasSaveProgressContactInStore(store.getters.order.customer);
vm.showSaveProgressModal = !hasSaveProgressContactInStore(store.getters.order?.customer);
if (store.getters.externalParameterState?.isExternalParameter) {
if (store.getters.externalParameterServiceZip.zipCode) {
await baseMixin.methods.dispatchStoreAction(

View file

@ -143,7 +143,7 @@ export default {
}
const resultMap = await settleAllPromises(promiseResultMap);
const showSaveProgressModal = !hasSaveProgressContactInStore(store.getters.order.customer);
const showSaveProgressModal = !hasSaveProgressContactInStore(store.getters.order?.customer);
next((vm) => {
vm.setCmsContent(resultMap.cmsContent);
vm.clientConfig = resultMap.clientConfig ?? {};

View file

@ -224,7 +224,7 @@ export default {
},
];
const resultMap = await settleAllPromises(promiseResultMap);
const showSaveProgressModal = !hasSaveProgressContactInStore(store.getters.order.customer);
const showSaveProgressModal = !hasSaveProgressContactInStore(store.getters.order?.customer);
next((vm) => {
vm.setCmsContent(resultMap.cmsContent);
vm.showSaveProgressModal = showSaveProgressModal;

View file

@ -63,7 +63,7 @@ export default {
// Call the "next" function to complete the transition to this page.
next(async (vm) => {
vm.setCmsContent(resultMap.cmsContent);
vm.showSaveProgressModal = !hasSaveProgressContactInStore(store.getters.order.customer);
vm.showSaveProgressModal = !hasSaveProgressContactInStore(store.getters.order?.customer);
if (store.getters.externalParameterState?.isExternalParameter) {
if (store.getters.externalParameterServiceZip.zipCode) {
await baseMixin.methods.dispatchStoreAction(

View file

@ -63,7 +63,7 @@ export default {
// Call the "next" function to complete the transition to this page.
next(async (vm) => {
vm.setCmsContent(resultMap.cmsContent);
vm.showSaveProgressModal = !hasSaveProgressContactInStore(store.getters.order.customer);
vm.showSaveProgressModal = !hasSaveProgressContactInStore(store.getters.order?.customer);
if (store.getters.externalParameterState?.isExternalParameter) {
if (store.getters.externalParameterServiceZip.zipCode) {
const serviceState = store.getters.order.serviceLocation.state;

View file

@ -92,7 +92,7 @@ export default {
},
];
const resultMap = await settleAllPromises(promiseResultMap);
const showSaveProgressModal = !hasSaveProgressContactInStore(store.getters.order.customer);
const showSaveProgressModal = !hasSaveProgressContactInStore(store.getters.order?.customer);
next((vm) => {
vm.setCmsContent(resultMap.cmsContent);
vm.clientConfig = resultMap.clientConfig ?? {};

View file

@ -81,7 +81,7 @@ export default {
// Call the "next" function to complete the transition to this page.
next((vm) => {
vm.setCmsContent(resultMap.cmsContent);
vm.showSaveProgressModal = !hasSaveProgressContactInStore(store.getters.order.customer);
vm.showSaveProgressModal = !hasSaveProgressContactInStore(store.getters.order?.customer);
// Glass Part Question dynamic component
Object.keys(vm.$refs)