Merge branch 'develop' into feature/jnou/more-fixes-playwright
This commit is contained in:
commit
eed4830620
4 changed files with 49 additions and 21 deletions
|
|
@ -6,6 +6,7 @@ import { GaCategories, GaActions, GaLabels } from '@/constants/analytics';
|
|||
import headerKeys from '@/constants/header-keys';
|
||||
import axiosResponseInterceptorMessages from '@/constants/axios-response-interceptor-messages.js';
|
||||
import { getSessionKeyValue } from '@/helpers/cookie-helper';
|
||||
import endpoints from "@/constants/endpoints";
|
||||
|
||||
// Add a response interceptor for global axios error handing.
|
||||
axios.interceptors.response.use(
|
||||
|
|
@ -84,24 +85,33 @@ export default {
|
|||
return resolve(response);
|
||||
},
|
||||
(error) => {
|
||||
if (logApiCall) {
|
||||
analyticsMixIn.methods.pushEventToGA(
|
||||
GaCategories.API_RESPONSE,
|
||||
GaActions.RESULT,
|
||||
`${GaLabels.ERROR}_${endpoint}`,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if (error.response.status !== 404) {
|
||||
const errorData = { method, url, payload, error };
|
||||
global.$logger.logError(`${method}: ${endpoint}`, errorData);
|
||||
if (bailoutOnError && global.bailoutOnAxiosError !== undefined)
|
||||
{
|
||||
global.bailoutOnAxiosError(errorData);
|
||||
// Add any logging specific endpoints here.
|
||||
if (
|
||||
endpoint.toLowerCase().includes(endpoints.LogIssSessionData.url) ||
|
||||
endpoint.toLowerCase().includes(endpoints.LogPageView.url) ||
|
||||
endpoint.toLowerCase().includes(endpoints.LogCustomEvent.url)
|
||||
) {
|
||||
return resolve({ data: null, error: "Ignore errors when logging" });
|
||||
} else {
|
||||
if (logApiCall) {
|
||||
analyticsMixIn.methods.pushEventToGA(
|
||||
GaCategories.API_RESPONSE,
|
||||
GaActions.RESULT,
|
||||
`${GaLabels.ERROR}_${endpoint}`,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if (error.response.status !== 404) {
|
||||
const errorData = { method, url, payload, error };
|
||||
global.$logger.logError(`${method}: ${endpoint}`, errorData);
|
||||
if (bailoutOnError && global.bailoutOnAxiosError !== undefined)
|
||||
{
|
||||
global.bailoutOnAxiosError(errorData);
|
||||
}
|
||||
}
|
||||
return reject(error.response);
|
||||
}
|
||||
return reject(error.response);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -43,7 +43,11 @@ const routes = [
|
|||
updateSessionIdCookie();
|
||||
}
|
||||
|
||||
await runExperiments(issPageToUse); // fmg has this further down
|
||||
try {
|
||||
await runExperiments(issPageToUse);
|
||||
} catch (error) {
|
||||
console.error('Failed to run experiments during route navigation.', error);
|
||||
}
|
||||
}
|
||||
|
||||
// Intercept all navigation if a submitted order exists in storage
|
||||
|
|
|
|||
|
|
@ -637,6 +637,7 @@ export const useMainStore = defineStore({
|
|||
referralCorrelationId: this.order.referralCorrelationId,
|
||||
accountNumber: this.order.parentAccountNumber?.toString() ?? '',
|
||||
policyData: this.order.policy.policyData,
|
||||
isRepair: this.order.damage.isRepair,
|
||||
isItac: isITAC,
|
||||
insured: {
|
||||
firstName: this.order.customer.firstName,
|
||||
|
|
@ -665,7 +666,9 @@ export const useMainStore = defineStore({
|
|||
safelitePolicy: {
|
||||
policies: []
|
||||
},
|
||||
actualDeductible: this.currentDeductible.toString() ?? ''
|
||||
actualDeductible: this.currentDeductible.toString() ?? '',
|
||||
currentRepairDeductible: this.order.currentDeductible.repair,
|
||||
currentReplaceDeductible: this.order.currentDeductible.replace,
|
||||
},
|
||||
lossInfo: {
|
||||
dateOfLoss: this.order.policy.dateOfLoss,
|
||||
|
|
@ -728,6 +731,8 @@ export const useMainStore = defineStore({
|
|||
status: this.order.policy.status,
|
||||
originalDeductible: this.originalDeductible,
|
||||
currentDeductible: this.currentDeductible,
|
||||
currentRepairDeductible: this.order.currentDeductible.repair,
|
||||
currentReplaceDeductible: this.order.currentDeductible.replace,
|
||||
noCoverage: false,
|
||||
isRepair: this.order.damage.isRepair,
|
||||
policyNumber: this.order.policy.policyNumber,
|
||||
|
|
@ -2542,13 +2547,17 @@ export const useMainStore = defineStore({
|
|||
sessionKey: getSessionKeyValue(),
|
||||
pageName
|
||||
}
|
||||
}
|
||||
},
|
||||
bailoutOnError: false
|
||||
});
|
||||
},
|
||||
logExperimentIfExists(pageName, universe) {
|
||||
const experiment = this.applicationUser.experiments.find((e) => e.universeName === universe);
|
||||
if (experiment !== undefined) {
|
||||
this.logExperimentExposure(pageName, experiment);
|
||||
void this.logExperimentExposure(pageName, experiment)
|
||||
.catch((error) => {
|
||||
console.error(`Failed to log experiment exposure: ${error?.data ?? error}`);
|
||||
});
|
||||
}
|
||||
},
|
||||
logPageView({ userId, sessionKey, pageName, referralSequenceNumber, parentAccountNumber, sessionId, action, event, shouldUseSessionId, experimentsForUser }) {
|
||||
|
|
@ -2853,7 +2862,8 @@ export const useMainStore = defineStore({
|
|||
const response = await globalMethods.callHttpClient({
|
||||
method: endpoints.RunExperimentsForTrigger.method,
|
||||
endpoint: endpoints.RunExperimentsForTrigger.url,
|
||||
payload
|
||||
payload: payload,
|
||||
bailoutOnError: false
|
||||
});
|
||||
|
||||
this.updateExperiments(response.data.experiments);
|
||||
|
|
|
|||
|
|
@ -1798,6 +1798,8 @@ describe('Store', () => {
|
|||
status,
|
||||
currentDeductible,
|
||||
originalDeductible,
|
||||
currentRepairDeductible: store.order.currentDeductible.repair,
|
||||
currentReplaceDeductible: store.order.currentDeductible.replace,
|
||||
noCoverage: store.isNoComp,
|
||||
isRepair,
|
||||
policyNumber,
|
||||
|
|
@ -1904,6 +1906,8 @@ describe('Store', () => {
|
|||
status,
|
||||
currentDeductible,
|
||||
originalDeductible,
|
||||
currentRepairDeductible: store.order.currentDeductible.repair,
|
||||
currentReplaceDeductible: store.order.currentDeductible.replace,
|
||||
noCoverage: store.isNoComp,
|
||||
isRepair,
|
||||
policyNumber,
|
||||
|
|
|
|||
Loading…
Reference in a new issue