Skip to content

Commit

Permalink
Merge branch 'shiksha-2.0' of https://github.com/tekdi/shiksha-frontend
Browse files Browse the repository at this point in the history
… into cachingLatest
  • Loading branch information
Aar-if committed Jul 1, 2024
2 parents b87767f + 90a2184 commit 2e9e9c1
Show file tree
Hide file tree
Showing 28 changed files with 884 additions and 229 deletions.
19 changes: 13 additions & 6 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"OK": "OK",
"FROM_TO_DATE": "From - To dates",
"REMOVE": "Remove",
"SEND_REQUEST": "Send Request",
"MARK_DROP_OUT": "Mark as Drop Out",
"UNMARK_DROP_OUT": "Unmark as Drop Out",
"SOMETHING_WENT_WRONG": "Something went wrong",
Expand All @@ -74,16 +75,19 @@
"FILTERS": "Filters",
"MANAGE_USERS": "Manage Users",
"FACILITATORS": "Facilitators",
"CENTERS_ASSIGNED": "Centers Assigned",
"MANAGE_CENTERS": "Manage Centers",
"CENTERS_ASSIGNED": "Centers Assigned in {{block}}",
"REASSIGN_CENTERS": "Reassign Centers",
"REASSIGN_BLOCKS_REQUEST": "Request to Re-assign Block",
"ASSIGN": "Assign",
"SEARCH_FACILITATORS": "Search Facilitators..",
"ADD_LEARNER":"Add Learners",
"DESELECT_ALL":"Deselect All",
"SELECT_ALL":"Select All",
"ADD_LEARNER": "Add Learners",
"DESELECT_ALL": "Deselect All",
"SELECT_ALL": "Select All",
"LEARNER_MARKED_DROPOUT": "Learner marked as dropout",
"LEARNER_UNMARKED_DROPOUT": "Learner un-marked as dropout",
"LEARNER_REMOVED": "Learner has been removed"
"LEARNER_REMOVED": "Learner has been removed",
"DROPPED_OUT": "Dropped Out",
"DELETE_USER": "Delete User Permanently"
},
"LOGIN_PAGE": {
"USERNAME": "Username",
Expand Down Expand Up @@ -123,6 +127,8 @@
},
"ATTENDANCE": {
"TOTAL_STUDENTS": "Total Number of Learners: {{count}}",
"ACTIVE_STUDENTS": "Active Learners: {{count}}",
"DROPOUT_STUDENTS": "Dropout Learners: {{count}}",
"PRESENT_STUDENTS": "Present Learners: {{count}}",
"ABSENT_STUDENTS": "Absent Learners: {{count}}",
"PRESENT": "Present",
Expand Down Expand Up @@ -238,6 +244,7 @@
},
"BLOCKS": {
"TEACHING_BLOCKS": "Teaching Blocks",
"SEARCH": "Search..",
"CREATE_NEW": "Create New",
"NEW_BLOCK": "New Block",
"BLOCK_NAME": "Block Name",
Expand Down
13 changes: 9 additions & 4 deletions public/locales/hi/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"OK": "ठीक है",
"FROM_TO_DATE": "से - दिनांक तक",
"REMOVE": "हटाएं",
"SEND_REQUEST": "अनुरोध भेजें",
"MARK_DROP_OUT": "ड्रॉप आउट के रूप में चिह्नित करें",
"UNMARK_DROP_OUT": "ड्रॉप आउट के रूप में हटाएं",
"SOMETHING_WENT_WRONG": "कुछ गलत हो गया",
Expand All @@ -74,16 +75,18 @@
"FILTERS": "फिल्टर्स",
"MANAGE_USERS": "उपयोगकर्ताओं का प्रबंधन",
"FACILITATORS": "सुविधाकर्ता",
"CENTERS_ASSIGNED": "केंद्र निरुपित",
"MANAGE_CENTERS": "केंद्र प्रबंधित करें",
"CENTERS_ASSIGNED": "{{block}} में केंद्र आवंटित किए गए",
"REASSIGN_CENTERS": "केंद्रों को पुनः आवंटित करें",
"REASSIGN_BLOCKS_REQUEST": "ब्लॉक को पुनः आवंटित करने का अनुरोध",
"ASSIGN": "निरुपण करें",
"SEARCH_FACILITATORS": "खोज सुविधा प्रदाता..",
"ADD_LEARNER": "शिक्षार्थियों को जोड़ें",
"DESELECT_ALL": "सभी को अचयनित करें",
"SELECT_ALL": "सभी को चुनें",
"LEARNER_MARKED_DROPOUT": "शिक्षार्थी को ड्रॉप आउट के रूप में चिह्नित किया गया",
"LEARNER_UNMARKED_DROPOUT": "शिक्षार्थी को ड्रॉपआउट के रूप में अनचिह्नित किया गया",
"LEARNER_REMOVED": "शिक्षार्थी को हटा दिया गया है"
"LEARNER_REMOVED": "शिक्षार्थी को हटा दिया गया है",
"DELETE_USER": "उपयोगकर्ता को स्थायी रूप से हटाएं"
},
"LOGIN_PAGE": {
"USERNAME": "उपयोगकर्ता नाम",
Expand Down Expand Up @@ -122,6 +125,8 @@
},
"ATTENDANCE": {
"TOTAL_STUDENTS": "कुल छात्रों की संख्या: {{count}}",
"ACTIVE_STUDENTS": "सक्रिय शिक्षार्थी: {{count}}",
"DROPOUT_STUDENTS": "छोड़े हुए छात्र: {{count}}",
"PRESENT_STUDENTS": "उपस्थित छात्र: {{count}}",
"ABSENT_STUDENTS": "अनुपस्थित छात्र: {{count}}",
"PRESENT": "उपस्थित",
Expand Down Expand Up @@ -237,7 +242,7 @@
},
"BLOCKS": {
"TEACHING_BLOCKS": "शिक्षण ब्लॉक्स",

"SEARCH": "खोजें..",
"CREATE_NEW": "नया निर्माण",
"NEW_BLOCK": "नया ब्लॉक",
"BLOCK_NAME": "ब्लॉक का नाम",
Expand Down
13 changes: 9 additions & 4 deletions public/locales/mr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"OK": "ठीक आहे",
"FROM_TO_DATE": "पासून - पर्यंत तारीख",
"REMOVE": "काढून टाका",
"SEND_REQUEST": "विनंती पाठवा",
"MARK_DROP_OUT": "ड्रॉप आउट म्हणून चिन्हांकित करा",
"UNMARK_DROP_OUT": "ड्रॉप आउट म्हणून काढून टाका",
"SOMETHING_WENT_WRONG": "काहीतरी चूक झाली",
Expand All @@ -74,16 +75,18 @@
"FILTERS": "फिल्टर्स",
"MANAGE_USERS": "वापरकर्ते व्यवस्थापित करा",
"FACILITATORS": "सुविधासंचालक",
"CENTERS_ASSIGNED": "केंद्र निरुपित",
"MANAGE_CENTERS": "केंद्र प्रबंधित करा",
"CENTERS_ASSIGNED": "{{block}} मध्ये केंद्र नियुक्त केले",
"REASSIGN_CENTERS": "केंद्र पुन्हा नियुक्त करा",
"REASSIGN_BLOCKS_REQUEST": "ब्लॉक पुनः नियुक्त करण्याची विनंती",
"ASSIGN": "नियुक्त करा",
"SEARCH_FACILITATORS": "शोध सुविधा..",
"ADD_LEARNER": "शिक्षार्थी जोडा",
"DESELECT_ALL": "सर्व निवड रद्द करा",
"SELECT_ALL": "सर्व निवडा",
"LEARNER_MARKED_DROPOUT": "शिकणाऱ्याला ड्रॉप आऊट म्हणून चिन्हांकित केले",
"LEARNER_UNMARKED_DROPOUT": "शिकणाऱ्याला ड्रॉपआउट म्हणून अनचिन्हांकित केले",
"LEARNER_REMOVED": "शिकणाऱ्याचे हटवले गेले आहे"
"LEARNER_REMOVED": "शिकणाऱ्याचे हटवले गेले आहे",
"DELETE_USER": "वापरकर्त्यास कायमचे हटवा"
},
"LOGIN_PAGE": {
"USERNAME": "वापरकर्तानाव",
Expand Down Expand Up @@ -123,6 +126,8 @@
},
"ATTENDANCE": {
"TOTAL_STUDENTS": "एकूण विद्यार्थी: {{count}}",
"ACTIVE_STUDENTS": "सक्रिय शिकणारे: {{count}}",
"DROPOUT_STUDENTS": "काढून टाकलेले विद्यार्थी: {{count}}",
"PRESENT_STUDENTS": "उपस्थित विद्यार्थी: {{count}}",
"ABSENT_STUDENTS": "अनुपस्थित विद्यार्थी: {{count}}",
"PRESENT": "उपस्थित",
Expand Down Expand Up @@ -243,7 +248,7 @@
"NEW_BLOCK": "नवीन ब्लॉक",
"BLOCK_NAME": "ब्लॉकचं नाव",
"CREATE": "तयार करा",

"SEARCH_BLOCKS": "ब्लॉक शोधा"

},
Expand Down
2 changes: 2 additions & 0 deletions public/locales/or/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@
},
"ATTENDANCE": {
"TOTAL_STUDENTS": "ମୋଟ ଶିକ୍ଷାର୍ଥୀ ସଂଖ୍ୟା: {{count}}",
"ACTIVE_STUDENTS": "ସକ୍ରିୟ ଶିକ୍ଷାର୍ଥୀ: {{count}}",
"DROPOUT_STUDENTS": "ଛାଡ଼ିଦେଇଥିବା ଛାତ୍ରଛାତ୍ରୀ: {{count}}",
"PRESENT_STUDENTS": "ଉପସ୍ଥିତ ଛାତ୍ର-ଛାତ୍ରୀ: {{count}}",
"ABSENT_STUDENTS": "ଅନୁପସ୍ଥିତ ଛାତ୍ର-ଛାତ୍ରୀ: {{count}}",
"PRESENT": "ଉପସ୍ଥିତ",
Expand Down
17 changes: 8 additions & 9 deletions src/components/AttendanceStatusListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import Loader from './Loader';
import { getUserDetails } from '@/services/ProfileService';
import { useTheme } from '@mui/material/styles';
import { useTranslation } from 'next-i18next';
import DropoutLabel from './DropoutLabel';
import { Status, names } from '@/utils/app.constant';

const AttendanceStatusListView: React.FC<AttendanceStatusListViewProps> = ({
isDisabled = false,
Expand Down Expand Up @@ -109,15 +111,6 @@ const AttendanceStatusListView: React.FC<AttendanceStatusListViewProps> = ({
}
};

const names = [
'name',
'age',
'gender',
'student_type',
'enrollment_number',
'primary_work',
];

const filteredFields = names
.map((label) => customFieldsData.find((field) => field.name === label))
.filter(Boolean);
Expand Down Expand Up @@ -146,6 +139,7 @@ const AttendanceStatusListView: React.FC<AttendanceStatusListViewProps> = ({
marginY="auto"
sx={{
textAlign: 'left',
alignItems: 'center',
fontSize: '14px',
fontWeight: '400',
color: '#1F1B13',
Expand All @@ -163,6 +157,10 @@ const AttendanceStatusListView: React.FC<AttendanceStatusListViewProps> = ({
userData?.name
)}
</Typography>
{userData?.memberStatus === Status.DROPOUT ?
<DropoutLabel/>
:
<>
<Box
display="flex"
flexDirection="column"
Expand Down Expand Up @@ -245,6 +243,7 @@ const AttendanceStatusListView: React.FC<AttendanceStatusListViewProps> = ({
{t('ATTENDANCE.ABSENT')}
</Typography>
</Box>
</>}
</Box>
</Box>
);
Expand Down
8 changes: 6 additions & 2 deletions src/components/BottomDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ type Anchor = 'bottom';
interface BottomDrawerProps {
toggleDrawer: (
anchor: Anchor,
open: boolean
open: boolean,
user: any
) => (event: React.MouseEvent) => void;
state: { [key in Anchor]?: boolean };
optionList: {
Expand All @@ -23,6 +24,7 @@ interface BottomDrawerProps {
}[];
listItemClick: (event: React.MouseEvent, name: string) => void;
renderCustomContent?: () => React.ReactNode;
children?: React.ReactNode;
}

const BottomDrawer: React.FC<BottomDrawerProps> = ({
Expand All @@ -31,6 +33,7 @@ const BottomDrawer: React.FC<BottomDrawerProps> = ({
optionList,
listItemClick,
renderCustomContent,
children,
}) => {
const theme = useTheme<any>();

Expand All @@ -47,11 +50,12 @@ const BottomDrawer: React.FC<BottomDrawerProps> = ({
display: 'flex',
justifyContent: 'center',
}}
onClick={toggleDrawer(anchor, false)}
onClick={toggleDrawer(anchor, false, '')}
>
<Box className="bg-grey"></Box>
</Box>
{renderCustomContent?.()}
{children}
<List>
{optionList.map(({ label, icon, name }, index) => (
<ListItem disablePadding key={index}>
Expand Down
5 changes: 3 additions & 2 deletions src/components/CohortLearnerList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
toPascalCase,
} from '@/utils/Helper';
import LearnersList from '@/components/LearnersList';
import { limit } from '@/utils/app.constant';
import { Status, limit } from '@/utils/app.constant';
import { showToastMessage } from './Toastify';
import { useTranslation } from 'next-i18next';
import { Box, Typography } from '@mui/material';
Expand Down Expand Up @@ -81,10 +81,11 @@ const CohortLearnerList : React.FC<CohortLearnerListProp> = ({cohortId, reloadSt
return (
<LearnersList
key={data.userId}
userId = {data.userId}
learnerName={data.name}
enrollmentId={data.enrollmentNumber}
cohortMembershipId={data.cohortMembershipId}
isDropout={data.memberStatus === 'dropout'}
isDropout={data.memberStatus === Status.DROPOUT}
statusReason = {data.statusReason}
reloadState={reloadState}
setReloadState={setReloadState}
Expand Down
2 changes: 1 addition & 1 deletion src/components/ConfirmationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const ConfirmationModal: React.FC<ConfirmationModalProps> = ({
</Button>
<Button
sx={{
width: '128px',
width: 'auto',
height: '40px',
fontSize: '14px',
fontWeight: '500',
Expand Down
3 changes: 2 additions & 1 deletion src/components/DropOutModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { showToastMessage } from './Toastify';
import { updateCohortMemberStatus } from '@/services/MyClassDetailsService';
import { useTheme } from '@mui/material/styles';
import { useTranslation } from 'next-i18next';
import { Status } from '@/utils/app.constant';

interface DropOutModalProps {
open: boolean;
Expand Down Expand Up @@ -80,7 +81,7 @@ function DropOutModal({
setLoading(true);

if (selectedReason && cohortMembershipId) {
const memberStatus = 'dropout';
const memberStatus = Status.DROPOUT;
const statusReason = selectedReason;
const membershipId = cohortMembershipId;

Expand Down
32 changes: 32 additions & 0 deletions src/components/DropoutLabel.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Box, Typography } from '@mui/material'
import { useTheme } from '@mui/material/styles';
import { useTranslation } from 'next-i18next';
import React from 'react'


const DropoutLabel = () => {
const theme = useTheme<any>();
const { t } = useTranslation();
return (
<Box
sx={{
fontSize: '12px',
color: theme.palette.warning['300'],
background: theme.palette.error.light,
fontWeight: '500',
borderRadius: '8px',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
gap: '4px',
padding: '4px 8px',
my: '0.5rem',
mr:'11px'
}}
>
<Typography sx={{ marginTop: '1px', fontWeight: 500, fontSize: '0.75rem' }}>{t('COMMON.DROPPED_OUT')}</Typography>
</Box>
)
}

export default DropoutLabel
21 changes: 12 additions & 9 deletions src/components/LearnerAttendanceStatsListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ import { getUserDetails } from '@/services/ProfileService';
import { useTheme } from '@mui/material/styles';
import { useTranslation } from 'react-i18next';
import useAttendanceRangeColor from '@/hooks/useAttendanceRangeColor';
import DropoutLabel from './DropoutLabel';
import { Status, names } from '@/utils/app.constant';

interface StudentsStatsListProps {
name: string;
presentPercent: number;
classesMissed: number;
userId?: string;
cohortId?: string;
memberStatus? : string;
}

const StudentsStatsList: React.FC<StudentsStatsListProps> = ({
Expand All @@ -25,6 +28,7 @@ const StudentsStatsList: React.FC<StudentsStatsListProps> = ({
classesMissed,
userId,
cohortId,
memberStatus
}) => {
const theme = useTheme<any>();
const { t } = useTranslation();
Expand Down Expand Up @@ -85,15 +89,6 @@ const StudentsStatsList: React.FC<StudentsStatsListProps> = ({
}
};

const names = [
'name',
'age',
'gender',
'student_type',
'enrollment_number',
'primary_work',
];

const filteredFields = names
.map((name) => customFieldsData.find((field) => field.name === name))
.filter(Boolean);
Expand Down Expand Up @@ -148,6 +143,12 @@ const StudentsStatsList: React.FC<StudentsStatsListProps> = ({
</Typography>
</Link>
</Grid>
{memberStatus === Status.DROPOUT ?
<Grid item xs={6}>
<DropoutLabel/>
</Grid>
:
<>
<Grid item xs={3}>
<Typography
fontSize="1rem"
Expand All @@ -171,6 +172,8 @@ const StudentsStatsList: React.FC<StudentsStatsListProps> = ({
{classesMissed}
</Typography>
</Grid>
</>
}
</Grid>
</Box>
</Stack>
Expand Down
Loading

0 comments on commit 2e9e9c1

Please sign in to comment.