Move accountName logic to store getter, better required field search

This commit is contained in:
Alex Humphries 2026-03-24 17:28:26 -04:00
parent 7f565fb8cf
commit 6acefcb307
3 changed files with 8 additions and 12 deletions

View file

@ -64,14 +64,11 @@ export default {
modalSubHeaderText() {
return this.getCmsContent('ContinueReferralModalWidget', 'SubheaderText')
.replaceAll('{custom:mmFound}', this.getMakeModelString.toUpperCase());
},
accountName() {
return this.mainStore.issConfig.clientName.replaceAll(" ", "").replaceAll("&", "amp");
}
},
methods: {
openModal() {
this.pushEventToGA("existing_claim", "pop_up_displayed", this.accountName, true);
this.pushEventToGA("existing_claim", "pop_up_displayed", this.mainStore.accountNameForEvents, true);
this.$refs.continueModal.openModal();
},
setModalStatus(isOpened) {
@ -81,11 +78,11 @@ export default {
this.$refs.continueModal.closeModal();
},
continueReferral() {
this.pushEventToGA("existing_claim", "finish_claim", this.accountName, true);
this.pushEventToGA("existing_claim", "finish_claim", this.mainStore.accountNameForEvents, true);
this.$emit('continue-previous-referral');
},
startNewReferral() {
this.pushEventToGA("existing_claim", "start_new_claim", this.accountName, true);
this.pushEventToGA("existing_claim", "start_new_claim", this.mainStore.accountNameForEvents, true);
this.$emit('start-new-referral');
}
}

View file

@ -262,7 +262,8 @@ export default {
this.pushEventToGA("policy_info", "info_prefilled", isInfoPrefilled.toString(), true);
this.$nextTick(() => {
const requiredFieldCount = document.querySelectorAll('[aria-required="true"]').length;
const formRoot = this.$el;
const requiredFieldCount = formRoot.querySelectorAll('[aria-required="true"]').length;
this.pushEventToGA("policy_info", "required_fields", requiredFieldCount.toString(), true);
});
@ -279,7 +280,7 @@ export default {
this.pushEventToGA("visitor_info_welcome", "referring_site", "ClientSite", null);
}
this.pushEventToGA("visitor_info_welcome", "client_name", this.accountName, null);
this.pushEventToGA("visitor_info_welcome", "client_name", this.mainStore.accountNameForEvents, null);
},
computed: {
DamageCauseOptions() {
@ -329,9 +330,6 @@ export default {
},
phoneMask() {
return MaskaFormattedMasks.PHONE_NUMBER;
},
accountName() {
return this.mainStore.issConfig.clientName.replaceAll(" ", "").replaceAll("&", "amp");
}
},
methods: {

View file

@ -445,7 +445,8 @@ export const useMainStore = defineStore({
.map((x) => x.settings)
.reduce((r, c) => Object.assign(r, c), {}) ?? {},
originalDeductible: (state) => (state.order.damage.isRepair ? state.order.originalDeductible.repair : state.order.originalDeductible.replace),
currentDeductible: (state) => (state.order.damage.isRepair ? state.order.currentDeductible.repair : state.order.currentDeductible.replace)
currentDeductible: (state) => (state.order.damage.isRepair ? state.order.currentDeductible.repair : state.order.currentDeductible.replace),
accountNameForEvents: (state) => state.issConfig.clientName.replaceAll(" ", "").replaceAll("&", "amp")
},
actions:
{