Skip to content

Commit

Permalink
Merge pull request #328 from Rushikesh-Sonawane99/shiksha-2.0
Browse files Browse the repository at this point in the history
Issue #PS-793 chore: Added link for name to open profile popup and added route for attendance overview
  • Loading branch information
itsvick authored Jul 1, 2024
2 parents 34f1afc + aaa12ec commit 90a2184
Show file tree
Hide file tree
Showing 13 changed files with 252 additions and 127 deletions.
12 changes: 2 additions & 10 deletions src/components/AttendanceStatusListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ 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 @@ -110,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 @@ -165,7 +157,7 @@ const AttendanceStatusListView: React.FC<AttendanceStatusListViewProps> = ({
userData?.name
)}
</Typography>
{userData?.memberStatus === "dropout" ?
{userData?.memberStatus === Status.DROPOUT ?
<DropoutLabel/>
:
<>
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
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
12 changes: 2 additions & 10 deletions src/components/LearnerAttendanceStatsListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ 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;
Expand Down Expand Up @@ -88,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 @@ -151,7 +143,7 @@ const StudentsStatsList: React.FC<StudentsStatsListProps> = ({
</Typography>
</Link>
</Grid>
{memberStatus === "dropout" ?
{memberStatus === Status.DROPOUT ?
<Grid item xs={6}>
<DropoutLabel/>
</Grid>
Expand Down
Loading

0 comments on commit 90a2184

Please sign in to comment.