@asaleh37/ui-base 25.6.19-3 → 25.6.19-6
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.
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/layout/NavigationTree.tsx +17 -17
package/package.json
CHANGED
|
@@ -235,31 +235,31 @@ export default function NavigationTree() {
|
|
|
235
235
|
const dispatch = useDispatch();
|
|
236
236
|
const isMobile = useIsMobile();
|
|
237
237
|
const { isUserAuthorized } = useSession();
|
|
238
|
-
debugger;
|
|
239
238
|
const filterData = (data) => {
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
item.children = filterData(item?.children || []);
|
|
239
|
+
const parentItems = [];
|
|
240
|
+
for (let parentItem of data) {
|
|
241
|
+
if (
|
|
242
|
+
parentItem.authority === undefined ||
|
|
243
|
+
parentItem.authority == null ||
|
|
244
|
+
isUserAuthorized(parentItem.authority)
|
|
245
|
+
) {
|
|
246
|
+
let newParentItem = structuredClone(parentItem);
|
|
247
|
+
if (parentItem?.children) {
|
|
248
|
+
newParentItem.children = filterData(parentItem.children);
|
|
251
249
|
}
|
|
252
|
-
|
|
253
|
-
}
|
|
250
|
+
parentItems.push(newParentItem);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
return parentItems;
|
|
254
254
|
};
|
|
255
255
|
|
|
256
256
|
const mergedNavigationItems = [];
|
|
257
257
|
if (AppInfo.enableAdministrationModule) {
|
|
258
|
-
mergedNavigationItems.push(
|
|
258
|
+
mergedNavigationItems.push(structuredClone(NavigationItems));
|
|
259
259
|
}
|
|
260
|
-
mergedNavigationItems.push(
|
|
260
|
+
mergedNavigationItems.push(structuredClone(AppInfo.businessNavigationItems));
|
|
261
261
|
const authoriedNavigationItems = filterData(mergedNavigationItems);
|
|
262
|
-
|
|
262
|
+
console.log("authoriedNavigationItems", authoriedNavigationItems);
|
|
263
263
|
return (
|
|
264
264
|
<RichTreeView
|
|
265
265
|
items={authoriedNavigationItems}
|