Move accountName logic to store getter, better required field search
This commit is contained in:
parent
7f565fb8cf
commit
6acefcb307
3 changed files with 8 additions and 12 deletions
|
|
@ -64,14 +64,11 @@ export default {
|
||||||
modalSubHeaderText() {
|
modalSubHeaderText() {
|
||||||
return this.getCmsContent('ContinueReferralModalWidget', 'SubheaderText')
|
return this.getCmsContent('ContinueReferralModalWidget', 'SubheaderText')
|
||||||
.replaceAll('{custom:mmFound}', this.getMakeModelString.toUpperCase());
|
.replaceAll('{custom:mmFound}', this.getMakeModelString.toUpperCase());
|
||||||
},
|
|
||||||
accountName() {
|
|
||||||
return this.mainStore.issConfig.clientName.replaceAll(" ", "").replaceAll("&", "amp");
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
openModal() {
|
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();
|
this.$refs.continueModal.openModal();
|
||||||
},
|
},
|
||||||
setModalStatus(isOpened) {
|
setModalStatus(isOpened) {
|
||||||
|
|
@ -81,11 +78,11 @@ export default {
|
||||||
this.$refs.continueModal.closeModal();
|
this.$refs.continueModal.closeModal();
|
||||||
},
|
},
|
||||||
continueReferral() {
|
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');
|
this.$emit('continue-previous-referral');
|
||||||
},
|
},
|
||||||
startNewReferral() {
|
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');
|
this.$emit('start-new-referral');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -262,7 +262,8 @@ export default {
|
||||||
this.pushEventToGA("policy_info", "info_prefilled", isInfoPrefilled.toString(), true);
|
this.pushEventToGA("policy_info", "info_prefilled", isInfoPrefilled.toString(), true);
|
||||||
|
|
||||||
this.$nextTick(() => {
|
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);
|
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", "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: {
|
computed: {
|
||||||
DamageCauseOptions() {
|
DamageCauseOptions() {
|
||||||
|
|
@ -329,9 +330,6 @@ export default {
|
||||||
},
|
},
|
||||||
phoneMask() {
|
phoneMask() {
|
||||||
return MaskaFormattedMasks.PHONE_NUMBER;
|
return MaskaFormattedMasks.PHONE_NUMBER;
|
||||||
},
|
|
||||||
accountName() {
|
|
||||||
return this.mainStore.issConfig.clientName.replaceAll(" ", "").replaceAll("&", "amp");
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
||||||
|
|
@ -445,7 +445,8 @@ export const useMainStore = defineStore({
|
||||||
.map((x) => x.settings)
|
.map((x) => x.settings)
|
||||||
.reduce((r, c) => Object.assign(r, c), {}) ?? {},
|
.reduce((r, c) => Object.assign(r, c), {}) ?? {},
|
||||||
originalDeductible: (state) => (state.order.damage.isRepair ? state.order.originalDeductible.repair : state.order.originalDeductible.replace),
|
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:
|
actions:
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue