@campxdev/shared 1.10.80 → 1.10.82

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campxdev/shared",
3
- "version": "1.10.80",
3
+ "version": "1.10.82",
4
4
  "main": "./exports.ts",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
@@ -1,18 +1,29 @@
1
- import { Box, Typography, styled } from '@mui/material'
1
+ import { Box, TextField, Typography, styled } from '@mui/material'
2
+ import { useState } from 'react'
2
3
  import { InsititutionsStore } from '../../shared-state/InstitutionsStore'
3
4
  import Image from '../Image/Image'
4
5
 
5
6
  export default function InsititutionsDialog({ close }) {
7
+ const [searchText, setSearchText] = useState('')
6
8
  const { institutions } = InsititutionsStore.useState((s) => s)
9
+ const filteredInstitutions = institutions.filter((item) =>
10
+ item.name.toLowerCase().includes(searchText.toLowerCase()),
11
+ )
7
12
 
8
13
  return (
9
14
  <Box sx={{ padding: '20px' }}>
10
15
  <Typography variant="h3" textAlign={'center'}>
11
- Select an Instituition
16
+ Select an Institution
12
17
  </Typography>
13
-
18
+ <TextField
19
+ label="Search Institution"
20
+ variant="outlined"
21
+ margin="normal"
22
+ value={searchText}
23
+ onChange={(e) => setSearchText(e.target.value)}
24
+ />
14
25
  <StyledInstitutionContainer>
15
- {institutions?.map((item, index) => (
26
+ {filteredInstitutions?.map((item, index) => (
16
27
  <InstitutionCard institution={item} key={index} />
17
28
  ))}
18
29
  </StyledInstitutionContainer>
@@ -42,7 +42,7 @@ const checkIsAdmin = (user) => {
42
42
  let subDomain = window.location.host.split('.')?.slice(-3)[0]
43
43
  const localSubDomain = process.env.REACT_APP_SUBDOMAIN
44
44
 
45
- if (user?.isSuperuser) return 1
45
+ if (user?.isSuperUser) return 1
46
46
 
47
47
  if (process.env.NODE_ENV === 'development') {
48
48
  subDomain = localSubDomain
@@ -195,6 +195,7 @@ function useAuth({ permissionsEndpoint, loginUrl }: AuthParams): AuthResponse {
195
195
  const isAdmin = checkIsAdmin(res.data.user)
196
196
  const isSetup =
197
197
  window.location.hostname.split('.').includes('setup') && isAdmin
198
+ const isMasterSlave = res.data?.institutionType === 'MASTER_CHILD'
198
199
 
199
200
  // eslint-disable-next-line no-console
200
201
  console.log('Is Admin -> ', isAdmin)
@@ -231,6 +232,12 @@ function useAuth({ permissionsEndpoint, loginUrl }: AuthParams): AuthResponse {
231
232
  can_individual_pages_view: 1,
232
233
  can_analatics_view: isAdmin,
233
234
  can_admin_view: isAdmin,
235
+ can_challan_registrations_view:
236
+ isMasterSlave &&
237
+ res.data?.permissions.can_challan_registrations_view,
238
+ can_my_mentees_view:
239
+ res.data?.user?.isMentor &&
240
+ res.data?.permissions.can_my_mentees_view,
234
241
  } as any
235
242
  s.applications = res.data?.applications ?? []
236
243
  })
@@ -319,13 +319,6 @@ export enum SquarePermissions {
319
319
  CAN_SURVEYS_EDIT = 'can_surveys_edit',
320
320
  CAN_SURVEYS_ADD = 'can_surveys_add',
321
321
  CAN_SURVEYS_DELETE = 'can_surveys_delete',
322
-
323
-
324
-
325
-
326
-
327
-
328
-
329
322
  }
330
323
 
331
324
  export enum EnrollPermissions {
@@ -963,7 +956,7 @@ export enum Permission {
963
956
  CAN_SURVEYS_ADD = 'can_surveys_add',
964
957
  CAN_SURVEYS_DELETE = 'can_surveys_delete',
965
958
 
966
- //Configuration
959
+ //Configuration
967
960
 
968
961
  CAN_CONFIGURATION_VIEW = 'can_configuration_view',
969
962
 
@@ -973,14 +966,12 @@ export enum Permission {
973
966
  CAN_NOTICE_BOARD_ADD = 'can_notice_board_add',
974
967
  CAN_NOTICE_BOARD_DELETE = 'can_notice_board_delete',
975
968
 
976
-
977
969
  //Research Projects
978
970
  CAN_RESEARCH_PROJECT_VIEW = 'can_research_project_view',
979
971
  CAN_RESEARCH_PROJECT_EDIT = 'can_research_project_edit',
980
972
  CAN_RESEARCH_PROJECT_ADD = 'can_research_project_add',
981
973
  CAN_RESEARCH_PROJECT_DELETE = 'can_research_project_delete',
982
974
 
983
-
984
975
  // Enroll X
985
976
 
986
977
  // manage exams profile_permissions
@@ -1071,19 +1062,28 @@ export enum Permission {
1071
1062
  CAN_MANAGE_EXAMS_PROFILE_PERMISSIONS_EDIT = 'can_manage_exams_profile_permissions_edit',
1072
1063
  CAN_MANAGE_EXAMS_PROFILE_PERMISSIONS_DELETE = 'can_manage_exams_profile_permissions_delete',
1073
1064
 
1074
-
1075
1065
  // End Semester Examination
1076
1066
  CAN_END_SEMESTER_EXAMINATIONS_VIEW = 'can_end_semester_examinations_view',
1077
1067
  CAN_END_SEMESTER_EXAMINATIONS_ADD = 'can_end_semester_examinations_add',
1078
1068
  CAN_END_SEMESTER_EXAMINATIONS_EDIT = 'can_end_semester_examinations_edit',
1069
+ CAN_END_SEMESTER_EXAMINATIONS_ARCHIVE_EXAM = 'can_end_semester_examinations_archive_exam',
1079
1070
  CAN_END_SEMESTER_EXAMINATIONS_DELETE = 'can_end_semester_examinations_delete',
1080
- CAN_END_SEMESTER_EXAMINATIONS_NOTIFICATION_DETAILS_VIEW = "can_end_semester_examinations_notification_details_view",
1071
+ CAN_END_SEMESTER_EXAMINATIONS_NOTIFICATION_DETAILS_VIEW = 'can_end_semester_examinations_notification_details_view',
1081
1072
 
1082
1073
  // Registrations
1083
1074
  CAN_EXAM_REGISTARTIONS_VIEW = 'can_exam_registrations_view',
1084
1075
  CAN_EXAM_REGISTARTIONS_ADD = 'can_exam_registrations_add',
1085
- CAN_EXAM_REGISTARTIONS_CHALLAN_UPLOAD = "can_exam_registrations_challan_upload",
1086
- CAN_EXAM_REGISTARTIONS_SUBMIT = "can_exam_registrations_submit",
1076
+ CAN_EXAM_REGISTARTIONS_CHALLAN_UPLOAD = 'can_exam_registrations_challan_upload',
1077
+ CAN_EXAM_REGISTARTIONS_SUBMIT = 'can_exam_registrations_submit',
1078
+
1079
+ //Challan Upload
1080
+ CAN_CHALLAN_UPLOAD_VIEW = 'can_challan_upload_view',
1081
+ CAN_CHALLAN_REGISTRATION_VIEW = 'can_challan_registrations_view',
1082
+ CAN_CHALLAN_REGISTRATION_ADD = 'can_challan_registrations_add',
1083
+ CAN_CHALLAN_UPLOAD_ADD = 'can_challan_upload_add',
1084
+
1085
+ //settings
1086
+ CAN_EXAMS_SETTINGS_VIEW = 'can_exams_settings_view',
1087
1087
 
1088
1088
  // Fee configuration
1089
1089
  EXAM_FEE_CONFIGURATION_VIEW = 'can_exam_fee_configuration_view',
@@ -1097,25 +1097,25 @@ export enum Permission {
1097
1097
 
1098
1098
  // Hall tickets
1099
1099
  CAN_HALL_TICKETS_VIEW = 'can_hall_tickets_view',
1100
- CAN_HALL_TICKETS_DOWNLOAD = "can_hall_tickets_download",
1100
+ CAN_HALL_TICKETS_DOWNLOAD = 'can_hall_tickets_download',
1101
1101
 
1102
1102
  // OMRS
1103
1103
  CAN_OMRS_VIEW = 'can_omrs_view',
1104
1104
  CAN_OMRS_UPDATE = 'can_omrs_update',
1105
1105
  CAN_OMRS_GENERATE = 'can_omrs_generate',
1106
- CAN_OMRS_DOWNLOAD = "can_omrs_download",
1106
+ CAN_OMRS_DOWNLOAD = 'can_omrs_download',
1107
1107
 
1108
1108
  // Paper Configuration
1109
1109
  CAN_PAPER_CONFIGURATION_VIEW = 'can_paper_configuration_view',
1110
1110
  CAN_PAPER_CONFIGURATION_ADD = 'can_paper_configuration_add',
1111
1111
  CAN_PAPER_CONFIGURATION_EDIT = 'can_paper_configuration_edit',
1112
1112
  CAN_PAPER_CONFIGURATION_DELETE = 'can_paper_configuration_delete',
1113
- CAN_PAPER_CONFIGURATION_DOWNLOAD = "can_paper_configuration_download",
1113
+ CAN_PAPER_CONFIGURATION_DOWNLOAD = 'can_paper_configuration_download',
1114
1114
 
1115
1115
  // D Form
1116
1116
  CAN_D_FORM_VIEW = 'can_d_forms_view',
1117
1117
  CAN_D_FORM_ADD = 'can_d_forms_add',
1118
- CAN_D_FORM_DOWNLOAD = "can_d_forms_download",
1118
+ CAN_D_FORM_DOWNLOAD = 'can_d_forms_download',
1119
1119
 
1120
1120
  // Bundling
1121
1121
  CAN_VIEW_ANSWER_SHEET_REPORT = 'can_view_answer_sheet_report',