Skip to content

Commit

Permalink
Merge pull request #168 from upendraTekdi/late_markingfor_self_uk
Browse files Browse the repository at this point in the history
Task #225334 :  update in Remove user from class,Reason for Remove,My classes ,mark for Learners & makr for self,reasons for absen,use all reasons of oblf when attendance popup in absent case
  • Loading branch information
itsvick authored Aug 22, 2024
2 parents ceaab1c + cafc95f commit 9d249a9
Show file tree
Hide file tree
Showing 6 changed files with 264 additions and 220 deletions.
12 changes: 12 additions & 0 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ export const dropoutReasons = [
{ label: 'SCHOOL_ADMISSION', value: 'School admission' },
];

export const absentReasonOptions = [
{ label: 'PAID_LEAVE_HALF_DAY', value: 'Paid leave - Half day' },
{ label: 'PAID_LEAVE_FULL_DAY', value: 'Paid leave - Full day' },
{ label: 'UNPAID_LEAVE_HALF_DAY', value: 'Unpaid leave - Half day' },
{ label: 'UNPAID_LEAVE_FULL_DAY', value: 'Unpaid leave - Full day' },
{ label: 'MENSTRUAL_LEAVE_HALF_DAY', value: 'Menstrual leave - Half day' },
{ label: 'MENSTRUAL_LEAVE_FULL_DAY', value: 'Menstrual leave - Full day' },
];

export const accessControl: { [key: string]: Role[] } = {
accessDashboard: [Role.TEACHER, Role.TEAM_LEADER],
accessAttendanceHistory: [Role.TEACHER, Role.TEAM_LEADER],
Expand Down Expand Up @@ -81,3 +90,6 @@ export const ShowSelfAttendance = true;

export const reassignCenters = false;
export const markdDropOut = false;

// show lables as per product
export const showLablesForOther = true;
12 changes: 11 additions & 1 deletion public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"MARK": "Mark",
"MARK_TO_LEARNER": "Mark To Learners",
"MARK_TO_SELF": "Mark To Self",
"MARK_FOR_LEARNER": "Mark For Learners",
"MARK_FOR_SELF": "Mark For Self",
"MARK_MY_ATTENDANCE": "Mark My Attendance",
"MARK_CENTER_ATTENDANCE": "Mark Center Attendance",
"MARK_ATTENDANCE": "Mark Attendance",
Expand Down Expand Up @@ -73,6 +75,8 @@
"DROP_OUT": "Drop Out",
"REASON_FOR_DROPOUT": "Reason for Dropout",
"REASON_FOR_DELETION": "Reason for Deletion",
"REASON_FOR_REMOVE": "Reason for Remove",
"REASON_FOR_ABSENT": "Reason for Absent",
"SURE_LOGOUT": "Are you sure you want to Logout?",
"SURE_UPDATE": "Are you sure you want to update this attendance?",
"SURE_REMOVE": "Are you sure you want to remove this learner?",
Expand Down Expand Up @@ -213,7 +217,13 @@
"CENTER_NAME": "Center Name",
"ALL_CENTERS": "All Centers",
"NO_LEARNER_WITH_LOW_ATTENDANCE": "None",
"ATTENDANCE_MARKED_OUT_OF_DAYS": "Attendance marked: {{count}} out of last 7 days"
"ATTENDANCE_MARKED_OUT_OF_DAYS": "Attendance marked: {{count}} out of last 7 days",
"PAID_LEAVE_HALF_DAY": "Paid leave - Half day",
"PAID_LEAVE_FULL_DAY": "Paid leave - Full day",
"UNPAID_LEAVE_HALF_DAY": "Unpaid leave - Half day",
"UNPAID_LEAVE_FULL_DAY": "Unpaid leave - Full day",
"MENSTRUAL_LEAVE_HALF_DAY": "Menstrual leave - Half day",
"MENSTRUAL_LEAVE_FULL_DAY": "Menstrual leave - Full day"
},
"PROFILE": {
"EDIT_PROFILE": "Edit Profile",
Expand Down
9 changes: 7 additions & 2 deletions src/components/DeleteUserModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { updateFacilitator } from '@/services/ManageUser';
import { updateCohortMemberStatus } from '@/services/MyClassDetailsService';
import { Role, Status } from '@/utils/app.constant';
import manageUserStore from '@/store/manageUserStore';
import { showLablesForOther } from '../../app.config';

interface DeleteUserModalProps {
type: Role.STUDENT | Role.TEACHER;
Expand Down Expand Up @@ -130,7 +131,9 @@ const DeleteUserModal: React.FC<DeleteUserModalProps> = ({
}}
component="h2"
>
{t('COMMON.DELETE_USER')}
{showLablesForOther
? t('COMMON.REMOVE_USER_FROM_CLASS')
: t('COMMON.DELETE_USER')}
</Typography>
</Box>
<CloseIcon
Expand All @@ -152,7 +155,9 @@ const DeleteUserModal: React.FC<DeleteUserModalProps> = ({
}}
component="h2"
>
{t('COMMON.REASON_FOR_DELETION')}
{showLablesForOther
? t('COMMON.REASON_FOR_REMOVE')
: t('COMMON.REASON_FOR_DELETION')}
</Typography>
</Box>
<>
Expand Down
16 changes: 6 additions & 10 deletions src/components/MenuDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
ShowMyTeachingCenter,
ShowObservationsAndForms,
accessControl,
showLablesForOther,
} from '../../app.config';
import EventAvailableOutlinedIcon from '@mui/icons-material/EventAvailableOutlined';
import checkBook from '../assets/images/checkbook.svg';
Expand Down Expand Up @@ -84,7 +85,6 @@ const MenuDrawer: React.FC<DrawerProps> = ({
handleToggleDrawer(false)();
}
};


const navigateToDashboard = () => {
closeDrawer();
Expand All @@ -106,9 +106,7 @@ const MenuDrawer: React.FC<DrawerProps> = ({
return (
<Drawer
open={isDesktop || isOpen}
onClose={
closeDrawer
}
onClose={closeDrawer}
transitionDuration={{ enter: 500, exit: 500 }}
className="backgroundFaded"
variant={isDesktop ? 'persistent' : 'temporary'}
Expand Down Expand Up @@ -138,11 +136,7 @@ const MenuDrawer: React.FC<DrawerProps> = ({
</Box>
{!isDesktop && (
<Box>
<IconButton
onClick={
closeDrawer
}
>
<IconButton onClick={closeDrawer}>
<ClearIcon sx={{ color: theme.palette.warning['300'] }} />
</IconButton>
</Box>
Expand Down Expand Up @@ -266,7 +260,9 @@ const MenuDrawer: React.FC<DrawerProps> = ({
>
{accessGranted('showTeachingCenter', accessControl, userRole)
? t('DASHBOARD.TEACHING_CENTERS')
: t('DASHBOARD.MY_TEACHING_CENTERS')}
: showLablesForOther
? t('DASHBOARD.MY_CLASSES')
: t('DASHBOARD.MY_TEACHING_CENTERS')}
</Button>
</Box>
)}
Expand Down
Loading

0 comments on commit 9d249a9

Please sign in to comment.