diff --git a/src/layouts/entry-page/entry-page.vue b/src/layouts/entry-page/entry-page.vue index 11d51a7b..ddfb6862 100644 --- a/src/layouts/entry-page/entry-page.vue +++ b/src/layouts/entry-page/entry-page.vue @@ -51,9 +51,8 @@ if ( resp?.data.active && resp?.data.accountName.length > 0 ) { - this.mainStore.issConfig.clientName = resp.data.accountName; - this.mainStore.issConfig.accountNumber = resp.data.accountNumber; - this.mainStore.issConfig.styleSheet = resp.data.styleSheet; + this.populateISSConfigValues(resp.data); + authorized = true; if ( resp.data.parameters?.length > 0 ) @@ -89,9 +88,39 @@ window.location = "/?issPage=" + issPageValues.WELCOME_PAGE; } }, - populateStoreItemsFromParams(params) { + populateISSConfigValues(data) + { + this.mainStore.issConfig.clientName = data.accountName; + this.mainStore.issConfig.accountNumber = data.accountNumber; + this.mainStore.issConfig.styleSheet = data.styleSheet; - const mainStore = useMainStore(); + console.log(data.clientFlags); + console.log(data.parameters); + + try + { + const clientFlags = JSON.parse(data.clientFlags); + + console.log(clientFlags.clientDisplayName); + + if ( clientFlags.TPAEnabled ) + { + console.log("TPA Flow Enabled!"); + this.mainStore.issConfig.enableTPAFlow = true; + } + + if ( clientFlags.clientDisplayName != null ) + { + console.log("Client Display Name set!"); + this.mainStore.issConfig.clientDisplayName = clientflags.clientDisplayName; + } + } + catch ( e ) + { + console.error("Error parsing client flags: " + e); + } + }, + populateStoreItemsFromParams(params) { // Populate store items from parameters. for ( let param in params) @@ -102,7 +131,7 @@ switch (name) { case "policynumber": - mainStore.order.policy.policyNumber = value; + this.mainStore.order.policy.policyNumber = value; break; } } diff --git a/src/store/index.js b/src/store/index.js index 19aff5c1..de09569f 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -99,8 +99,10 @@ const getDefaultState = () => { }, issConfig: { clientName: "", + clientDisplayName: "", styleSheet: "", accountNumber: 0, + enableTPAFlow: false, } }; }; @@ -587,8 +589,10 @@ export const useMainStore = defineStore({ resetISSConfigState() { this.issConfig.clientName = ""; + this.issConfig.clientDisplayName = ""; this.issConfig.accountNumber = 0; this.issConfig.styleSheet = ""; + this.issConfig.enableTPAFlow = false; }, updateVehicleYear(year) {