Skip to content

Commit

Permalink
Merge pull request #338 from suvarnakale/shiksha-2.0
Browse files Browse the repository at this point in the history
Issue #0000 chore: linted and formatted the code
  • Loading branch information
itsvick authored Jul 2, 2024
2 parents 18f8b0c + 23bc3ab commit 79e7e08
Show file tree
Hide file tree
Showing 25 changed files with 318 additions and 271 deletions.
4 changes: 2 additions & 2 deletions public/locales/hi/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"UPDATE_ATTENDANCE": "उपस्थिति अपडेट करें",
"LOADING": "लोडिंग",
"SAVE": "सहेजें",
"SEARCH" : "खोजें..",
"SEARCH": "खोजें..",
"UPDATE": "अद्यतन करें",
"CLEAR_ALL": "सब हटाएं",
"SEARCH_STUDENT": "छात्र खोजें",
Expand Down Expand Up @@ -249,7 +249,7 @@
"CREATE": "बनाएँ",
"SEARCH_BLOCKS": "ब्लॉक खोजें"
},
"CENTERS": {
"CENTERS": {
"REGULAR_CENTERS": "नियमित केंद्र",
"REMOTE_CENTERS": "दूरस्थ केंद्र",
"CENTER_TYPE": "केंद्र प्रकार",
Expand Down
13 changes: 5 additions & 8 deletions public/locales/mr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"UPDATE_ATTENDANCE": "उपस्थिती अद्यतनित करा",
"LOADING": "लोड होत आहे",
"SAVE": "जतन करा",
"SEARCH" : "शोधा..",
"SEARCH": "शोधा..",
"UPDATE": "अपडेट करा",
"CLEAR_ALL": "सर्व काढा",
"SEARCH_STUDENT": "विद्यार्थी शोधा",
Expand Down Expand Up @@ -242,22 +242,19 @@
},
"BLOCKS": {
"TEACHING_BLOCKS": "शिक्षण ब्लॉक्स",



"CREATE_NEW": "नवीन तयार करा",
"NEW_BLOCK": "नवीन ब्लॉक",
"BLOCK_NAME": "ब्लॉकचं नाव",
"CREATE": "तयार करा",

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

},
"CENTERS": {
"CENTERS": {
"REGULAR_CENTERS": "नियमित केंद्र",
"REMOTE_CENTERS": "दूरस्थ केंद्र",
"CENTER_TYPE": "केंद्र प्रकार",
"REGULAR": "नियमित",
"REMOTE": "दूरस्थ"
}
}

}
}
10 changes: 5 additions & 5 deletions public/locales/or/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"MARK_ATTENDANCE": "ଉପସ୍ଥିତି ଚିହ୍ନିତ କର",
"UPDATE_ATTENDANCE": "ଉପସ୍ଥିତି ଅପଡେଟ କର",
"SAVE": "ସେଭ କର",
"SEARCH" : "ସନ୍ଧାନ କରନ୍ତୁ..",
"SEARCH": "ସନ୍ଧାନ କରନ୍ତୁ..",
"UPDATE": "ଅପଡେଟ",
"MODIFY": "ସଂଶୋଧିତ କର",
"CLEAR_ALL": "ସବୁ ସଫା କର",
Expand Down Expand Up @@ -191,12 +191,12 @@
},
"BLOCKS": {
"TEACHING_BLOCKS": "ଶିକ୍ଷା ବ୍ଲକ୍ସ",

"CREATE_NEW": "ନୂତନ ସୃଷ୍ଟି କରନ୍ତୁ",
"NEW_BLOCK": "ନୂଆ ବ୍ଲକ୍",
"BLOCK_NAME": "ବ୍ଲକ୍ ନାମ",
"CREATE": "ତିଆରି କରନ୍ତୁ",

"SEARCH_BLOCKS": "ବ୍ଲକ୍‌ ଖୋଜନ୍ତୁ"
},
"CENTERS": {
Expand All @@ -205,5 +205,5 @@
"CENTER_TYPE": "କେନ୍ଦ୍ର ପ୍ରକାର",
"REGULAR": "ସାଧାରଣ",
"REMOTE": "ଦୂରସ୍ଥ"
}
}
}
}
175 changes: 88 additions & 87 deletions src/components/AttendanceStatusListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,93 +157,94 @@ const AttendanceStatusListView: React.FC<AttendanceStatusListViewProps> = ({
userData?.name
)}
</Typography>
{userData?.memberStatus === Status.DROPOUT ?
<DropoutLabel/>
:
<>
<Box
display="flex"
flexDirection="column"
alignItems="center"
className="icon_holder"
p={1}
onClick={() =>
handleClickAction(
isBulkAction,
ATTENDANCE_ENUM.PRESENT,
isBulkAction ? '' : userData?.userId
)
}
>
{[userData?.attendance, bulkAttendanceStatus].includes(
ATTENDANCE_ENUM.PRESENT
) ? (
<CheckCircleIcon
sx={{ cursor: isDisabled ? 'default' : 'pointer' }}
style={{
fill: isDisabled
? theme.palette.success.main
: theme.palette.success.main,
}}
/>
) : (
<CheckCircleOutlineIcon
sx={{ cursor: isDisabled ? 'default' : 'pointer' }}
style={{
fill: isDisabled
? theme.palette.warning['400']
: theme.palette.warning[100],
}}
/>
)}
<Typography
variant="h6"
marginTop={1}
sx={{ color: () => theme.palette.warning[400] }}
>
{t('ATTENDANCE.PRESENT')}
</Typography>
</Box>
<Box
display="flex"
flexDirection="column"
alignItems="center"
className="icon_holder"
p={1}
onClick={() =>
handleClickAction(
isBulkAction,
ATTENDANCE_ENUM.ABSENT,
isBulkAction ? '' : userData?.userId
)
}
>
{[userData?.attendance, bulkAttendanceStatus].includes(
ATTENDANCE_ENUM.ABSENT
) ? (
<CancelIcon
sx={{ cursor: isDisabled ? 'default' : 'pointer' }}
style={{ fill: theme.palette.error.main }}
/>
) : (
<HighlightOffIcon
sx={{ cursor: isDisabled ? 'default' : 'pointer' }}
style={{
fill: isDisabled
? theme.palette.warning['400']
: theme.palette.warning[100],
}}
/>
)}
<Typography
variant="h6"
marginTop={1}
sx={{ color: () => theme.palette.warning[400] }}
>
{t('ATTENDANCE.ABSENT')}
</Typography>
</Box>
</>}
{userData?.memberStatus === Status.DROPOUT ? (
<DropoutLabel />
) : (
<>
<Box
display="flex"
flexDirection="column"
alignItems="center"
className="icon_holder"
p={1}
onClick={() =>
handleClickAction(
isBulkAction,
ATTENDANCE_ENUM.PRESENT,
isBulkAction ? '' : userData?.userId
)
}
>
{[userData?.attendance, bulkAttendanceStatus].includes(
ATTENDANCE_ENUM.PRESENT
) ? (
<CheckCircleIcon
sx={{ cursor: isDisabled ? 'default' : 'pointer' }}
style={{
fill: isDisabled
? theme.palette.success.main
: theme.palette.success.main,
}}
/>
) : (
<CheckCircleOutlineIcon
sx={{ cursor: isDisabled ? 'default' : 'pointer' }}
style={{
fill: isDisabled
? theme.palette.warning['400']
: theme.palette.warning[100],
}}
/>
)}
<Typography
variant="h6"
marginTop={1}
sx={{ color: () => theme.palette.warning[400] }}
>
{t('ATTENDANCE.PRESENT')}
</Typography>
</Box>
<Box
display="flex"
flexDirection="column"
alignItems="center"
className="icon_holder"
p={1}
onClick={() =>
handleClickAction(
isBulkAction,
ATTENDANCE_ENUM.ABSENT,
isBulkAction ? '' : userData?.userId
)
}
>
{[userData?.attendance, bulkAttendanceStatus].includes(
ATTENDANCE_ENUM.ABSENT
) ? (
<CancelIcon
sx={{ cursor: isDisabled ? 'default' : 'pointer' }}
style={{ fill: theme.palette.error.main }}
/>
) : (
<HighlightOffIcon
sx={{ cursor: isDisabled ? 'default' : 'pointer' }}
style={{
fill: isDisabled
? theme.palette.warning['400']
: theme.palette.warning[100],
}}
/>
)}
<Typography
variant="h6"
marginTop={1}
sx={{ color: () => theme.palette.warning[400] }}
>
{t('ATTENDANCE.ABSENT')}
</Typography>
</Box>
</>
)}
</Box>
</Box>
);
Expand Down
19 changes: 12 additions & 7 deletions src/components/CohortLearnerList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,17 @@ interface UserDataProps {
cohortMembershipId: string;
enrollmentNumber: string;
}
interface CohortLearnerListProp{
cohortId: any,
interface CohortLearnerListProp {
cohortId: any;
reloadState: boolean;
setReloadState: React.Dispatch<React.SetStateAction<boolean>>;
}

const CohortLearnerList : React.FC<CohortLearnerListProp> = ({cohortId, reloadState, setReloadState}) => {
const CohortLearnerList: React.FC<CohortLearnerListProp> = ({
cohortId,
reloadState,
setReloadState,
}) => {
const [loading, setLoading] = React.useState<boolean>(false);
const [userData, setUserData] = React.useState<UserDataProps[]>();

Expand All @@ -37,7 +41,7 @@ const CohortLearnerList : React.FC<CohortLearnerListProp> = ({cohortId, reloadSt
try {
if (cohortId) {
const page = 0;
const filters = {cohortId: cohortId};
const filters = { cohortId: cohortId };
const response = await getMyCohortMemberList({
limit,
page,
Expand Down Expand Up @@ -71,6 +75,7 @@ const CohortLearnerList : React.FC<CohortLearnerListProp> = ({cohortId, reloadSt
getCohortMemberList();
}, [cohortId, reloadState]);

console.log('userData', userData);
return (
<div>
{loading ? (
Expand All @@ -81,13 +86,13 @@ const CohortLearnerList : React.FC<CohortLearnerListProp> = ({cohortId, reloadSt
return (
<LearnersList
key={data.userId}
userId = {data.userId}
userId={data.userId}
learnerName={data.name}
enrollmentId={data.enrollmentNumber}
cohortMembershipId={data.cohortMembershipId}
isDropout={data.memberStatus === Status.DROPOUT}
statusReason = {data.statusReason}
reloadState={reloadState}
statusReason={data.statusReason}
reloadState={reloadState}
setReloadState={setReloadState}
/>
);
Expand Down
5 changes: 2 additions & 3 deletions src/components/DateRangePopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,13 @@ const DateRangePopup: React.FC<CustomSelectModalProps> = ({
} catch (error) {
console.error('Failed to parse stored dates:', error);
}
}
}
}
}, []);

const getDateRange = (index: number | null) => {
const today = new Date();
const formatDate = (date: Date) => {
console.log('date', date);
if (typeof date === 'object') {
// return date?.toISOString()?.split('T')[0];}
const localDate = new Date(
Expand Down Expand Up @@ -216,7 +215,6 @@ const DateRangePopup: React.FC<CustomSelectModalProps> = ({
setDateRangeArray(date);
setDisplayCalendarFromDate(getDayAndMonthName(date[0]));
setDisplayCalendarToDate(getDayAndMonthName(date[1]));
// toggleCalendarModal();
}
};

Expand Down Expand Up @@ -298,6 +296,7 @@ const DateRangePopup: React.FC<CustomSelectModalProps> = ({
color: index === 4 ? theme.palette.secondary.main : '#4D4639',
'&:hover': {
backgroundColor: 'transparent',
color: '#0D599E',
},
}}
>
Expand Down
Loading

0 comments on commit 79e7e08

Please sign in to comment.