Skip to content

Commit

Permalink
Merge pull request #258 from shreyas1434shinde/BugFixes
Browse files Browse the repository at this point in the history
Issue #PS-657 fix:Tracker Bug fixes
  • Loading branch information
itsvick authored Jun 6, 2024
2 parents b229f14 + 798cbc3 commit 199b04d
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 41 deletions.
4 changes: 2 additions & 2 deletions src/components/LearnerAttendanceStatsListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const StudentsStatsList: React.FC<StudentsStatsListProps> = ({
)}
<Stack>
<Box
height="60px"
// height="60px"
borderTop={`1px solid ${theme.palette.warning['A100']}`}
margin="0px"
alignItems={'center'}
Expand All @@ -125,7 +125,7 @@ const StudentsStatsList: React.FC<StudentsStatsListProps> = ({
p={2}
>
<Grid item xs={6} textAlign={'left'}>
<Link href={''}>
<Link className="word-break" href={''}>
<Typography
onClick={() => handleOpenModalLearner(userId!)}
sx={{
Expand Down
11 changes: 4 additions & 7 deletions src/pages/attendance-overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import OverviewCard from '@/components/OverviewCard';
import SearchIcon from '@mui/icons-material/Search';
import SortingModal from '@/components/SortingModal';
import StudentsStatsList from '@/components/LearnerAttendanceStatsListView';
import ToastMessage from '@/components/ToastMessage';
import UpDownButton from '@/components/UpDownButton';
import { cohortList } from '@/services/CohortServices';
import { getMyCohortMemberList } from '@/services/MyClassDetailsService';
Expand All @@ -49,7 +50,6 @@ import { usePathname } from 'next/navigation';
import { useRouter } from 'next/router';
import { useTheme } from '@mui/material/styles';
import { useTranslation } from 'next-i18next';
import ToastMessage from '@/components/ToastMessage';

interface AttendanceOverviewProps {
// buttonText: string;
Expand Down Expand Up @@ -199,7 +199,6 @@ const AttendanceOverview: React.FC<AttendanceOverviewProps> = () => {
state: stateName,
};
});


setCohortsData(filteredData);

Expand Down Expand Up @@ -234,7 +233,7 @@ const AttendanceOverview: React.FC<AttendanceOverviewProps> = () => {
setIsError(false);
} catch (error) {
console.error('Error fetching cohort list:', error);
setIsError(true)
setIsError(true);
setLoading(false);
}
};
Expand Down Expand Up @@ -431,7 +430,7 @@ const AttendanceOverview: React.FC<AttendanceOverviewProps> = () => {
}
} catch (error) {
console.error('Error fetching cohort list:', error);
setIsError(true)
setIsError(true);
setLoading(false);
} finally {
setLoading(false);
Expand Down Expand Up @@ -897,9 +896,7 @@ const AttendanceOverview: React.FC<AttendanceOverviewProps> = () => {
<Typography>{t('COMMON.NO_DATA_FOUND')}</Typography>
</Box>
)}
{ isError &&
<ToastMessage message={t('COMMON.SOMETHING_WENT_WRONG')} />
}
{isError && <ToastMessage message={t('COMMON.SOMETHING_WENT_WRONG')} />}
</Box>
);
};
Expand Down
45 changes: 20 additions & 25 deletions src/pages/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,15 @@ import ArrowForwardSharpIcon from '@mui/icons-material/ArrowForwardSharp';
import CalendarMonthIcon from '@mui/icons-material/CalendarMonth';
import Divider from '@mui/material/Divider';
import Header from '../components/Header';
import Image from 'next/image';
import Link from 'next/link';
import Loader from '../components/Loader';
import MarkBulkAttendance from '@/components/MarkBulkAttendance';
import OverviewCard from '@/components/OverviewCard';
import ToastMessage from '@/components/ToastMessage';
import WeekCalender from '@/components/WeekCalender';
import { calculatePercentage } from '@/utils/attendanceStats';
import calendar from '../assets/images/calendar.svg';
import { cohortList } from '../services/CohortServices';
import { getMyCohortMemberList } from '@/services/MyClassDetailsService';
import { lowLearnerAttendanceLimit } from './../../app.config';
Expand All @@ -53,9 +56,6 @@ import useDeterminePathColor from '../hooks/useDeterminePathColor';
import { useRouter } from 'next/navigation';
import { useTheme } from '@mui/material/styles';
import { useTranslation } from 'next-i18next';
import ToastMessage from '@/components/ToastMessage';
import calendar from '../assets/images/calendar.svg';
import Image from 'next/image';

// interface State extends SnackbarOrigin {
// openModal: boolean;
Expand Down Expand Up @@ -667,33 +667,28 @@ const Dashboard: React.FC<DashboardProps> = () => {
<Stack
direction="row"
spacing={1}
marginTop={1}
// marginTop={1}
justifyContent={'space-between'}
alignItems={'center'}
>
<Box display={'flex'}>
<Box display={'flex'} gap={'5px'} alignItems={'center'}>
{currentAttendance !== 'notMarked' &&
currentAttendance !== 'futureDate' && (
<>
<Box
width={'25px'}
height={'2rem'}
marginTop={'0.25rem'}
margin={'5px'}
>
<CircularProgressbar
value={currentAttendance?.present_percentage}
background
backgroundPadding={8}
styles={buildStyles({
textColor: pathColor,
pathColor: pathColor,
trailColor: '#E6E6E6',
strokeLinecap: 'round',
backgroundColor: '#ffffff',
})}
strokeWidth={20}
/>
</Box>
<CircularProgressbar
value={currentAttendance?.present_percentage}
background
backgroundPadding={8}
styles={buildStyles({
textColor: pathColor,
pathColor: pathColor,
trailColor: '#E6E6E6',
strokeLinecap: 'round',
backgroundColor: '#ffffff',
})}
className="fs-24 htw-24"
strokeWidth={20}
/>
<Box>
<Typography
// sx={{ color: theme.palette.warning['A400'] }}
Expand Down
16 changes: 12 additions & 4 deletions src/pages/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Image from 'next/image';
import Link from '@mui/material/Link';
import Loader from '../components/Loader';
import MenuItem from '@mui/material/MenuItem';
import ToastMessage from '@/components/ToastMessage';
import appLogo from '../../public/images/appLogo.png';
import config from '../../config.json';
import { getUserId } from '../services/ProfileService';
Expand All @@ -25,7 +26,6 @@ import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
import { useRouter } from 'next/router';
import { useTheme } from '@mui/material/styles';
import { useTranslation } from 'next-i18next';
import ToastMessage from '@/components/ToastMessage';

interface State extends SnackbarOrigin {
openModal: boolean;
Expand Down Expand Up @@ -138,7 +138,7 @@ const LoginPage = () => {
setShowToastMessage(true);
} else {
console.error('Error:', error);
setShowToastMessage(true);
setShowToastMessage(true);
}
}
}
Expand Down Expand Up @@ -268,6 +268,7 @@ const LoginPage = () => {
value={username}
onChange={handleUsernameChange}
error={usernameError}
className="userName"
/>
</Box>
<Box
Expand All @@ -286,6 +287,7 @@ const LoginPage = () => {
shrink: true,
}}
onClick={() => setScrolling(!scrolling)}
className="password"
InputProps={{
endAdornment: (
<InputAdornment position="end">
Expand Down Expand Up @@ -324,7 +326,11 @@ const LoginPage = () => {
checked={rememberMe}
/>
<span
style={{ cursor: 'pointer' }}
style={{
cursor: 'pointer',
color: theme.palette.warning['300'],
}}
className="fw-400"
onClick={() => setRememberMe(!rememberMe)}
>
{t('LOGIN_PAGE.REMEMBER_ME')}
Expand All @@ -351,7 +357,9 @@ const LoginPage = () => {
</Box>
</Box>
{showToastMessage && (
<ToastMessage message={t('LOGIN_PAGE.USERNAME_PASSWORD_NOT_CORRECT')} />
<ToastMessage
message={t('LOGIN_PAGE.USERNAME_PASSWORD_NOT_CORRECT')}
/>
)}
</form>
</Box>
Expand Down
6 changes: 3 additions & 3 deletions src/pages/profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ import Image from 'next/image';
import Loader from '@/components/Loader';
import Modal from '@mui/material/Modal';
import PlaceOutlinedIcon from '@mui/icons-material/PlaceOutlined';
import ToastMessage from '@/components/ToastMessage';
import { getLabelForValue } from '@/utils/Helper';
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
import { useRouter } from 'next/router';
import { useTranslation } from 'next-i18next';
import userPicture from '@/assets/images/imageOne.jpg';
import user_placeholder from '../assets/images/user_placeholder.png';
import ToastMessage from '@/components/ToastMessage';

interface FieldOption {
name: string;
Expand Down Expand Up @@ -89,7 +89,7 @@ const TeacherProfile = () => {
const style = {
position: 'absolute',
top: '50%',
maxWidth: 350, // Maximum width for responsiveness
maxWidth: 300, // Maximum width for responsiveness
left: '50%',
transform: 'translate(-50%, -50%)',
width: isDesktop ? 700 : 400,
Expand Down Expand Up @@ -536,7 +536,6 @@ const TeacherProfile = () => {
textAlign: 'center',
color: theme.palette.warning.A200,
border: `1px solid ${theme.palette.warning.A200}`,
borderColor: theme.palette.warning['A100'],
background: '#fff',
marginBottom: '20px',
display: 'flex',
Expand Down Expand Up @@ -573,6 +572,7 @@ const TeacherProfile = () => {
borderColor: theme.palette.warning['A100'],
padding: '16px',
}}
className="bg-white"
minWidth={'100%'}
borderRadius={'16px'}
border={'1px'}
Expand Down
13 changes: 13 additions & 0 deletions src/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,20 @@ main {
.text-4d {
color: #4d4639;
}
.userName label {
color: #1f1b13 !important;
}
.password label {
color: #1f1b13 !important;
}

.fs-24 {
font-size: 24px !important;
}
.htw-24 {
height: 24px;
width: 24px;
}
.selected-range {
background-color: var(--mui-palette-Skeleton-bg) !important;
}

0 comments on commit 199b04d

Please sign in to comment.