@campxdev/shared 1.11.6 → 1.11.7-0.alpha-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/.vscode/settings.json +3 -0
- package/exports.ts +4 -0
- package/package.json +17 -9
- package/src/assets/images/X.png +0 -0
- package/src/assets/images/active_devices.svg +3 -0
- package/src/assets/images/animation.gif +0 -0
- package/src/assets/images/change_password.svg +6 -0
- package/src/assets/images/clog_wheel.svg +6 -0
- package/src/assets/images/index.ts +28 -3
- package/src/assets/images/location.svg +6 -0
- package/src/assets/images/logout_icon.svg +6 -0
- package/src/assets/images/lottery.svg +22 -0
- package/src/assets/images/mobile.svg +7 -0
- package/src/assets/images/no_devices.svg +734 -0
- package/src/assets/images/notifications.svg +3 -0
- package/src/assets/images/profile.svg +6 -0
- package/src/assets/images/web.svg +13 -0
- package/src/components/ActiveDevices/ActiveDevices.tsx +60 -0
- package/src/components/ActiveDevices/DeviceInformationCard.tsx +97 -0
- package/src/components/ActiveDevices/index.ts +1 -0
- package/src/components/ActivityLog/ActivityLog.tsx +268 -0
- package/src/components/ActivityLog/Styles.tsx +35 -0
- package/src/components/ActivityLog/index.ts +1 -0
- package/src/components/ApplicationProfile/ApplicationProfile.tsx +1 -0
- package/src/components/ApplicationProfile/UserProfileRelation.tsx +4 -1
- package/src/components/DatabaseConfiguration/DatabaseConfiguration.tsx +28 -0
- package/src/components/DatabaseConfiguration/DatabaseConfigurationForm.tsx +87 -0
- package/src/components/DatabaseConfiguration/components/AddConnectionDrawerButton.tsx +30 -0
- package/src/components/DatabaseConfiguration/components/ConnectionCard.tsx +79 -0
- package/src/components/DatabaseConfiguration/index.ts +5 -0
- package/src/components/DatabaseConfiguration/service.ts +6 -0
- package/src/components/DatabaseConfiguration/styles.ts +30 -0
- package/src/components/DrawerWrapper/DialogTemplate.tsx +58 -0
- package/src/components/DrawerWrapper/DrawerWrapper.tsx +23 -7
- package/src/components/DrawerWrapper/ErrorTemplate.tsx +77 -0
- package/src/components/ErrorModal.tsx +88 -0
- package/src/components/ErrorModalWrapper/ErrorModalTemplate.tsx +118 -0
- package/src/components/ErrorModalWrapper/ErrorModalWrapper.tsx +76 -0
- package/src/components/FilterComponents/SearchBar.tsx +5 -2
- package/src/components/Form/Form.tsx +4 -1
- package/src/components/HookForm/AutoCompleteSearch.tsx +3 -0
- package/src/components/HookForm/MultiSelect.tsx +1 -0
- package/src/components/HookForm/SingleSelect.tsx +2 -2
- package/src/components/ImageUpload.tsx +4 -1
- package/src/components/Input/MultiSelect.tsx +1 -0
- package/src/components/Input/SearchSingleSelect.tsx +1 -1
- package/src/components/Input/SingleSelect.tsx +7 -7
- package/src/components/Institutions/InsititutionsDialog.tsx +2 -2
- package/src/components/Layout/Header/AppHeader.tsx +23 -6
- package/src/components/Layout/Header/HeaderActions/CogWheelMenu.tsx +2 -2
- package/src/components/Layout/Header/HeaderActions/HeaderActions.tsx +41 -16
- package/src/components/Layout/Header/HeaderActions/UserBox.tsx +48 -6
- package/src/components/Layout/Header/applications.ts +43 -30
- package/src/components/Layout/LayoutWrapper.tsx +82 -4
- package/src/components/Layout/SideNav.tsx +42 -9
- package/src/components/LoginForm.tsx +53 -1
- package/src/components/MongoCharts/MongoDashboard.tsx +146 -0
- package/src/components/MongoCharts/index.tsx +1 -0
- package/src/components/MyProfile/MyProfile.tsx +1 -1
- package/src/components/ReportHeader.tsx +2 -2
- package/src/components/Selectors/ClassRoomSelector.tsx +2 -2
- package/src/components/Selectors/CourseSelector.tsx +2 -2
- package/src/components/Selectors/DepartmentSelector.tsx +2 -2
- package/src/components/Selectors/ExamGroupSelector.tsx +19 -10
- package/src/components/Selectors/FacultySelector.tsx +2 -2
- package/src/components/Selectors/FeeTypeSelector.tsx +2 -2
- package/src/components/Selectors/FormSelectors/FormClassRoomSelector.tsx +2 -2
- package/src/components/Selectors/FormSelectors/FormCourseSelector.tsx +2 -2
- package/src/components/Selectors/FormSelectors/FormDepartmentSelector.tsx +2 -2
- package/src/components/Selectors/FormSelectors/FormExamGroupSelector.tsx +2 -2
- package/src/components/Selectors/FormSelectors/FormFacultySelector.tsx +2 -2
- package/src/components/Selectors/FormSelectors/FormFeeTypeSelector.tsx +2 -2
- package/src/components/Selectors/FormSelectors/FormProgramSelector.tsx +2 -2
- package/src/components/Selectors/FormSelectors/FormQuotaSelector.tsx +3 -3
- package/src/components/Selectors/FormSelectors/FormSemesterSelector.tsx +2 -2
- package/src/components/Selectors/FormSelectors/MultiSelect/MultiFacultySelector.tsx +2 -2
- package/src/components/Selectors/FormSelectors/MultiSelect/MultiFeeTypeSelector.tsx +2 -2
- package/src/components/Selectors/FormSelectors/MultiSelect/MultiProgramSelector.tsx +2 -2
- package/src/components/Selectors/FormSelectors/MultiSelect/MultiQuotaSelector.tsx +2 -2
- package/src/components/Selectors/ProgramSelector.tsx +3 -3
- package/src/components/Selectors/QuotaSelector.tsx +3 -3
- package/src/components/Selectors/SemesterSelector.tsx +2 -2
- package/src/components/SignatureFooter.tsx +35 -0
- package/src/components/SwitchButton.tsx +6 -1
- package/src/components/Tables/2DTable/Table.tsx +20 -23
- package/src/components/Tables/BasicTable/Table.tsx +22 -13
- package/src/components/Tables/BasicTable/TableFooter.tsx +35 -9
- package/src/components/Tables/BasicTable/styles.ts +1 -1
- package/src/components/Tables/ReactTable/ReactTable.tsx +42 -8
- package/src/components/Tables/common/types.ts +1 -0
- package/src/components/Tabs/TabsContainer.tsx +5 -5
- package/src/components/Tabs/styles.tsx +1 -0
- package/src/components/ToastContainer/ToastContainer.tsx +2 -3
- package/src/components/UploadButton/UploadButton.tsx +3 -1
- package/src/components/UploadButton/types.ts +2 -2
- package/src/components/UploadDocument.tsx +3 -0
- package/src/components/UploadFileDialog/UploadFileDialog.tsx +20 -9
- package/src/components/index.ts +5 -0
- package/src/config/axios.ts +5 -19
- package/src/constants/UIConstants.ts +65 -2
- package/src/constants/isDevelopment.ts +0 -1
- package/src/contexts/Providers.tsx +5 -43
- package/src/hooks/useAuth.ts +7 -0
- package/src/layouts/Components/styles.tsx +25 -7
- package/src/permissions/PermissionsStore.ts +658 -55
- package/src/permissions/ValidateAccess.tsx +37 -8
- package/src/shared-state/PermissionsStore.ts +779 -85
- package/src/theme/theme.d.ts +69 -35
- package/src/utils/debounce.ts +11 -0
- package/src/utils/getUrlParams.ts +13 -0
- package/src/utils/index.ts +6 -3
- package/src/utils/logout.ts +4 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseSelectProps } from '@mui/material'
|
|
2
2
|
import { ReactNode } from 'react'
|
|
3
3
|
import { Controller } from 'react-hook-form'
|
|
4
4
|
import { SingleSelect } from '../Input'
|
|
@@ -9,7 +9,7 @@ type Props = {
|
|
|
9
9
|
options: Array<{ label: ReactNode; value: any }>
|
|
10
10
|
firstItemEmpty?: boolean
|
|
11
11
|
onOpen?: (e: any) => void
|
|
12
|
-
} &
|
|
12
|
+
} & BaseSelectProps
|
|
13
13
|
|
|
14
14
|
export default function FormSingleSelect(props: Props) {
|
|
15
15
|
const {
|
|
@@ -2,6 +2,7 @@ import { InsertPhotoOutlined } from '@mui/icons-material'
|
|
|
2
2
|
import { styled, Typography } from '@mui/material'
|
|
3
3
|
import { ReactNode, useRef, useState } from 'react'
|
|
4
4
|
import axios, { axiosErrorToast } from '../config/axios'
|
|
5
|
+
import { useErrorModal } from './ErrorModalWrapper/ErrorModalWrapper'
|
|
5
6
|
|
|
6
7
|
interface ImageUploadProps {
|
|
7
8
|
onFileUploaded: (v) => void
|
|
@@ -17,6 +18,7 @@ export default function ImageUpload({
|
|
|
17
18
|
loadingState,
|
|
18
19
|
postBody = {},
|
|
19
20
|
}: ImageUploadProps) {
|
|
21
|
+
const errorModal = useErrorModal()
|
|
20
22
|
const [loading, setLoading] = useState(false)
|
|
21
23
|
const ref = useRef<HTMLInputElement>(null)
|
|
22
24
|
|
|
@@ -47,7 +49,8 @@ export default function ImageUpload({
|
|
|
47
49
|
.catch((err) => {
|
|
48
50
|
setLoading(false)
|
|
49
51
|
loadingState && setLoading(false)
|
|
50
|
-
axiosErrorToast(err)
|
|
52
|
+
// axiosErrorToast(err)
|
|
53
|
+
errorModal({ error: err })
|
|
51
54
|
})
|
|
52
55
|
}
|
|
53
56
|
}
|
|
@@ -87,7 +87,7 @@ export const SearchSingleSelect = ({ options, value, onChange }: Props) => {
|
|
|
87
87
|
<TextField
|
|
88
88
|
inputRef={(input) => {
|
|
89
89
|
if (input && value) {
|
|
90
|
-
input.style.width = `${value.label
|
|
90
|
+
input.style.width = `${value.label?.length * 9}px`
|
|
91
91
|
}
|
|
92
92
|
}}
|
|
93
93
|
InputProps={{
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { KeyboardArrowDown } from '@mui/icons-material'
|
|
2
2
|
import {
|
|
3
|
+
BaseSelectProps,
|
|
4
|
+
Box,
|
|
5
|
+
BoxProps,
|
|
3
6
|
FormControl,
|
|
7
|
+
FormHelperText,
|
|
4
8
|
MenuItem,
|
|
5
|
-
SelectProps,
|
|
6
|
-
styled,
|
|
7
9
|
Select,
|
|
8
|
-
|
|
9
|
-
Box,
|
|
10
|
-
BoxProps,
|
|
10
|
+
styled,
|
|
11
11
|
} from '@mui/material'
|
|
12
12
|
import { ReactNode } from 'react'
|
|
13
13
|
import FormLabel from './FormLabel'
|
|
@@ -55,7 +55,7 @@ type Props = {
|
|
|
55
55
|
helperText?: string
|
|
56
56
|
containerProps?: BoxProps
|
|
57
57
|
onOpen?: (e: any) => void
|
|
58
|
-
} &
|
|
58
|
+
} & BaseSelectProps
|
|
59
59
|
|
|
60
60
|
export default function SingleSelect({
|
|
61
61
|
name = 'select',
|
|
@@ -12,7 +12,7 @@ export default function InstitutionsDialog({ close }) {
|
|
|
12
12
|
|
|
13
13
|
return (
|
|
14
14
|
<Box sx={{ padding: '20px' }}>
|
|
15
|
-
<Typography variant="
|
|
15
|
+
<Typography variant="h6" textAlign={'center'}>
|
|
16
16
|
Select an Institution
|
|
17
17
|
</Typography>
|
|
18
18
|
<TextField
|
|
@@ -46,7 +46,7 @@ const InstitutionCard = ({ institution }) => {
|
|
|
46
46
|
alt="logo"
|
|
47
47
|
height={'100px'}
|
|
48
48
|
width="100%"
|
|
49
|
-
src={institution?.
|
|
49
|
+
src={institution?.imageSquare?.url}
|
|
50
50
|
/>
|
|
51
51
|
<Typography variant="body2">{institution?.name}</Typography>
|
|
52
52
|
</StyledInstitutionCard>
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
peoplex,
|
|
14
14
|
} from './assets'
|
|
15
15
|
|
|
16
|
+
import { campxLogoPrimary } from '../../../assets/images'
|
|
16
17
|
import HeaderActions from './HeaderActions/HeaderActions'
|
|
17
18
|
import {
|
|
18
19
|
StyledHeader,
|
|
@@ -30,32 +31,45 @@ const imageMap = {
|
|
|
30
31
|
campx: collegex,
|
|
31
32
|
commute: commutex,
|
|
32
33
|
hostel: hostelx,
|
|
34
|
+
admin: campxLogoPrimary,
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
interface AppHeaderProps {
|
|
36
38
|
clientLogo: string
|
|
37
39
|
fullName: string
|
|
40
|
+
profileUrl?: string
|
|
41
|
+
showMenu?: boolean
|
|
42
|
+
actions?: ReactNode[]
|
|
38
43
|
userBoxActions: {
|
|
39
44
|
label: ReactNode
|
|
40
45
|
icon?: ReactNode
|
|
41
46
|
onClick: any
|
|
42
47
|
}[]
|
|
43
48
|
customHeaderActions?: ReactNode
|
|
49
|
+
headerSx?: any
|
|
50
|
+
imageSx?: any
|
|
51
|
+
profileSx?: any
|
|
44
52
|
cogWheelMenu?: { label: string; path: string; openNewTab?: boolean }[]
|
|
45
53
|
}
|
|
46
54
|
|
|
47
55
|
export default function AppHeader({
|
|
48
56
|
clientLogo = imageMap.campx,
|
|
57
|
+
showMenu = true,
|
|
49
58
|
fullName,
|
|
50
59
|
userBoxActions = [],
|
|
51
60
|
cogWheelMenu = [],
|
|
52
61
|
customHeaderActions,
|
|
62
|
+
profileUrl,
|
|
63
|
+
actions = [],
|
|
64
|
+
headerSx = {},
|
|
65
|
+
profileSx = {},
|
|
66
|
+
imageSx = {},
|
|
53
67
|
}: AppHeaderProps) {
|
|
54
68
|
return (
|
|
55
|
-
<StyledHeader>
|
|
69
|
+
<StyledHeader sx={headerSx}>
|
|
56
70
|
<Box sx={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
|
|
57
|
-
<AppsMenu />
|
|
58
|
-
<AppLogo clientLogo={clientLogo} />
|
|
71
|
+
{showMenu && <AppsMenu />}
|
|
72
|
+
<AppLogo clientLogo={clientLogo} imageSx={imageSx} />
|
|
59
73
|
</Box>
|
|
60
74
|
<Box className="actions">
|
|
61
75
|
{customHeaderActions ? (
|
|
@@ -65,6 +79,9 @@ export default function AppHeader({
|
|
|
65
79
|
cogWheelMenu={cogWheelMenu}
|
|
66
80
|
fullName={fullName}
|
|
67
81
|
userBoxActions={userBoxActions}
|
|
82
|
+
profileUrl={profileUrl}
|
|
83
|
+
actions={actions}
|
|
84
|
+
profileSx={profileSx}
|
|
68
85
|
/>
|
|
69
86
|
)}
|
|
70
87
|
</Box>
|
|
@@ -72,16 +89,16 @@ export default function AppHeader({
|
|
|
72
89
|
)
|
|
73
90
|
}
|
|
74
91
|
|
|
75
|
-
const AppLogo = ({ clientLogo }) => {
|
|
92
|
+
const AppLogo = ({ clientLogo, imageSx }) => {
|
|
76
93
|
const originSubdomain = window.location.host.split('.')?.slice(-3)[0] ?? 'ums'
|
|
77
94
|
const currentApp =
|
|
78
95
|
applications.find((item) => item.domainName === originSubdomain)
|
|
79
|
-
?.domainName ?? '
|
|
96
|
+
?.domainName ?? 'admin'
|
|
80
97
|
|
|
81
98
|
return (
|
|
82
99
|
<StyledRouterLink to={'/'}>
|
|
83
100
|
<StyledLogosWrapper>
|
|
84
|
-
<StyledImageWrapper>
|
|
101
|
+
<StyledImageWrapper sx={imageSx}>
|
|
85
102
|
<img src={imageMap[currentApp]} />
|
|
86
103
|
</StyledImageWrapper>
|
|
87
104
|
<Box
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SettingsOutlined } from '@mui/icons-material'
|
|
2
1
|
import { IconButton } from '@mui/material'
|
|
3
2
|
import { useNavigate } from 'react-router-dom'
|
|
3
|
+
import { clogWheel } from '../../../../assets/images'
|
|
4
4
|
import DropDownButton from '../../../DropDownButton/DropDownButton'
|
|
5
5
|
|
|
6
6
|
const CogWheelMenu = ({ menu }) => {
|
|
@@ -10,7 +10,7 @@ const CogWheelMenu = ({ menu }) => {
|
|
|
10
10
|
<DropDownButton
|
|
11
11
|
anchor={({ open }) => (
|
|
12
12
|
<IconButton color="secondary" onClick={open}>
|
|
13
|
-
<
|
|
13
|
+
<img src={clogWheel.default} alt="Settings" />
|
|
14
14
|
</IconButton>
|
|
15
15
|
)}
|
|
16
16
|
menu={menu?.map((item) => ({
|
|
@@ -1,31 +1,56 @@
|
|
|
1
|
-
import
|
|
1
|
+
import HelpOutlineIcon from '@mui/icons-material/HelpOutline'
|
|
2
|
+
import { IconButton, Stack } from '@mui/material'
|
|
3
|
+
import { ReactNode } from 'react'
|
|
4
|
+
import { useNavigate } from 'react-router-dom'
|
|
5
|
+
import { IMenuItemProps } from '../../../DropDownButton/DropdownMenuItem'
|
|
2
6
|
import InstitutionsDropDown from '../../../Institutions/InstitutionsDropdown'
|
|
3
7
|
import CogWheelMenu from './CogWheelMenu'
|
|
4
8
|
import UserBox from './UserBox'
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
9
|
+
|
|
10
|
+
const profileMenu = [
|
|
11
|
+
{ label: 'Student Results', path: '/results' },
|
|
12
|
+
{ label: 'Careers', path: '/careers' },
|
|
13
|
+
]
|
|
8
14
|
|
|
9
15
|
export default function HeaderActions({
|
|
10
16
|
cogWheelMenu,
|
|
11
17
|
fullName,
|
|
12
18
|
userBoxActions,
|
|
19
|
+
profileUrl = '',
|
|
20
|
+
actions = [],
|
|
21
|
+
profileSx = {},
|
|
22
|
+
}: {
|
|
23
|
+
cogWheelMenu?: any[]
|
|
24
|
+
fullName: string
|
|
25
|
+
userBoxActions: IMenuItemProps[] | []
|
|
26
|
+
profileUrl: string
|
|
27
|
+
actions?: ReactNode[]
|
|
28
|
+
profileSx?: any
|
|
13
29
|
}) {
|
|
30
|
+
const navigate = useNavigate()
|
|
14
31
|
return (
|
|
15
|
-
|
|
32
|
+
<Stack direction="row" gap={6}>
|
|
16
33
|
<InstitutionsDropDown />
|
|
17
34
|
{/* <SearchButton /> */}
|
|
18
35
|
{/* <FreshDeskHelpButton /> */}
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
36
|
+
<Stack direction="row" gap={2}>
|
|
37
|
+
<IconButton
|
|
38
|
+
href={'https://campx.atlassian.net/servicedesk/customer/portal/2'}
|
|
39
|
+
target="_blank"
|
|
40
|
+
sx={{ color: 'black', padding: '0px' }}
|
|
41
|
+
>
|
|
42
|
+
<HelpOutlineIcon />
|
|
43
|
+
</IconButton>
|
|
44
|
+
|
|
45
|
+
{actions.map((action, index) => action)}
|
|
46
|
+
{cogWheelMenu?.length ? <CogWheelMenu menu={cogWheelMenu} /> : null}
|
|
47
|
+
<UserBox
|
|
48
|
+
fullName={fullName}
|
|
49
|
+
actions={userBoxActions}
|
|
50
|
+
profileUrl={profileUrl}
|
|
51
|
+
profileSx={profileSx}
|
|
52
|
+
/>
|
|
53
|
+
</Stack>
|
|
54
|
+
</Stack>
|
|
30
55
|
)
|
|
31
56
|
}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import { ExitToAppOutlined, HttpsOutlined, Person } from '@mui/icons-material'
|
|
2
1
|
import { useNavigate } from 'react-router-dom'
|
|
2
|
+
import {
|
|
3
|
+
activeDevices,
|
|
4
|
+
changePassword,
|
|
5
|
+
logoutIcon,
|
|
6
|
+
profile,
|
|
7
|
+
} from '../../../../assets/images'
|
|
8
|
+
|
|
3
9
|
import logout from '../../../../utils/logout'
|
|
10
|
+
import ActiveDevices from '../../../ActiveDevices'
|
|
4
11
|
import ChangePassword from '../../../ChangePassword'
|
|
5
12
|
import DropDownButton from '../../../DropDownButton/DropDownButton'
|
|
6
13
|
import { IMenuItemProps } from '../../../DropDownButton/DropdownMenuItem'
|
|
@@ -19,16 +26,20 @@ export default function UserBox({
|
|
|
19
26
|
fullName,
|
|
20
27
|
actions,
|
|
21
28
|
customActions = [],
|
|
29
|
+
profileUrl,
|
|
30
|
+
profileSx = {},
|
|
22
31
|
}: {
|
|
23
32
|
fullName: string
|
|
24
33
|
actions: IMenuItemProps[] | []
|
|
25
34
|
customActions?: IMenuItemProps[] | []
|
|
35
|
+
profileUrl?: string
|
|
36
|
+
profileSx?: any
|
|
26
37
|
}) {
|
|
27
38
|
const navigate = useNavigate()
|
|
28
39
|
return (
|
|
29
40
|
<DropDownButton
|
|
30
41
|
anchor={({ open }) => (
|
|
31
|
-
<StyledAvatar onClick={open}>
|
|
42
|
+
<StyledAvatar src={profileUrl ?? ''} onClick={open} sx={profileSx}>
|
|
32
43
|
{getStartingLetters(fullName)}
|
|
33
44
|
</StyledAvatar>
|
|
34
45
|
)}
|
|
@@ -40,7 +51,9 @@ export default function UserBox({
|
|
|
40
51
|
{
|
|
41
52
|
label: 'My Profile',
|
|
42
53
|
actionType: 'dialog',
|
|
43
|
-
icon:
|
|
54
|
+
icon: (
|
|
55
|
+
<img style={{ marginRight: '10px' }} src={profile.default} />
|
|
56
|
+
),
|
|
44
57
|
content: ({ close }) => <MyProfile close={close} />,
|
|
45
58
|
dialogProps: {
|
|
46
59
|
maxWidth: 'xl',
|
|
@@ -51,17 +64,46 @@ export default function UserBox({
|
|
|
51
64
|
},
|
|
52
65
|
},
|
|
53
66
|
},
|
|
54
|
-
|
|
67
|
+
{
|
|
68
|
+
label: 'Active Devices',
|
|
69
|
+
actionType: 'dialog',
|
|
70
|
+
icon: (
|
|
71
|
+
<img
|
|
72
|
+
style={{ marginRight: '10px' }}
|
|
73
|
+
src={activeDevices.default}
|
|
74
|
+
/>
|
|
75
|
+
),
|
|
76
|
+
content: ({ close }) => <ActiveDevices close={close} />,
|
|
77
|
+
contentTitle: 'Active Devices',
|
|
78
|
+
dialogProps: {
|
|
79
|
+
maxWidth: 'lg',
|
|
80
|
+
PaperProps: {
|
|
81
|
+
sx: {
|
|
82
|
+
padding: 0,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
},
|
|
55
87
|
{
|
|
56
88
|
label: 'Change Password',
|
|
57
89
|
actionType: 'dialog',
|
|
58
|
-
icon:
|
|
90
|
+
icon: (
|
|
91
|
+
<img
|
|
92
|
+
style={{ marginRight: '10px' }}
|
|
93
|
+
src={changePassword.default}
|
|
94
|
+
/>
|
|
95
|
+
),
|
|
59
96
|
content: ({ close }) => <ChangePassword close={close} />,
|
|
60
97
|
contentTitle: 'Change Password',
|
|
61
98
|
},
|
|
62
99
|
{
|
|
63
100
|
label: 'Logout',
|
|
64
|
-
icon:
|
|
101
|
+
icon: (
|
|
102
|
+
<img
|
|
103
|
+
style={{ marginRight: '10px' }}
|
|
104
|
+
src={logoutIcon.default}
|
|
105
|
+
/>
|
|
106
|
+
),
|
|
65
107
|
onClick: logout,
|
|
66
108
|
},
|
|
67
109
|
]
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { campxLogoSquare } from '../../../assets/images'
|
|
1
2
|
import { isDevelopment } from '../../../constants'
|
|
2
3
|
import {
|
|
3
4
|
campxSquareSmall,
|
|
@@ -10,14 +11,22 @@ import {
|
|
|
10
11
|
} from './assets'
|
|
11
12
|
|
|
12
13
|
const origins = {
|
|
13
|
-
|
|
14
|
-
dev: 'https://
|
|
15
|
-
prod: 'https://
|
|
14
|
+
admin: {
|
|
15
|
+
dev: 'https://admin.campx.dev',
|
|
16
|
+
prod: 'https://admin.campx.in',
|
|
17
|
+
},
|
|
18
|
+
enroll: {
|
|
19
|
+
dev: 'https://enroll.campx.dev',
|
|
20
|
+
prod: 'https://enroll.campx.in',
|
|
16
21
|
},
|
|
17
22
|
payments: {
|
|
18
23
|
dev: 'https://payments.campx.dev',
|
|
19
24
|
prod: 'https://payments.campx.in',
|
|
20
25
|
},
|
|
26
|
+
ums: {
|
|
27
|
+
dev: 'https://ums.campx.dev',
|
|
28
|
+
prod: 'https://ums.campx.in',
|
|
29
|
+
},
|
|
21
30
|
exams: {
|
|
22
31
|
dev: 'https://exams.campx.dev',
|
|
23
32
|
prod: 'https://exams.campx.in',
|
|
@@ -34,13 +43,34 @@ const origins = {
|
|
|
34
43
|
dev: 'https://commute.campx.dev',
|
|
35
44
|
prod: 'https://commute.campx.in',
|
|
36
45
|
},
|
|
37
|
-
enroll: {
|
|
38
|
-
dev: 'https://enroll.campx.dev',
|
|
39
|
-
prod: 'https://enroll.campx.in',
|
|
40
|
-
},
|
|
41
46
|
}
|
|
42
47
|
|
|
43
48
|
export const applications = [
|
|
49
|
+
{
|
|
50
|
+
title: 'Admin',
|
|
51
|
+
path: isDevelopment ? origins.admin.dev : origins.admin.prod,
|
|
52
|
+
icon: campxLogoSquare,
|
|
53
|
+
key: 'admin',
|
|
54
|
+
domainName: 'admin',
|
|
55
|
+
description: 'Manage Complete Campus Root Configuration',
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
{
|
|
59
|
+
title: 'EnrollX',
|
|
60
|
+
key: 'enroll_x',
|
|
61
|
+
domainName: 'enroll',
|
|
62
|
+
path: isDevelopment ? origins.enroll.dev : origins.enroll.prod,
|
|
63
|
+
icon: enrollSmall,
|
|
64
|
+
description: 'Manage Admissions in the Campus',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
title: 'PayX',
|
|
68
|
+
key: 'payments',
|
|
69
|
+
domainName: 'payments',
|
|
70
|
+
path: isDevelopment ? origins.payments.dev : origins.payments.prod,
|
|
71
|
+
icon: paySmall,
|
|
72
|
+
description: 'Manage Payments in the Campus',
|
|
73
|
+
},
|
|
44
74
|
{
|
|
45
75
|
title: 'CollegeX',
|
|
46
76
|
path: isDevelopment ? origins.ums.dev : origins.ums.prod,
|
|
@@ -58,20 +88,12 @@ export const applications = [
|
|
|
58
88
|
description: 'Manage all Examinations in the Campus',
|
|
59
89
|
},
|
|
60
90
|
{
|
|
61
|
-
title: '
|
|
62
|
-
key: '
|
|
63
|
-
domainName: '
|
|
64
|
-
path: isDevelopment ? origins.
|
|
65
|
-
icon:
|
|
66
|
-
description: 'Manage
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
title: 'EnrollX',
|
|
70
|
-
key: 'enroll_x',
|
|
71
|
-
domainName: 'enroll',
|
|
72
|
-
path: isDevelopment ? origins.enroll.dev : origins.enroll.prod,
|
|
73
|
-
icon: enrollSmall,
|
|
74
|
-
description: 'Manage Admissions in the Campus',
|
|
91
|
+
title: 'PeopleX',
|
|
92
|
+
key: 'hrms',
|
|
93
|
+
domainName: 'people',
|
|
94
|
+
path: isDevelopment ? origins.people.dev : origins.people.prod,
|
|
95
|
+
icon: peopleSmall,
|
|
96
|
+
description: 'Manage People in the Campus',
|
|
75
97
|
},
|
|
76
98
|
{
|
|
77
99
|
title: 'HostelX',
|
|
@@ -89,13 +111,4 @@ export const applications = [
|
|
|
89
111
|
icon: commuteSmall,
|
|
90
112
|
description: 'Manage Commute in the Campus',
|
|
91
113
|
},
|
|
92
|
-
|
|
93
|
-
{
|
|
94
|
-
title: 'PeopleX',
|
|
95
|
-
key: 'hrms',
|
|
96
|
-
domainName: 'people',
|
|
97
|
-
path: isDevelopment ? origins.people.dev : origins.people.prod,
|
|
98
|
-
icon: peopleSmall,
|
|
99
|
-
description: 'Manage People in the Campus',
|
|
100
|
-
},
|
|
101
114
|
]
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import MenuIcon from '@mui/icons-material/Menu'
|
|
2
|
+
import { Drawer, IconButton, styled } from '@mui/material'
|
|
3
|
+
import { useState } from 'react'
|
|
1
4
|
import {
|
|
2
5
|
StyledLeftNavContainer,
|
|
3
6
|
StyledMainContentContainer,
|
|
4
7
|
} from '../../layouts/Components/styles'
|
|
8
|
+
import { PermissionsStore } from '../../shared-state'
|
|
5
9
|
import ErrorBoundary from '../ErrorBoundary'
|
|
6
10
|
import SideNav from './SideNav'
|
|
7
11
|
interface Props {
|
|
@@ -15,14 +19,88 @@ export default function LayoutWrapper({
|
|
|
15
19
|
menu,
|
|
16
20
|
sideMenuHeader,
|
|
17
21
|
}: Props) {
|
|
22
|
+
const permissions = PermissionsStore.useState()
|
|
23
|
+
|
|
24
|
+
const [open, setOpen] = useState<boolean>(false)
|
|
25
|
+
|
|
26
|
+
const handleDrawer = () => {
|
|
27
|
+
console.log('hi')
|
|
28
|
+
setOpen(!open)
|
|
29
|
+
}
|
|
18
30
|
return (
|
|
19
31
|
<ErrorBoundary>
|
|
20
|
-
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
32
|
+
{window.innerWidth > 1024 && !permissions.isHomePageEnabled && (
|
|
33
|
+
<StyledLeftNavContainer>
|
|
34
|
+
<SideNav menuItems={menu as any[]} header={sideMenuHeader} />
|
|
35
|
+
</StyledLeftNavContainer>
|
|
36
|
+
)}
|
|
37
|
+
|
|
38
|
+
<StyledMainContentContainer
|
|
39
|
+
style={{
|
|
40
|
+
width: permissions.isHomePageEnabled
|
|
41
|
+
? 'inherit'
|
|
42
|
+
: 'calc(100% - 220px)',
|
|
43
|
+
position: permissions.isHomePageEnabled ? 'unset' : 'fixed',
|
|
44
|
+
marginTop: permissions.isHomePageEnabled ? '10px' : '0px',
|
|
45
|
+
borderRadius: permissions.isHomePageEnabled ? '10px' : '0px',
|
|
46
|
+
border: permissions.isHomePageEnabled ? '1px solid #1212' : 'none',
|
|
47
|
+
height: permissions.isHomePageEnabled
|
|
48
|
+
? 'calc(100vh - 74px)'
|
|
49
|
+
: 'calc(100vh - 64px)',
|
|
50
|
+
}}
|
|
51
|
+
>
|
|
52
|
+
{window.innerWidth < 1024 && (
|
|
53
|
+
<>
|
|
54
|
+
<IconButton
|
|
55
|
+
color="inherit"
|
|
56
|
+
aria-label="open drawer"
|
|
57
|
+
onClick={handleDrawer}
|
|
58
|
+
edge="start"
|
|
59
|
+
sx={{ mr: 0.5 }}
|
|
60
|
+
>
|
|
61
|
+
<MenuIcon />
|
|
62
|
+
</IconButton>
|
|
63
|
+
{/* <Button
|
|
64
|
+
onClick={() => {
|
|
65
|
+
console.log('hi')
|
|
66
|
+
}}
|
|
67
|
+
// edge="start"
|
|
68
|
+
// sx={{ mr: 0.5 }}
|
|
69
|
+
>
|
|
70
|
+
<MenuIcon />
|
|
71
|
+
</Button> */}
|
|
72
|
+
<StyledDrawer
|
|
73
|
+
variant={'temporary'}
|
|
74
|
+
anchor="left"
|
|
75
|
+
open={open}
|
|
76
|
+
onClose={handleDrawer}
|
|
77
|
+
>
|
|
78
|
+
<SideNav menuItems={menu as any[]} header={sideMenuHeader} />
|
|
79
|
+
</StyledDrawer>
|
|
80
|
+
</>
|
|
81
|
+
)}
|
|
24
82
|
<ErrorBoundary>{children}</ErrorBoundary>
|
|
25
83
|
</StyledMainContentContainer>
|
|
26
84
|
</ErrorBoundary>
|
|
27
85
|
)
|
|
28
86
|
}
|
|
87
|
+
|
|
88
|
+
const drawerWidth: number = 240
|
|
89
|
+
|
|
90
|
+
export const StyledDrawer = styled(Drawer)(() => ({
|
|
91
|
+
width: drawerWidth,
|
|
92
|
+
flexShrink: 0,
|
|
93
|
+
'& .MuiDrawer-paper': {
|
|
94
|
+
width: drawerWidth,
|
|
95
|
+
boxSizing: 'border-box',
|
|
96
|
+
position: 'unset',
|
|
97
|
+
transition: 'none !important',
|
|
98
|
+
borderRight: 'none !important',
|
|
99
|
+
borderRadius: '5px',
|
|
100
|
+
},
|
|
101
|
+
['@media (max-width: 1024px)']: {
|
|
102
|
+
'& .MuiDrawer-paper': {
|
|
103
|
+
borderRadius: '0px',
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
}))
|