Skip to content

Commit

Permalink
Merge pull request #232 from Rushikesh-Sonawane99/shiksha-2.0
Browse files Browse the repository at this point in the history
Issue #PS-384 chore: Added message No Data Found when no search content found
  • Loading branch information
itsvick authored Jun 4, 2024
2 parents f3ad5b7 + 2a26adf commit 2660259
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 31 deletions.
44 changes: 31 additions & 13 deletions src/pages/attendance-history.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -781,17 +781,34 @@ const UserAttendanceHistory = () => {
</Box>
{cohortMemberList?.length > 0 ? (
<Box>
{displayStudentList?.map((user: any) => (
<AttendanceStatusListView
isDisabled={true}
showLink={true}
key={user.userId}
userData={user}
isEdit={false}
bulkAttendanceStatus={bulkAttendanceStatus}
handleBulkAction={submitBulkAttendanceAction}
/>
))}
{displayStudentList.length >=1 ? (
displayStudentList?.map((user: any) => (
<AttendanceStatusListView
isDisabled={true}
showLink={true}
key={user.userId}
userData={user}
isEdit={false}
bulkAttendanceStatus={bulkAttendanceStatus}
handleBulkAction={submitBulkAttendanceAction}
/>
))
) : (
<Box
sx={{
m: '1rem',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
}}
>
<Typography
style={{ fontWeight: 'bold', marginLeft: '1rem' }}
>
{t('COMMON.NO_DATA_FOUND')}
</Typography>
</Box>
)}
</Box>
) : (
<Box
Expand All @@ -800,7 +817,8 @@ const UserAttendanceHistory = () => {
mt={2}
p={'1rem'}
borderRadius={'1rem'}
bgcolor={'secondary.light'}
bgcolor={theme.palette.warning['A400']}
// bgcolor={'secondary.light'}
>
<Typography>{t('COMMON.NO_DATA_FOUND')}</Typography>
</Box>
Expand All @@ -816,7 +834,7 @@ const UserAttendanceHistory = () => {
/>
</Box>
</Box>
{displayStudentList ? <UpDownButton /> : null}
{displayStudentList.length>=1 ? <UpDownButton /> : null}
</Box>
);
};
Expand Down
54 changes: 36 additions & 18 deletions src/pages/attendance-overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ const AttendanceOverview: React.FC<AttendanceOverviewProps> = () => {
const response = res?.data?.result?.attendanceDate;
if (response) {
setNumberOfDaysAttendanceMarked(Object.keys(response)?.length);
} else {
setNumberOfDaysAttendanceMarked(0);
}
} else {
setNumberOfDaysAttendanceMarked(0);
}
};
if (classId) {
getAttendanceMarkedDays();
Expand Down Expand Up @@ -482,7 +482,7 @@ const AttendanceOverview: React.FC<AttendanceOverviewProps> = () => {

// close modal of sort
const handleCloseModal = () => {
setModalOpen(false)
setModalOpen(false);
};

//handel sorting
Expand Down Expand Up @@ -564,7 +564,7 @@ const AttendanceOverview: React.FC<AttendanceOverviewProps> = () => {
};
return (
<Box>
{(displayStudentList.length) ? <UpDownButton /> : null}
{displayStudentList.length ? <UpDownButton /> : null}
<Header />
{loading && (
<Loader showBackdrop={true} loadingText={t('COMMON.LOADING')} />
Expand Down Expand Up @@ -787,18 +787,35 @@ const AttendanceOverview: React.FC<AttendanceOverviewProps> = () => {
secondColumnName={t('COMMON.CLASS_MISSED')}
/>
<Box>
{displayStudentList?.map((user: any) => (
<StudentsStatsList
key={user.userId}
name={user.name}
presentPercent={
Math.floor(parseFloat(user.present_percent)) || 0
}
classesMissed={user.absent || 0}
userId={user.userId}
cohortId={classId}
/>
))}
{displayStudentList.length >= 1 ? (
displayStudentList?.map((user: any) => (
<StudentsStatsList
key={user.userId}
name={user.name}
presentPercent={
Math.floor(parseFloat(user.present_percent)) || 0
}
classesMissed={user.absent || 0}
userId={user.userId}
cohortId={classId}
/>
))
) : (
<Box
sx={{
mt: '1rem',
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
}}
>
<Typography
style={{ fontWeight: 'bold', marginLeft: '1rem' }}
>
{t('COMMON.NO_DATA_FOUND')}
</Typography>
</Box>
)}
</Box>
</Box>
) : (
Expand Down Expand Up @@ -830,7 +847,8 @@ const AttendanceOverview: React.FC<AttendanceOverviewProps> = () => {
mt={2}
p={'1rem'}
borderRadius={'1rem'}
bgcolor={'secondary.light'}
bgcolor={theme.palette.warning['A400']}
// bgcolor={'secondary.light'}
>
<Typography>{t('COMMON.NO_DATA_FOUND')}</Typography>
</Box>
Expand Down

0 comments on commit 2660259

Please sign in to comment.