icleafreportui 0.1.5 → 0.1.7
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/App.js +39 -43
- package/dist/Login.js +130 -121
- package/dist/Reports/CourseReport.js +163 -152
- package/dist/Reports/ExamPackReport.js +245 -226
- package/dist/Reports/ExamReport.js +173 -161
- package/dist/Reports/Report.js +193 -178
- package/dist/api/client.js +1 -7
- package/dist/components/Header.js +76 -78
- package/dist/components/Loader.js +16 -22
- package/dist/components/imagePathUrl.js +5 -11
- package/dist/components/sidebar.js +96 -65
- package/dist/context/TenantProvider.js +13 -22
- package/dist/index.js +16 -15
- package/dist/package.js +15 -100
- package/dist/reportWebVitals.js +2 -10
- package/dist/setupTests.js +5 -3
- package/package.json +1 -1
package/dist/App.js
CHANGED
|
@@ -1,22 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
var _reactRouterDom = require("react-router-dom");
|
|
11
|
-
var _CourseReport = _interopRequireDefault(require("./Reports/CourseReport"));
|
|
12
|
-
var _ExamReport = _interopRequireDefault(require("./Reports/ExamReport"));
|
|
13
|
-
var _ExamPackReport = _interopRequireDefault(require("./Reports/ExamPackReport"));
|
|
14
|
-
var _TenantProvider = require("./context/TenantProvider");
|
|
15
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
17
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
|
-
// ADD THIS
|
|
19
|
-
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import Login from './Login';
|
|
3
|
+
import Report from './Reports/Report';
|
|
4
|
+
import { HashRouter, Route, Routes } from 'react-router-dom';
|
|
5
|
+
import CourseReport from './Reports/CourseReport';
|
|
6
|
+
import ExamReport from './Reports/ExamReport';
|
|
7
|
+
import ExamPackReport from './Reports/ExamPackReport';
|
|
8
|
+
import { TenantProvider } from './context/TenantProvider'; // ADD THIS
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
10
|
const App = () => {
|
|
21
11
|
const userToken = localStorage.getItem("token");
|
|
22
12
|
|
|
@@ -25,28 +15,34 @@ const App = () => {
|
|
|
25
15
|
baseURL: process.env.REACT_APP_BASE_URL || 'http://192.168.2.203:8080/icleafreport',
|
|
26
16
|
tenantToken: 'tn_852cf0d3242a11f19d84005056575b50' // Your test token
|
|
27
17
|
};
|
|
28
|
-
return /*#__PURE__*/
|
|
29
|
-
config: config
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
18
|
+
return /*#__PURE__*/_jsx(TenantProvider, {
|
|
19
|
+
config: config,
|
|
20
|
+
children: /*#__PURE__*/_jsx("div", {
|
|
21
|
+
className: "App",
|
|
22
|
+
children: /*#__PURE__*/_jsx(HashRouter, {
|
|
23
|
+
children: /*#__PURE__*/_jsxs(Routes, {
|
|
24
|
+
children: [/*#__PURE__*/_jsx(Route, {
|
|
25
|
+
path: "/",
|
|
26
|
+
element: userToken != null ? /*#__PURE__*/_jsx(Report, {}) : /*#__PURE__*/_jsx(Login, {})
|
|
27
|
+
}), /*#__PURE__*/_jsx(Route, {
|
|
28
|
+
path: "/login",
|
|
29
|
+
element: userToken != null ? /*#__PURE__*/_jsx(Report, {}) : /*#__PURE__*/_jsx(Login, {})
|
|
30
|
+
}), /*#__PURE__*/_jsx(Route, {
|
|
31
|
+
path: "/report",
|
|
32
|
+
element: /*#__PURE__*/_jsx(Report, {})
|
|
33
|
+
}), /*#__PURE__*/_jsx(Route, {
|
|
34
|
+
path: "/coursereport",
|
|
35
|
+
element: /*#__PURE__*/_jsx(CourseReport, {})
|
|
36
|
+
}), /*#__PURE__*/_jsx(Route, {
|
|
37
|
+
path: "/examReport",
|
|
38
|
+
element: /*#__PURE__*/_jsx(ExamReport, {})
|
|
39
|
+
}), /*#__PURE__*/_jsx(Route, {
|
|
40
|
+
path: "/examPackReport",
|
|
41
|
+
element: /*#__PURE__*/_jsx(ExamPackReport, {})
|
|
42
|
+
})]
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
})
|
|
46
|
+
});
|
|
51
47
|
};
|
|
52
|
-
|
|
48
|
+
export default App;
|
package/dist/Login.js
CHANGED
|
@@ -1,30 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var _ri = require("react-icons/ri");
|
|
12
|
-
var _ai = require("react-icons/ai");
|
|
13
|
-
require("bootstrap/dist/css/bootstrap.css");
|
|
14
|
-
require("./login.css");
|
|
15
|
-
var _material = require("@mui/material");
|
|
16
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
18
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
19
|
-
// Correct import statement for useHistory
|
|
20
|
-
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import axios from 'axios';
|
|
3
|
+
import { useHistory, useNavigate } from 'react-router-dom'; // Correct import statement for useHistory
|
|
4
|
+
import { logo, youngMan } from './components/imagePathUrl';
|
|
5
|
+
import { RiMailLine, RiLockLine, RiEyeOffLine } from 'react-icons/ri';
|
|
6
|
+
import { AiOutlineEyeInvisible, AiOutlineEye } from 'react-icons/ai';
|
|
7
|
+
import 'bootstrap/dist/css/bootstrap.css';
|
|
8
|
+
import './login.css';
|
|
9
|
+
import { Alert, Button, Snackbar } from '@mui/material';
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
21
11
|
const Login = () => {
|
|
22
|
-
const [username, setUsername] =
|
|
23
|
-
const [password, setPassword] =
|
|
24
|
-
const [showPassword, setShowPassword] =
|
|
25
|
-
const [error, setError] =
|
|
26
|
-
const [openAlert, setOpenAlert] =
|
|
27
|
-
const navigate =
|
|
12
|
+
const [username, setUsername] = useState('');
|
|
13
|
+
const [password, setPassword] = useState('');
|
|
14
|
+
const [showPassword, setShowPassword] = useState(false);
|
|
15
|
+
const [error, setError] = useState('');
|
|
16
|
+
const [openAlert, setOpenAlert] = useState(false);
|
|
17
|
+
const navigate = useNavigate(); // Initialize useHistory
|
|
28
18
|
|
|
29
19
|
// const getSubDomain = () => {
|
|
30
20
|
// const hostname = window.location.hostname;
|
|
@@ -56,7 +46,7 @@ const Login = () => {
|
|
|
56
46
|
const subdomain = getSubDomain();
|
|
57
47
|
try {
|
|
58
48
|
// const response = await axios.get(`${baseURL}` + "api/login?userName=" + username + "&password=" + password);
|
|
59
|
-
const response = await
|
|
49
|
+
const response = await axios.get(`${baseURL}api/login?userName=${username}&password=${password}&subdomain=${subdomain}`);
|
|
60
50
|
console.log(response, "response");
|
|
61
51
|
if (response.data) {
|
|
62
52
|
var res = response.data;
|
|
@@ -80,98 +70,117 @@ const Login = () => {
|
|
|
80
70
|
const togglePasswordVisibility = () => {
|
|
81
71
|
setShowPassword(!showPassword);
|
|
82
72
|
};
|
|
83
|
-
return /*#__PURE__*/
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
73
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
74
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
75
|
+
className: "row page_container",
|
|
76
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
77
|
+
className: "col-6 login_container1",
|
|
78
|
+
children: /*#__PURE__*/_jsx("img", {
|
|
79
|
+
className: "login_img",
|
|
80
|
+
src: youngMan
|
|
81
|
+
})
|
|
82
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
83
|
+
className: "col-6 login_container2_bg",
|
|
84
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
85
|
+
className: "login_form_container",
|
|
86
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
87
|
+
className: "logo_container",
|
|
88
|
+
children: /*#__PURE__*/_jsx("img", {
|
|
89
|
+
className: "logo_img",
|
|
90
|
+
src: logo,
|
|
91
|
+
alt: "Login logo Image"
|
|
92
|
+
})
|
|
93
|
+
}), /*#__PURE__*/_jsx("text", {
|
|
94
|
+
className: "welcome_text",
|
|
95
|
+
children: "Welcome"
|
|
96
|
+
}), /*#__PURE__*/_jsxs("form", {
|
|
97
|
+
onSubmit: handleLogin,
|
|
98
|
+
children: [/*#__PURE__*/_jsx("label", {
|
|
99
|
+
className: "login_label",
|
|
100
|
+
children: "Username"
|
|
101
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
102
|
+
className: "input_contanier",
|
|
103
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
104
|
+
className: "input_icons",
|
|
105
|
+
children: /*#__PURE__*/_jsx(RiMailLine, {})
|
|
106
|
+
}), /*#__PURE__*/_jsx("input", {
|
|
107
|
+
type: "username",
|
|
108
|
+
id: "username",
|
|
109
|
+
name: "username",
|
|
110
|
+
className: "input_box",
|
|
111
|
+
placeholder: "Username"
|
|
112
|
+
// onBlur={(e) => validateForm(e.target.value, language.enterUsername, "userName")}
|
|
113
|
+
,
|
|
114
|
+
value: username,
|
|
115
|
+
onChange: e => {
|
|
116
|
+
setUsername(e.target.value);
|
|
117
|
+
// validateForm(e.target.value, language.enterUsername, "userName")
|
|
118
|
+
}
|
|
119
|
+
})]
|
|
120
|
+
}), /*#__PURE__*/_jsx("label", {
|
|
121
|
+
className: "login_label",
|
|
122
|
+
children: "Password"
|
|
123
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
124
|
+
className: "input_contanier",
|
|
125
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
126
|
+
className: "input_icons",
|
|
127
|
+
children: /*#__PURE__*/_jsx(RiLockLine, {})
|
|
128
|
+
}), /*#__PURE__*/_jsx("input", {
|
|
129
|
+
type: showPassword ? "text" : "password",
|
|
130
|
+
id: "password",
|
|
131
|
+
name: "password",
|
|
132
|
+
className: "input_box"
|
|
133
|
+
// onBlur={(e) => validateForm(e.target.value, language.enterPass, "password")}
|
|
134
|
+
,
|
|
135
|
+
placeholder: "Password",
|
|
136
|
+
value: password,
|
|
137
|
+
onChange: e => {
|
|
138
|
+
setPassword(e.target.value);
|
|
139
|
+
// validateForm(e.target.value, language.enterPass, "password")
|
|
140
|
+
},
|
|
141
|
+
style: {
|
|
142
|
+
userSelect: "none"
|
|
143
|
+
}
|
|
144
|
+
}), showPassword ? /*#__PURE__*/_jsx(AiOutlineEye, {
|
|
145
|
+
onClick: () => togglePasswordVisibility(),
|
|
146
|
+
className: "eye-icon_login"
|
|
147
|
+
}) : /*#__PURE__*/_jsx(AiOutlineEyeInvisible, {
|
|
148
|
+
onClick: () => togglePasswordVisibility(),
|
|
149
|
+
className: "eye-icon_login"
|
|
150
|
+
})]
|
|
151
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
152
|
+
className: "login_btn_container",
|
|
153
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
154
|
+
variant: "contained",
|
|
155
|
+
style: {
|
|
156
|
+
width: "100%",
|
|
157
|
+
marginTop: "15px",
|
|
158
|
+
padding: "10px"
|
|
159
|
+
},
|
|
160
|
+
type: "submit",
|
|
161
|
+
children: "Login"
|
|
162
|
+
})
|
|
163
|
+
})]
|
|
164
|
+
})]
|
|
165
|
+
})
|
|
166
|
+
}), /*#__PURE__*/_jsx(Snackbar, {
|
|
167
|
+
open: openAlert,
|
|
168
|
+
autoHideDuration: 6000,
|
|
169
|
+
onClose: () => setOpenAlert(false),
|
|
170
|
+
anchorOrigin: {
|
|
171
|
+
vertical: 'top',
|
|
172
|
+
horizontal: 'center'
|
|
173
|
+
},
|
|
174
|
+
children: /*#__PURE__*/_jsx(Alert, {
|
|
175
|
+
onClose: () => setOpenAlert(false),
|
|
176
|
+
severity: "info",
|
|
177
|
+
sx: {
|
|
178
|
+
width: '30%'
|
|
179
|
+
},
|
|
180
|
+
children: error
|
|
181
|
+
})
|
|
182
|
+
})]
|
|
183
|
+
})
|
|
184
|
+
});
|
|
176
185
|
};
|
|
177
|
-
|
|
186
|
+
export default Login;
|