@asaleh37/ui-base 1.1.9 → 1.2.1

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.
Files changed (60) hide show
  1. package/dist/index.d.ts +23 -1
  2. package/dist/index.js +5 -5
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.mjs +5 -5
  5. package/dist/index.mjs.map +1 -1
  6. package/package.json +1 -1
  7. package/src/components/App.tsx +61 -3
  8. package/src/components/BaseApp.tsx +7 -0
  9. package/src/components/admin/AttachmentGrid.tsx +1 -1
  10. package/src/components/admin/AuthorityGrid.tsx +1 -1
  11. package/src/components/admin/BluePrintGrid.tsx +1 -1
  12. package/src/components/admin/BluePrintPageGrid.tsx +1 -1
  13. package/src/components/admin/BluePrintPointGrid.tsx +1 -1
  14. package/src/components/admin/DashboardGrid.tsx +1 -1
  15. package/src/components/admin/DashboardWidgetGrid.tsx +1 -1
  16. package/src/components/admin/DataQueryGrid.tsx +1 -1
  17. package/src/components/admin/DataQueryParameterGrid.tsx +1 -1
  18. package/src/components/admin/DatasourceConnectionGrid.tsx +1 -1
  19. package/src/components/admin/EmployeeGrid.tsx +1 -1
  20. package/src/components/admin/EntityParameterGrid.tsx +1 -1
  21. package/src/components/admin/ExcelUploaderDetailGrid.tsx +1 -1
  22. package/src/components/admin/ExcelUploaderHeaderGrid.tsx +1 -1
  23. package/src/components/admin/LookupGrid.tsx +1 -1
  24. package/src/components/admin/MailAttachmentGrid.tsx +1 -1
  25. package/src/components/admin/MailBodyGrid.tsx +1 -1
  26. package/src/components/admin/MailNotificationQueueGrid.tsx +1 -1
  27. package/src/components/admin/MailRecipientGrid.tsx +1 -1
  28. package/src/components/admin/MailTemplateGrid.tsx +1 -1
  29. package/src/components/admin/NewTableGrid.tsx +1 -1
  30. package/src/components/admin/NotificationGrid.tsx +1 -1
  31. package/src/components/admin/NotificationQueueGrid.tsx +1 -1
  32. package/src/components/admin/OrganizationApplicationGrid.tsx +1 -1
  33. package/src/components/admin/OrganizationGrid.tsx +1 -1
  34. package/src/components/admin/OrganizationRankGrid.tsx +1 -1
  35. package/src/components/admin/OrganizationUnitGrid.tsx +1 -1
  36. package/src/components/admin/OrganizationUserGrid.tsx +1 -1
  37. package/src/components/admin/OrganizationUserRoleGrid.tsx +1 -1
  38. package/src/components/admin/ReportGrid.tsx +1 -1
  39. package/src/components/admin/ReportParameterGrid.tsx +1 -1
  40. package/src/components/admin/RoleAuthorityGrid.tsx +1 -1
  41. package/src/components/admin/RoleGrid.tsx +1 -1
  42. package/src/components/admin/UserAccountGrid.tsx +1 -1
  43. package/src/components/admin/UserRequestGrid.tsx +1 -1
  44. package/src/components/admin/WidgetGrid.tsx +1 -1
  45. package/src/components/admin/WorkflowDocumentActionGrid.tsx +1 -1
  46. package/src/components/admin/WorkflowDocumentActionHistoryGrid.tsx +1 -1
  47. package/src/components/admin/WorkflowDocumentActionMailGrid.tsx +1 -1
  48. package/src/components/admin/WorkflowDocumentGrid.tsx +1 -1
  49. package/src/components/admin/WorkflowDocumentMailLogGrid.tsx +1 -1
  50. package/src/components/admin/WorkflowDocumentStatusGrid.tsx +1 -1
  51. package/src/components/common/Login.tsx +28 -2
  52. package/src/components/templates/DataEntryTemplates/DataEntryTypes.ts +1 -1
  53. package/src/hooks/index.ts +1 -0
  54. package/src/{components/templates/DataEntryTemplates → hooks}/useApiActions.ts +4 -4
  55. package/src/layout/MainContent.tsx +12 -9
  56. package/src/layout/NavigationTree.tsx +10 -9
  57. package/src/redux/features/common/AppInfoSlice.ts +10 -0
  58. package/src/redux/features/common/CommonStoreSlice.ts +1 -4
  59. package/src/theme/DarkThemeOptions.ts +0 -30
  60. package/src/theme/LightThemeOptions.ts +0 -34
