From e95d9372b3efc4ea915952c1d78178137167a052 Mon Sep 17 00:00:00 2001 From: Arun S Date: Thu, 9 Jan 2025 11:52:20 +0530 Subject: [PATCH] [Bugfix] currentUserRoles data to be fetched from groups variable from 'userDetails' localstorage instead of roles variable --- forms-flow-web/src/constants/applicationComponent.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forms-flow-web/src/constants/applicationComponent.js b/forms-flow-web/src/constants/applicationComponent.js index aa81ea352..bf9cc9c7e 100644 --- a/forms-flow-web/src/constants/applicationComponent.js +++ b/forms-flow-web/src/constants/applicationComponent.js @@ -131,7 +131,7 @@ export const addHiddenApplicationComponent = (form) => { label: "Current User Roles", persistent: true, key: "currentUserRole", - customDefaultValue: "const localdata = localStorage.getItem('UserDetails') && JSON.parse(localStorage.getItem('UserDetails')); value = localdata?.role || [];" + customDefaultValue: "const localdata = localStorage.getItem('UserDetails') && (JSON.parse(localStorage.getItem('UserDetails'))) || []; value = localdata?.groups?.map(group => group.replace(new RegExp('^/+|/+$', 'g'), '')) || [];" }, // { // label: "All Available Roles",