Merge branch 'develop' into feature/digital/SSR-405

# Conflicts:
#	src/store/index.js
This commit is contained in:
Jason Wheeler 2023-04-25 13:39:30 -04:00
commit f685f788ad
6 changed files with 116 additions and 17 deletions

View file

@ -0,0 +1,74 @@
<template>
<Form @submit="onSubmit" @invalid-submit="onInvalidSubmit" ref="theForm" v-slot="{ meta }" >
<div class="page-container-grouped-styles">
<div class="fade-on-route-transition position-relative">
<siteHeader cmsWidgetName="SiteHeaderWidget"/>
<div class="container-fluid pb-2">
<p>Placeholder for bailout page</p>
<siteFooter
cmsWidgetName="SiteFooterWidget"
ref="siteFooter"
:isForwardActionDisabled="!meta.valid"
@ForwardClicked="forwardButtonAction"
@back-clicked="backButtonAction"
/>
</div>
</div>
</div>
</Form>
</template>
<script>
// Components
import siteHeader from '@/iss-components/site-header/site-header';
import siteFooter from "@/iss-components/site-footer/site-footer";
// Supporting files
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
import { settleAllPromises } from "@/helpers/layout-helper";
import { Form } from "vee-validate";
import BaseFormMixin from '@/mixins/base-form-mixin.js';
import { useMainStore } from '@/store';
export default {
name: "bailout-page",
mixins: [BaseFormMixin],
data() {
},
setup() {
const mainStore = useMainStore();
return { mainStore };
},
async beforeRouteEnter(to, from, next)
{
// Call APIs
const cmsContentPromise = fetchCmsContentForPage(to.query.issPage);
// Settle promises and get results
const promiseResultMap = [
{
resultKey: "cmsContent",
promise: cmsContentPromise,
},];
//use resultMap to populate layout content.
let resultMap = await settleAllPromises(promiseResultMap);
next((vm) => {
vm.setCmsContent(resultMap.cmsContent);
});
},
methods:
{
backButtonAction() {
},
forwardButtonAction() {
return this.navigateForward();
},
navigateForward() {
},
},
components: {
siteHeader,
siteFooter,
Form,
},
}
</script>
<style lang="scss">
</style>

View file

@ -74,6 +74,7 @@
populateISSConfigValues(data)
{
this.mainStore.issConfig.clientName = data.accountName;
this.mainStore.issConfig.clientDisplayName = data.accountName; // Defaults to use the client name.
this.mainStore.issConfig.accountNumber = data.accountNumber;
this.mainStore.issConfig.styleSheet = data.styleSheet;
this.mainStore.issConfig.isCoverageEnabled = data.coverageEnabled;
@ -91,9 +92,9 @@
this.mainStore.issConfig.enableTPAFlow = true;
}
if ( clientFlags.clientDisplayName != null )
if ( clientFlags.ClientDisplayName != null )
{
this.mainStore.issConfig.clientDisplayName = clientFlags.clientDisplayName;
this.mainStore.issConfig.clientDisplayName = clientFlags.ClientDisplayName;
}
}
catch ( e )

View file

@ -35,6 +35,7 @@
<script>
// Components
import baseFormMixin from '@/mixins/base-form-mixin';
import siteHeader from '@/iss-components/site-header/site-header';
import siteFooter from '@/iss-components/site-footer/site-footer';
import siteSubHeader from '@/iss-components/site-sub-header/site-sub-header';
@ -53,6 +54,7 @@
export default {
name: 'service-packages',
mixins: [baseFormMixin],
async beforeRouteEnter(to, from, next) {
const store = useMainStore();

View file

@ -144,18 +144,18 @@ export default {
const response = await useMainStore().initializeSession(payload);
if (response.data) {
if (response.data.sessionKey && skey === 0) {
if (response?.data) {
if (response?.data.sessionKey && skey === 0) {
setCookieProperties(
{ [cookieNames.SESSION_KEY]: response.data.sessionKey },
{ [cookieNames.SESSION_KEY]: response?.data.sessionKey },
{
useDefaultFunnelCookieAttributes: false,
}
);
}
if (response.data.sessionId && sid === "00000000-0000-0000-0000-000000000000") {
if (response?.data.sessionId && sid === "00000000-0000-0000-0000-000000000000") {
setCookieProperties(
{ [cookieNames.SESSION_ID]: response.data.sessionId },
{ [cookieNames.SESSION_ID]: response?.data.sessionId },
{
maxAge: 60 * 30, // 30 minutes
}

View file

@ -28,6 +28,7 @@ export const issPageValues = {
VEHICLE_STYLE: 'vehicle-style',
VEHICLE_YEAR: 'vehicle-year',
VIN_LOOKUP: 'vin-lookup',
TPA_SUBMIT: 'tpa-submit'
TPA_SUBMIT: 'tpa-submit',
BAILOUT_PAGE: 'bailout-page',
};

View file

@ -97,7 +97,7 @@ const getDefaultState = () => {
},
issConfig: {
clientName: "Generic Insurance", // this is the default and will be overriden by the client's name
clientDisplayName: "Generic Insurance",
clientDisplayName: "Generic Insurance", // this is the default and will be overridden by the client's name or client display name.
styleSheet: "",
accountNumber: 0,
isCoverageEnabled: false, // Indicates if we should be calling coverage on this flow.
@ -968,12 +968,19 @@ export const useMainStore = defineStore({
experimentsForUser: experimentsForUser,
}
return globalMethods.callHttpClient({
method: endpoints.LogPageView.method,
endpoint: endpoints.LogPageView.url,
payload: payload,
logApiCall: false
});
return globalMethods.callHttpClient({
method: endpoints.LogPageView.method,
endpoint: endpoints.LogPageView.url,
payload: payload,
logApiCall: false
}).then(
(response) => {
return response;
},
(error) => {
console.log("Analytics Service Error: " + error.data);
}
);
},
logCustomEvent({ userId, sessionKey, pageName, sessionId, category, action, label, value, shouldUseSessionId, experimentsForUser})
{
@ -999,7 +1006,14 @@ export const useMainStore = defineStore({
endpoint: endpoints.LogCustomEvent.url,
payload: payload,
logApiCall: false
});
}).then(
(response) => {
return response;
},
(error) => {
console.log("Analytics Service Error: " + error.data);
}
);
},
initializeSession({ userId, sessionId, userAgent, referrer }) {
var payload = {
@ -1018,7 +1032,14 @@ export const useMainStore = defineStore({
endpoint: endpoints.InitializeSession.url,
payload: payload,
logApiCall: false
});
}).then(
(response) => {
return response;
},
(error) => {
console.log("Analytics Service Error: " + error.data);
}
);
},
updateLastPageVisited(lastPageVisited) {