@@ -232,9 +232,7 @@ const CustomTreeItem = React.forwardRef(function CustomTreeItem(
232
232
  export default function NavigationTree() {
233
233
  const navigate = useNavigate();
234
234
  const appLayoutState = useSelector((state: RootState) => state.AppLayout);
235
- const businessNavigationItems = useSelector(
236
- (state: RootState) => state.AppInfo.value.businessNavigationItems
237
- );
235
+ const AppInfo = useSelector((state: RootState) => state.AppInfo.value);
238
236
  const dispatch = useDispatch();
239
237
  const isMobile = useIsMobile();
240
238
  const { isUserAuthorized } = useSession();
@@ -254,18 +252,21 @@ export default function NavigationTree() {
254
252
  });
255
253
  };
256
254
 
257
- const mergedNavigationItems = [
258
- ...NavigationItems,
259
- ...businessNavigationItems,
260
- ];
261
-
255
+ const mergedNavigationItems = [];
256
+ if (AppInfo.enableAdministrationModule) {
257
+ mergedNavigationItems.push(...NavigationItems);
258
+ }
259
+ mergedNavigationItems.push(...AppInfo.businessNavigationItems);
262
260
  const authoriedNavigationItems = filterData(mergedNavigationItems);
263
261
 
264
262
  return (
265
263
  <RichTreeView
266
264
  items={authoriedNavigationItems}
267
265
  onItemClick={(event, itemId) => {
268
- const navigationItem = findNavigationItemById(itemId, NavigationItems);
266
+ const navigationItem = findNavigationItemById(
267
+ itemId,
268
+ mergedNavigationItems
269
+ );
269
270
  if (
270
271
  navigationItem?.action === "NAVIGATION" &&
271
272
  navigationItem?.actionPayload != null &&
@@ -14,6 +14,11 @@ export type AppInfo = {
14
14
  businessReduxReducers: { [key: string]: Reducer<any> };
15
15
  businessCommonStoresMetaData: { [key: string]: StoreMetaData };
16
16
  muiPremiumKey: string;
17
+ enableAdministrationModule: boolean;
18
+ appTheme: {
19
+ light: { primaryColor: string; secondaryColor: string };
20
+ dark: { primaryColor: string; secondaryColor: string };
21
+ };
17
22
  };
18
23
 
19
24
  export type AppInfoProp = {
@@ -28,10 +33,15 @@ const initialState: AppInfoProp = {
28
33
  appVersion: null,
29
34
  appLogo: null,
30
35
  muiPremiumKey: null,
36
+ enableAdministrationModule: false,
31
37
  businessRoutes: [],
32
38
  businessNavigationItems: [],
33
39
  businessReduxReducers: {},
34
40
  businessCommonStoresMetaData: {},
41
+ appTheme: {
42
+ light: { primaryColor: "#37505C", secondaryColor: "#ff6d00" },
43
+ dark: { primaryColor: "#ea690e", secondaryColor: "#74776B" },
44
+ },
35
45
  },
36
46
  };
37
47
 
@@ -1,5 +1,4 @@
1
1
  import { createSlice, PayloadAction } from "@reduxjs/toolkit";
2
- import { ADMINISTRATION_STORES } from "../administration/AdministrationStoresMetaData";
3
2
 
4
3
  export interface CommonStoresInterface {
5
4
  [key: string]: StoreMetaData;
@@ -17,9 +16,7 @@ export interface StoreMetaData {
17
16
  authority?: string;
18
17
  }
19
18
 
20
- export const commonStoresInitialState: CommonStoresInterface = {
21
- ...ADMINISTRATION_STORES,
22
- };
19
+ export const commonStoresInitialState: CommonStoresInterface = {};
23
20
 
24
21
  const commonStoreSlice = createSlice({
25
22
  name: "loadingMask",
@@ -1,30 +0,0 @@
1
- import { ThemeOptions } from "@mui/material";
2
-
3
- export const DarkThemeOptions: ThemeOptions = {
4
- components: {
5
- MuiCssBaseline: {
6
- styleOverrides: `
7
- /* Custom Scrollbar */
8
- * {
9
- scrollbar-width: thin;
10
- scrollbar-color: #ea690e #121212;
11
- }
12
-
13
- /* Webkit Browsers */
14
- *::-webkit-scrollbar {
15
- width: 12px;
16
- height: 10px;
17
- }
18
- `,
19
- },
20
- },
21
- palette: {
22
- mode: "dark",
23
- primary: {
24
- main: "#ea690e",
25
- },
26
- secondary: {
27
- main: "#74776B",
28
- },
29
- },
30
- };
@@ -1,34 +0,0 @@
1
- import { ThemeOptions } from "@mui/material";
2
-
3
- export const LightThemeOptions: ThemeOptions = {
4
- components: {
5
- MuiCssBaseline: {
6
- styleOverrides: `
7
- /* Custom Scrollbar */
8
- * {
9
- scrollbar-width: thin;
10
- scrollbar-color: #37505C #ffffff;
11
- }
12
-
13
- /* Webkit Browsers */
14
- *::-webkit-scrollbar {
15
- width: 12px;
16
- height: 10px;
17
- }
18
- `,
19
- },
20
- },
21
- palette: {
22
- mode: "light",
23
- primary: {
24
- main: "#37505C",
25
- },
26
- secondary: {
27
- main: "#ff6d00",
28
- },
29
- background: {
30
- default: "#f5f5f5",
31
- paper: "#f5f5f5",
32
- },
33
- },
34
- };