Skip to content

Commit 20972a4

Browse files
authored
Merge pull request #2048 from tekdi/release-1.12.0
Release 1.12.0 to admin prod
2 parents a196a91 + dce4407 commit 20972a4

File tree

36 files changed

+400
-228
lines changed

36 files changed

+400
-228
lines changed

apps/admin-app-repo/public/locales/en/common.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,10 +315,10 @@
315315
"SEARCHBAR_PLACEHOLDER": "Search Center.."
316316
},
317317
"COURSE_PLANNER": {
318-
"LEARNERS_PREREQISITE": "Learners Prepare-requisites",
319-
"NO_DATA_PRE": "No data available for Learners Prepare-requisites",
320-
"LEARNERS_POSTREQISITE": "Learners Practice-requisites",
321-
"NO_DATA_POST": "No data available for Learners Practice-requisites",
318+
"LEARNERS_PREREQISITE": "Learners Prepare",
319+
"NO_DATA_PRE": "No data available for Learners Prepare",
320+
"LEARNERS_POSTREQISITE": "Learners Practice",
321+
"NO_DATA_POST": "No data available for Learners Practice",
322322
"FACILITATORS": "Facilitators Requisites",
323323
"NO_DATA": "No data available for Facilitators Requisites",
324324
"DOWNLOAD_SAMPLE_CSV": "Download Sample CSV",

apps/admin-app-repo/src/components/layouts/header/Header.tsx

Lines changed: 62 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -197,38 +197,56 @@ const Header = ({
197197
};
198198
return (
199199
<AppBar sx={sx} position={position} elevation={0} className={customClass}>
200-
<Toolbar sx={{ gap: '15px' }}>
201-
<Typography
202-
variant="h2"
203-
sx={{
204-
color: '#635E57',
205-
marginRight: '10px',
206-
fontSize: '22px',
207-
fontWeight: 400,
208-
'@media (max-width: 900px)': { paddingLeft: '34px' },
209-
}}
210-
>
211-
Admin
212-
</Typography>
200+
<Toolbar
201+
sx={{
202+
gap: { xs: '8px', sm: '12px', md: '15px' }, // Responsive gap
203+
paddingX: { xs: '8px', sm: '16px' }, // Responsive horizontal padding
204+
minHeight: { xs: '56px', sm: '64px' }, // Responsive toolbar height
205+
}}
206+
>
213207
<IconButton
214208
size="large"
215209
color="inherit"
216210
aria-label="menu"
217211
onClick={toggleMobileSidebar}
218212
sx={{
219213
display: {
220-
color: theme.palette.warning['A400'],
221214
lg: 'none',
222215
xs: 'flex',
223-
'@media (max-width: 600px)': {
224-
padding: '0px',
225-
},
216+
},
217+
color: '#333333', // Dark color for better visibility
218+
marginRight: '12px',
219+
padding: '8px',
220+
backgroundColor: 'rgba(255, 255, 255, 0.1)', // Subtle background for contrast
221+
'&:hover': {
222+
backgroundColor: 'rgba(255, 255, 255, 0.2)',
223+
color: '#000000',
224+
},
225+
'@media (max-width: 600px)': {
226+
padding: '4px',
227+
marginRight: '8px',
226228
},
227229
}}
228230
>
229-
{/* {showIcon === false ? "" : <FeatherIcon icon="menu" size="20" />} */}
230-
<MenuIcon />
231+
<MenuIcon sx={{ fontSize: '24px' }} />
231232
</IconButton>
233+
<Typography
234+
variant="h2"
235+
sx={{
236+
color: '#635E57',
237+
marginRight: '10px',
238+
fontSize: '22px',
239+
fontWeight: 400,
240+
'@media (max-width: 900px)': {
241+
fontSize: '20px',
242+
},
243+
'@media (max-width: 600px)': {
244+
fontSize: '18px',
245+
},
246+
}}
247+
>
248+
Admin
249+
</Typography>
232250
{/* ------------------------------------------- */}
233251
{/* Search Dropdown */}
234252
{/* ------------------------------------------- */}
@@ -243,63 +261,66 @@ const Header = ({
243261
{(typeof window !== 'undefined' && localStorage.getItem('academicYearId')) &&(userRole !== Role.CCTA &&
244262
userRole !== Role.SCTA &&
245263
userRole !== '') && (
246-
<Box sx={{ flexBasis: '20%' }}>
247-
{/* <FormControl className="drawer-select" sx={{ width: '100%' }}> */}
264+
<Box
265+
sx={{
266+
flexBasis: { xs: '35%', sm: '25%', md: '20%' }, // Responsive width
267+
minWidth: { xs: '120px', sm: '150px' }, // Minimum width
268+
marginRight: { xs: '8px', sm: '12px' }, // Responsive margin
269+
}}
270+
>
248271
<Select
249272
onChange={handleSelectChange}
250273
value={selectedSessionId}
251274
className="select-languages"
252275
displayEmpty
253276
sx={{
254277
borderRadius: '0.5rem',
255-
// color: theme.palette.warning['200'],
256278
width: '100%',
257279
marginBottom: '0rem',
258-
height: '30px',
280+
height: { xs: '28px', sm: '30px' }, // Responsive height
259281
color: '#fff',
260282
border: '1px solid #fff',
283+
fontSize: { xs: '12px', sm: '14px' }, // Responsive font size
261284
'& .MuiSvgIcon-root': {
262285
color: 'black',
263286
},
287+
'& .MuiSelect-select': {
288+
padding: { xs: '4px 8px', sm: '6px 12px' }, // Responsive padding
289+
},
264290
}}
265291
>
266292
{academicYearList.map(({ id, session }) => (
267293
<MenuItem key={id} value={id}>
268-
<span style={{ color: 'black' }}>{session}</span>
294+
<span style={{ color: 'black', fontSize: '14px' }}>{session}</span>
269295
</MenuItem>
270296
))}
271297
</Select>
272-
{/* </FormControl> */}
273298
</Box>
274299
)}
275300

276301
<Box
277302
sx={{
278303
display: 'flex',
279-
// gap:"10px",
280304
backgroundColor: '#bdbdbd',
281-
padding: '5px',
305+
padding: { xs: '3px', sm: '5px' }, // Responsive padding
282306
alignItems: 'center',
283307
justifyContent: 'center',
284-
height: '20px',
285-
width: '35px',
308+
height: { xs: '24px', sm: '20px' }, // Responsive height
309+
width: { xs: '30px', sm: '35px' }, // Responsive width
286310
borderRadius: '10px',
287311
cursor: 'pointer',
312+
marginRight: { xs: '6px', sm: '8px' }, // Responsive margin
313+
marginLeft: { xs: '6px', sm: '0px' }, // Add left margin on mobile
288314
}}
289315
onClick={handleClick}
290316
>
291-
{/* <IconButton
292-
aria-label="more"
293-
id="long-button"
294-
aria-controls={open ? "long-menu" : undefined}
295-
aria-expanded={open ? "true" : undefined}
296-
aria-haspopup="true"
297-
onClick={handleClick}
298-
>
299-
<TranslateIcon />
300-
301-
</IconButton> */}
302-
<Image src={deleteIcon} alt="" width={22} />
317+
<Image
318+
src={deleteIcon}
319+
alt=""
320+
width={18}
321+
height={18}
322+
style={{ maxWidth: '100%', height: 'auto' }}
323+
/>
303324
</Box>
304325
<Menu
305326
id="long-menu"

apps/admin-app-repo/src/components/layouts/header/Profile.tsx

Lines changed: 23 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -246,51 +246,40 @@ const Profile = () => {
246246
}}
247247
>
248248
<Box display="flex" alignItems="center" color="#bdbdbd">
249-
{/*<Avatar sx={{ width: 32, height: 32, mr: 1 }} />
250-
<Box
251-
sx={{
252-
display: 'flex',
253-
alignItems: 'center',
254-
// ml: 1,
255-
'@media (max-width: 600px)': {
256-
display: 'none',
257-
},
258-
}}
259-
>
260-
<Typography
261-
variant="body1"
262-
fontWeight="400"
263-
sx={{
264-
ml: 1,
265-
color: 'black',
266-
maxWidth: '200px',
267-
overflow: 'hidden',
268-
textOverflow: 'ellipsis',
269-
fontSize: '16px',
270-
whiteSpace: 'nowrap',
271-
}}
272-
>
273-
{t('COMMON.HI', { name: firstLetterInUpperCase(userName ?? '') })}
274-
</Typography>
275-
276-
</Box> */}
277-
<Avatar sx={{ width: 32, height: 32, mr: 1 }} />
249+
<Avatar
250+
sx={{
251+
width: { xs: 28, sm: 32 },
252+
height: { xs: 28, sm: 32 },
253+
mr: { xs: 0.5, sm: 1 }
254+
}}
255+
/>
278256
<Typography
279257
variant="body1"
280258
sx={{
281-
ml: 1,
259+
ml: { xs: 0.5, sm: 1 },
282260
color: 'black',
283-
maxWidth: '200px',
261+
maxWidth: { xs: '80px', sm: '120px', md: '200px' }, // Responsive max width
284262
overflow: 'hidden',
285263
textOverflow: 'ellipsis',
286-
fontSize: '16px',
264+
fontSize: { xs: '12px', sm: '14px', md: '16px' }, // Responsive font size
287265
whiteSpace: 'nowrap',
266+
display: { xs: 'none', sm: 'block' }, // Hide on extra small screens
288267
}}
289268
>
290269
{userName}
291270
</Typography>
292-
<IconButton size="small">
293-
<ArrowDropDownIcon />
271+
<IconButton
272+
size="small"
273+
sx={{
274+
padding: { xs: '2px', sm: '4px' }, // Smaller padding on mobile
275+
marginLeft: { xs: '2px', sm: '4px' },
276+
}}
277+
>
278+
<ArrowDropDownIcon
279+
sx={{
280+
fontSize: { xs: '18px', sm: '20px' } // Responsive icon size
281+
}}
282+
/>
294283
</IconButton>
295284
</Box>
296285
</Button>

apps/admin-app-repo/src/components/layouts/sidebar/Sidebar.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,20 @@ const Sidebar = ({
179179
sx: {
180180
width: '284px',
181181
border: '0 !important',
182+
zIndex: 1300, // Ensure it appears above other content
182183
},
183184
}}
184185
variant="temporary"
186+
ModalProps={{
187+
keepMounted: true, // Better open performance on mobile
188+
}}
189+
sx={{
190+
display: { xs: 'block', lg: 'none' },
191+
'& .MuiDrawer-paper': {
192+
boxSizing: 'border-box',
193+
width: '284px',
194+
},
195+
}}
185196
>
186197
{SidebarContent}
187198
</Drawer>

apps/admin-app-repo/src/config/menuConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ export const MENU_CONFIG = {
404404
title: 'SIDEBAR.WORKSPACE',
405405
icon: '/images/dashboard.svg',
406406
link: '/workspace',
407-
roles: [Role.CENTRAL_ADMIN],
407+
roles: [Role.CENTRAL_ADMIN, Role.CCTA, Role.SCTA],
408408
},
409409
manageNotificationTemplates: {
410410
title: 'SIDEBAR.MANAGE_NOTIFICATION',

apps/learner-web-app/src/app/logout/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function Logout() {
4040
// Specify the keys you want to keep
4141
preserveLocalStorage();
4242
}
43-
router.replace('/login');
43+
router.replace('/');
4444
}, []);
4545

4646
return <Loader isLoading={true} />;

apps/learner-web-app/src/app/sso/page.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ const SSOContent = () => {
204204
FilterKey[label as keyof typeof FilterKey],
205205
JSON.stringify(selectedValues)
206206
);
207+
if(label === 'EMP_GROUP') {
208+
localStorage.setItem(FilterKey.GROUP_MEMBERSHIP, JSON.stringify(selectedValues));
209+
}
207210

208211
// Map the label to the corresponding FilterKey and store in localStorage
209212
// switch (label) {

apps/learner-web-app/src/components/Content/L1ContentList.tsx

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,26 @@ const MyComponent: React.FC = () => {
137137
{t('COMMON.WELCOME')}, {localStorage.getItem('firstName')}!
138138
</Typography>
139139
</Box>
140-
{(tab == '0' || tab === null) && <InProgressContent />}
140+
{(() => {
141+
// Find indices of 'courses' and 'self' in storedConfig.showContent
142+
const coursesIndex = storedConfig?.showContent?.findIndex((item: string) =>
143+
item.toLowerCase() === 'courses'
144+
);
145+
const selfIndex = storedConfig?.showContent?.findIndex((item: string) =>
146+
item.toLowerCase() === 'self'
147+
);
148+
149+
// Show InProgressContent if tab matches either index or if tab is null/undefined
150+
const shouldShowInProgress =
151+
// tab === null ||
152+
// tab === undefined ||
153+
( storedConfig?.showContent?.[0]=== 'courses' && (tab === null || tab === undefined))||
154+
( storedConfig?.showContent?.[0]=== 'self' && (tab === null || tab === undefined))||
155+
(coursesIndex !== -1 && tab === coursesIndex.toString()) ||
156+
(selfIndex !== -1 && tab === selfIndex.toString());
157+
158+
return shouldShowInProgress && <InProgressContent />;
159+
})()}
141160

142161
{localStorage.getItem('userProgram') === TenantName.YOUTHNET && (
143162
<Grid container>
@@ -194,7 +213,7 @@ const MyComponent: React.FC = () => {
194213
storedConfig.showContent.includes('courses') &&
195214
storedConfig.showContent.includes('contents')
196215
? { contentTabs: ['courses', 'content'] }
197-
: {}),
216+
: { contentTabs: storedConfig.showContent?.map((item: string) => item.toLowerCase()) }),
198217

199218
staticFilter: {
200219
program:

apps/learner-web-app/src/components/Content/LearnerCourse.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ export default memo(function LearnerCourse({
367367
<Box>
368368
<Content
369369
isShowLayout={false}
370-
contentTabs={['Course']}
370+
contentTabs={_content?.contentTabs || ['Course']}
371371
showFilter={false}
372372
showSearch={false}
373373
showHelpDesk={false}

apps/learner-web-app/src/components/Learning.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ const Learning = ({
304304
color: '#7C766F',
305305
fontFamily: 'Poppins',
306306
mb: '8px',
307+
textAlign: 'justify',
307308
}}
308309
>
309310
<SpeakableText>
@@ -339,6 +340,7 @@ const Learning = ({
339340
fontWeight: 400,
340341
color: '#7C766F',
341342
fontFamily: 'Poppins',
343+
textAlign: 'justify',
342344
}}
343345
>
344346
<SpeakableText>{desc}</SpeakableText>
@@ -354,6 +356,7 @@ const Learning = ({
354356
fontWeight: 400,
355357
color: '#7C766F',
356358
fontFamily: 'Poppins',
359+
textAlign: 'justify',
357360
}}
358361
>
359362
<SpeakableText>{descriptions[index]}</SpeakableText>

0 commit comments

Comments
 (0)