Skip to content

Commit

Permalink
Merge pull request #190 from upendraTekdi/late_markingfor_self_uk
Browse files Browse the repository at this point in the history
 Task #22482: reason for remove to reason, changes reason of delete learners
  • Loading branch information
itsvick authored Aug 26, 2024
2 parents 0a35cb9 + 4ff06ba commit c6b9e47
Show file tree
Hide file tree
Showing 34 changed files with 1,207 additions and 1,280 deletions.
22 changes: 18 additions & 4 deletions public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"REASON_FOR_DROPOUT": "Reason for Dropout",
"REASON_FOR_DELETION": "Reason for Deletion",
"REASON_FOR_REMOVE": "Reason for Remove",
"REASON": "Reason",
"REASON_FOR_ABSENT": "Reason for Absent",
"SURE_LOGOUT": "Are you sure you want to Logout?",
"SURE_UPDATE": "Are you sure you want to update this attendance?",
Expand Down Expand Up @@ -351,14 +352,19 @@
"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",
"ERROR_NUMBER": "Center name cannot be number"
"ERROR_NUMBER": "Center name cannot be number",
"LONG_ABSENTEE": "Long Absentee",
"TAKEN_TC": "Taken Tc",
"ALLOCATION_CHANGE": "Allocation Change",
"INCORRECT_ENTRY": "Incorrect Entry",
"DUPLICATION_ENTRY": "Duplicate Entry"
},
"CENTER_SESSION": {
"THIS_SESSION": "This session",
"FOLLOWING_SESSIONS": "This and following sessions",
"MODE_OF_SESSION": "Mode of Session",
"OFFLINE": "offline",
"ONLINE": "online",
"OFFLINE": "Offline",
"ONLINE": "Online",
"SUBJECT": "Subject",
"MEETING_LINK": "Meeting Link",
"MEETING_PASSCODE": "Meeting Passcode (if applicable)",
Expand All @@ -381,6 +387,7 @@
"ADD_SESSION": "Add Session",
"SESSION_DETAILS": "Session Details",
"SESSION_TITLE": "Session Title",
"SESSION_TITLE_OPTIONAL": "Session Title (optional)",
"TYPE_OF_SESSION": "Type of Session",
"REPEATING": "Repeating",
"JUST_ONCE": "Just Once",
Expand All @@ -390,7 +397,14 @@
"ENTER_VALID_MEETING_LINK": "Please enter a valid Zoom or Google Meet link.",
"ZOOM": "Zoom",
"GOOGLEMEET": "GoogleMeet",
"SET_UP": "Set-Up"
"SET_UP": "Set-Up",
"EDIT_THIS_SESSION": " Edit this session",
"EDIT_FOLLOWING_SESSIONS": " Edit this and following sessions",
"DELETE_SESSION_MSG": "Are you sure you want to delete this session?",
"DELETE_ALL_SESSION_MSG": "Are you sure you want to delete all sessions in this series?",
"DELETE_THIS_SESSION": "Delete this session",
"DELETE_FOLLOWING_SESSION": "Delete this and following sessions",
"UPDATE_CHANGES": "Are you sure you want to update the changes?"
},
"MANAGE_USERS": {
"CENTERS_REQUESTED_SUCCESSFULLY": "Center Requested Successfully",
Expand Down
17 changes: 16 additions & 1 deletion src/components/AddFacilitator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
GenerateSchemaAndUiSchema,
customFields,
} from '@/components/GeneratedSchemas';
import { FormContext, FormContextType, RoleId } from '@/utils/app.constant';
import { FormContext, FormContextType, RoleId, Telemetry } from '@/utils/app.constant';
import React, { useEffect } from 'react';
import ReactGA from 'react-ga4';

