@visns-studio/visns-components 1.4.5 → 1.4.7
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,14 +130,25 @@ function Navigation({ logo, logout, navConfig, setSystemAuth, userProfile }) {
|
|
|
130
130
|
const permissions = userProfile.roles[0].permissions;
|
|
131
131
|
|
|
132
132
|
setNavData((prevNavData) => {
|
|
133
|
-
const
|
|
133
|
+
const updatedNavigations = prevNavData.navigations.map((nav) => ({
|
|
134
134
|
...nav,
|
|
135
135
|
permission: permissions.some(
|
|
136
136
|
(permission) => permission.name === nav.permissionKey
|
|
137
137
|
),
|
|
138
138
|
}));
|
|
139
139
|
|
|
140
|
-
|
|
140
|
+
const updatedSettings = prevNavData.settings.map((nav) => ({
|
|
141
|
+
...nav,
|
|
142
|
+
permission: permissions.some(
|
|
143
|
+
(permission) => permission.name === nav.permissionKey
|
|
144
|
+
),
|
|
145
|
+
}));
|
|
146
|
+
|
|
147
|
+
return {
|
|
148
|
+
...prevNavData,
|
|
149
|
+
navigations: updatedNavigations,
|
|
150
|
+
settings: updatedSettings,
|
|
151
|
+
};
|
|
141
152
|
});
|
|
142
153
|
}, [userProfile]);
|
|
143
154
|
|
|
@@ -185,11 +196,13 @@ function Navigation({ logo, logout, navConfig, setSystemAuth, userProfile }) {
|
|
|
185
196
|
</div>
|
|
186
197
|
<div className="hactions">
|
|
187
198
|
<ul>
|
|
188
|
-
{navData.settings.map((setting, settingKey) =>
|
|
189
|
-
|
|
190
|
-
{
|
|
191
|
-
|
|
192
|
-
|
|
199
|
+
{navData.settings.map((setting, settingKey) =>
|
|
200
|
+
setting.permission === true ? (
|
|
201
|
+
<React.Fragment key={`setting-${settingKey}`}>
|
|
202
|
+
{renderSetting(setting)}
|
|
203
|
+
</React.Fragment>
|
|
204
|
+
) : null
|
|
205
|
+
)}
|
|
193
206
|
</ul>
|
|
194
207
|
</div>
|
|
195
208
|
</div>
|
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.
|
|
37
|
+
"version": "1.4.7",
|
|
38
38
|
"description": "Various packages to assist in the development of our Custom Applications.",
|
|
39
39
|
"main": "index.js",
|
|
40
40
|
"devDependencies": {},
|