Updates.
This commit is contained in:
parent
e462b23af5
commit
4c24fdd6ff
2 changed files with 47 additions and 31 deletions
|
|
@ -57,28 +57,9 @@
|
|||
|
||||
if ( resp.data.parameters?.length > 0 )
|
||||
{
|
||||
const clientParams = JSON.parse(resp.data.parameters);
|
||||
|
||||
console.log(clientParams);
|
||||
|
||||
let finalParams = [];
|
||||
for ( let cparam in clientParams)
|
||||
{
|
||||
let cname = clientParams[cparam].toLowerCase();
|
||||
|
||||
for ( let qsparam in queryStringParams)
|
||||
{
|
||||
let qsname = qsparam.toLowerCase();
|
||||
|
||||
if ( cname === qsname )
|
||||
{
|
||||
finalParams[cname] = queryStringParams[cname];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const finalParams = this.combineClientParameters(resp.data.parameters, queryStringParams);
|
||||
this.populateStoreItemsFromParams(finalParams);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -109,7 +90,7 @@
|
|||
if ( clientFlags.clientDisplayName != null )
|
||||
{
|
||||
console.log("Client Display Name set!");
|
||||
this.mainStore.issConfig.clientDisplayName = clientflags.clientDisplayName;
|
||||
this.mainStore.issConfig.clientDisplayName = clientFlags.clientDisplayName;
|
||||
}
|
||||
}
|
||||
catch ( e )
|
||||
|
|
@ -117,6 +98,37 @@
|
|||
console.error("Error parsing client flags: " + e);
|
||||
}
|
||||
},
|
||||
combineClientParameters(configParams, queryStringParams)
|
||||
{
|
||||
let finalParams = [];
|
||||
|
||||
try
|
||||
{
|
||||
const clientParams = JSON.parse(configParams);
|
||||
console.log(clientParams);
|
||||
|
||||
for ( let cparam in clientParams)
|
||||
{
|
||||
let cname = clientParams[cparam].toLowerCase();
|
||||
|
||||
for ( let qsparam in queryStringParams)
|
||||
{
|
||||
let qsname = qsparam.toLowerCase();
|
||||
|
||||
if ( cname === qsname )
|
||||
{
|
||||
finalParams[cname] = queryStringParams[cname];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch ( e )
|
||||
{
|
||||
console.error("Error combining client parameters: " + e);
|
||||
}
|
||||
|
||||
return finalParams;
|
||||
},
|
||||
populateStoreItemsFromParams(params) {
|
||||
|
||||
console.log("populate is running");
|
||||
|
|
@ -124,9 +136,6 @@
|
|||
// Populate store items from parameters.
|
||||
for ( let param in params)
|
||||
{
|
||||
// ["PolicyNumber","LossDate","Timestamp","Token","Signature","ReturnURL","ReturnURL2"]
|
||||
//console.log("param: " + params[param])
|
||||
|
||||
let name = param.toLowerCase();
|
||||
let value = params[param];
|
||||
|
||||
|
|
@ -139,16 +148,19 @@
|
|||
case "lossdate":
|
||||
this.mainStore.order.policy.dateOfLoss = value;
|
||||
break;
|
||||
|
||||
// Not implemented yet.
|
||||
|
||||
case "returnurl":
|
||||
this.mainStore.iisConfig.returnURL = value;
|
||||
break;
|
||||
|
||||
case "returnurl2":
|
||||
this.mainStore.iisConfig.returnURL2 = value;
|
||||
break;
|
||||
|
||||
// Not stored
|
||||
case "timestamp":
|
||||
case "token":
|
||||
case "signature":
|
||||
case "signature":
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,10 +99,12 @@ const getDefaultState = () => {
|
|||
},
|
||||
issConfig: {
|
||||
clientName: "Generic Insurance", // this is the default and will be overriden by the client's name
|
||||
clientDisplayName: "",
|
||||
clientDisplayName: "Generic Insurance",
|
||||
styleSheet: "",
|
||||
accountNumber: 0,
|
||||
enableTPAFlow: false,
|
||||
returnURL: null,
|
||||
returnURL2: null,
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
@ -603,11 +605,13 @@ export const useMainStore = defineStore({
|
|||
|
||||
resetISSConfigState()
|
||||
{
|
||||
this.issConfig.clientName = "";
|
||||
this.issConfig.clientDisplayName = "";
|
||||
this.issConfig.clientName = "Generic Insurance";
|
||||
this.issConfig.clientDisplayName = "Generic Insurance";
|
||||
this.issConfig.accountNumber = 0;
|
||||
this.issConfig.styleSheet = "";
|
||||
this.issConfig.enableTPAFlow = false;
|
||||
this.issConfig.returnURL = null;
|
||||
this.issConfig.returnURL2 = null;
|
||||
},
|
||||
|
||||
updateVehicleYear(year) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue