@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/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-6",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "Ahmed Saleh Mohamed",
@@ -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
- 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 || []);
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
- return item;
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(...NavigationItems);
258
+ mergedNavigationItems.push(structuredClone(NavigationItems));
259
259
  }
260
- mergedNavigationItems.push(...AppInfo.businessNavigationItems);
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}