This commit is contained in:
Jeremy Zimmerman 2023-03-01 15:43:40 -05:00
parent 0629442570
commit 56bed721b1
2 changed files with 39 additions and 6 deletions

View file

@ -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;
}
}

View file

@ -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) {