Skip to content

Commit

Permalink
Issue #PS-000 fIX: Lint issues fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
itsvick committed Jul 12, 2024
1 parent c425996 commit fd403ef
Show file tree
Hide file tree
Showing 19 changed files with 192 additions and 147 deletions.
5 changes: 2 additions & 3 deletions app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,11 @@ export const accessControl: { [key: string]: Role[] } = {
accessProfile: [Role.TEACHER, Role.TEAM_LEADER],
accessLearnerProfile: [Role.TEACHER, Role.TEAM_LEADER],
accessLearnerAttendanceHistory: [Role.TEACHER, Role.TEAM_LEADER],
showTeachingCenter : [Role.TEAM_LEADER],
showBlockLevelCohort : [Role.TEAM_LEADER],
showTeachingCenter: [Role.TEAM_LEADER],
showBlockLevelCohort: [Role.TEAM_LEADER],
showTeacherCohorts: [Role.TEACHER],
showBlockLevelData: [Role.TEAM_LEADER],
showCreateCenterButton: [Role.TEAM_LEADER],
showBlockLevelCenterData: [Role.TEAM_LEADER],
showTeacherLevelCenterData: [Role.TEACHER],
};

11 changes: 5 additions & 6 deletions public/locales/or/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,11 @@
"REGULAR": "ସାଧାରଣ",
"REMOTE": "ଦୂରସ୍ଥ",
"NEW_CENTER": "ନୂଆ କେନ୍ଦ୍ର",
"UNIT_NAME": "ଏକକ ନାମ",
"NOTE": "ଟିପ୍ପଣୀ: ଏହା କେନ୍ଦ୍ରର ନାମ ହେବ",
"RENAME_CENTER": "କେନ୍ଦ୍ରର ନାମ ପରିବର୍ତ୍ତନ କରନ୍ତୁ",
"REQUEST_TO_DELETE": "ହଟାଇବାକୁ ଅନୁରୋଧ",
"UNIT_NAME": "ଏକକ ନାମ",
"NOTE": "ଟିପ୍ପଣୀ: ଏହା କେନ୍ଦ୍ରର ନାମ ହେବ",
"RENAME_CENTER": "କେନ୍ଦ୍ରର ନାମ ପରିବର୍ତ୍ତନ କରନ୍ତୁ",
"REQUEST_TO_DELETE": "ହଟାଇବାକୁ ଅନୁରୋଧ",
"RENAME": "ପୁନ ame ନାମ କରନ୍ତୁ",
"CENTER_RENAMED": "କେନ୍ଦ୍ରର ନାମ ସଫଳତାର ସହ ଚାଲିଛି!"

}
}
}
2 changes: 1 addition & 1 deletion src/components/CohortSelectionSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const CohortSelectionSection: React.FC<CohortSelectionSectionProps> = ({
console.log('Response:', response);
if (response && response.length > 0) {
if (response[0].type === cohortHierarchy.COHORT) {
let filteredData = response
const filteredData = response
?.map((item: any) => ({
cohortId: item?.cohortId,
parentId: item?.parentId,
Expand Down
4 changes: 2 additions & 2 deletions src/components/GeneratedSchemas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ const GenerateSchemaAndUiSchema = (apiResponse: any) => {
dependsOn,
} = field;

let fieldSchema: any = {
const fieldSchema: any = {
title: label,
};

let fieldUiSchema: any = {};
const fieldUiSchema: any = {};

switch (type) {
case 'text':
Expand Down
165 changes: 82 additions & 83 deletions src/components/ManageUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import { styled } from '@mui/system';
import { getMyUserList } from '@/services/MyClassDetailsService';
import DeleteUserModal from './DeleteUserModal';
import Image from 'next/image';
import profileALT from "../assets/images/Profile.png"
import profileALT from '../assets/images/Profile.png';
interface Cohort {
cohortId: string;
parentId: string;
Expand Down Expand Up @@ -122,7 +122,7 @@ const manageUsers: React.FC<ManageUsersProps> = ({
const getFacilitator = async () => {
setLoading(true);
try {
let cohortId = cohortData
const cohortId = cohortData
.map((block: any) => {
return block.blockId;
})
Expand Down Expand Up @@ -501,91 +501,90 @@ const manageUsers: React.FC<ManageUsersProps> = ({
</Grid> */}

<Box>
<Box px={'18px'} mt={3}>
<Box
sx={{
display: 'flex',
gap: '20px',
alignItems: 'center',
justifyContent: 'space-between',
paddingBottom: '15px',
}}
>
<Box
sx={{ gap: '15px', alignItems: 'center' }}
width={'100%'}
>
{users && users.length !== 0 && users.map((user) => (
<Box
key={user.userId}
display={'flex'}
borderBottom={`1px solid ${theme.palette.warning['A100']}`}
width={'100%'}
justifyContent={'space-between'}
sx={{ cursor: 'pointer' }}
>
<Box display="flex" alignItems="center" gap="5px" >
<Image
src={profileALT}
alt="img"
/>
<Box>
<CustomLink className="word-break" href="#">
<Typography
onClick={() => {
handleLearnerFullProfile(user.userId!);
}}
<Box px={'18px'} mt={3}>
<Box
sx={{
textAlign: 'left',
fontSize: '16px',
fontWeight: '400',
marginTop: '5px',
color: theme.palette.secondary.main,
display: 'flex',
gap: '20px',
alignItems: 'center',
justifyContent: 'space-between',
paddingBottom: '15px',
}}
>
{user.name}
</Typography>
</CustomLink>
<Box
sx={{
fontSize: '12px',
color: theme.palette.warning['400'],
marginBottom: '10px',
}}
>
{user?.age ? `${user.age} y/o` : 'N/A'}
<Box
sx={{ gap: '15px', alignItems: 'center' }}
width={'100%'}
>
{users &&
users.length !== 0 &&
users.map((user) => (
<Box
key={user.userId}
display={'flex'}
borderBottom={`1px solid ${theme.palette.warning['A100']}`}
width={'100%'}
justifyContent={'space-between'}
sx={{ cursor: 'pointer' }}
>
<Box display="flex" alignItems="center" gap="5px">
<Image src={profileALT} alt="img" />
<Box>
<CustomLink className="word-break" href="#">
<Typography
onClick={() => {
handleLearnerFullProfile(user.userId!);
}}
sx={{
textAlign: 'left',
fontSize: '16px',
fontWeight: '400',
marginTop: '5px',
color: theme.palette.secondary.main,
}}
>
{user.name}
</Typography>
</CustomLink>
<Box
sx={{
fontSize: '12px',
color: theme.palette.warning['400'],
marginBottom: '10px',
}}
>
{user?.age ? `${user.age} y/o` : 'N/A'}
</Box>
</Box>
</Box>
<Box>
<MoreVertIcon
onClick={toggleDrawer('bottom', true, user)}
sx={{
fontSize: '24px',
marginTop: '1rem',
color: theme.palette.warning['300'],
}}
/>
</Box>
</Box>
))}
{!users?.length && (
<Box
sx={{
m: '1.125rem',
display: 'flex',
justifyContent: 'left',
alignItems: 'center',
}}
>
<Typography style={{ fontWeight: 'bold' }}>
{t('COMMON.NO_DATA_FOUND')}
</Typography>
</Box>
)}
</Box>
</Box>
</Box>
</Box>
</Box>
<Box>
<MoreVertIcon
onClick={toggleDrawer('bottom', true, user)}
sx={{
fontSize: '24px',
marginTop: '1rem',
color: theme.palette.warning['300'],
}}
/>
</Box>
</Box>
))}
{!users?.length && (
<Box
sx={{
m: '1.125rem',
display: 'flex',
justifyContent: 'left',
alignItems: 'center',
}}
>
<Typography style={{ fontWeight: 'bold' }}>
{t('COMMON.NO_DATA_FOUND')}
</Typography>
</Box>
)}
</Box>
</Box>
</Box>

<ManageUsersModal
open={open}
Expand Down
8 changes: 4 additions & 4 deletions src/components/MarkBulkAttendance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ const MarkBulkAttendance: React.FC<MarkBulkAttendanceProps> = ({
});
if (newArray.length != 0) {
setNumberOfCohortMembers(newArray?.length);
setCohortMemberList(newArray)
setCohortMemberList(newArray);
const hasDropout = newArray.some(
(user) => user.memberStatus === Status.DROPOUT
);
Expand Down Expand Up @@ -566,16 +566,16 @@ const MarkBulkAttendance: React.FC<MarkBulkAttendanceProps> = ({
) => (
<AttendanceStatusListView
key={user.userId}
isDisabled = {true}
isDisabled={true}
userData={{
userId: user.userId,
attendance: user.attendance,
attendanceDate: selectedDate,
name: user.name,
memberStatus: user.memberStatus,
}}
presentCount = {presentCount}
absentCount = {absentCount}
presentCount={presentCount}
absentCount={absentCount}
// isEdit={true}
// bulkAttendanceStatus={bulkAttendanceStatus}
// handleBulkAction={submitBulkAttendanceAction}
Expand Down
6 changes: 5 additions & 1 deletion src/components/OverviewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ const OverviewCard: React.FC<OverviewCardProps> = ({
{value ? (
<Typography
variant="h2"
sx={{ color: theme.palette.warning['300'], fontSize: '16px', fontWeight: '500' }}
sx={{
color: theme.palette.warning['300'],
fontSize: '16px',
fontWeight: '500',
}}
fontWeight={500}
>
{value}
Expand Down
3 changes: 1 addition & 2 deletions src/components/center/RenameCenterModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ const RenameCenterModal: React.FC<CreateBlockModalProps> = ({
setCenterName(event.target.value);
};


const handleCreateButtonClick = () => {
console.log('Entered Rename Name:', centerName);
showToastMessage(t('CENTERS.CENTER_RENAMED'), 'success');
Expand Down Expand Up @@ -96,7 +95,7 @@ const RenameCenterModal: React.FC<CreateBlockModalProps> = ({
</IconButton>
</Box>
<Divider sx={{ mb: 2, mx: -2 }} />

<TextField
fullWidth
label={t('CENTERS.UNIT_NAME')}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/centers/[cohortId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ const TeachingCenterDetails = () => {
onClose={handleMenuClose}
>
<MenuItem onClick={() => setOpenRenameCenterModal(true)}>
<ListItemIcon sx={{ color: theme.palette.warning['A200'] }}>
<ListItemIcon sx={{ color: theme.palette.warning['A200'] }}>
<ModeEditOutlineOutlinedIcon fontSize="small" />
</ListItemIcon>
{t('CENTERS.RENAME_CENTER')}
Expand Down
5 changes: 4 additions & 1 deletion src/pages/learner/[userId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1647,4 +1647,7 @@ export const getStaticPaths: GetStaticPaths<{ slug: string }> = async () => {
};
};

export default withAccessControl('accessLearnerProfile', accessControl)(LearnerProfile);
export default withAccessControl(
'accessLearnerProfile',
accessControl
)(LearnerProfile);
6 changes: 4 additions & 2 deletions src/pages/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ import useStore from '@/store/store';
const LoginPage = () => {
const { t } = useTranslation();
const store = useStore();
const setUserRole = useStore((state: { setUserRole: any }) => state.setUserRole);
const setUserRole = useStore(
(state: { setUserRole: any }) => state.setUserRole
);
const [showPassword, setShowPassword] = useState(false);
const [username, setUsername] = useState('');
const [password, setPassword] = useState('');
Expand Down Expand Up @@ -123,7 +125,7 @@ const LoginPage = () => {
localStorage.setItem('state', userResponse?.state);
localStorage.setItem('district', userResponse?.district);
localStorage.setItem('role', userResponse?.tenantData[0]?.roleName);
setUserRole(userResponse?.tenantData[0]?.roleName)
setUserRole(userResponse?.tenantData[0]?.roleName);
}
}
setLoading(false);
Expand Down
3 changes: 1 addition & 2 deletions src/services/AssesmentService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ export const AssesmentListService = async ({
pagination,
filters,
}: assesmentListServiceParam): Promise<any> => {
const apiUrl: string =
`${process.env.NEXT_PUBLIC_TRACKING_API_URL}/tracking-assessment/v1/list`;
const apiUrl: string = `${process.env.NEXT_PUBLIC_TRACKING_API_URL}/tracking-assessment/v1/list`;
try {
const response = await post(apiUrl, { pagination, filters, sort });
return response?.data;
Expand Down
4 changes: 2 additions & 2 deletions src/services/MyClassDetailsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ export const getMyUserList = async ({
limit,
page,
filters,
fields
fields,
}: userList): Promise<any> => {
const apiUrl: string = `${process.env.NEXT_PUBLIC_BASE_URL}/list`;
try {
const response = await post(apiUrl, {
limit,
page,
filters,
fields
fields,
});
console.log('data', response?.data);
return response?.data;
Expand Down
Loading

0 comments on commit fd403ef

Please sign in to comment.