@visns-studio/visns-components 1.4.7 → 1.4.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -130,19 +130,24 @@ function Navigation({ logo, logout, navConfig, setSystemAuth, userProfile }) {
130
130
  const permissions = userProfile.roles[0].permissions;
131
131
 
132
132
  setNavData((prevNavData) => {
133
- const updatedNavigations = prevNavData.navigations.map((nav) => ({
134
- ...nav,
135
- permission: permissions.some(
133
+ const updatePermissions = (nav) => {
134
+ const matchingPermission = permissions.find(
136
135
  (permission) => permission.name === nav.permissionKey
137
- ),
138
- }));
136
+ );
139
137
 
140
- const updatedSettings = prevNavData.settings.map((nav) => ({
141
- ...nav,
142
- permission: permissions.some(
143
- (permission) => permission.name === nav.permissionKey
144
- ),
145
- }));
138
+ if (matchingPermission) {
139
+ return {
140
+ ...nav,
141
+ permission: true,
142
+ };
143
+ }
144
+
145
+ return nav;
146
+ };
147
+
148
+ const updatedNavigations =
149
+ prevNavData.navigations.map(updatePermissions);
150
+ const updatedSettings = prevNavData.settings.map(updatePermissions);
146
151
 
147
152
  return {
148
153
  ...prevNavData,
package/package.json CHANGED
@@ -34,7 +34,7 @@
34
34
  "react-dom": "^17.0.1"
35
35
  },
36
36
  "name": "@visns-studio/visns-components",
37
- "version": "1.4.7",
37
+ "version": "1.4.8",
38
38
  "description": "Various packages to assist in the development of our Custom Applications.",
39
39
  "main": "index.js",
40
40
  "devDependencies": {},