@asaleh37/ui-base 26.1.26 → 26.2.2

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": "26.1.26",
3
+ "version": "26.2.2",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "Ahmed Saleh Mohamed",
@@ -279,49 +279,53 @@ export default function NavigationTree() {
279
279
  mergedNavigationItems.push(
280
280
  ...structuredClone(AppInfo.businessNavigationItems),
281
281
  );
282
- let sysReports = [];
283
- let reportCategories = {};
284
- let currentCategory = null;
285
- let reportNodeId = 1;
286
- for (const report of UserInfo?.systemReports || []) {
287
- if (report?.reportCategory) {
288
- currentCategory = report.reportCategory;
289
- } else {
290
- currentCategory = "NA";
291
- }
292
- if (!reportCategories[currentCategory]) {
293
- reportCategories[currentCategory] = [];
294
- }
295
- reportCategories[currentCategory].push({
296
- id: `system_report_${reportNodeId}`,
297
- label: report.reportName,
298
- icon: report.reportType === "Excel" ? "file-excel" : "file-pdf",
299
- action: "NAVIGATION",
300
- authority: report.reportAuthorityCode,
301
- actionPayload: { path: "report-viewer/" + report.reportCode },
302
- });
303
- reportNodeId++;
304
- }
305
- for (const category of Object.keys(reportCategories)) {
306
- if (category === "NA") {
307
- for (const sysReport of reportCategories[category]) {
308
- sysReports.push(sysReport);
282
+ if (AppInfo?.showSystemReportsTreeNode) {
283
+ let sysReports = [];
284
+ let reportCategories = {};
285
+ let currentCategory = null;
286
+ let reportNodeId = 1;
287
+
288
+ for (const report of UserInfo?.systemReports || []) {
289
+ if (report?.reportCategory) {
290
+ currentCategory = report.reportCategory;
291
+ } else {
292
+ currentCategory = "NA";
293
+ }
294
+ if (!reportCategories[currentCategory]) {
295
+ reportCategories[currentCategory] = [];
309
296
  }
310
- } else {
311
- sysReports.push({
312
- id: `system_report_category_${category}`,
313
- label: category,
314
- icon: "folder",
315
- children: reportCategories[category],
297
+ reportCategories[currentCategory].push({
298
+ id: `system_report_${reportNodeId}`,
299
+ label: report.reportName,
300
+ icon: report.reportType === "Excel" ? "file-excel" : "file-pdf",
301
+ action: "NAVIGATION",
302
+ authority: report.reportAuthorityCode,
303
+ actionPayload: { path: "report-viewer/" + report.reportCode },
316
304
  });
305
+ reportNodeId++;
317
306
  }
307
+ for (const category of Object.keys(reportCategories)) {
308
+ if (category === "NA") {
309
+ for (const sysReport of reportCategories[category]) {
310
+ sysReports.push(sysReport);
311
+ }
312
+ } else {
313
+ sysReports.push({
314
+ id: `system_report_category_${category}`,
315
+ label: category,
316
+ icon: "folder",
317
+ children: reportCategories[category],
318
+ });
319
+ }
320
+ }
321
+ mergedNavigationItems.push({
322
+ id: "system_configured_reports",
323
+ label: "Reports",
324
+ icon: "folder",
325
+ children: sysReports,
326
+ });
318
327
  }
319
- mergedNavigationItems.push({
320
- id: "system_configured_reports",
321
- label: "Reports",
322
- icon: "folder",
323
- children: sysReports,
324
- });
328
+
325
329
  const authoriedNavigationItems = filterData(mergedNavigationItems);
326
330
  return (
327
331
  <RichTreeView
@@ -35,6 +35,7 @@ export type AppInfo = {
35
35
  redirectURL: string;
36
36
  scopes: Array<string>;
37
37
  };
38
+ showSystemReportsTreeNode?: boolean;
38
39
  businessRoutes?: Array<SystemRoute>;
39
40
  businessNavigationItems?: Array<ExtendedTreeItemProps>;
40
41
  businessReduxReducers?: { [key: string]: Reducer<any> };
@@ -63,6 +64,7 @@ const initialState: AppInfoProp = {
63
64
  appName: null,
64
65
  appVersion: null,
65
66
  appLogo: null,
67
+ showSystemReportsTreeNode: false,
66
68
  muiPremiumKey: null,
67
69
  enableAdministrationModule: false,
68
70
  enableUINotifications: false,