Skip to content

Commit

Permalink
Merge pull request #161 from upendraTekdi/late_markingfor_self_uk
Browse files Browse the repository at this point in the history
 Task #224976: Updated code from release-1.0.0,  fixed- attendanceTimes.restrict_attendance_timings if 0 then able to see mark attendance
  • Loading branch information
itsvick authored Aug 20, 2024
2 parents 7080af4 + b472f73 commit eebf09b
Show file tree
Hide file tree
Showing 51 changed files with 2,504 additions and 2,515 deletions.
54 changes: 36 additions & 18 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"REMOVE": "Remove",
"SEND_REQUEST": "Send Request",
"MARK_DROP_OUT": "Mark as Drop Out",
"MARK_ALL_AS": "Mark All As",
"UNMARK_DROP_OUT": "Unmark as Drop Out",
"SOMETHING_WENT_WRONG": "Something went wrong",
"NO_GO_BACK": "No, go back",
Expand Down Expand Up @@ -134,7 +135,8 @@
"TURN_ON": "Turn On",
"OKAY": "Okay",
"HELD_EVERY_WEEK_ON": "Held every week on {{days}}",
"SESSION_SCHEDULED_SUCCESSFULLY": "Session has been scheduled successfully!"
"SESSION_SCHEDULED_SUCCESSFULLY": "Session has been scheduled successfully!",
"CENTER": "Center"
},
"LOGIN_PAGE": {
"USERNAME": "Username",
Expand Down Expand Up @@ -176,14 +178,15 @@
"LEARNER": "Learners",
"ATTENDANCE_COMPARISON": "Attendance Comparison",
"CENTER_TYPE": "Center Type",
"BLOCK_AVERAGE_ATTENDANCE": "Block Average Attendance",
"REMOTE_AVERAGE_ATTENDANCE": "Remote Average Attendance",
"REGULAR_AVERAGE_ATTENDANCE": "Regular Average Attendance",
"BLOCK": "Block",
"ATTENDANCE": "Attendance (%)"
},
"ATTENDANCE": {
"TOTAL_STUDENTS": "Total Learners: {{count}}",
"ACTIVE_STUDENTS": "Active Learners: {{count}}",
"DROPOUT_STUDENTS": "Dropout Learners: {{count}}",
"TOTAL_STUDENTS": "Total: {{count}}",
"ACTIVE_STUDENTS": "Active: {{count}}",
"DROPOUT_STUDENTS": "Dropout: {{count}}",
"PRESENT_STUDENTS": "Present: {{count}}",
"ABSENT_STUDENTS": "Absent: {{count}}",
"PRESENT": "Present",
Expand All @@ -205,9 +208,11 @@
"CENTER_ATTENDANCE": "Center Attendance",
"LOW_ATTENDANCE_STUDENTS": "Low Attendance Learners",
"N/A": "No Centers Assigned",
"NO_ATTENDANCE": "0 %",
"UNKNOWN": "Unknown",
"CENTER_NAME": "Center Name",
"ALL_CENTERS": "All Centers",
"NO_LEARNER_WITH_LOW_ATTENDANCE": "No Learner with low attendance",
"NO_LEARNER_WITH_LOW_ATTENDANCE": "None",
"ATTENDANCE_MARKED_OUT_OF_DAYS": "Attendance marked: {{count}} out of last 7 days"
},
"PROFILE": {
Expand Down Expand Up @@ -287,16 +292,19 @@
"SCHOOL_ADMISSION": "School admission"
},
"GUIDE_TOUR": {
"STEP_1": "Welcome! let’s get you familiar with the dashboard",
"STEP_2": "Use the calendar to view day-wise attendance of learners",
"STEP_3": "Check daily attendance percentage for each Center",
"STEP_4": "Mark each day’s attendance of learners",
"STEP_5": "Check Center attendance over the last {{numberOfDays}} days",
"STEP_6": "View learners with low attendance in the past {{numberOfDays}} days",
"STEP_1": "Welcome! Let’s take a quick tour to understand the key features that will help you with your daily tasks.",
"STEP_2": "This section provides a quick overview of attendance trends to help you spot key insights for each center. You can mark attendance, check daily attendance percentages, and modify previous attendance for the last 7 days.",
"STEP_3": "Access the full calendar to track your attendance for any month and see which learners were present each day.",
"STEP_4": "Use this button to view a detailed overview of center attendance and see a list of learners categorized by low, average, and good attendance for any custom date range.",
"STEP_5": "Update your preferred language anytime from here.",
"STEP_6": "Access your teaching centers and manage tasks like adding, editing, or removing learners, marking dropouts, and reassigning centers or blocks. You can also easily schedule online or offline sessions for your subjects.",
"STEP_7": "Access the full academic year’s course plan for each subject, along with resources like videos and documents for every topic. Track your teaching progress by updating topic completion status.",
"STEP_8": "View detailed scores and summaries of Pre and Post tests for each learner. Track which students have completed, are in progress or yet to start the test.",
"PREVIOUS": "Previous",
"NEXT": "Next",
"SKIP": "Skip",
"FINISH": "Finish"
"FINISH": "Finish",
"LEARN_HOW_TO_USE": "Learn how to use"
},
"BLOCKS": {
"TEACHING_BLOCKS": "Teaching Blocks",
Expand Down Expand Up @@ -331,7 +339,9 @@
"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",
"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."
"PLEASE_REMOVE_THE_USER_FROM_COHORT": "Please remove the user from these cohorts before proceeding with deletion.",
"ERROR_EMPTY": "Center name cannot be empty",
"ERROR_NUMBER": "Center name cannot be number"
},
"CENTER_SESSION": {
"THIS_SESSION": "This session",
Expand Down Expand Up @@ -450,10 +460,17 @@
"MONTH_MOBILISATION": "Month of Mobilisation",
"DROP_OUT_REASON": "Reason for Drop Out From School",
"ASSIGN_CENTERS": "Assign Centers",
"TYPE_OF_COHORT": "Type of cohort",
"NOTE_THIS_WILL_BE_CENTER_NAME": "Note this will be Center name",
"ACCESS_TO_WHATSAPP": "Access To WhatsApp",
"MOTHER_NAME": "Mother's Name"
"MOTHER_NAME": "Mother's Name",
"TYPE_OF_COHORT": "Center type",
"NOTE_THIS_WILL_BE_CENTER_NAME": "Note this will be Center name",
"ENGLISH": "English",
"HOME_SCIENCE": "Home Science",
"MATH": "Math",
"LANGUAGE": "Language",
"SCIENCE": "Science",
"SOCIAL_SCIENCE": "Social Science",
"LIFE_SKILLS": "Life Skills"
},
"FORM_ERROR_MESSAGES": {
"INVALID_INPUT": "Invalid Input.",
Expand Down Expand Up @@ -487,6 +504,7 @@
"SUBMITTED_ON": "Submitted On",
"CORRECT_ANSWER": "correct answers",
"NO_DATA_FOUND": "No data found",
"SEARCH_STUDENT": "search student"
"SEARCH_STUDENT": "search student",
"NO_ASSESSMENTS_FOUND": "No assessments found"
}
}
Binary file added src/assets/images/login-image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
143 changes: 70 additions & 73 deletions src/components/AddFacilitator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
} from '@/components/GeneratedSchemas';
import { FormContext, FormContextType, RoleId } from '@/utils/app.constant';
import React, { useEffect } from 'react';
import ReactGA from 'react-ga4';

