@asaleh37/ui-base 25.6.19-3 → 25.6.19-5
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 +16 -15
package/package.json
CHANGED
|
@@ -235,29 +235,30 @@ 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
239
|
console.log("filterDate", data);
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
)
|
|
248
|
-
|
|
249
|
-
if (
|
|
250
|
-
|
|
240
|
+
const parentItems = [];
|
|
241
|
+
for (let parentItem of data) {
|
|
242
|
+
if (
|
|
243
|
+
parentItem.authority === undefined ||
|
|
244
|
+
parentItem.authority == null ||
|
|
245
|
+
isUserAuthorized(parentItem.authority)
|
|
246
|
+
) {
|
|
247
|
+
let newParentItem = structuredClone(parentItem);
|
|
248
|
+
if (parentItem?.children) {
|
|
249
|
+
newParentItem.children = filterData(parentItem.children);
|
|
251
250
|
}
|
|
252
|
-
|
|
253
|
-
}
|
|
251
|
+
parentItems.push(newParentItem);
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
return parentItems;
|
|
254
255
|
};
|
|
255
256
|
|
|
256
257
|
const mergedNavigationItems = [];
|
|
257
258
|
if (AppInfo.enableAdministrationModule) {
|
|
258
|
-
mergedNavigationItems.push(
|
|
259
|
+
mergedNavigationItems.push(structuredClone(NavigationItems));
|
|
259
260
|
}
|
|
260
|
-
mergedNavigationItems.push(
|
|
261
|
+
mergedNavigationItems.push(structuredClone(AppInfo.businessNavigationItems));
|
|
261
262
|
const authoriedNavigationItems = filterData(mergedNavigationItems);
|
|
262
263
|
|
|
263
264
|
return (
|