Skip to content

Commit

Permalink
Merge pull request #115 from Aar-if/centers
Browse files Browse the repository at this point in the history
Issue #PS-1677 feat: Teaching Centers Page Inconsistencies
  • Loading branch information
itsvick authored Aug 9, 2024
2 parents 71122a0 + c9c2c53 commit 6dbc617
Show file tree
Hide file tree
Showing 7 changed files with 326 additions and 331 deletions.
6 changes: 3 additions & 3 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"SEARCH_STUDENT": "Search Learner",
"SORT_BY": "Sort by",
"APPLY": "Apply",
"A_TO_Z": "A TO Z",
"Z_TO_A": "Z TO A",
"A_TO_Z": "A to Z",
"Z_TO_A": "Z to A",
"HIGH_TO_LOW": "High to Low",
"LOW_TO_HIGH": "Low to High",
"NAMES": "Names",
Expand Down Expand Up @@ -191,7 +191,7 @@
"ATTENDANCE_OVERVIEW": "Attendance Overview",
"CENTER_ATTENDANCE": "Center Attendance",
"LOW_ATTENDANCE_STUDENTS": "Low Attendance Learners",
"N/A": "N/A",
"N/A": "No Centers Assigned",
"CENTER_NAME": "Center Name",
"ALL_CENTERS": "All Centers",
"NO_LEARNER_WITH_LOW_ATTENDANCE": "No Learner with low attendance",
Expand Down
4 changes: 2 additions & 2 deletions public/locales/hi/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"SEARCH_STUDENT": "छात्र खोजें",
"SORT_BY": "इसके अनुसार क्रमबद्ध करें",
"APPLY": "आवेदन करना",
"A_TO_Z": "A TO Z",
"Z_TO_A": "Z TO A",
"A_TO_Z": "A to Z",
"Z_TO_A": "Z tO A",
"HIGH_TO_LOW": "उच्चे से नीचा",
"LOW_TO_HIGH": "नीचा से उच्चे",
"NAMES": "नाम",
Expand Down
4 changes: 2 additions & 2 deletions public/locales/mr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"SEARCH_STUDENT": "विद्यार्थी शोधा",
"SORT_BY": "क्रमवारी लावा",
"APPLY": "लागू करा",
"A_TO_Z": "A TO Z",
"Z_TO_A": "Z TO A",
"A_TO_Z": "A to Z",
"Z_TO_A": "Z to A",
"HIGH_TO_LOW": "उच्च ते कमी",
"LOW_TO_HIGH": "कमी ते उच्च",
"NAMES": "नावे",
Expand Down
2 changes: 1 addition & 1 deletion src/components/FormButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const FormButtons: React.FC<FormButtons> = ({
height: '2.5rem',
padding: theme.spacing(1),
fontWeight: '500',
width: isSingleButton ? '100%' : '48%',
width: '100%',
}}
type="submit"
onClick={() => onClick(formData)}
Expand Down
118 changes: 59 additions & 59 deletions src/components/ManageUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ const ManageUser: React.FC<ManageUsersProps> = ({
return;
}
const userIds = facilitatorList?.map((user: any) => user.userId);


const cohortDetailsPromises = userIds?.map((userId: string) =>
getCohortList(userId, { filter: 'true' })
Expand All @@ -175,7 +174,6 @@ const ManageUser: React.FC<ManageUsersProps> = ({
}
});


const extractedData = facilitatorList?.map(
(user: any, index: number) => {
const cohorts = cohortDetails[index] || [];
Expand Down Expand Up @@ -631,70 +629,72 @@ const ManageUser: React.FC<ManageUsersProps> = ({
>
{users &&
users.length !== 0 &&
users.map((user) => (
<Box
key={user.userId}
display={'flex'}
borderBottom={`1px solid ${theme.palette.warning['A100']}`}
width={'100%'}
justifyContent={'space-between'}
sx={{ cursor: 'pointer' }}
>
<Box display="flex" alignItems="center" gap="5px">
<Image src={profileALT} alt="img" />
<Box>
<CustomLink
className="word-break"
href="#"
onClick={(e) => e.preventDefault()}
>
<Typography
onClick={() => {
handleTeacherFullProfile(user.userId!);
// ReactGA.event('teacher-details-link-clicked', {
// userId: userId,
// });
}}
[...users]
.sort((a, b) => a.name.localeCompare(b.name))
.map((user) => (
<Box
key={user.userId}
display={'flex'}
borderBottom={`1px solid ${theme.palette.warning['A100']}`}
width={'100%'}
justifyContent={'space-between'}
sx={{ cursor: 'pointer' }}
>
<Box display="flex" alignItems="center" gap="5px">
<Box>
<CustomLink
className="word-break"
href="#"
onClick={(e) => e.preventDefault()}
>
<Typography
onClick={() => {
handleTeacherFullProfile(user.userId!);
// ReactGA.event('teacher-details-link-clicked', {
// userId: userId,
// });
}}
sx={{
textAlign: 'left',
fontSize: '16px',
fontWeight: '400',
marginTop: '5px',
color: theme.palette.secondary.main,
}}
>
{user.name}
</Typography>
</CustomLink>
<Box
sx={{
textAlign: 'left',
fontSize: '16px',
fontWeight: '400',
marginTop: '5px',
color: theme.palette.secondary.main,
backgroundColor: '#FFF8F2',
padding: '5px',
borderRadius: '5px',
fontSize: '12px',
fontWeight: '600',
color: 'black',
marginBottom: '10px',
}}
>
{user.name}
</Typography>
</CustomLink>
<Box
{user?.cohortNames
? `${user.cohortNames}`
: t('ATTENDANCE.N/A')}
</Box>
</Box>
</Box>
<Box>
<MoreVertIcon
onClick={toggleDrawer('bottom', true, user)}
sx={{
backgroundColor: '#FFF8F2',
padding: '5px',
borderRadius: '5px',
fontSize: '12px',
fontWeight: '600',
color: 'black',
marginBottom: '10px',
fontSize: '24px',
marginTop: '1rem',
color: theme.palette.warning['300'],
}}
>
{user?.cohortNames
? `${user.cohortNames}`
: t('ATTENDANCE.N/A')}
</Box>
/>
</Box>
</Box>
<Box>
<MoreVertIcon
onClick={toggleDrawer('bottom', true, user)}
sx={{
fontSize: '24px',
marginTop: '1rem',
color: theme.palette.warning['300'],
}}
/>
</Box>
</Box>
))}
))}

{!users?.length && (
<Box
sx={{
Expand Down
2 changes: 1 addition & 1 deletion src/pages/blocks/components/FilterModalCenter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const FilterModalCenter: React.FC<FilterModalProps> = ({
>
{t('COMMON.FILTERS')}
</Typography>
<IconButton onClick={handleClose}>
<IconButton onClick={handleClose} sx={{color: "#4D4639"}}>
<Close />
</IconButton>
</Box>
Expand Down
Loading

0 comments on commit 6dbc617

Please sign in to comment.