Skip to content

Commit

Permalink
Issue #PS-000 feat: Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
itsvick committed Aug 27, 2024
1 parent b622442 commit 211b579
Show file tree
Hide file tree
Showing 11 changed files with 206 additions and 292 deletions.
29 changes: 15 additions & 14 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"SURE_LOGOUT": "Are you sure you want to Logout?",
"SURE_UPDATE": "Are you sure you want to update this attendance?",
"SURE_REMOVE": "Are you sure you want to remove this learner?",
"SURE_REASSIGN_CENTER": "Are you sure you want to re-assign Center to this user?",
"SURE_REASSIGN_CENTER": "Are you sure you want to re-assign center to this user?",
"SURE_CLOSE": "Are you sure you want to close without saving?",
"LEARNER_LIST": "Learners List",
"FACILITATOR_LIST": "Facilitators List",
Expand All @@ -94,7 +94,7 @@
"DROPPED_OUT": "Dropped Out",
"DELETE_USER": "Delete User Permanently",
"DELETE_USER_WITH_REASON": "Delete User",
"USER_DELETED_PERMANENTLY": "User Successfully Deleted!",
"USER_DELETED_PERMANENTLY": "User successfully deleted!",
"OBSERVATIONS_FORMS": "Observations and Forms",
"OTHER_REASON": "Other Reason",
"OTHER_REASON_PLACEHOLDER": "Enter Other Reason",
Expand All @@ -103,7 +103,7 @@
"CREDENTIALS_EMAILED": "The login credentials will be emailed to the Facilitator at ",
"CREDENTIALS_EMAILED_OF_LEARNER": "The login credentials have been send to your email ",
"NEW": "New {{role}}",
"USER_CREDENTIAL_SEND_SUCCESSFULLY": "User Credentials Sent Successfully!",
"USER_CREDENTIAL_SEND_SUCCESSFULLY": "User credentials sent successfully!",
"CENTER_SESSIONS": "Center Sessions",
"SCHEDULE_NEW": "Schedule New",
"UPCOMING_EXTRA_SESSION": "Upcoming Extra Sessions (Next {{days}} days)",
Expand All @@ -118,7 +118,7 @@
"NEW_FACILITATOR": "New Facilitator",
"EDIT_FACILITATOR": "Edit Facilitator",
"SUBMIT": "Submit",
"LEARNER_CREATED_SUCCESSFULLY": "Leaner has been Successfully Created!",
"LEARNER_CREATED_SUCCESSFULLY": "Leaner has been successfully created!",
"FACILITATOR_ADDED_SUCCESSFULLY": "Facilitator added successfully!",
"LEARNER_UPDATED_SUCCESSFULLY": "Learner profile updated successfully!",
"FACILITATOR_UPDATED_SUCCESSFULLY": "Facilitator profile updated successfully!",
Expand Down Expand Up @@ -319,14 +319,14 @@
"CENTER_TYPE": "Center Type",
"UNIT_NAME": "Unit Name",
"NOTE": "Note: This will be the center name",
"CENTER_CREATED": "Center Created Successfully!",
"CENTER_CREATED": "Center created successfully!",
"RENAME_CENTER": "Rename Center",
"REQUEST_TO_DELETE": "Request to Delete",
"RENAME": "Rename",
"CENTER_RENAMED": "Center Renamed Successfully!",
"CENTER_RENAMED": "Center renamed successfully!",
"SEND_REQUEST": "Send Request",
"REQUEST_TO_DELETE_HAS_BEEN_SENT": "Request to Delete has been sent",
"YOU_ARE_SENDING_REQUEST_TO_THE_STATE_ADMIN": "You are sending a request to the State Admin to delete this Center",
"YOU_ARE_SENDING_REQUEST_TO_THE_STATE_ADMIN": "You are sending a request to the State Admin to delete this center",
"THE_USER_BELONGS_TO_THE_FOLLOWING_COHORT": "The user belongs to the following cohort: ",
"PLEASE_REMOVE_THE_USER_FROM_COHORT": "Please remove the user from these cohorts before proceeding with deletion.",
"ERROR_EMPTY": "Center name cannot be empty",
Expand All @@ -352,7 +352,7 @@
"DOUBT_CLEARING": "For doubt clearing, webinars, etc",
"TOPIC": "Topic",
"SUBTOPIC": "Sub Topic",
"FACILITATORS": " Facilitators Pre-requisites",
"FACILITATORS": "Facilitators Pre-requisites",
"TITLE": "Title",
"DELETE_SESSION": "Delete Session",
"SCHEDULE": "Schedule",
Expand All @@ -371,7 +371,7 @@
"EXTRA_OFFLINE": "Extra offline",
"ENTER_VALID_MEETING_LINK": "Please enter a valid Zoom or Google Meet link.",
"ZOOM": "Zoom",
"GOOGLEMEET": "GoogleMeet",
"GOOGLE_MEET": "GOOGLE_MEET",
"SET_UP": "Set-Up",
"EDIT_THIS_SESSION": "Edit this session",
"EDIT_FOLLOWING_SESSIONS": "Edit this and following sessions",
Expand All @@ -382,8 +382,8 @@
"UPDATE_CHANGES": "Are you sure you want to update the changes?"
},
"MANAGE_USERS": {
"CENTERS_REQUESTED_SUCCESSFULLY": "Center Requested Successfully",
"CENTERS_REQUEST_FAILED": "Center Requested Failed"
"CENTERS_REQUESTED_SUCCESSFULLY": "Center requested successfully",
"CENTERS_REQUEST_FAILED": "Center Request Failed"
},
"FORM": {
"FULL_NAME": "Full Name",
Expand All @@ -408,7 +408,7 @@
"ENTER_YOUR_FATHER_NAME": "Enter Your Father Name",
"CLASS_OR_LAST_PASSED_GRADE": "Class (Last passed grade)",
"NO_SCHOOLING": "No Schooling",
"REASON_FOR_DROPOUT_FROM_SCHOOL": "Reason for Drop Out From School",
"REASON_FOR_DROPOUT_FROM_SCHOOL": "Reason for dropout from school",
"SCHOOL_INACCESSIBLE": "School inaccessible",
"FINANCIAL_CONSTRAINTS": "Financial Constraints",
"LACK_OF_INTEREST": "Lack of Interest",
Expand Down Expand Up @@ -483,7 +483,8 @@
"ENTER_VALID_EMAIL": "Enter valid Email",
"ENTER_VALID_YEAR": "Enter valid Year",
"MUST_BE_LESS_THAN": "{{fieldname}} must be less than {{maxLength}}",
"MUST_BE_GREATER_THAN": "{{fieldname}} must be greater than {{minLength}}"
"MUST_BE_GREATER_THAN": "{{fieldname}} must be greater than {{minLength}}",
"ENTER_VALID_CENTER_NAME": "Enter valid center name"
},
"COURSE_PLANNER": {
"COURSE_PLANNER": "Course Plan",
Expand Down Expand Up @@ -512,7 +513,7 @@
"ASSESSMENT_NOT_STARTED_YET": "Assessment not started yet",
"NUMBER_OUT_OF_COMPLETED": "{{completedCount}} out of {{totalCount}} completed"
},
"BOARD_ENROOLMENT": {
"BOARD_ENROLMENT": {
"BOARD_ENROLLMENT": "Board Enrollment",
"BOARD_SELECTION":"Board Selection",
"SUBJECTS_SELECTION": "Subjects Selection",
Expand Down
88 changes: 38 additions & 50 deletions src/components/CohortFacilitatorList.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import React, { useEffect } from 'react';
import LearnersList from '@/components/LearnersListItem';
import {
getMyCohortFacilitatorList,
getMyCohortMemberList,
getMyCohortFacilitatorList
} from '@/services/MyClassDetailsService';
import { Status, limit } from '@/utils/app.constant';
import {
capitalizeEachWord,
getFieldValue,
toPascalCase,
} from '@/utils/Helper';
import LearnersList from '@/components/LearnersListItem';
import { Status, limit } from '@/utils/app.constant';
import { showToastMessage } from './Toastify';
import { Box, Grid } from '@mui/material';
import { useTheme } from '@mui/material/styles';
import { useTranslation } from 'next-i18next';
import { Box, Grid, Typography } from '@mui/material';
import React, { useEffect } from 'react';
import NoDataFound from './common/NoDataFound';
import Loader from './Loader';
import { useTheme } from '@mui/material/styles';
import { showToastMessage } from './Toastify';

interface UserDataProps {
name: string;
Expand Down Expand Up @@ -88,7 +88,7 @@ const CohortLearnerList: React.FC<CohortLearnerListProp> = ({
getCohortMemberList();
}, [cohortId, reloadState]);

const onDelete = () => { };
const onDelete = () => {};

console.log('userData', userData);
const theme = useTheme<any>();
Expand All @@ -97,50 +97,38 @@ const CohortLearnerList: React.FC<CohortLearnerListProp> = ({
{loading ? (
<Loader showBackdrop={true} loadingText={t('COMMON.LOADING')} />
) : (
<>
<Box sx={{
<Box
sx={{
'@media (min-width: 900px)': {
background: theme.palette.action.selected,
paddingBottom: '20px'
paddingBottom: '20px',
},
}}>
<Grid container>
{userData?.map((data: any) => {
return (
<Grid xs={12} sm={6} md={4} >
<LearnersList
key={data.userId}
userId={data.userId}
learnerName={data.name}
enrollmentId={data.enrollmentNumber}
cohortMembershipId={data.cohortMembershipId}
isDropout={data.memberStatus === Status.DROPOUT}
statusReason={data.statusReason}
reloadState={reloadState}
setReloadState={setReloadState}
showMiniProfile={false}
onLearnerDelete={onDelete}
/>
</Grid>
);
})}
{!userData?.length && (
<Box
sx={{
m: '1.125rem',
display: 'flex',
justifyContent: 'left',
alignItems: 'center',
}}
>
<Typography style={{ fontWeight: 'bold' }}>
{t('COMMON.NO_DATA_FOUND')}
</Typography>
</Box>
)}
</Grid>
</Box>
</>
}}
>
<Grid container>
{userData?.map((data: any) => {
return (
<Grid xs={12} sm={6} md={4} key={data.userId}>
<LearnersList
userId={data.userId}
learnerName={data.name}
enrollmentId={data.enrollmentNumber}
cohortMembershipId={data.cohortMembershipId}
isDropout={data.memberStatus === Status.DROPOUT}
statusReason={data.statusReason}
reloadState={reloadState}
setReloadState={setReloadState}
showMiniProfile={false}
onLearnerDelete={onDelete}
/>
</Grid>
);
})}
{!userData?.length && (
<NoDataFound />
)}
</Grid>
</Box>
)}
</div>
);
Expand Down
87 changes: 37 additions & 50 deletions src/components/CohortLearnerList.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import React, { useEffect } from 'react';
import LearnersListItem from '@/components/LearnersListItem';
import { getMyCohortMemberList } from '@/services/MyClassDetailsService';
import { Role, Status, limit } from '@/utils/app.constant';
import {
capitalizeEachWord,
getFieldValue,
toPascalCase,
} from '@/utils/Helper';
import LearnersListItem from '@/components/LearnersListItem';
import { Role, Status, limit } from '@/utils/app.constant';
import { showToastMessage } from './Toastify';
import { useTranslation } from 'next-i18next';
import { Box, Grid, Typography } from '@mui/material';
import Loader from './Loader';
import { useTheme } from '@mui/material/styles';

import { useTranslation } from 'next-i18next';
import React, { useEffect } from 'react';
import Loader from './Loader';
import { showToastMessage } from './Toastify';
import NoDataFound from './common/NoDataFound';

interface UserDataProps {
name: string;
Expand Down Expand Up @@ -99,53 +99,40 @@ const CohortLearnerList: React.FC<CohortLearnerListProp> = ({
{loading ? (
<Loader showBackdrop={true} loadingText={t('COMMON.LOADING')} />
) : (
<>
<Box sx={{
<Box
sx={{
'@media (min-width: 900px)': {
background: theme.palette.action.selected,
marginTop: '12px',
paddingBottom: '20px'
paddingBottom: '20px',
},
}}>
<Grid container>

{userData?.map((data: any) => {
return (
<Grid xs={12} sm={6} md={4} >
<LearnersListItem
type={Role.STUDENT}
key={data.userId}
userId={data.userId}
learnerName={data.name}
enrollmentId={data.enrollmentNumber}
cohortMembershipId={data.cohortMembershipId}
isDropout={data.memberStatus === Status.DROPOUT}
statusReason={data.statusReason}
reloadState={reloadState}
setReloadState={setReloadState}
showMiniProfile={true}
onLearnerDelete={handleLearnerDelete}
/>
</Grid>
);
})}
{!userData?.length && (
<Box
sx={{
m: '1.125rem',
display: 'flex',
justifyContent: 'left',
alignItems: 'center',
}}
>
<Typography style={{ fontWeight: 'bold' }}>
{t('COMMON.NO_DATA_FOUND')}
</Typography>
</Box>
)}
</Grid>
</Box>
</>
}}
>
<Grid container>
{userData?.map((data: any) => {
return (
<Grid xs={12} sm={6} md={4} key={data.userId}>
<LearnersListItem
type={Role.STUDENT}
userId={data.userId}
learnerName={data.name}
enrollmentId={data.enrollmentNumber}
cohortMembershipId={data.cohortMembershipId}
isDropout={data.memberStatus === Status.DROPOUT}
statusReason={data.statusReason}
reloadState={reloadState}
setReloadState={setReloadState}
showMiniProfile={true}
onLearnerDelete={handleLearnerDelete}
/>
</Grid>
);
})}
{!userData?.length && (
<NoDataFound />
)}
</Grid>
</Box>
)}
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/ConfirmationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const ConfirmationModal: React.FC<ConfirmationModalProps> = ({
<Box
sx={{
display: 'flex',
justifyContent: 'center',
justifyContent: 'flex-end',
gap: '18px',
p: 2,
}}
Expand Down
2 changes: 1 addition & 1 deletion src/components/MenuDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ const MenuDrawer: React.FC<DrawerProps> = ({
router.push(`/board-enrollment`);
}}
>
{t('BOARD_ENROOLMENT.BOARD_ENROLLMENT')}
{t('BOARD_ENROLMENT.BOARD_ENROLLMENT')}
</Button>
</Box>
<Box sx={{ marginTop: '18px' }}>
Expand Down
6 changes: 3 additions & 3 deletions src/components/PieChartGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ const PieChartGraph = () => {
const theme = useTheme<any>();
const data: DataItem[] = [
{ name: t('ASSESSMENTS.NOT_STARTED'), value: 4 },
{ name: t('BOARD_ENROOLMENT.BOARD_SELECTION'), value: 5 },
{ name: t('BOARD_ENROOLMENT.SUBJECTS_SELECTION'), value: 10 },
{ name: t('BOARD_ENROOLMENT.REGISTRATION_COMPLETED'), value: 5 },
{ name: t('BOARD_ENROLMENT.BOARD_SELECTION'), value: 5 },
{ name: t('BOARD_ENROLMENT.SUBJECTS_SELECTION'), value: 10 },
{ name: t('BOARD_ENROLMENT.REGISTRATION_COMPLETED'), value: 5 },
];


Expand Down
Loading

0 comments on commit 211b579

Please sign in to comment.