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