@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asaleh37/ui-base",
3
- "version": "25.6.19-3",
3
+ "version": "25.6.19-5",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "Ahmed Saleh Mohamed",
@@ -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
- return data
242
- .filter(
243
- (item: any) =>
244
- item.authority === undefined ||
245
- item.authority == null ||
246
- isUserAuthorized(item.authority)
247
- )
248
- .map((item: any) => {
249
- if (item?.children) {
250
- item.children = filterData(item?.children || []);
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
- return item;
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(...NavigationItems);
259
+ mergedNavigationItems.push(structuredClone(NavigationItems));
259
260
  }
260
- mergedNavigationItems.push(...AppInfo.businessNavigationItems);
261
+ mergedNavigationItems.push(structuredClone(AppInfo.businessNavigationItems));
261
262
  const authoriedNavigationItems = filterData(mergedNavigationItems);
262
263
 
263
264
  return (