@campxdev/shared 0.5.21 → 0.5.22
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/.eslintignore +4 -0
- package/.eslintrc.js +34 -0
- package/.prettierrc +10 -0
- package/exports.ts +7 -6
- package/package.json +64 -50
- package/publish.sh +2 -0
- package/src/assets/images/index.ts +8 -8
- package/src/components/Breadcrumbs.tsx +3 -3
- package/src/components/ChangePassword.tsx +147 -147
- package/src/components/DropDownButton.tsx +167 -163
- package/src/components/ErrorBoundary/ErrorBoundary.tsx +22 -22
- package/src/components/ErrorBoundary/ErrorFallback.tsx +215 -215
- package/src/components/ErrorBoundary/GlobalNetworkLoadingIndicator.tsx +6 -6
- package/src/components/ErrorBoundary/index.tsx +1 -1
- package/src/components/FullScreenLoader.tsx +15 -15
- package/src/components/HookForm/AutoCompleteSearch.tsx +0 -30
- package/src/components/HookForm/RadioGroup.tsx +1 -1
- package/src/components/IconButtons/Icons.tsx +1 -2
- package/src/components/Input/AutoCompleteSearch.tsx +0 -30
- package/src/components/Input/SingleSelect.tsx +0 -15
- package/src/components/Layout/Header/AppHeader.tsx +89 -89
- package/src/components/Layout/Header/AppsMenu.tsx +79 -79
- package/src/components/Layout/Header/CogWheelMenu.tsx +27 -27
- package/src/components/Layout/Header/UserBox.tsx +25 -25
- package/src/components/Layout/Header/applications.ts +79 -79
- package/src/components/Layout/Header/assets/index.ts +10 -10
- package/src/components/Layout/Header/styles.tsx +72 -72
- package/src/components/LayoutWrapper.tsx +6 -6
- package/src/components/LinearProgress.tsx +14 -14
- package/src/components/ListItemButton.tsx +79 -79
- package/src/components/LoginForm.tsx +86 -86
- package/src/components/MenuButton.tsx +88 -88
- package/src/components/ModalButtons/DialogButton.tsx +66 -66
- package/src/components/PageContent.tsx +10 -10
- package/src/components/PageNotFound.tsx +12 -12
- package/src/components/PopupConfirm/ConfirmContextProvider.tsx +28 -28
- package/src/components/PopupConfirm/PopupConfirm.tsx +27 -27
- package/src/components/PopupConfirm/useConfirm.ts +41 -41
- package/src/components/SideMenuHeader.tsx +15 -15
- package/src/components/SideNav.tsx +119 -119
- package/src/components/Spinner.tsx +14 -14
- package/src/components/TableComponent/ReactTable.tsx +256 -256
- package/src/components/TableComponent/RenderTableBody.tsx +56 -56
- package/src/components/TableComponent/index.tsx +171 -171
- package/src/components/TableComponent/react-table-config.d.ts +2 -3
- package/src/components/index.ts +54 -54
- package/src/config/axios.ts +50 -50
- package/src/config/axiosXTenant.ts +57 -0
- package/src/constants/isDevelopment.ts +2 -2
- package/src/contexts/LoginFormProvider.tsx +28 -28
- package/src/contexts/Providers.tsx +40 -40
- package/src/contexts/QueryClientProvider.tsx +15 -15
- package/src/hooks/index.ts +2 -2
- package/src/hooks/useAppInit.ts +23 -23
- package/src/hooks/useAuth.ts +78 -77
- package/src/layouts/Components/DashBoardMenu.tsx +77 -77
- package/src/layouts/Components/icons/index.tsx +32 -32
- package/src/layouts/Components/styles.tsx +23 -23
- package/src/permissions/PageWithPermission.tsx +9 -9
- package/src/permissions/PermissionDeniedPage.tsx +13 -13
- package/src/permissions/PermissionsStore.ts +303 -303
- package/src/shared-state/index.ts +3 -3
- package/src/theme/MuiThemeProvider.tsx +9 -9
- package/src/theme/theme.d.ts +72 -72
- package/src/utils/index.ts +7 -7
- package/src/utils/logout.ts +19 -19
- package/src/utils/withLocalization.tsx +8 -8
- package/src/utils/withRouteWrapper.tsx +20 -20
- package/src/utils/withSuspense.tsx +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Permission } from
|
|
1
|
+
import { Permission } from '../../permissions'
|
|
2
2
|
import {
|
|
3
3
|
ActivitiesIcon,
|
|
4
4
|
AdmissionsIcon,
|
|
@@ -11,80 +11,80 @@ import {
|
|
|
11
11
|
SettingsIcon,
|
|
12
12
|
StudentsIcon,
|
|
13
13
|
TaskListIcon,
|
|
14
|
-
} from
|
|
15
|
-
|
|
14
|
+
} from './icons'
|
|
15
|
+
;``
|
|
16
16
|
export interface IMenuItem {
|
|
17
|
-
title: string
|
|
18
|
-
path: string
|
|
19
|
-
icon?: any
|
|
20
|
-
children?: Array<IMenuItem
|
|
21
|
-
permissionKey?: string
|
|
17
|
+
title: string
|
|
18
|
+
path: string
|
|
19
|
+
icon?: any
|
|
20
|
+
children?: Array<IMenuItem>
|
|
21
|
+
permissionKey?: string
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export const dashboardMenu: Array<IMenuItem> = [
|
|
25
25
|
{
|
|
26
|
-
title:
|
|
27
|
-
path:
|
|
26
|
+
title: 'Dashboard',
|
|
27
|
+
path: '/dashboard',
|
|
28
28
|
icon: DashboardIcon,
|
|
29
29
|
permissionKey: Permission.CAN_DASHBOARD_VIEW,
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
|
-
title:
|
|
33
|
-
path:
|
|
32
|
+
title: 'Tasks',
|
|
33
|
+
path: '/tasks',
|
|
34
34
|
icon: TaskListIcon,
|
|
35
35
|
children: [
|
|
36
36
|
{
|
|
37
|
-
title:
|
|
38
|
-
path:
|
|
37
|
+
title: 'Dashboard',
|
|
38
|
+
path: '/dashboard',
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
|
-
title:
|
|
42
|
-
path:
|
|
41
|
+
title: 'Taskboard',
|
|
42
|
+
path: '/taskboard/pending-task/',
|
|
43
43
|
permissionKey: Permission.CAN_TASKS_VIEW,
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
|
-
title:
|
|
47
|
-
path:
|
|
46
|
+
title: 'Reports',
|
|
47
|
+
path: '/reports',
|
|
48
48
|
},
|
|
49
49
|
],
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
|
-
title:
|
|
53
|
-
path:
|
|
52
|
+
title: 'Admissions',
|
|
53
|
+
path: '/admissions',
|
|
54
54
|
icon: AdmissionsIcon,
|
|
55
55
|
children: [
|
|
56
56
|
{
|
|
57
|
-
title:
|
|
58
|
-
path:
|
|
57
|
+
title: 'Dashboard',
|
|
58
|
+
path: '/dashboard',
|
|
59
59
|
permissionKey: Permission.CAN_ADMISSIONS_DASHBOARD_VIEW,
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
|
-
title:
|
|
63
|
-
path:
|
|
62
|
+
title: 'Leads',
|
|
63
|
+
path: '/leads',
|
|
64
64
|
permissionKey: Permission.ADMISSIONS_VIEW,
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
|
-
title:
|
|
68
|
-
path:
|
|
67
|
+
title: 'CET',
|
|
68
|
+
path: '/cet',
|
|
69
69
|
permissionKey: Permission.ADMISSIONS_VIEW,
|
|
70
70
|
},
|
|
71
71
|
|
|
72
72
|
{
|
|
73
|
-
title:
|
|
74
|
-
path:
|
|
73
|
+
title: 'Reports',
|
|
74
|
+
path: '/reports',
|
|
75
75
|
permissionKey: Permission.ADMISSIONS_VIEW,
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
|
-
title:
|
|
79
|
-
path:
|
|
78
|
+
title: 'All Admissions',
|
|
79
|
+
path: '/all',
|
|
80
80
|
permissionKey: Permission.ADMISSIONS_VIEW,
|
|
81
81
|
},
|
|
82
82
|
],
|
|
83
83
|
},
|
|
84
84
|
|
|
85
85
|
{
|
|
86
|
-
title:
|
|
87
|
-
path:
|
|
86
|
+
title: 'Students',
|
|
87
|
+
path: '/students',
|
|
88
88
|
icon: StudentsIcon,
|
|
89
89
|
permissionKey: Permission.STUDENTS_VIEW,
|
|
90
90
|
|
|
@@ -104,93 +104,93 @@ export const dashboardMenu: Array<IMenuItem> = [
|
|
|
104
104
|
// ],
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
|
-
title:
|
|
108
|
-
path:
|
|
107
|
+
title: 'Classrooms',
|
|
108
|
+
path: '/classrooms',
|
|
109
109
|
icon: ClassroomsIcon,
|
|
110
110
|
children: [
|
|
111
111
|
{
|
|
112
|
-
title:
|
|
113
|
-
path:
|
|
112
|
+
title: 'Classrooms',
|
|
113
|
+
path: '/classrooms',
|
|
114
114
|
permissionKey: Permission.CLASSROOM_VIEW,
|
|
115
115
|
},
|
|
116
116
|
{
|
|
117
|
-
title:
|
|
118
|
-
path:
|
|
117
|
+
title: 'Faculty Timetable',
|
|
118
|
+
path: '/faculty-timetable',
|
|
119
119
|
permissionKey: Permission.CLASSROOM_VIEW,
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
|
-
title:
|
|
123
|
-
path:
|
|
122
|
+
title: 'Reports',
|
|
123
|
+
path: '/reports/classrooms',
|
|
124
124
|
permissionKey: Permission.CLASSROOM_VIEW,
|
|
125
125
|
},
|
|
126
126
|
],
|
|
127
127
|
},
|
|
128
128
|
{
|
|
129
|
-
title:
|
|
130
|
-
path:
|
|
129
|
+
title: 'Activities',
|
|
130
|
+
path: '/activities',
|
|
131
131
|
icon: ActivitiesIcon,
|
|
132
132
|
children: [
|
|
133
133
|
{
|
|
134
|
-
title:
|
|
135
|
-
path:
|
|
134
|
+
title: 'Clubs',
|
|
135
|
+
path: '/clubs',
|
|
136
136
|
permissionKey: Permission.EXTRA_CURRICULAR_ACTIVITIES_CLUBS,
|
|
137
137
|
},
|
|
138
138
|
{
|
|
139
|
-
title:
|
|
140
|
-
path:
|
|
139
|
+
title: 'Events',
|
|
140
|
+
path: '/events',
|
|
141
141
|
permissionKey: Permission.EXTRA_CURRICULAR_ACTIVITIES_EVENTS,
|
|
142
142
|
},
|
|
143
143
|
],
|
|
144
144
|
},
|
|
145
145
|
|
|
146
146
|
{
|
|
147
|
-
title:
|
|
148
|
-
path:
|
|
147
|
+
title: 'Hostels',
|
|
148
|
+
path: '/hostels',
|
|
149
149
|
icon: HostelsIcon,
|
|
150
150
|
children: [
|
|
151
151
|
{
|
|
152
|
-
title:
|
|
153
|
-
path:
|
|
152
|
+
title: 'Dashboard',
|
|
153
|
+
path: '/dashboard',
|
|
154
154
|
permissionKey: Permission.CAN_HOSTELER_DASHBOARD_VIEW,
|
|
155
155
|
},
|
|
156
156
|
{
|
|
157
|
-
title:
|
|
158
|
-
path:
|
|
157
|
+
title: 'Hostelers',
|
|
158
|
+
path: '/hostelers',
|
|
159
159
|
permissionKey: Permission.CAN_HOSTELER_VIEW,
|
|
160
160
|
},
|
|
161
161
|
{
|
|
162
|
-
title:
|
|
163
|
-
path:
|
|
162
|
+
title: 'Fee Payments',
|
|
163
|
+
path: '/fee-payments',
|
|
164
164
|
permissionKey: Permission.CAN_HOSTELER_FEE_PAYMENT_VIEW,
|
|
165
165
|
},
|
|
166
166
|
{
|
|
167
|
-
title:
|
|
168
|
-
path:
|
|
167
|
+
title: 'Reports',
|
|
168
|
+
path: '/reports',
|
|
169
169
|
permissionKey: Permission.CAN_HOSTELER_REPORTS_VIEW,
|
|
170
170
|
},
|
|
171
171
|
],
|
|
172
172
|
},
|
|
173
173
|
{
|
|
174
|
-
title:
|
|
175
|
-
path:
|
|
174
|
+
title: 'Library',
|
|
175
|
+
path: '/library',
|
|
176
176
|
icon: HostelsIcon,
|
|
177
177
|
children: [
|
|
178
178
|
{
|
|
179
|
-
title:
|
|
180
|
-
path:
|
|
179
|
+
title: 'Dashboard',
|
|
180
|
+
path: '/dashboard',
|
|
181
181
|
// permissionKey: Permission.CAN_HOSTELER_DASHBOARD_VIEW,
|
|
182
182
|
},
|
|
183
183
|
{
|
|
184
|
-
title:
|
|
185
|
-
path:
|
|
184
|
+
title: 'Catalogue',
|
|
185
|
+
path: '/catalogue',
|
|
186
186
|
},
|
|
187
187
|
{
|
|
188
|
-
title:
|
|
189
|
-
path:
|
|
188
|
+
title: 'Cards',
|
|
189
|
+
path: '/cards',
|
|
190
190
|
},
|
|
191
191
|
{
|
|
192
|
-
title:
|
|
193
|
-
path:
|
|
192
|
+
title: 'Reports',
|
|
193
|
+
path: '/reports',
|
|
194
194
|
},
|
|
195
195
|
// {
|
|
196
196
|
// title: 'Feedback System',
|
|
@@ -199,34 +199,34 @@ export const dashboardMenu: Array<IMenuItem> = [
|
|
|
199
199
|
],
|
|
200
200
|
},
|
|
201
201
|
{
|
|
202
|
-
title:
|
|
203
|
-
path:
|
|
202
|
+
title: 'HRMS',
|
|
203
|
+
path: '/hrms',
|
|
204
204
|
icon: HrmsIcon,
|
|
205
205
|
children: [
|
|
206
206
|
{
|
|
207
|
-
title:
|
|
208
|
-
path:
|
|
207
|
+
title: 'Leave Applications',
|
|
208
|
+
path: '/leave-applications',
|
|
209
209
|
},
|
|
210
210
|
],
|
|
211
211
|
},
|
|
212
212
|
|
|
213
213
|
{
|
|
214
|
-
title:
|
|
215
|
-
path:
|
|
214
|
+
title: 'Course Registrations',
|
|
215
|
+
path: '/course-registrations',
|
|
216
216
|
icon: ReportsIcon,
|
|
217
217
|
permissionKey: Permission.COURSE_REGISTRATION_VIEW,
|
|
218
218
|
},
|
|
219
219
|
|
|
220
220
|
{
|
|
221
|
-
title:
|
|
222
|
-
path:
|
|
221
|
+
title: 'Activity Logs',
|
|
222
|
+
path: '/audit-logs',
|
|
223
223
|
icon: LogsIcon,
|
|
224
224
|
permissionKey: Permission.VIEW_AUDIT_LOGS,
|
|
225
225
|
},
|
|
226
226
|
{
|
|
227
|
-
title:
|
|
228
|
-
path:
|
|
227
|
+
title: 'Settings',
|
|
228
|
+
path: '/settings',
|
|
229
229
|
icon: SettingsIcon,
|
|
230
230
|
permissionKey: Permission.CAN_SETTINGS_VIEW,
|
|
231
231
|
},
|
|
232
|
-
]
|
|
232
|
+
]
|
|
@@ -36,8 +36,8 @@ export const DashboardIcon = () => {
|
|
|
36
36
|
fill="#fff"
|
|
37
37
|
/>
|
|
38
38
|
</svg>
|
|
39
|
-
)
|
|
40
|
-
}
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
41
|
|
|
42
42
|
export const LogsIcon = () => {
|
|
43
43
|
return (
|
|
@@ -63,8 +63,8 @@ export const LogsIcon = () => {
|
|
|
63
63
|
/>
|
|
64
64
|
</g>
|
|
65
65
|
</svg>
|
|
66
|
-
)
|
|
67
|
-
}
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
68
|
|
|
69
69
|
export const ClassroomsIcon = () => {
|
|
70
70
|
return (
|
|
@@ -81,8 +81,8 @@ export const ClassroomsIcon = () => {
|
|
|
81
81
|
fill="#fff"
|
|
82
82
|
/>
|
|
83
83
|
</svg>
|
|
84
|
-
)
|
|
85
|
-
}
|
|
84
|
+
)
|
|
85
|
+
}
|
|
86
86
|
|
|
87
87
|
export const ReceiptIcon = () => {
|
|
88
88
|
return (
|
|
@@ -119,8 +119,8 @@ export const ReceiptIcon = () => {
|
|
|
119
119
|
/>
|
|
120
120
|
</g>
|
|
121
121
|
</svg>
|
|
122
|
-
)
|
|
123
|
-
}
|
|
122
|
+
)
|
|
123
|
+
}
|
|
124
124
|
|
|
125
125
|
export const SettingsIcon = () => {
|
|
126
126
|
return (
|
|
@@ -151,8 +151,8 @@ export const SettingsIcon = () => {
|
|
|
151
151
|
/>
|
|
152
152
|
</g>
|
|
153
153
|
</svg>
|
|
154
|
-
)
|
|
155
|
-
}
|
|
154
|
+
)
|
|
155
|
+
}
|
|
156
156
|
|
|
157
157
|
export const ReportsIcon = () => {
|
|
158
158
|
return (
|
|
@@ -199,8 +199,8 @@ export const ReportsIcon = () => {
|
|
|
199
199
|
fill="#fff"
|
|
200
200
|
/>
|
|
201
201
|
</svg>
|
|
202
|
-
)
|
|
203
|
-
}
|
|
202
|
+
)
|
|
203
|
+
}
|
|
204
204
|
|
|
205
205
|
export const ExamsIcon = () => {
|
|
206
206
|
return (
|
|
@@ -218,8 +218,8 @@ export const ExamsIcon = () => {
|
|
|
218
218
|
fill="#fff"
|
|
219
219
|
/>
|
|
220
220
|
</svg>
|
|
221
|
-
)
|
|
222
|
-
}
|
|
221
|
+
)
|
|
222
|
+
}
|
|
223
223
|
|
|
224
224
|
export const ActivitiesIcon = () => {
|
|
225
225
|
return (
|
|
@@ -237,8 +237,8 @@ export const ActivitiesIcon = () => {
|
|
|
237
237
|
fill="#fff"
|
|
238
238
|
/>
|
|
239
239
|
</svg>
|
|
240
|
-
)
|
|
241
|
-
}
|
|
240
|
+
)
|
|
241
|
+
}
|
|
242
242
|
|
|
243
243
|
export const AdmissionsIcon = () => {
|
|
244
244
|
return (
|
|
@@ -271,8 +271,8 @@ export const AdmissionsIcon = () => {
|
|
|
271
271
|
fill="#fff"
|
|
272
272
|
/>
|
|
273
273
|
</svg>
|
|
274
|
-
)
|
|
275
|
-
}
|
|
274
|
+
)
|
|
275
|
+
}
|
|
276
276
|
|
|
277
277
|
export const NotificationIcon = () => {
|
|
278
278
|
return (
|
|
@@ -289,8 +289,8 @@ export const NotificationIcon = () => {
|
|
|
289
289
|
fill="#fff"
|
|
290
290
|
/>
|
|
291
291
|
</svg>
|
|
292
|
-
)
|
|
293
|
-
}
|
|
292
|
+
)
|
|
293
|
+
}
|
|
294
294
|
|
|
295
295
|
export const LibraryIcon = () => {
|
|
296
296
|
return (
|
|
@@ -309,8 +309,8 @@ export const LibraryIcon = () => {
|
|
|
309
309
|
strokeWidth="0.2"
|
|
310
310
|
/>
|
|
311
311
|
</svg>
|
|
312
|
-
)
|
|
313
|
-
}
|
|
312
|
+
)
|
|
313
|
+
}
|
|
314
314
|
|
|
315
315
|
export const PlacementIcon = () => {
|
|
316
316
|
return (
|
|
@@ -326,8 +326,8 @@ export const PlacementIcon = () => {
|
|
|
326
326
|
fill="#fff"
|
|
327
327
|
/>
|
|
328
328
|
</svg>
|
|
329
|
-
)
|
|
330
|
-
}
|
|
329
|
+
)
|
|
330
|
+
}
|
|
331
331
|
|
|
332
332
|
export const StudentsIcon = () => {
|
|
333
333
|
return (
|
|
@@ -344,8 +344,8 @@ export const StudentsIcon = () => {
|
|
|
344
344
|
fill="#fff"
|
|
345
345
|
/>
|
|
346
346
|
</svg>
|
|
347
|
-
)
|
|
348
|
-
}
|
|
347
|
+
)
|
|
348
|
+
}
|
|
349
349
|
|
|
350
350
|
export const HostelsIcon = () => {
|
|
351
351
|
return (
|
|
@@ -361,8 +361,8 @@ export const HostelsIcon = () => {
|
|
|
361
361
|
fill="#fff"
|
|
362
362
|
/>
|
|
363
363
|
</svg>
|
|
364
|
-
)
|
|
365
|
-
}
|
|
364
|
+
)
|
|
365
|
+
}
|
|
366
366
|
|
|
367
367
|
export const TaskListIcon = () => {
|
|
368
368
|
return (
|
|
@@ -381,8 +381,8 @@ export const TaskListIcon = () => {
|
|
|
381
381
|
stroke-width="0.4"
|
|
382
382
|
/>
|
|
383
383
|
</svg>
|
|
384
|
-
)
|
|
385
|
-
}
|
|
384
|
+
)
|
|
385
|
+
}
|
|
386
386
|
|
|
387
387
|
export const HrmsIcon = () => {
|
|
388
388
|
return (
|
|
@@ -399,5 +399,5 @@ export const HrmsIcon = () => {
|
|
|
399
399
|
fill="#fff"
|
|
400
400
|
/>
|
|
401
401
|
</svg>
|
|
402
|
-
)
|
|
403
|
-
}
|
|
402
|
+
)
|
|
403
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
import { styled as muiStyled } from
|
|
1
|
+
import styled from 'styled-components'
|
|
2
|
+
import { styled as muiStyled } from '@mui/material'
|
|
3
3
|
|
|
4
|
-
export const headerHeight =
|
|
5
|
-
export const sideNavWidth =
|
|
4
|
+
export const headerHeight = '64px'
|
|
5
|
+
export const sideNavWidth = '220px'
|
|
6
6
|
|
|
7
7
|
export const StyledLayoutContainer = styled.div`
|
|
8
8
|
& > div {
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
`
|
|
11
11
|
|
|
12
12
|
export const StyledHeaderContainer = styled.header`
|
|
13
13
|
z-index: 300;
|
|
@@ -21,40 +21,40 @@ export const StyledHeaderContainer = styled.header`
|
|
|
21
21
|
& > div {
|
|
22
22
|
height: ${headerHeight};
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
`
|
|
25
25
|
|
|
26
|
-
export const StyledLeftNavContainer = muiStyled(
|
|
26
|
+
export const StyledLeftNavContainer = muiStyled('aside')(({ theme }) => ({
|
|
27
27
|
width: sideNavWidth,
|
|
28
28
|
background: theme.palette.secondary.main,
|
|
29
|
-
color:
|
|
30
|
-
position:
|
|
29
|
+
color: 'white',
|
|
30
|
+
position: 'fixed',
|
|
31
31
|
top: headerHeight,
|
|
32
32
|
left: 0,
|
|
33
33
|
height: `calc(100vh - ${headerHeight})`,
|
|
34
|
-
overflowY:
|
|
34
|
+
overflowY: 'auto',
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
width:
|
|
38
|
-
height:
|
|
36
|
+
'&::-webkit-scrollbar': {
|
|
37
|
+
width: '0.5em',
|
|
38
|
+
height: '0.5em',
|
|
39
39
|
},
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
backgroundColor:
|
|
43
|
-
borderRadius:
|
|
41
|
+
'&::-webkit-scrollbar-thumb': {
|
|
42
|
+
backgroundColor: 'rgba(255, 255, 255, 0.3)',
|
|
43
|
+
borderRadius: '3px',
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
background:
|
|
45
|
+
'&:hover': {
|
|
46
|
+
background: 'rgba(255, 255, 255, 0.4)',
|
|
47
47
|
},
|
|
48
48
|
},
|
|
49
49
|
|
|
50
50
|
zIndex: 100,
|
|
51
|
-
}))
|
|
51
|
+
}))
|
|
52
52
|
|
|
53
|
-
export const StyledMainContentContainer = muiStyled(
|
|
53
|
+
export const StyledMainContentContainer = muiStyled('main')(() => ({
|
|
54
54
|
width: `calc(100% - ${sideNavWidth})`,
|
|
55
55
|
height: `calc(100vh - ${headerHeight})`,
|
|
56
|
-
position:
|
|
56
|
+
position: 'fixed',
|
|
57
57
|
top: headerHeight,
|
|
58
58
|
left: sideNavWidth,
|
|
59
|
-
overflowY:
|
|
60
|
-
}))
|
|
59
|
+
overflowY: 'auto',
|
|
60
|
+
}))
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import PermissionDeniedPage from './PermissionDeniedPage'
|
|
2
|
-
import {PermissionsStore} from './PermissionsStore'
|
|
2
|
+
import { PermissionsStore } from './PermissionsStore'
|
|
3
3
|
|
|
4
4
|
const accessIfNoKey = process.env.NODE_ENV === 'development' ? true : false
|
|
5
5
|
|
|
6
6
|
export default function PageWithPermission({
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
permissionKey,
|
|
8
|
+
children,
|
|
9
9
|
}: {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
permissionKey: string
|
|
11
|
+
children?: any
|
|
12
12
|
}) {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const permissions = PermissionsStore.useState((s) => s).permissions
|
|
14
|
+
const hasAccess = permissionKey ? permissions[permissionKey] : accessIfNoKey
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
if (hasAccess) return children
|
|
17
|
+
return <PermissionDeniedPage />
|
|
18
18
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {Box, Typography} from '@mui/material'
|
|
1
|
+
import { Box, Typography } from '@mui/material'
|
|
2
2
|
|
|
3
3
|
export default function PermissionDeniedPage() {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
4
|
+
return (
|
|
5
|
+
<Box
|
|
6
|
+
sx={{
|
|
7
|
+
height: '100vh',
|
|
8
|
+
width: '100%',
|
|
9
|
+
display: 'grid',
|
|
10
|
+
placeItems: 'center',
|
|
11
|
+
}}
|
|
12
|
+
>
|
|
13
|
+
<Typography variant="h6">Permission Denied</Typography>
|
|
14
|
+
</Box>
|
|
15
|
+
)
|
|
16
16
|
}
|