Expand Down Expand Up @@ -31,6 +31,7 @@ import {
import CloseIcon from '@mui/icons-material/Close';
import { modalStyles } from '@/styles/modalStyles';
import useSubmittedButtonStore from '@/store/useSubmittedButtonStore';
import { telemetryFactory } from '@/utils/telemetry';
interface AddFacilitatorModalprops {
open: boolean;
onClose: () => void;
Expand Down Expand Up @@ -281,6 +282,20 @@ const AddFacilitatorModal: React.FC<AddFacilitatorModalprops> = ({
userName: username,
});

const telemetryInteract = {
context: {
env: 'teaching-center',
cdata: [],
},
edata: {
id: 'facilitator-created-success',
type: Telemetry.CLICK,
subtype: '',
pageid: 'centers',
},
};
telemetryFactory.interact(telemetryInteract);

const isQueue = false;
const context = 'USER';
const key = 'onFacilitatorCreated';
Expand Down
17 changes: 16 additions & 1 deletion src/components/AddLeanerModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import SimpleModal from '@/components/SimpleModal';
import { createUser, getFormRead } from '@/services/CreateUserService';
import { generateUsernameAndPassword } from '@/utils/Helper';
import { FormData } from '@/utils/Interfaces';
import { FormContext, FormContextType, RoleId } from '@/utils/app.constant';
import { FormContext, FormContextType, RoleId, Telemetry } from '@/utils/app.constant';
import { IChangeEvent } from '@rjsf/core';
import { RJSFSchema } from '@rjsf/utils';
import React, { useEffect } from 'react';
Expand All @@ -20,6 +20,7 @@ import FormButtons from './FormButtons';
import { sendCredentialService } from '@/services/NotificationService';
import useSubmittedButtonStore from '@/store/useSubmittedButtonStore';
import ReactGA from 'react-ga4';
import { telemetryFactory } from '@/utils/telemetry';

interface AddLearnerModalProps {
open: boolean;
Expand Down Expand Up @@ -228,6 +229,20 @@ const AddLearnerModal: React.FC<AddLearnerModalProps> = ({
username: username,
});

const telemetryInteract = {
context: {
env: 'teaching-center',
cdata: [],
},
edata: {
id: 'learner-creation-success',
type: Telemetry.CLICK,
subtype: '',
pageid: 'centers',
},
};
telemetryFactory.interact(telemetryInteract);

const isQueue = false;
const context = 'USER';
let createrName;
Expand Down
2 changes: 1 addition & 1 deletion src/components/AttendanceStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function AttendanceStatus({
learnerAttendanceData,
onDateSelection,
onUpdate,
}: AttendanceStatusProps) {
}: Readonly<AttendanceStatusProps>) {
const { t } = useTranslation();
const determinePathColor = useDeterminePathColor();
const selectedDate = shortDateFormat(onDateSelection);
Expand Down
8 changes: 8 additions & 0 deletions src/components/BottomDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ const BottomDrawer: React.FC<BottomDrawerProps> = ({
vertical: 'top',
horizontal: 'center',
}}
sx={{
padding: '0',
'& .MuiList-root': {
paddingTop: '0px',
paddingBottom: '0px',
},
}}
>
{optionList.map(({ label, icon, name }) => (
<MenuItem
Expand All @@ -116,6 +123,7 @@ const BottomDrawer: React.FC<BottomDrawerProps> = ({
</MenuItem>
))}
</Menu>

)}
</div>
);
Expand Down
3 changes: 2 additions & 1 deletion src/components/CenterSessionModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const CenterSessionModal: React.FC<SessionsModalProps> = ({
date,
secondary,
handlePrimaryModel,
handleEditModal
}) => {
const theme = useTheme<any>();
const { t } = useTranslation();
Expand Down Expand Up @@ -164,7 +165,7 @@ const CenterSessionModal: React.FC<SessionsModalProps> = ({
width: '100%',
},
}}
onClick={handlePrimaryModel}
onClick={handlePrimaryModel || handleEditModal}
>
{primary}
</Button>
Expand Down
42 changes: 25 additions & 17 deletions src/components/CohortSelectionSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@ import { getCohortList } from '@/services/CohortServices';
import useStore from '@/store/store';
import { CohortDetails, ICohort } from '@/utils/Interfaces';
import { CustomField } from '@/utils/Interfaces';
import { CenterType, cohortHierarchy } from '@/utils/app.constant';
import { CenterType, cohortHierarchy, Telemetry } from '@/utils/app.constant';
import { useTheme } from '@mui/material/styles';
import { useTranslation } from 'next-i18next';
import ReactGA from 'react-ga4';
import Loader from './Loader';
import { showToastMessage } from './Toastify';
import manageUserStore from '@/store/manageUserStore';
import { ArrowDropDownIcon } from '@mui/x-date-pickers/icons';
import { telemetryFactory } from '@/utils/telemetry';

interface CohortSelectionSectionProps {
classId: string;
Expand Down Expand Up @@ -294,6 +295,19 @@ const CohortSelectionSection: React.FC<CohortSelectionSectionProps> = ({
ReactGA.event('cohort-selection-dashboard', {
selectedCohortID: event.target.value,
});
const telemetryInteract = {
context: {
env: 'dashboard',
cdata: [],
},
edata: {
id: 'cohort-selection-dashboard',
type: Telemetry.SEARCH,
subtype: '',
pageid: 'centers',
},
};
telemetryFactory.interact(telemetryInteract);
localStorage.setItem('classId', event.target.value);
setHandleSaveHasRun?.(!handleSaveHasRun);

Expand Down Expand Up @@ -331,8 +345,10 @@ const CohortSelectionSection: React.FC<CohortSelectionSectionProps> = ({

const isAttendanceOverview = pathname === '/attendance-overview';

const isAssessment = pathname === '/assessments'

return (
<Box className={isAttendanceOverview ? 'w-100' : 'w-md-40'}>
<Box className={isAttendanceOverview || isAssessment ? 'w-100' : 'w-md-40'}>
{loading && <Loader showBackdrop={true} loadingText={t('LOADING')} />}
{!loading && cohortsData && (
<Box>
Expand Down Expand Up @@ -445,21 +461,13 @@ const CohortSelectionSection: React.FC<CohortSelectionSectionProps> = ({
// style={{ borderRadius: '4px' }}

inputProps={{ 'aria-label': 'Without label' }}
className={
showFloatingLabel
? ''
: 'select-languages fs-14 fw-500 bg-white'
}
style={
showFloatingLabel
? { borderRadius: '4px' }
: {
borderRadius: '0.5rem',
color: theme.palette.warning['200'],
width: '100%',
marginBottom: '0rem',
}
}
className={showFloatingLabel ? '' : "select-languages fs-14 fw-500 bg-white"}
style={showFloatingLabel ? { borderRadius: '4px' } : {
borderRadius: '0.5rem',
color: theme.palette.warning['200'],
width: '100%',
marginBottom: '0rem',
}}
>
{cohortsData?.length !== 0 ? (
manipulatedCohortData?.map((cohort) => (
Expand Down
15 changes: 15 additions & 0 deletions src/components/DateRangePopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import Image from 'next/image';
import ReactGA from 'react-ga4';
import checkMark from '../assets/images/checkMark.svg';
import MonthCalender from './MonthCalender';
import { telemetryFactory } from '@/utils/telemetry';
import { Telemetry } from '@/utils/app.constant';

const modalStyle = {
position: 'absolute',
Expand Down Expand Up @@ -129,6 +131,19 @@ const DateRangePopup: React.FC<CustomSelectModalProps> = ({
ReactGA.event('date-range-pop-up-clicked', {
dateRangeType: selectedValue,
});
const telemetryInteract = {
context: {
env: 'dashboard',
cdata: [],
},
edata: {
id: 'date-range-pop-up-clicked',
type: Telemetry.SEARCH,
subtype: '',
pageid: 'dashboard',
},
};
telemetryFactory.interact(telemetryInteract);
const values = getDateRange(selectedIndex);
const { toDate, fromDate } = values;
// console.log(toDate, fromDate);
Expand Down
14 changes: 11 additions & 3 deletions src/components/DeleteUserModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,19 @@ const DeleteUserModal: React.FC<DeleteUserModalProps> = ({
// const [otherReason, setOtherReason] = useState('');

const reasons = [
{ value: 'Incorrect Data Entry', label: 'Incorrect Data Entry' },
{ value: 'Duplicated User', label: 'Duplicated User' },
// { value: 'Incorrect Data Entry', label: 'Incorrect Data Entry' },
// { value: 'Duplicated User', label: 'Duplicated User' },
// { value: 'Other', label: 'Other' },
{value:t("CENTERS.LONG_ABSENTEE"), label:t("CENTERS.LONG_ABSENTEE")},
{ value:t("CENTERS.TAKEN_TC"),label:t("CENTERS.TAKEN_TC")},
{ value:t("CENTERS.ALLOCATION_CHANGE"),label:t("CENTERS.ALLOCATION_CHANGE")},
{ value:t("CENTERS.INCORRECT_ENTRY"),label:t("CENTERS.INCORRECT_ENTRY")},
{value:t("CENTERS.DUPLICATION_ENTRY"), label : t("CENTERS.DUPLICATION_ENTRY")},
];




const handleRadioChange = (value: string) => {
console.log(value);
setSelectedValue(value);
Expand Down Expand Up @@ -156,7 +164,7 @@ const DeleteUserModal: React.FC<DeleteUserModalProps> = ({
component="h2"
>
{showLablesForOther
? t('COMMON.REASON_FOR_REMOVE')
? t('COMMON.REASON')
: t('COMMON.REASON_FOR_DELETION')}
</Typography>
</Box>
Expand Down
16 changes: 14 additions & 2 deletions src/components/FacilitatorDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,17 @@ const FacilitatorDrawer: React.FC<FacilitatorDrawerProps> = ({
open={drawerState.bottom}
onClose={toggleDrawer(true)}
onOpen={toggleDrawer(true)}
sx={{ position: 'unset' }}
sx={{
position: 'unset',
'@media (min-width: 900px)': {
'& .MuiPaper-root': {
marginLeft: '352px',
// bottom:'3rem',
// borderRadius:'16px'
},
}
}}
className='facilitator-drawer'
BackdropProps={{ invisible: true }}
>
<Box
Expand All @@ -38,7 +48,9 @@ const FacilitatorDrawer: React.FC<FacilitatorDrawerProps> = ({
fontSize: '14px',
fontWeight: '400',
color: theme?.palette?.warning['A400'],
'@media (min-width: 600px)': {
textAlign: 'center',
}
}}
>
Khapari Dharmu (Chimur, Chandrapur) {/* will come from API */}
Expand Down Expand Up @@ -74,7 +86,7 @@ const FacilitatorDrawer: React.FC<FacilitatorDrawerProps> = ({
width: '100%',
},
}}
// onClick={handleSecondaryModel} // Uncomment and implement this function if needed
// onClick={handleSecondaryModel} // Uncomment and implement this function if needed
>
{secondary}
</Button>
Expand Down
11 changes: 6 additions & 5 deletions src/components/GuideTour.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const GuideTour: React.FC<GuideTourProps> = ({ toggleDrawer }) => {
}
};

const handleJoyrideCallback = (data: JoyrideCallbackData) => {
const handleJoyrideCallback = async (data: JoyrideCallbackData) => {
const { action, index, type, status } = data;

if (status === 'finished' || status === 'skipped') {
Expand All @@ -54,10 +54,11 @@ const GuideTour: React.FC<GuideTourProps> = ({ toggleDrawer }) => {
} else if (type === 'step:after' || type === 'tour:start') {
if (action === 'next') {
if (stepIndex === 4) {
toggleDrawer(true)();
setTimeout(() => {
setStepIndex((prevIndex) => prevIndex + 1);
}, 0);
await new Promise<void>((resolve) => {
toggleDrawer(true)();
setTimeout(resolve, 645); // Adjust the delay time as needed
});
setStepIndex((prevIndex) => prevIndex + 1);
} else {
setStepIndex((prevIndex) => prevIndex + 1);
}
Expand Down
Loading

0 comments on commit c6b9e47

Please sign in to comment.