Skip to content

Commit

Permalink
Merge pull request #220 from Rushikesh-Sonawane99/shiksha-2.0
Browse files Browse the repository at this point in the history
Issue #PS-388 chore: Added feature to show number of days attendance marked out of 7 days on attendance overview page
  • Loading branch information
itsvick authored Jun 4, 2024
2 parents 9f589c3 + 559bd57 commit de3192c
Show file tree
Hide file tree
Showing 6 changed files with 175 additions and 82 deletions.
4 changes: 3 additions & 1 deletion public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
"UPCOMING_EXTRA_SESSION": "Upcoming Extra Sessions",
"BACK_TO_TOP": "Back to Top",
"LAST_SEVEN_DAYS_RANGE": "Last 7 Days {{date_range}}",
"AS_OF_TODAY_DATE": "As of Today {{day_date}}",
"LEARNER": "Learners"
},
"ATTENDANCE": {
Expand Down Expand Up @@ -116,7 +117,8 @@
"N/A": "N/A",
"CENTER_NAME": "Center Name",
"ALL_CENTERS": "All Centers",
"NO_LEARNER_WITH_LOW_ATTENDANCE": "No Learner with low attendance"
"NO_LEARNER_WITH_LOW_ATTENDANCE": "No Learner with low attendance",
"ATTENDANCE_MARKED_OUT_OF_DAYS": "Attendance marked: {{count}} out of last 7 days"
},
"PROFILE": {
"EDIT_PROFILE": "Edit Profile",
Expand Down
4 changes: 3 additions & 1 deletion public/locales/hi/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
"UPCOMING_EXTRA_SESSION": "आगामी अतिरिक्त सत्र",
"BACK_TO_TOP": "वापस शीर्ष पर",
"LAST_SEVEN_DAYS_RANGE": "पिछले 7 दिन {{date_range}}",
"AS_OF_TODAY_DATE": "As of Today {{dayDate}}",
"LEARNER": "शिक्षार्थियों"
},
"ATTENDANCE": {
Expand Down Expand Up @@ -115,7 +116,8 @@
"N/A": "उपलब्ध नहीं",
"CENTER_NAME": "केंद्र का नाम",
"ALL_CENTERS": "सभी केंद्र",
"NO_LEARNER_WITH_LOW_ATTENDANCE": "कम उपस्थिति वाले कोई शिक्षार्थी नहीं"
"NO_LEARNER_WITH_LOW_ATTENDANCE": "कम उपस्थिति वाले कोई शिक्षार्थी नहीं",
"ATTENDANCE_MARKED_OUT_OF_DAYS": "उपस्थिति चिह्नित: पिछले 7 दिनों में से {{count}} दिन"
},
"PROFILE": {
"EDIT_PROFILE": "प्रोफ़ाइल संपादित करें",
Expand Down
4 changes: 3 additions & 1 deletion public/locales/mr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
"UPCOMING_EXTRA_SESSION": "आगामी अतिरिक्त सत्रे",
"BACK_TO_TOP": "परत वर जा",
"LAST_SEVEN_DAYS_RANGE": "शेवटचे 7 दिवस {{date_range}}",
"AS_OF_TODAY_DATE": "As of Today {{day_date}}",
"LEARNER": "शिकणारे"
},
"ATTENDANCE": {
Expand All @@ -110,7 +111,8 @@
"N/A": "उपलब्ध नाही",
"CENTER_NAME": "केंद्राचे नाव",
"ALL_CENTERS": "सर्व केंद्रे",
"NO_LEARNER_WITH_LOW_ATTENDANCE": "कमी उपस्थिती असलेला कोणताही शिकणारा नाही"
"NO_LEARNER_WITH_LOW_ATTENDANCE": "कमी उपस्थिती असलेला कोणताही शिकणारा नाही",
"ATTENDANCE_MARKED_OUT_OF_DAYS": "उपस्थिती नोंदवली: मागील 7 दिवसांपैकी {{count}} दिवस"
},
"PROFILE": {
"EDIT_PROFILE": "प्रोफाइल संपादित करा",
Expand Down
6 changes: 4 additions & 2 deletions src/components/DateRangePopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,15 @@ interface CustomSelectModalProps {
selectedValue: string;
setSelectedValue: (value: string) => void;
onDateRangeSelected: any;
currentDayMonth:string;
}

const DateRangePopup: React.FC<CustomSelectModalProps> = ({
menuItems,
selectedValue,
setSelectedValue,
onDateRangeSelected,
currentDayMonth
}) => {
const [isModalOpen, setIsModalOpen] = useState(false);
const [isCalendarModalOpen, setIsCalenderModalOpen] = useState(false);
Expand Down Expand Up @@ -187,10 +189,10 @@ const DateRangePopup: React.FC<CustomSelectModalProps> = ({
inputProps={{ readOnly: true }}
>
<MenuItem value="" disabled>
{t('COMMON.SELECT_AN_OPTION')}
{ t('DASHBOARD.AS_OF_TODAY_DATE', {day_date: currentDayMonth})}
</MenuItem>
<MenuItem value={selectedValue}>
{selectedValue ? selectedValue : t('COMMON.SELECT_AN_OPTION')}
{selectedValue ? selectedValue : t('DASHBOARD.AS_OF_TODAY_DATE', {day_date: currentDayMonth})}
</MenuItem>
</Select>
</FormControl>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ ModalComponent.propTypes = {
open: PropTypes.bool.isRequired,
onClose: PropTypes.func.isRequired,
heading: PropTypes.string.isRequired,
SubHeading: PropTypes.string.isRequired,
SubHeading: PropTypes.string,
btnText: PropTypes.string.isRequired,
children: PropTypes.node,
};
Expand Down
Loading

0 comments on commit de3192c

Please sign in to comment.