Skip to content

Commit

Permalink
Merge pull request #319 from shreyas1434shinde/boardEnrollment
Browse files Browse the repository at this point in the history
Task #PS-2128: Handle Large text translations like Malayalam language
  • Loading branch information
itsvick authored Oct 3, 2024
2 parents e14d5e7 + bad0466 commit 584e9d0
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 40 deletions.
3 changes: 2 additions & 1 deletion public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,7 @@
"SAVE_AND_NEXT": "Save and Next",
"TO_SAVE_YOUR_PROGRESS": "“Save & Next” to save your progress. You can come back and change it anytime.",
"MANDATORY": "Mandatory for {{FeesStepBoards}} only. For other Boards, this step is automatically marked completed. Please click on Save to submit the data.",
"COMPLETED": "Completed"
"COMPLETED": "Completed",
"MARK_AS_COMPLETE":"Mark as Complete"
}
}
6 changes: 3 additions & 3 deletions src/components/CohortSelectionSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ const CohortSelectionSection: React.FC<CohortSelectionSectionProps> = ({
width: '100%',
marginBottom: '0rem',
'@media (max-width: 900px)': {
width: isAttendanceOverview ? '100%' : '50%',
width: isAttendanceOverview ? '100%' : '62%',
},
}}
MenuProps={{
Expand Down Expand Up @@ -517,12 +517,12 @@ const CohortSelectionSection: React.FC<CohortSelectionSectionProps> = ({
'@media (max-width: 902px)': {
width: isAttendanceOverview
? '100%'
: '60%',
: '62%',
},
'@media (max-width: 702px)': {
width: isAttendanceOverview
? '100%'
: '50%',
: '65%',
},
}
}
Expand Down
6 changes: 4 additions & 2 deletions src/components/FacilitatorDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ const FacilitatorDrawer: React.FC<FacilitatorDrawerProps> = ({
sx={{
border: `1px solid ${theme?.palette?.warning['A400']}`,
color: theme?.palette?.warning['A400'],
width: '121px',
width: 'fit-content',
px: '20px',
}}
variant="outlined"
>
Expand All @@ -105,7 +106,8 @@ const FacilitatorDrawer: React.FC<FacilitatorDrawerProps> = ({
variant="contained"
color="primary"
onClick={onPrimaryClick}
sx={{ width: '199px' }}
sx={{ width: 'fit-content', px: '20px' }}
className="one-line-text"
>
{primary}
</Button>
Expand Down
3 changes: 3 additions & 0 deletions src/components/LearnerModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,18 @@ const LearnerModal = ({
<Box sx={buttonContainerStyles}>
<Button
sx={closeButtonStyles(theme)}
style={{ width: 'fit-content', padding: '5px 16px' }}
onClick={onClose}
variant="outlined"
>
{t('COMMON.CLOSE')}
</Button>
<Button
sx={profileButtonStyles(theme)}
style={{ width: 'fit-content', padding: '5px 16px' }}
variant="contained"
onClick={handleLearnerFullProfile}
fullWidth
>
{t('PROFILE.VIEW_FULL_PROFILE')}
</Button>
Expand Down
8 changes: 6 additions & 2 deletions src/pages/board-enrollment/student-detail/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,10 @@ const BoardEnrollmentDetail = () => {
},
border: `1px solid ${theme.palette.error.contrastText}`,
mt: '15px',
width: '144px',
width: 'fit-content',
px: '20px',
}}
className="one-line-text"
variant="outlined"
onClick={handleBack}
disabled={activeStep === 0}
Expand All @@ -403,12 +405,14 @@ const BoardEnrollmentDetail = () => {
</Button>
<Button
sx={{
width: '144px',
height: '40px',
fontSize: '14px',
fontWeight: '500',
mt: '15px',
width: 'fit-content',
px: '20px',
}}
className="one-line-text"
variant="contained"
color="primary"
onClick={handleNext}
Expand Down
12 changes: 6 additions & 6 deletions src/pages/centers/[cohortId]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ const CohortPage = () => {
border: `1px solid ${theme.palette.error.contrastText}`,
borderRadius: '100px',
height: '40px',
width: '163px',
px: '16px',
color: theme.palette.error.contrastText,
}}
onClick={handleOpen}
Expand Down Expand Up @@ -619,15 +619,15 @@ const CohortPage = () => {
type: 'fraction',
}}
breakpoints={{
500: {
600: {
slidesPerView: 1,
spaceBetween: 20,
},
740: {
900: {
slidesPerView: 2,
spaceBetween: 20,
},
900: {
1200: {
slidesPerView: 3,
spaceBetween: 30,
},
Expand Down Expand Up @@ -725,7 +725,7 @@ const CohortPage = () => {
<Box mt={3} px="18px">
<Grid container spacing={3}>
{sessions?.map((item) => (
<Grid item xs={12} sm={6} md={4} key={item.id}>
<Grid item xs={12} sm={12} md={6} lg={4} mb={2} key={item.id}>
<SessionCard
data={item}
isEventDeleted={handleEventDeleted}
Expand Down Expand Up @@ -769,7 +769,7 @@ const CohortPage = () => {
border: '1px solid #1E1B16',
borderRadius: '100px',
height: '40px',
width: '126px',
px: '16px',
color: theme.palette.error.contrastText,
}}
className="text-1E"
Expand Down
32 changes: 15 additions & 17 deletions src/pages/centers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,34 +69,32 @@ const CentersPage = () => {
if (router.isReady) {
const queryParamValue = router.query.tab ? Number(router.query.tab) : 1;

if ([1,2].includes(queryParamValue))
setValue(queryParamValue);
else
setValue(1);
if ([1, 2].includes(queryParamValue)) setValue(queryParamValue);
else setValue(1);
}
}, [router.isReady, router.query.tab]);

useEffect(() => {
// Merge existing query params with new ones
if (router.isReady) {
const updatedQuery = { ...router.query, tab: value };
const updatedQuery = { ...router.query, tab: value };

// Update the URL without reloading the page
router.push(
{
pathname: router.pathname,
query: updatedQuery,
},
undefined,
{ shallow: true }
);
}
// Update the URL without reloading the page
router.push(
{
pathname: router.pathname,
query: updatedQuery,
},
undefined,
{ shallow: true }
);
}
}, [value]);

useEffect(() => {
if (typeof window !== 'undefined' && window.localStorage) {
const role = localStorage.getItem('role');
setType("");
setType('');
if (role === Role.TEAM_LEADER) {
setIsTeamLeader(true);
} else {
Expand Down Expand Up @@ -420,7 +418,7 @@ const CentersPage = () => {
border: '1px solid #1E1B16',
borderRadius: '100px',
height: '40px',
width: '9rem',
px: '20px',
color: theme.palette.error.contrastText,
}}
className="text-1E"
Expand Down
4 changes: 2 additions & 2 deletions src/pages/course-planner-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -681,8 +681,8 @@ const CoursePlannerDetail = () => {
)}
</div>
<FacilitatorDrawer
secondary={'Cancel'}
primary={`Mark as Complete (${selectedCount})`}
secondary={t('COMMON.CANCEL')}
primary={`${t('BOARD_ENROLMENT.MARK_AS_COMPLETE')} (${selectedCount})`}
toggleDrawer={toggleDrawer}
drawerState={drawerState}
onPrimaryClick={() => {
Expand Down
10 changes: 6 additions & 4 deletions src/pages/learner/[userId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,10 @@ const LearnerProfile: React.FC<LearnerProfileProp> = ({
};

// Conditionally add fromDate and toDate to filters if selectedValue doesn't match the specific condition
if (selectedValue !== t('DASHBOARD.AS_OF_TODAY_DATE', { day_date: currentDayMonth })) {
if (
selectedValue !==
t('DASHBOARD.AS_OF_TODAY_DATE', { day_date: currentDayMonth })
) {
filters.fromDate = fromDates;
filters.toDate = toDates;
}
Expand Down Expand Up @@ -863,11 +866,10 @@ const LearnerProfile: React.FC<LearnerProfileProp> = ({
// }}
>
<Button
className="min-width-md-20"
sx={{
fontSize: '14px',
lineHeight: '20px',
minWidth: '100%',
minWidth: 'fit-content',
padding: '10px 24px 10px 16px',
gap: '8px',
borderRadius: '100px',
Expand Down Expand Up @@ -1013,4 +1015,4 @@ export const getStaticPaths: GetStaticPaths<{ slug: string }> = async () => {
export default withAccessControl(
'accessLearnerProfile',
accessControl
)(LearnerProfile);
)(LearnerProfile);
7 changes: 4 additions & 3 deletions src/pages/user-profile/[userId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,8 @@ const TeacherProfile: React.FC<TeacherProfileProp> = ({
sx={{
fontSize: '14px',
lineHeight: '20px',
width: '100%',
minWidth: '182px',

minWidth: 'fit-content',
padding: '10px 24px 10px 16px',
gap: '8px',
borderRadius: '100px',
Expand All @@ -456,7 +456,8 @@ const TeacherProfile: React.FC<TeacherProfileProp> = ({
textAlign: 'center',
color: theme.palette.warning.A200,
border: `1px solid #4D4639`,
maxWidth: '40%',

px: '16px',
}}
onClick={handleOpenAddLearnerModal}
>
Expand Down

0 comments on commit 584e9d0

Please sign in to comment.