@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
package/src/theme/theme.d.ts
CHANGED
|
@@ -2,37 +2,51 @@ import { ThemeOptions as MuiThemeOptions } from '@mui/material/styles'
|
|
|
2
2
|
|
|
3
3
|
declare module '@mui/material/styles' {
|
|
4
4
|
interface Theme {
|
|
5
|
-
borders
|
|
6
|
-
grayLight
|
|
7
|
-
primary
|
|
5
|
+
borders?: {
|
|
6
|
+
grayLight?: string
|
|
7
|
+
primary?: string
|
|
8
8
|
}
|
|
9
|
-
palette
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
main
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
9
|
+
palette?: {
|
|
10
|
+
mode?: string
|
|
11
|
+
primary?: {
|
|
12
|
+
dark?: string
|
|
13
|
+
main?: string
|
|
14
|
+
light?: string
|
|
15
|
+
lighter?: string
|
|
16
|
+
}
|
|
17
|
+
secondary?: {
|
|
18
|
+
main?: string
|
|
19
|
+
light?: string
|
|
20
|
+
dark?: string
|
|
21
|
+
lighter?: string
|
|
22
|
+
}
|
|
23
|
+
highlight?: {
|
|
24
|
+
main?: string
|
|
25
|
+
}
|
|
26
|
+
grey?: {
|
|
27
|
+
main?: string
|
|
28
|
+
}
|
|
29
|
+
info?: {
|
|
30
|
+
main?: string
|
|
31
|
+
}
|
|
32
|
+
common?: {
|
|
33
|
+
black?: string
|
|
34
|
+
white?: string
|
|
35
|
+
green?: string
|
|
36
|
+
yellow?: string
|
|
37
|
+
blue?: string
|
|
38
|
+
}
|
|
39
|
+
error?: {
|
|
40
|
+
main?: string
|
|
41
|
+
}
|
|
42
|
+
text?: {
|
|
43
|
+
primary?: string
|
|
44
|
+
secondary?: string
|
|
45
|
+
disabled?: string
|
|
46
|
+
}
|
|
47
|
+
background?: {
|
|
48
|
+
paper?: string
|
|
49
|
+
default?: string
|
|
36
50
|
}
|
|
37
51
|
}
|
|
38
52
|
}
|
|
@@ -40,20 +54,28 @@ declare module '@mui/material/styles' {
|
|
|
40
54
|
interface CustomThemeOptions extends MuiThemeOptions {
|
|
41
55
|
borders?: {
|
|
42
56
|
grayLight?: string
|
|
57
|
+
primary?: string
|
|
43
58
|
}
|
|
44
|
-
palette
|
|
45
|
-
|
|
59
|
+
palette?: {
|
|
60
|
+
mode?: string
|
|
61
|
+
primary?: {
|
|
62
|
+
dark?: string
|
|
46
63
|
main?: string
|
|
47
64
|
light?: string
|
|
48
|
-
dark?: string
|
|
49
65
|
lighter?: string
|
|
50
66
|
}
|
|
51
|
-
|
|
52
|
-
dark?: string
|
|
67
|
+
secondary?: {
|
|
53
68
|
main?: string
|
|
54
69
|
light?: string
|
|
70
|
+
dark?: string
|
|
55
71
|
lighter?: string
|
|
56
72
|
}
|
|
73
|
+
highlight?: {
|
|
74
|
+
main?: string
|
|
75
|
+
}
|
|
76
|
+
grey?: {
|
|
77
|
+
main?: string
|
|
78
|
+
}
|
|
57
79
|
common?: {
|
|
58
80
|
black?: string
|
|
59
81
|
white?: string
|
|
@@ -69,9 +91,21 @@ declare module '@mui/material/styles' {
|
|
|
69
91
|
secondary?: string
|
|
70
92
|
disabled?: string
|
|
71
93
|
}
|
|
94
|
+
background?: {
|
|
95
|
+
paper?: string
|
|
96
|
+
default?: string
|
|
97
|
+
}
|
|
72
98
|
}
|
|
73
99
|
components?: Components<Omit<Theme, 'components'>>
|
|
74
100
|
typography?: TypographyOptions | ((palette: Palette) => TypographyOptions)
|
|
75
101
|
}
|
|
76
102
|
export function createTheme(options?: CustomThemeOptions): CustomTheme
|
|
77
103
|
}
|
|
104
|
+
|
|
105
|
+
declare module '@mui/material/Typography' {
|
|
106
|
+
interface TypographyPropsVariantOverrides {
|
|
107
|
+
label1: true
|
|
108
|
+
label2: true
|
|
109
|
+
subtitle3: true
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -6,3 +6,16 @@ export default function getUrlParams() {
|
|
|
6
6
|
}
|
|
7
7
|
return params
|
|
8
8
|
}
|
|
9
|
+
|
|
10
|
+
export const createSearchParams = (query: {
|
|
11
|
+
[key: string]: string | number
|
|
12
|
+
}) => {
|
|
13
|
+
const searchParams = new URLSearchParams()
|
|
14
|
+
|
|
15
|
+
for (const key in query) {
|
|
16
|
+
if (query[key] !== null && query[key] !== 'all') {
|
|
17
|
+
searchParams.append(key, encodeURIComponent(query[key]))
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return query
|
|
21
|
+
}
|
package/src/utils/index.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { createSearchParams } from './getUrlParams'
|
|
2
2
|
export { default as arrayPadEnd } from './arrayPadEnd'
|
|
3
|
-
export { default as romanize } from './romanize'
|
|
4
3
|
export { default as buffertoCSV } from './buffertoCSV'
|
|
4
|
+
export { default as getUrlParams } from './getUrlParams'
|
|
5
|
+
export { default as romanize } from './romanize'
|
|
5
6
|
|
|
7
|
+
export { default as onLogout } from './logout'
|
|
6
8
|
export { default as withRouteWrapper } from './withRouteWrapper'
|
|
7
9
|
export { default as withSuspense } from './withSuspense'
|
|
8
|
-
|
|
10
|
+
|
|
11
|
+
export { createSearchParams }
|
package/src/utils/logout.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import Cookies from 'js-cookie'
|
|
2
2
|
import axios, { axiosErrorToast } from '../config/axios'
|
|
3
|
-
import { isDevelopment, isSetup } from '../constants'
|
|
4
3
|
|
|
5
4
|
export default function logout() {
|
|
6
5
|
axios({
|
|
@@ -9,13 +8,10 @@ export default function logout() {
|
|
|
9
8
|
url: '/auth-server/auth/logout',
|
|
10
9
|
})
|
|
11
10
|
.then((res) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} else {
|
|
17
|
-
window.location.href = 'https://id.campx.in'
|
|
18
|
-
}
|
|
11
|
+
Cookies.remove('campx_tenant')
|
|
12
|
+
Cookies.remove('campx_session_key')
|
|
13
|
+
Cookies.remove('campx_institution')
|
|
14
|
+
window.location.href = '/'
|
|
19
15
|
})
|
|
20
16
|
.catch((err) => {
|
|
21
17
|
axiosErrorToast('Unable To Logout.')
|