@asaleh37/ui-base 1.1.8 → 1.2.0
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/dist/index.d.ts +12 -0
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +113 -113
- package/rollup.config-1748377725725.cjs +16 -16
- package/src/components/App.tsx +63 -3
- package/src/components/BaseApp.tsx +7 -5
- package/src/components/common/Login.tsx +28 -2
- package/src/layout/MainContent.tsx +12 -9
- package/src/layout/NavigationTree.tsx +10 -9
- package/src/redux/features/common/AppInfoSlice.ts +12 -0
- package/src/redux/features/common/CommonStoreSlice.ts +1 -4
- package/src/theme/DarkThemeOptions.ts +0 -30
- package/src/theme/LightThemeOptions.ts +0 -34
package/package.json
CHANGED
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@asaleh37/ui-base",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "",
|
|
5
|
-
"license": "ISC",
|
|
6
|
-
"author": "Ahmed Saleh Mohamed",
|
|
7
|
-
"type": "commonjs",
|
|
8
|
-
"main": "dist/index.js",
|
|
9
|
-
"module": "dist/index.mjs",
|
|
10
|
-
"types": "dist/index.d.ts",
|
|
11
|
-
"scripts": {
|
|
12
|
-
"build": "rollup -c --bundleConfigAsCjs",
|
|
13
|
-
"dev": "vite"
|
|
14
|
-
},
|
|
15
|
-
"devDependencies": {
|
|
16
|
-
"@emotion/cache": "^11.14.0",
|
|
17
|
-
"@emotion/react": "^11.14.0",
|
|
18
|
-
"@emotion/styled": "^11.14.0",
|
|
19
|
-
"@eslint/js": "^9.19.0",
|
|
20
|
-
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
|
21
|
-
"@fortawesome/free-brands-svg-icons": "^6.7.2",
|
|
22
|
-
"@fortawesome/free-regular-svg-icons": "^6.7.2",
|
|
23
|
-
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
|
24
|
-
"@fortawesome/react-fontawesome": "^0.2.2",
|
|
25
|
-
"@hookform/resolvers": "^4.1.0",
|
|
26
|
-
"@mui/icons-material": "^6.4.8",
|
|
27
|
-
"@mui/material": "^6.4.4",
|
|
28
|
-
"@mui/x-charts": "^7.27.0",
|
|
29
|
-
"@mui/x-data-grid-premium": "^8.3.0",
|
|
30
|
-
"@mui/x-date-pickers": "^7.27.0",
|
|
31
|
-
"@mui/x-license": "^8.3.0",
|
|
32
|
-
"@mui/x-tree-view": "^7.26.0",
|
|
33
|
-
"@react-spring/web": "^9.7.5",
|
|
34
|
-
"@reduxjs/toolkit": "^2.5.1",
|
|
35
|
-
"@rollup/plugin-commonjs": "^28.0.3",
|
|
36
|
-
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
37
|
-
"@rollup/plugin-terser": "^0.4.4",
|
|
38
|
-
"@rollup/plugin-typescript": "^12.1.2",
|
|
39
|
-
"@types/react": "^19.1.6",
|
|
40
|
-
"@types/react-dom": "^19.0.3",
|
|
41
|
-
"@types/react-i18next": "^7.8.3",
|
|
42
|
-
"@vitejs/plugin-react": "^4.3.4",
|
|
43
|
-
"axios": "^1.8.1",
|
|
44
|
-
"eslint": "^9.19.0",
|
|
45
|
-
"eslint-plugin-react-hooks": "^5.0.0",
|
|
46
|
-
"eslint-plugin-react-refresh": "^0.4.18",
|
|
47
|
-
"globals": "^15.14.0",
|
|
48
|
-
"i18next": "^24.2.2",
|
|
49
|
-
"i18next-browser-languagedetector": "^8.0.3",
|
|
50
|
-
"i18next-http-backend": "^3.0.2",
|
|
51
|
-
"moment": "^2.30.1",
|
|
52
|
-
"oidc-client-ts": "^3.1.0",
|
|
53
|
-
"react": "^19.1.0",
|
|
54
|
-
"react-dom": "^19.0.0",
|
|
55
|
-
"react-hook-form": "^7.54.2",
|
|
56
|
-
"react-i18next": "^15.4.0",
|
|
57
|
-
"react-redux": "^9.2.0",
|
|
58
|
-
"react-router-dom": "^7.1.5",
|
|
59
|
-
"react-toastify": "^11.0.5",
|
|
60
|
-
"rollup": "^4.41.1",
|
|
61
|
-
"rollup-plugin-dts": "^6.2.1",
|
|
62
|
-
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
63
|
-
"rollup-plugin-postcss": "^4.0.2",
|
|
64
|
-
"stylis": "^4.3.6",
|
|
65
|
-
"stylis-plugin-rtl": "^2.1.1",
|
|
66
|
-
"tslib": "^2.8.1",
|
|
67
|
-
"typescript": "~5.7.2",
|
|
68
|
-
"typescript-eslint": "^8.22.0",
|
|
69
|
-
"vite": "^6.1.0",
|
|
70
|
-
"zod": "^3.24.2"
|
|
71
|
-
},
|
|
72
|
-
"peerDependencies": {
|
|
73
|
-
"@emotion/cache": "^11.14.0",
|
|
74
|
-
"@emotion/react": "^11.14.0",
|
|
75
|
-
"@emotion/styled": "^11.14.0",
|
|
76
|
-
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
|
77
|
-
"@fortawesome/free-brands-svg-icons": "^6.7.2",
|
|
78
|
-
"@fortawesome/free-regular-svg-icons": "^6.7.2",
|
|
79
|
-
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
|
80
|
-
"@fortawesome/react-fontawesome": "^0.2.2",
|
|
81
|
-
"@hookform/resolvers": "^4.1.0",
|
|
82
|
-
"@mui/icons-material": "^6.4.8",
|
|
83
|
-
"@mui/material": "^6.4.4",
|
|
84
|
-
"@mui/x-charts": "^7.27.0",
|
|
85
|
-
"@mui/x-data-grid-premium": "^8.3.0",
|
|
86
|
-
"@mui/x-date-pickers": "^7.27.0",
|
|
87
|
-
"@mui/x-license": "^8.3.0",
|
|
88
|
-
"@mui/x-tree-view": "^7.26.0",
|
|
89
|
-
"@react-spring/web": "^9.7.5",
|
|
90
|
-
"@reduxjs/toolkit": "^2.5.1",
|
|
91
|
-
"axios": "^1.8.1",
|
|
92
|
-
"i18next": "^24.2.2",
|
|
93
|
-
"i18next-browser-languagedetector": "^8.0.3",
|
|
94
|
-
"i18next-http-backend": "^3.0.2",
|
|
95
|
-
"moment": "^2.30.1",
|
|
96
|
-
"oidc-client-ts": "^3.1.0",
|
|
97
|
-
"react": "^19.0.0",
|
|
98
|
-
"react-dom": "^19.0.0",
|
|
99
|
-
"react-hook-form": "^7.54.2",
|
|
100
|
-
"react-i18next": "^15.4.0",
|
|
101
|
-
"react-redux": "^9.2.0",
|
|
102
|
-
"react-router-dom": "^7.1.5",
|
|
103
|
-
"react-toastify": "^11.0.5",
|
|
104
|
-
"rollup": "^4.41.1",
|
|
105
|
-
"rollup-plugin-postcss": "^4.0.2",
|
|
106
|
-
"stylis": "^4.3.6",
|
|
107
|
-
"stylis-plugin-rtl": "^2.1.1",
|
|
108
|
-
"zod": "^3.24.2"
|
|
109
|
-
},
|
|
110
|
-
"dependencies": {
|
|
111
|
-
"@rollup/plugin-json": "^6.1.0"
|
|
112
|
-
}
|
|
113
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@asaleh37/ui-base",
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"license": "ISC",
|
|
6
|
+
"author": "Ahmed Saleh Mohamed",
|
|
7
|
+
"type": "commonjs",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"module": "dist/index.mjs",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "rollup -c --bundleConfigAsCjs",
|
|
13
|
+
"dev": "vite"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@emotion/cache": "^11.14.0",
|
|
17
|
+
"@emotion/react": "^11.14.0",
|
|
18
|
+
"@emotion/styled": "^11.14.0",
|
|
19
|
+
"@eslint/js": "^9.19.0",
|
|
20
|
+
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
|
21
|
+
"@fortawesome/free-brands-svg-icons": "^6.7.2",
|
|
22
|
+
"@fortawesome/free-regular-svg-icons": "^6.7.2",
|
|
23
|
+
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
|
24
|
+
"@fortawesome/react-fontawesome": "^0.2.2",
|
|
25
|
+
"@hookform/resolvers": "^4.1.0",
|
|
26
|
+
"@mui/icons-material": "^6.4.8",
|
|
27
|
+
"@mui/material": "^6.4.4",
|
|
28
|
+
"@mui/x-charts": "^7.27.0",
|
|
29
|
+
"@mui/x-data-grid-premium": "^8.3.0",
|
|
30
|
+
"@mui/x-date-pickers": "^7.27.0",
|
|
31
|
+
"@mui/x-license": "^8.3.0",
|
|
32
|
+
"@mui/x-tree-view": "^7.26.0",
|
|
33
|
+
"@react-spring/web": "^9.7.5",
|
|
34
|
+
"@reduxjs/toolkit": "^2.5.1",
|
|
35
|
+
"@rollup/plugin-commonjs": "^28.0.3",
|
|
36
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
37
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
38
|
+
"@rollup/plugin-typescript": "^12.1.2",
|
|
39
|
+
"@types/react": "^19.1.6",
|
|
40
|
+
"@types/react-dom": "^19.0.3",
|
|
41
|
+
"@types/react-i18next": "^7.8.3",
|
|
42
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
43
|
+
"axios": "^1.8.1",
|
|
44
|
+
"eslint": "^9.19.0",
|
|
45
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
46
|
+
"eslint-plugin-react-refresh": "^0.4.18",
|
|
47
|
+
"globals": "^15.14.0",
|
|
48
|
+
"i18next": "^24.2.2",
|
|
49
|
+
"i18next-browser-languagedetector": "^8.0.3",
|
|
50
|
+
"i18next-http-backend": "^3.0.2",
|
|
51
|
+
"moment": "^2.30.1",
|
|
52
|
+
"oidc-client-ts": "^3.1.0",
|
|
53
|
+
"react": "^19.1.0",
|
|
54
|
+
"react-dom": "^19.0.0",
|
|
55
|
+
"react-hook-form": "^7.54.2",
|
|
56
|
+
"react-i18next": "^15.4.0",
|
|
57
|
+
"react-redux": "^9.2.0",
|
|
58
|
+
"react-router-dom": "^7.1.5",
|
|
59
|
+
"react-toastify": "^11.0.5",
|
|
60
|
+
"rollup": "^4.41.1",
|
|
61
|
+
"rollup-plugin-dts": "^6.2.1",
|
|
62
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
63
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
64
|
+
"stylis": "^4.3.6",
|
|
65
|
+
"stylis-plugin-rtl": "^2.1.1",
|
|
66
|
+
"tslib": "^2.8.1",
|
|
67
|
+
"typescript": "~5.7.2",
|
|
68
|
+
"typescript-eslint": "^8.22.0",
|
|
69
|
+
"vite": "^6.1.0",
|
|
70
|
+
"zod": "^3.24.2"
|
|
71
|
+
},
|
|
72
|
+
"peerDependencies": {
|
|
73
|
+
"@emotion/cache": "^11.14.0",
|
|
74
|
+
"@emotion/react": "^11.14.0",
|
|
75
|
+
"@emotion/styled": "^11.14.0",
|
|
76
|
+
"@fortawesome/fontawesome-svg-core": "^6.7.2",
|
|
77
|
+
"@fortawesome/free-brands-svg-icons": "^6.7.2",
|
|
78
|
+
"@fortawesome/free-regular-svg-icons": "^6.7.2",
|
|
79
|
+
"@fortawesome/free-solid-svg-icons": "^6.7.2",
|
|
80
|
+
"@fortawesome/react-fontawesome": "^0.2.2",
|
|
81
|
+
"@hookform/resolvers": "^4.1.0",
|
|
82
|
+
"@mui/icons-material": "^6.4.8",
|
|
83
|
+
"@mui/material": "^6.4.4",
|
|
84
|
+
"@mui/x-charts": "^7.27.0",
|
|
85
|
+
"@mui/x-data-grid-premium": "^8.3.0",
|
|
86
|
+
"@mui/x-date-pickers": "^7.27.0",
|
|
87
|
+
"@mui/x-license": "^8.3.0",
|
|
88
|
+
"@mui/x-tree-view": "^7.26.0",
|
|
89
|
+
"@react-spring/web": "^9.7.5",
|
|
90
|
+
"@reduxjs/toolkit": "^2.5.1",
|
|
91
|
+
"axios": "^1.8.1",
|
|
92
|
+
"i18next": "^24.2.2",
|
|
93
|
+
"i18next-browser-languagedetector": "^8.0.3",
|
|
94
|
+
"i18next-http-backend": "^3.0.2",
|
|
95
|
+
"moment": "^2.30.1",
|
|
96
|
+
"oidc-client-ts": "^3.1.0",
|
|
97
|
+
"react": "^19.0.0",
|
|
98
|
+
"react-dom": "^19.0.0",
|
|
99
|
+
"react-hook-form": "^7.54.2",
|
|
100
|
+
"react-i18next": "^15.4.0",
|
|
101
|
+
"react-redux": "^9.2.0",
|
|
102
|
+
"react-router-dom": "^7.1.5",
|
|
103
|
+
"react-toastify": "^11.0.5",
|
|
104
|
+
"rollup": "^4.41.1",
|
|
105
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
106
|
+
"stylis": "^4.3.6",
|
|
107
|
+
"stylis-plugin-rtl": "^2.1.1",
|
|
108
|
+
"zod": "^3.24.2"
|
|
109
|
+
},
|
|
110
|
+
"dependencies": {
|
|
111
|
+
"@rollup/plugin-json": "^6.1.0"
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var resolve = require('@rollup/plugin-node-resolve');
|
|
6
|
-
var commonjs = require('@rollup/plugin-commonjs');
|
|
7
|
-
var typescript = require('@rollup/plugin-typescript');
|
|
8
|
-
var dts = require('rollup-plugin-dts');
|
|
9
|
-
var terser = require('@rollup/plugin-terser');
|
|
10
|
-
var json = require('@rollup/plugin-json');
|
|
11
|
-
var peerDepsExternal = require('rollup-plugin-peer-deps-external');
|
|
12
|
-
var postcss = require('rollup-plugin-postcss');
|
|
13
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var resolve = require('@rollup/plugin-node-resolve');
|
|
6
|
+
var commonjs = require('@rollup/plugin-commonjs');
|
|
7
|
+
var typescript = require('@rollup/plugin-typescript');
|
|
8
|
+
var dts = require('rollup-plugin-dts');
|
|
9
|
+
var terser = require('@rollup/plugin-terser');
|
|
10
|
+
var json = require('@rollup/plugin-json');
|
|
11
|
+
var peerDepsExternal = require('rollup-plugin-peer-deps-external');
|
|
12
|
+
var postcss = require('rollup-plugin-postcss');
|
|
13
|
+
|
|
14
14
|
const packageJson = require("./package.json");
|
|
15
15
|
|
|
16
16
|
var rollup_config = [
|
|
@@ -45,6 +45,6 @@ var rollup_config = [
|
|
|
45
45
|
plugins: [dts.default()],
|
|
46
46
|
external: [/\.css$/],
|
|
47
47
|
},
|
|
48
|
-
];
|
|
49
|
-
|
|
50
|
-
exports.default = rollup_config;
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
exports.default = rollup_config;
|
package/src/components/App.tsx
CHANGED
|
@@ -1,14 +1,74 @@
|
|
|
1
1
|
import { useDispatch, useSelector } from "react-redux";
|
|
2
|
-
import { createTheme } from "@mui/material";
|
|
2
|
+
import { createTheme, ThemeOptions } from "@mui/material";
|
|
3
3
|
import { ThemeProvider } from "@emotion/react";
|
|
4
4
|
import React, { useEffect } from "react";
|
|
5
5
|
import { RootState } from "../redux/store";
|
|
6
|
-
import { LightThemeOptions } from "../theme/LightThemeOptions";
|
|
7
|
-
import { DarkThemeOptions } from "../theme/DarkThemeOptions";
|
|
8
6
|
import Layout from "../layout/Layout";
|
|
9
7
|
import { AppInfo, AppInfoActions } from "../redux/features/common/AppInfoSlice";
|
|
8
|
+
import { LicenseInfo } from "@mui/x-license";
|
|
10
9
|
|
|
11
10
|
const App: React.FC<AppInfo> = (props: AppInfo) => {
|
|
11
|
+
LicenseInfo.setLicenseKey(props.muiPremiumKey);
|
|
12
|
+
const LightThemeOptions: ThemeOptions = {
|
|
13
|
+
components: {
|
|
14
|
+
MuiCssBaseline: {
|
|
15
|
+
styleOverrides: `
|
|
16
|
+
/* Custom Scrollbar */
|
|
17
|
+
* {
|
|
18
|
+
scrollbar-width: thin;
|
|
19
|
+
scrollbar-color: ${props.appTheme.light.primaryColor} #ffffff;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/* Webkit Browsers */
|
|
23
|
+
*::-webkit-scrollbar {
|
|
24
|
+
width: 12px;
|
|
25
|
+
height: 10px;
|
|
26
|
+
}
|
|
27
|
+
`,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
palette: {
|
|
31
|
+
mode: "light",
|
|
32
|
+
primary: {
|
|
33
|
+
main: props.appTheme.light.primaryColor,
|
|
34
|
+
},
|
|
35
|
+
secondary: {
|
|
36
|
+
main: props.appTheme.light.secondaryColor,
|
|
37
|
+
},
|
|
38
|
+
background: {
|
|
39
|
+
default: "#f5f5f5",
|
|
40
|
+
paper: "#f5f5f5",
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
const DarkThemeOptions: ThemeOptions = {
|
|
45
|
+
components: {
|
|
46
|
+
MuiCssBaseline: {
|
|
47
|
+
styleOverrides: `
|
|
48
|
+
/* Custom Scrollbar */
|
|
49
|
+
* {
|
|
50
|
+
scrollbar-width: thin;
|
|
51
|
+
scrollbar-color: ${props.appTheme.dark.primaryColor} #121212;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* Webkit Browsers */
|
|
55
|
+
*::-webkit-scrollbar {
|
|
56
|
+
width: 12px;
|
|
57
|
+
height: 10px;
|
|
58
|
+
}
|
|
59
|
+
`,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
palette: {
|
|
63
|
+
mode: "dark",
|
|
64
|
+
primary: {
|
|
65
|
+
main: props.appTheme.dark.primaryColor,
|
|
66
|
+
},
|
|
67
|
+
secondary: {
|
|
68
|
+
main: props.appTheme.dark.secondaryColor,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
};
|
|
12
72
|
const dispatch = useDispatch();
|
|
13
73
|
const AppLayoutState = useSelector((state: RootState) => state.AppLayout);
|
|
14
74
|
let themeOptions = { ...LightThemeOptions };
|
|
@@ -5,21 +5,23 @@ import { fab } from "@fortawesome/free-brands-svg-icons";
|
|
|
5
5
|
import { far } from "@fortawesome/free-regular-svg-icons";
|
|
6
6
|
import { fas } from "@fortawesome/free-solid-svg-icons";
|
|
7
7
|
import "../styles/index.css";
|
|
8
|
-
import { LicenseInfo } from "@mui/x-license";
|
|
9
|
-
|
|
10
|
-
LicenseInfo.setLicenseKey(
|
|
11
|
-
"c2bd611fa642666253500ab9c8e4f78fTz0xMTE4MjEsRT0xNzc2OTg4Nzk5MDAwLFM9cHJlbWl1bSxMTT1zdWJzY3JpcHRpb24sUFY9aW5pdGlhbCxLVj0y"
|
|
12
|
-
);
|
|
13
8
|
import "react-toastify/dist/ReactToastify.css";
|
|
14
9
|
import App from "./App";
|
|
15
10
|
import { AppInfo } from "../redux/features/common/AppInfoSlice";
|
|
16
11
|
import { commonStoresInitialState } from "../redux/features/common/CommonStoreSlice";
|
|
12
|
+
import { ADMINISTRATION_STORES } from "../redux/features/administration/AdministrationStoresMetaData";
|
|
17
13
|
|
|
18
14
|
library.add(fab);
|
|
19
15
|
library.add(far);
|
|
20
16
|
library.add(fas);
|
|
21
17
|
|
|
22
18
|
export const BaseApp: React.FC<AppInfo> = (props) => {
|
|
19
|
+
if (props.enableAdministrationModule) {
|
|
20
|
+
for (let adminStoreKey of Object.keys(ADMINISTRATION_STORES)) {
|
|
21
|
+
commonStoresInitialState[adminStoreKey] =
|
|
22
|
+
ADMINISTRATION_STORES[adminStoreKey];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
23
25
|
if (props?.businessCommonStoresMetaData) {
|
|
24
26
|
for (let businessStoreKey of Object.keys(
|
|
25
27
|
props.businessCommonStoresMetaData
|
|
@@ -14,7 +14,6 @@ import axios from "axios";
|
|
|
14
14
|
import { toast } from "react-toastify";
|
|
15
15
|
import { RootState } from "../../redux/store";
|
|
16
16
|
import { UserSessionActions } from "../../redux/features/common/UserSessionSlice";
|
|
17
|
-
import { DarkThemeOptions } from "../../theme/DarkThemeOptions";
|
|
18
17
|
|
|
19
18
|
const Login: React.FC = () => {
|
|
20
19
|
const appInfo = useSelector((state: RootState) => state.AppInfo.value);
|
|
@@ -67,7 +66,34 @@ const Login: React.FC = () => {
|
|
|
67
66
|
const userSession = useSelector(
|
|
68
67
|
(state: RootState) => state.UserSession.value
|
|
69
68
|
);
|
|
70
|
-
const loginTheme = createTheme(
|
|
69
|
+
const loginTheme = createTheme({
|
|
70
|
+
components: {
|
|
71
|
+
MuiCssBaseline: {
|
|
72
|
+
styleOverrides: `
|
|
73
|
+
/* Custom Scrollbar */
|
|
74
|
+
* {
|
|
75
|
+
scrollbar-width: thin;
|
|
76
|
+
scrollbar-color: ${appInfo.appTheme.dark.primaryColor} #121212;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* Webkit Browsers */
|
|
80
|
+
*::-webkit-scrollbar {
|
|
81
|
+
width: 12px;
|
|
82
|
+
height: 10px;
|
|
83
|
+
}
|
|
84
|
+
`,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
palette: {
|
|
88
|
+
mode: "dark",
|
|
89
|
+
primary: {
|
|
90
|
+
main: appInfo.appTheme.dark.primaryColor,
|
|
91
|
+
},
|
|
92
|
+
secondary: {
|
|
93
|
+
main: appInfo.appTheme.dark.secondaryColor,
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
});
|
|
71
97
|
const checkUserSession = async () => {
|
|
72
98
|
if (appInfo?.apiBaseUrl) {
|
|
73
99
|
if (userSession.isAuthenticated == null) {
|
|
@@ -9,6 +9,7 @@ import { SystemRoute } from "../routes/types";
|
|
|
9
9
|
|
|
10
10
|
const MainContent: React.FC = () => {
|
|
11
11
|
const AppLayoutState = useSelector((state: RootState) => state.AppLayout);
|
|
12
|
+
const AppInfo = useSelector((state: RootState) => state.AppInfo.value);
|
|
12
13
|
const businessRoutes = useSelector(
|
|
13
14
|
(state: RootState) => state.AppInfo.value.businessRoutes
|
|
14
15
|
);
|
|
@@ -28,15 +29,17 @@ const MainContent: React.FC = () => {
|
|
|
28
29
|
}}
|
|
29
30
|
>
|
|
30
31
|
<Routes>
|
|
31
|
-
{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
{AppInfo.enableAdministrationModule
|
|
33
|
+
? SYSTEM_ROUTES.map((route: SystemRoute, index) => {
|
|
34
|
+
return (
|
|
35
|
+
<Route
|
|
36
|
+
key={"adm" + index}
|
|
37
|
+
path={route.path}
|
|
38
|
+
Component={route.component}
|
|
39
|
+
/>
|
|
40
|
+
);
|
|
41
|
+
})
|
|
42
|
+
: null}
|
|
40
43
|
{businessRoutes.map((route: SystemRoute, index) => {
|
|
41
44
|
return (
|
|
42
45
|
<Route
|
|
@@ -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
|
|
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
|
-
|
|
259
|
-
...
|
|
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(
|
|
266
|
+
const navigationItem = findNavigationItemById(
|
|
267
|
+
itemId,
|
|
268
|
+
mergedNavigationItems
|
|
269
|
+
);
|
|
269
270
|
if (
|
|
270
271
|
navigationItem?.action === "NAVIGATION" &&
|
|
271
272
|
navigationItem?.actionPayload != null &&
|
|
@@ -13,6 +13,12 @@ export type AppInfo = {
|
|
|
13
13
|
businessNavigationItems: Array<ExtendedTreeItemProps>;
|
|
14
14
|
businessReduxReducers: { [key: string]: Reducer<any> };
|
|
15
15
|
businessCommonStoresMetaData: { [key: string]: StoreMetaData };
|
|
16
|
+
muiPremiumKey: string;
|
|
17
|
+
enableAdministrationModule: boolean;
|
|
18
|
+
appTheme: {
|
|
19
|
+
light: { primaryColor: string; secondaryColor: string };
|
|
20
|
+
dark: { primaryColor: string; secondaryColor: string };
|
|
21
|
+
};
|
|
16
22
|
};
|
|
17
23
|
|
|
18
24
|
export type AppInfoProp = {
|
|
@@ -26,10 +32,16 @@ const initialState: AppInfoProp = {
|
|
|
26
32
|
appName: null,
|
|
27
33
|
appVersion: null,
|
|
28
34
|
appLogo: null,
|
|
35
|
+
muiPremiumKey: null,
|
|
36
|
+
enableAdministrationModule: false,
|
|
29
37
|
businessRoutes: [],
|
|
30
38
|
businessNavigationItems: [],
|
|
31
39
|
businessReduxReducers: {},
|
|
32
40
|
businessCommonStoresMetaData: {},
|
|
41
|
+
appTheme: {
|
|
42
|
+
light: { primaryColor: "#37505C", secondaryColor: "#ff6d00" },
|
|
43
|
+
dark: { primaryColor: "#ea690e", secondaryColor: "#74776B" },
|
|
44
|
+
},
|
|
33
45
|
},
|
|
34
46
|
};
|
|
35
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
|
-
};
|