Hide/display fields based on the authentication of client

SSR-334
This commit is contained in:
Jethe 2023-04-20 14:53:58 +05:30
parent 4df7578879
commit bbcb61b6f6
4 changed files with 6 additions and 23 deletions

View file

@ -13,12 +13,10 @@ export function fetchCmsContentForPage(issPage) {
(baseResponse) => {
if ( !clientOverride )
{
setClientTag(clientName,accountNumber);
// Return the base page if there are no client override.
return processPageData(baseResponse, null);
}
else {
setClientTag(clientName,accountNumber);
// Else get the client override page.
const pageName = issPage + "_" + clientName.toLowerCase().replace(/ /g, "");
@ -116,17 +114,6 @@ function processPageData(baseResponse, clientResponse) {
});
return pageDataFromCms;
}
//ClientTag function to identify essential or advance flow
function setClientTag(clientName,accountNumber)
{
const storeState = useMainStore();
if(clientName !="Generic Insurance" && accountNumber){
storeState.issConfig.flowType = "Advanced Flow";
}
if(clientName =="Generic Insurance" && accountNumber==0){
storeState.issConfig.flowType = "Essential Flow";
}
}
// Parent function for processWidgetItemForReplacement. This will loop through the parent
// object and pass any objects that need additional processing to the processWidgetItemForReplacement function.

View file

@ -35,7 +35,6 @@ describe("welcome-page.vue", () => {
const glassOnlyDamage = wrapper.findComponent({ ref: "glassOnlyDamage" });
const phoneNumber = wrapper.findComponent({ ref: "phoneNumber" });
const email = wrapper.findComponent({ ref: "email" });
const policyZip = wrapper.findComponent({ ref: "policyZip" });
// Assert
@ -47,7 +46,6 @@ describe("welcome-page.vue", () => {
expect(glassOnlyDamage.exists()).toBe(false);
expect(phoneNumber.exists()).toBe(true);
expect(email.exists()).toBe(true);
expect(policyZip.exists()).toBe(false);
});
});

View file

@ -17,16 +17,13 @@
validationRules="policy-number-required" />
</div>
</div>
<div class="row mt-4 px-3">
<div class="row mt-4 px-3" v-if="this.displayPolicyZip">
<div class="col">
<textboxQuestion
inputId="policyZipCode"
cmsWidgetName="PolicyZipQuestion"
v-model="welcomePageModel.policyZip"
isRequired
ref="policyZip"
v-if="this.displayPolicyZip"
validationRules="policy-zip-required|policy-zip-format" />
ref="policyZip" />
</div>
</div>
<div class="row mt-4 px-3">
@ -349,7 +346,10 @@ export default {
return !!this.getCmsContent("GlassOnlyQuestion","QuestionText");
},
displayPolicyZip(){
if(this.mainStore.issConfig.flowType=="Essential Flow"){
if(this.mainStore.issConfig.isAuthenticated){
return false;
}
else{
return true;
}
}

View file

@ -107,7 +107,6 @@ const getDefaultState = () => {
enableTPAFlow: false, // Indicates if the TPA flow is supported for this client.
returnURL: null,
returnURL2: null,
flowType:"",
}
};
};
@ -618,7 +617,6 @@ export const useMainStore = defineStore({
this.issConfig.enableTPAFlow = false;
this.issConfig.returnURL = null;
this.issConfig.returnURL2 = null;
this.issConfig.flowType="";
},
updateVehicleYear(year) {