@asaleh37/ui-base 25.6.19-2 → 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-2",
3
+ "version": "25.6.19-5",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "Ahmed Saleh Mohamed",
@@ -8,8 +8,7 @@ import AttachmentPanel from "../templates/attachment/AttachmentPanel";
8
8
  import { useSelector } from "react-redux";
9
9
 
10
10
  const Home: React.FC = () => {
11
- const AppInfo = useSelector((state: any) => state.AppInfo.value);
12
- console.log("AppInfo", AppInfo);
11
+ const AppInfo = useSelector((state: any) => state.AppInfo.value);
13
12
  return (
14
13
  <Box
15
14
  sx={{
@@ -34,7 +34,6 @@ const MyNotificationsPanel: React.FC = () => {
34
34
  showMask: false,
35
35
  successCallBkFn: (response: any) => {
36
36
  setNotifications(response.data);
37
- console.log(response.data);
38
37
  },
39
38
  });
40
39
  }
@@ -341,7 +341,6 @@ const TemplateForm: React.FC<TemplateFormProps> = (
341
341
  }
342
342
  onClick={formManager.handleSubmit(
343
343
  (values) => {
344
- console.log("form values", values);
345
344
  saveRecord(values);
346
345
  },
347
346
  (errors) => {
@@ -27,8 +27,7 @@ const getGridColumnsFromRecord = (data: Array<any>) => {
27
27
  },
28
28
  };
29
29
  formElements.push(formElement);
30
- }
31
- console.log("formElements", formElements);
30
+ }
32
31
  return formElements;
33
32
  };
34
33
 
@@ -186,8 +186,7 @@ const ReportViewer: React.FC<ReportViewerProps> = (props) => {
186
186
  // Clean up
187
187
  document.body.removeChild(link);
188
188
  window.URL.revokeObjectURL(url);
189
- }
190
- console.log(response);
189
+ }
191
190
  },
192
191
  failureCallBkFn: (response) => {
193
192
  setErrorMessage(
@@ -235,28 +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
- return data
241
- .filter(
242
- (item: any) =>
243
- item.authority === undefined ||
244
- item.authority == null ||
245
- isUserAuthorized(item.authority)
246
- )
247
- .map((item: any) => {
248
- if (item.children) {
249
- item.children = filterData(item.children);
239
+ console.log("filterDate", data);
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);
250
250
  }
251
- return item;
252
- });
251
+ parentItems.push(newParentItem);
252
+ }
253
+ }
254
+ return parentItems;
253
255
  };
254
256
 
255
257
  const mergedNavigationItems = [];
256
258
  if (AppInfo.enableAdministrationModule) {
257
- mergedNavigationItems.push(...NavigationItems);
259
+ mergedNavigationItems.push(structuredClone(NavigationItems));
258
260
  }
259
- mergedNavigationItems.push(...AppInfo.businessNavigationItems);
261
+ mergedNavigationItems.push(structuredClone(AppInfo.businessNavigationItems));
260
262
  const authoriedNavigationItems = filterData(mergedNavigationItems);
261
263
 
262
264
  return (
@@ -80,9 +80,7 @@ const TopBar: React.FC = () => {
80
80
  const handleLogout = async () => {
81
81
  try {
82
82
  await handleGetRequest({ endPointURI: "api/auth/logout" });
83
- } catch (error) {
84
- console.log("logout error", error);
85
- }
83
+ } catch (error) {}
86
84
  dispatch(UserSessionActions.setUnAuthenticated());
87
85
  };
88
86
  const toggleSideBar = () => {