import DynamicForm from '@/components/DynamicForm';
import SendCredentialModal from '@/components/SendCredentialModal';
Expand Down Expand Up @@ -51,6 +52,7 @@ const AddFacilitatorModal: React.FC<AddFacilitatorModalprops> = ({
const [schema, setSchema] = React.useState<any>();
const [openSendCredModal, setOpenSendCredModal] = React.useState(false);
const [createFacilitator, setCreateFacilitator] = React.useState(false);
const [isVisible, setIsVisible] = React.useState(true);
const [uiSchema, setUiSchema] = React.useState<any>();
const [reloadProfile, setReloadProfile] = React.useState(false);
const [email, setEmail] = React.useState('');
Expand Down Expand Up @@ -141,6 +143,7 @@ const AddFacilitatorModal: React.FC<AddFacilitatorModalprops> = ({
useEffect(() => {
if (formData) {
handleButtonClick();
setIsVisible(false);
}
}, [formData, createFacilitator]);

Expand All @@ -154,9 +157,11 @@ const AddFacilitatorModal: React.FC<AddFacilitatorModalprops> = ({
if (typeof window !== 'undefined' && window.localStorage) {
fieldData = JSON.parse(localStorage.getItem('fieldData') || '');
}
const yearOfJoining = formData['year of joining scp'];
const { username, password } = generateUsernameAndPassword(
fieldData?.state?.stateCode,
'F'
'F',
yearOfJoining
);
setUsername(username);
setPassword(password);
Expand Down Expand Up @@ -196,7 +201,7 @@ const AddFacilitatorModal: React.FC<AddFacilitatorModalprops> = ({
) {
apiBody.customFields.push({
fieldId: fieldId,
value: Array.isArray(fieldValue) ? fieldValue : [fieldValue],
value: Array.isArray(fieldValue) ? fieldValue : [fieldValue],
});
} else {
if (fieldSchema.checkbox && fieldSchema.type === 'array') {
Expand Down Expand Up @@ -272,6 +277,9 @@ const AddFacilitatorModal: React.FC<AddFacilitatorModalprops> = ({
t('COMMON.FACILITATOR_ADDED_SUCCESSFULLY'),
'success'
);
ReactGA.event('facilitator-created-successfully', {
userName: username,
});

const isQueue = false;
const context = 'USER';
Expand All @@ -294,30 +302,16 @@ const AddFacilitatorModal: React.FC<AddFacilitatorModalprops> = ({
replacements,
email: sendTo,
});

if (
credentialResponse?.result[0]?.data[0]?.status ===
'success'
) {
showToastMessage(
t('COMMON.USER_CREDENTIAL_SEND_SUCCESSFULLY'),
'success'
);
} else {
showToastMessage(
t('COMMON.USER_CREDENTIALS_WILL_BE_SEND_SOON'),
'success'
);
}
} else {
showToastMessage(t('COMMON.SOMETHING_WENT_WRONG'), 'error');
}
} else {
showToastMessage(t('COMMON.SOMETHING_WENT_WRONG'), 'error');
}
} catch (error) {
console.error(error);
showToastMessage(t('COMMON.SOMETHING_WENT_WRONG'), 'error');
ReactGA.event('facilitator-creation-fail', {
error: error,
});
}
}
} else {
Expand All @@ -341,6 +335,7 @@ const AddFacilitatorModal: React.FC<AddFacilitatorModalprops> = ({
};

const handleBackAction = () => {
setIsVisible(true);
setCreateFacilitator(false);
setOpenSendCredModal(false);
};
Expand All @@ -354,60 +349,62 @@ const AddFacilitatorModal: React.FC<AddFacilitatorModalprops> = ({

return (
<>
<SimpleModal
open={open}
onClose={onClose}
showFooter={false}
modalTitle={
isEditModal
? t('COMMON.EDIT_FACILITATOR')
: t('COMMON.NEW_FACILITATOR')
}
>
{userFormData
? schema &&
uiSchema && (
<DynamicForm
schema={schema}
uiSchema={uiSchema}
onSubmit={handleSubmit}
onChange={handleChange}
onError={handleError}
widgets={{}}
showErrorList={true}
customFields={customFields}
formData={userFormData}
>
{/* <CustomSubmitButton onClose={primaryActionHandler} /> */}
<FormButtons
formData={formData}
onClick={handleButtonClick}
isSingleButton={true}
/>
</DynamicForm>
)
: schema &&
uiSchema && (
<DynamicForm
schema={schema}
uiSchema={uiSchema}
onSubmit={handleSubmit}
onChange={handleChange}
onError={handleError}
widgets={{}}
showErrorList={true}
customFields={customFields}
formData={createFacilitator ? '' : formData}
>
<FormButtons
formData={formData}
onClick={handleButtonClick}
isCreatedFacilitator={true}
isCreateCentered={false}
/>{' '}
</DynamicForm>
)}
</SimpleModal>
{isVisible && (
<SimpleModal
open={open}
onClose={onClose}
showFooter={false}
modalTitle={
isEditModal
? t('COMMON.EDIT_FACILITATOR')
: t('COMMON.NEW_FACILITATOR')
}
>
{userFormData
? schema &&
uiSchema && (
<DynamicForm
schema={schema}
uiSchema={uiSchema}
onSubmit={handleSubmit}
onChange={handleChange}
onError={handleError}
widgets={{}}
showErrorList={true}
customFields={customFields}
formData={userFormData}
>
{/* <CustomSubmitButton onClose={primaryActionHandler} /> */}
<FormButtons
formData={formData}
onClick={handleButtonClick}
isSingleButton={true}
/>
</DynamicForm>
)
: schema &&
uiSchema && (
<DynamicForm
schema={schema}
uiSchema={uiSchema}
onSubmit={handleSubmit}
onChange={handleChange}
onError={handleError}
widgets={{}}
showErrorList={true}
customFields={customFields}
formData={createFacilitator ? '' : formData}
>
<FormButtons
formData={formData}
onClick={handleButtonClick}
isCreatedFacilitator={true}
isCreateCentered={false}
/>{' '}
</DynamicForm>
)}
</SimpleModal>
)}
<Modal
open={openSendCredModal}
aria-labelledby="send credential modal"
Expand Down
9 changes: 9 additions & 0 deletions src/components/AddLeanerModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import SendCredentialModal from './SendCredentialModal';
import FormButtons from './FormButtons';
import { sendCredentialService } from '@/services/NotificationService';
import useSubmittedButtonStore from '@/store/useSubmittedButtonStore';
import ReactGA from 'react-ga4';

interface AddLearnerModalProps {
open: boolean;
Expand Down Expand Up @@ -120,6 +121,7 @@ const AddLearnerModal: React.FC<AddLearnerModalProps> = ({
}
const { username, password } = generateUsernameAndPassword(
fieldData?.state?.stateCode,
'',
''
);
const apiBody: any = {
Expand Down Expand Up @@ -222,6 +224,9 @@ const AddLearnerModal: React.FC<AddLearnerModalProps> = ({
);
onLearnerAdded?.();
onClose();
ReactGA.event('learner-creation-success', {
username: username,
});

const isQueue = false;
const context = 'USER';
Expand Down Expand Up @@ -266,6 +271,10 @@ const AddLearnerModal: React.FC<AddLearnerModalProps> = ({
} catch (error) {
showToastMessage(t('COMMON.SOMETHING_WENT_WRONG'), 'error');
setReloadProfile(true);
ReactGA.event('learner-creation-fail', {
error: error,
});

}
}
};
Expand Down
6 changes: 3 additions & 3 deletions src/components/AssessmentReport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import KeyboardArrowRightIcon from '@mui/icons-material/KeyboardArrowRight';
import { useRouter } from 'next/router';
import RemoveIcon from '@mui/icons-material/Remove';
import RadioButtonUncheckedIcon from '@mui/icons-material/RadioButtonUnchecked';
import { updateAssessment } from '@/services/UpdateAssesmentService';
import { learnerAssessmentReport } from '@/services/UpdateAssesmentService';

interface AssessmentReportProp{
isTitleRequired?: boolean
Expand All @@ -21,7 +21,7 @@ const AssessmentReport: React.FC<AssessmentReportProp> = ({ isTitleRequired }) =
const [assessmentList, setAssessmentList] = React.useState([]);

useEffect(() => {
const res: any = updateAssessment();
const res: any = learnerAssessmentReport();
setAssessmentList(res);
}, []);

Expand Down Expand Up @@ -56,7 +56,7 @@ const AssessmentReport: React.FC<AssessmentReportProp> = ({ isTitleRequired }) =
borderRadius: '8px',
gap: '5px',
}}
onClick={() => handleAssessmentDetails(assessment.userId)}
// onClick={() => handleAssessmentDetails(assessment.userId)}
>
<Box
sx={{
Expand Down
Loading

0 comments on commit eebf09b

Please sign in to comment.