From 24c9ae127871f71e1905609bad1ad75a751cbb22 Mon Sep 17 00:00:00 2001 From: Akshata Katwal Date: Sat, 10 Aug 2024 15:27:43 +0530 Subject: [PATCH 1/3] Issue feat: Implement Edit profile --- public/locales/en/common.json | 3 +- src/components/CommonUserModal.tsx | 4 +- src/components/layouts/header/Profile.tsx | 300 +++++++++++++++++----- 3 files changed, 235 insertions(+), 72 deletions(-) diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 62eb416e..836df0ad 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -74,7 +74,8 @@ "ALL_BLOCKS":"All Blocks", "ALL_DISTRICTS":"All Districts", "ALL_STATES":"All States", - "LOGOUT":"Log out" + "LOGOUT":"Log out", + "HI":"Hi" }, "LOGIN_PAGE": { diff --git a/src/components/CommonUserModal.tsx b/src/components/CommonUserModal.tsx index 0fce0076..d6bb0ef0 100644 --- a/src/components/CommonUserModal.tsx +++ b/src/components/CommonUserModal.tsx @@ -123,6 +123,7 @@ const CommonUserModal: React.FC = ({ setFormValue(formValues); setSchema(schema); setUiSchema(uiSchema); + console.log("teacher2") } else if (userType === FormContextType.TEAM_LEADER) { const { schema, uiSchema, formValues } = GenerateSchemaAndUiSchema( response, @@ -145,7 +146,7 @@ const CommonUserModal: React.FC = ({ } }; getAddUserFormData(); - }, []); + }, [userType]); const handleSubmit = async ( data: IChangeEvent, @@ -272,6 +273,7 @@ const CommonUserModal: React.FC = ({ name: apiBody?.name, mobile: apiBody?.mobile, father_name: apiBody?.father_name, + email:apiBody?.email }; const customFields = apiBody?.customFields; console.log(customFields); diff --git a/src/components/layouts/header/Profile.tsx b/src/components/layouts/header/Profile.tsx index c0c06c5f..1c67450c 100644 --- a/src/components/layouts/header/Profile.tsx +++ b/src/components/layouts/header/Profile.tsx @@ -1,31 +1,34 @@ -import React, { useEffect } from "react"; -import FeatherIcon from "feather-icons-react"; +import CommonUserModal from "@/components/CommonUserModal"; +import { FormContextType, Role } from "@/utils/app.constant"; import AccountCircleIcon from "@mui/icons-material/AccountCircle"; +import FeatherIcon from "feather-icons-react"; import { useTranslation } from "next-i18next"; +import React, { useEffect } from "react"; -import { useRouter } from "next/router"; +import { getFormRead } from "@/services/CreateUserService"; +import { getUserDetailsInfo } from "@/services/UserList"; +import { Storage } from "@/utils/app.constant"; +import EditIcon from '@mui/icons-material/Edit'; +import MailIcon from '@mui/icons-material/Mail'; +import PhoneIcon from '@mui/icons-material/Phone'; import { Box, - Menu, - Typography, - ListItemButton, - List, - ListItemText, Button, IconButton, - Divider, + Menu, + Typography } from "@mui/material"; -import { Storage } from "@/utils/app.constant"; -import EditIcon from '@mui/icons-material/Edit'; -import PhoneIcon from '@mui/icons-material/Phone'; -import MailIcon from '@mui/icons-material/Mail'; -import { getUserDetailsInfo } from "@/services/UserList"; +import { useRouter } from "next/router"; const Profile = () => { const [anchorEl4, setAnchorEl4] = React.useState(null); const [profileClick, setProfileClick] = React.useState(false); - + const [openEditModal, setOpenEditModal] = React.useState(false); const [userName, setUserName] = React.useState(""); + const [userId, setUserId] = React.useState(""); + const [formdata, setFormData] = React.useState(); + const [submitValue, setSubmitValue] = React.useState(false); + const [role, setRole] = React.useState(""); const [mobile, setMobile] = React.useState(""); @@ -53,13 +56,137 @@ const Profile = () => { router.push("/logout"); }; + + const mapFields = (formFields: any, response: any) => { + let initialFormData: any = {}; + formFields.fields.forEach((item: any) => { + const userData = response?.userData; + const customFieldValue = userData?.customFields?.find( + (field: any) => field.fieldId === item.fieldId, + ); + + const getValue = (data: any, field: any) => { + console.log(data, field); + if (item.default) { + return item.default; + } + if (item?.isMultiSelect) { + if (data[item.name] && item?.maxSelections > 1) { + return [field?.value]; + } else if (item?.type === "checkbox") { + console.log(item) + console.log(String(field?.value).split(",")) + + return String(field?.value).split(","); + } else { + return field?.value?.toLowerCase(); + } + } else { + if (item?.type === "numeric") { + return parseInt(String(field?.value)); + } else if (item?.type === "text") { + return String(field?.value); + } else { + if (field?.value === "FEMALE" || field?.value === "MALE") { + console.log(true); + return field?.value?.toLowerCase(); + } + // console.log() + return field?.value?.toLowerCase(); + } + } + }; + + if (item.coreField) { + if (item?.isMultiSelect) { + if (userData[item.name] && item?.maxSelections > 1) { + initialFormData[item.name] = [userData[item.name]]; + } else if (item?.type === "checkbox") { + // console.log("checkbox") + + initialFormData[item.name] = String(userData[item.name]).split(","); + } else { + initialFormData[item.name] = userData[item.name]; + } + } else if (item?.type === "numeric") { + console.log(item?.name); + initialFormData[item.name] = Number(userData[item.name]); + } else if (item?.type === "text" && userData[item.name]) { + initialFormData[item.name] = String(userData[item.name]); + } else { + console.log(item.name); + if (userData[item.name]) { + initialFormData[item.name] = userData[item.name]; + } + } + } else { + const fieldValue = getValue(userData, customFieldValue); + + if (fieldValue) { + initialFormData[item.name] = fieldValue; + } + } + }); + + console.log("initialFormData", initialFormData); + return initialFormData; + }; + const handleEditClick = async (rowData: any) => { + handleClose4(); + if(submitValue) + { + setSubmitValue(false); + } + console.log("Edit row:", rowData); + + try { + + const fieldValue = true; + const response = await getUserDetailsInfo(userId, fieldValue); + console.log(role); + + let formFields; + if (Role.STUDENT === role) { + formFields = await getFormRead("USERS", "STUDENT"); + setFormData(mapFields(formFields, response)); + console.log("mapped formdata", formdata); + } else if (Role.TEACHER === role) { + console.log("mapped formdata", formdata); + + formFields = await getFormRead("USERS", "TEACHER"); + setFormData(mapFields(formFields, response)); + } else if (Role.TEAM_LEADER === role) { + formFields = await getFormRead("USERS", "TEAM LEADER"); + setFormData(mapFields(formFields, response)); + } + handleOpenEditModal(); + + console.log("response", response); + console.log("formFields", formFields); + } catch (error) { + console.log(error); + } + }; + const getUserName = () => { if (typeof window !== "undefined" && window.localStorage) { const name = localStorage.getItem(Storage.NAME); setUserName(name); } }; + const handleCloseAddLearnerModal = () => { + setOpenEditModal(false); + }; + const handleOpenEditModal = () => { + setOpenEditModal(true); + }; + useEffect(() => { + getUserName(); + + + + }, [formdata]); useEffect(() => { getUserName(); @@ -74,13 +201,18 @@ console.log(profileClick) if(userId && profileClick) { + setUserId(userId) + console.log("true") const response=await getUserDetailsInfo(userId) console.log(response.userData) + setUserName(response?.userData?.name); + console.log(userName) setMobile(response?.userData?.mobile); setEmail(response?.userData?.email); setRole(response?.userData?.role); const initialLetters = userName?.split(' ').map(word => word[0]) .join(''); + console.log(initialLetters) if(initialLetters) setInitials(initialLetters) } @@ -98,8 +230,11 @@ console.log(profileClick) - }, [profileClick]); + }, [profileClick, submitValue]); + const handleModalSubmit = (value: boolean) => { + submitValue?setSubmitValue(false):setSubmitValue(true); + }; return ( <> - {/* - - */} - - + + + + + + + + {initials} + + + + + {userName} + + + {role} + + + + + {mobile} + + + + + + {email} + + + + + + ); From c83c0a8a61ded326cd24a844fed6721b24477497 Mon Sep 17 00:00:00 2001 From: Akshata Katwal Date: Sat, 10 Aug 2024 17:54:28 +0530 Subject: [PATCH 2/3] Issue feat: UI fixes --- public/locales/en/common.json | 4 +- src/components/KaTableComponent.tsx | 2 +- src/components/UserTable.tsx | 158 ++++++------ src/components/layouts/header/Profile.tsx | 253 +++++++++----------- src/components/layouts/header/SearchBar.tsx | 17 +- src/data/tableColumns.ts | 10 +- src/styles/style.css | 4 + 7 files changed, 217 insertions(+), 231 deletions(-) diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 836df0ad..8c1ccb7f 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -75,8 +75,8 @@ "ALL_DISTRICTS":"All Districts", "ALL_STATES":"All States", "LOGOUT":"Log out", - "HI":"Hi" - + "HI":"Hi", + "MOBILE": "Mobile" }, "LOGIN_PAGE": { "USERNAME": "Username", diff --git a/src/components/KaTableComponent.tsx b/src/components/KaTableComponent.tsx index 5aa88871..d6ae77fa 100644 --- a/src/components/KaTableComponent.tsx +++ b/src/components/KaTableComponent.tsx @@ -81,7 +81,7 @@ const KaTableComponent: React.FC = ({ {...tableProps} childComponents={{ pagingSizes: { - content: (props) => , + content: (props) =>!isMobile? (): (<>), }, pagingPages: { content: (props) => , diff --git a/src/components/UserTable.tsx b/src/components/UserTable.tsx index 2c0ea8b2..7630d758 100644 --- a/src/components/UserTable.tsx +++ b/src/components/UserTable.tsx @@ -24,7 +24,7 @@ import { getFormRead } from "@/services/CreateUserService"; import { showToastMessage } from "./Toastify"; import { capitalizeFirstLetterOfEachWordInArray } from "../utils/Helper"; import { getUserTableColumns, getTLTableColumns } from "@/data/tableColumns"; -import { useMediaQuery } from "@mui/material"; +import { TablePagination, useMediaQuery } from "@mui/material"; import { Theme } from "@mui/system"; import CommonUserModal from "./CommonUserModal"; type UserDetails = { @@ -46,7 +46,7 @@ type FilterDetails = { districts?: any; states?: any; blocks?: any; - name?:any + name?: any; }; interface Cohort { @@ -95,8 +95,8 @@ const UserTable: React.FC = ({ const [deleteUserState, setDeleteUserState] = useState(false); const isMobile: boolean = useMediaQuery((theme: Theme) => - theme.breakpoints.down('md'), -); + theme.breakpoints.down("sm") + ); const [confirmButtonDisable, setConfirmButtonDisable] = useState(true); const [pagination, setPagination] = useState(true); @@ -112,8 +112,8 @@ const UserTable: React.FC = ({ setOpenAddLearnerModal(true); }; const handleModalSubmit = (value: boolean) => { - console.log("true") - submitValue?setSubmitValue(false):setSubmitValue(true); + console.log("true"); + submitValue ? setSubmitValue(false) : setSubmitValue(true); }; const handleCloseAddLearnerModal = () => { setOpenAddLearnerModal(false); @@ -152,19 +152,26 @@ const UserTable: React.FC = ({ const handlePaginationChange = ( event: React.ChangeEvent, - value: number, + value: number ) => { setPageOffset(value - 1); }; const PagesSelector = () => ( - + <> + + + + ); const PageSizeSelectorFunction = () => ( @@ -200,7 +207,7 @@ const UserTable: React.FC = ({ const handleFilterChange = async (event: SelectChangeEvent) => { console.log(event.target.value as string); setSelectedFilter(event.target.value as string); - if (event.target.value === Status.ACTIVE_LABEL ) { + if (event.target.value === Status.ACTIVE_LABEL) { console.log(true); setFilters((prevFilters) => ({ ...prevFilters, @@ -315,7 +322,7 @@ const UserTable: React.FC = ({ formFields.fields.forEach((item: any) => { const userData = response?.userData; const customFieldValue = userData?.customFields?.find( - (field: any) => field.fieldId === item.fieldId, + (field: any) => field.fieldId === item.fieldId ); const getValue = (data: any, field: any) => { @@ -380,8 +387,7 @@ const UserTable: React.FC = ({ return initialFormData; }; const handleEdit = async (rowData: any) => { - if(submitValue) - { + if (submitValue) { setSubmitValue(false); } console.log("Edit row:", rowData); @@ -424,7 +430,7 @@ const UserTable: React.FC = ({ console.log("Delete row:", rowData.userId); }; const handleSearch = (keyword: string) => { - // console.log(filters) + // console.log(filters) setFilters((prevFilters) => ({ ...prevFilters, name: keyword, @@ -441,12 +447,11 @@ const UserTable: React.FC = ({ // const filters = { role: role , status:"active"}; const sort = sortBy; console.log("filters", filters); - if(filters.name) - { - offset=0; + if (filters.name) { + offset = 0; } const resp = await userList({ limit, filters, sort, offset, fields }); -console.log(resp?.getUserDetails) + console.log(resp?.getUserDetails); const result = resp?.getUserDetails; // console.log(resp?.totalCount) if (resp?.totalCount >= 15) { @@ -472,19 +477,19 @@ console.log(resp?.getUserDetails) console.log(result); const finalResult = result?.map((user: any) => { const ageField = user.customFields.find( - (field: any) => field.label === "AGE", + (field: any) => field.label === "AGE" ); const genderField = user.customFields.find( - (field: any) => field.label === "GENDER", + (field: any) => field.label === "GENDER" ); const blockField = user.customFields.find( - (field: any) => field.label === "BLOCKS", + (field: any) => field.label === "BLOCKS" ); const districtField = user.customFields.find( - (field: any) => field.label === "DISTRICTS", + (field: any) => field.label === "DISTRICTS" ); const stateField = user.customFields.find( - (field: any) => field.label === "STATES", + (field: any) => field.label === "STATES" ); return { @@ -505,32 +510,28 @@ console.log(resp?.getUserDetails) ? genderField.value?.charAt(0)?.toUpperCase() + genderField.value.slice(1).toLowerCase() : "-", - createdAt:user.createdAt, - updatedAt:user.updatedAt, - createdBy:user.createdBy, - updatedBy:user.updatedBy + createdAt: user.createdAt, + updatedAt: user.updatedAt, + createdBy: user.createdBy, + updatedBy: user.updatedBy, // centers: null, // Programs: null, }; }); - if(filters?.name) - { + if (filters?.name) { const prioritizedResult = finalResult.sort((a: any, b: any) => { const aStartsWith = a.name.toLowerCase().startsWith(filters?.name); const bStartsWith = b.name.toLowerCase().startsWith(filters?.name); - + if (aStartsWith && !bStartsWith) return -1; if (!aStartsWith && bStartsWith) return 1; return 0; }); - + setData(prioritizedResult); + } else { + setData(finalResult); } - - else{ - setData(finalResult); - - } setLoading(false); setCohortsFetched(false); @@ -553,8 +554,7 @@ console.log(resp?.getUserDetails) sortBy, filters, parentState, - deleteUserState - + deleteUserState, ]); useEffect(() => { @@ -570,10 +570,8 @@ console.log(resp?.getUserDetails) // (cohort: Cohort) => cohort.name, // ); const cohortNames = response?.result?.cohortData - ?.filter((cohort: Cohort) => cohort.type !== 'BLOCK') // Filter out cohorts with type 'block' - .map((cohort: Cohort) => cohort.name); // - - + ?.filter((cohort: Cohort) => cohort.type !== "BLOCK") // Filter out cohorts with type 'block' + .map((cohort: Cohort) => cohort.name); // let finalArray; if (cohortNames?.length >= 1) { @@ -583,9 +581,9 @@ console.log(resp?.getUserDetails) // console.log(finalArray) return { ...user, - centers: finalArray? finalArray?.join(" , "):"-", + centers: finalArray ? finalArray?.join(" , ") : "-", }; - }), + }) ); setData(newData); setCohortsFetched(true); @@ -614,9 +612,8 @@ console.log(resp?.getUserDetails) }, }; const response = await deleteUser(userId, userData); - if(response) - { - deleteUserState?setDeleteUserState(false):setDeleteUserState(true) + if (response) { + deleteUserState ? setDeleteUserState(false) : setDeleteUserState(true); } handleCloseDeleteModal(); showToastMessage(t("COMMON.USER_DELETE_SUCCSSFULLY"), "success"); @@ -661,7 +658,15 @@ console.log(resp?.getUserDetails) return ( {loading ? ( - + + + ) : data?.length !== 0 && loading === false ? ( ) : ( loading === false && @@ -695,33 +698,28 @@ console.log(resp?.getUserDetails) // // - - + ) - )} - { @@ -37,12 +31,11 @@ const Profile = () => { const [email, setEmail] = React.useState(""); const { t } = useTranslation(); - const router = useRouter(); const handleClick4 = (event: React.MouseEvent) => { setAnchorEl4(event.currentTarget); - setProfileClick(true) + setProfileClick(true); }; const handleClose4 = () => { @@ -50,19 +43,18 @@ const Profile = () => { }; const handleLogout = () => { - if (typeof window !== "undefined" && window.localStorage) { - localStorage.removeItem("token"); - } - router.push("/logout"); + // if (typeof window !== "undefined" && window.localStorage) { + // localStorage.removeItem("token"); + // } + // router.push("/logout"); }; - const mapFields = (formFields: any, response: any) => { let initialFormData: any = {}; formFields.fields.forEach((item: any) => { const userData = response?.userData; const customFieldValue = userData?.customFields?.find( - (field: any) => field.fieldId === item.fieldId, + (field: any) => field.fieldId === item.fieldId ); const getValue = (data: any, field: any) => { @@ -74,8 +66,8 @@ const Profile = () => { if (data[item.name] && item?.maxSelections > 1) { return [field?.value]; } else if (item?.type === "checkbox") { - console.log(item) - console.log(String(field?.value).split(",")) + console.log(item); + console.log(String(field?.value).split(",")); return String(field?.value).split(","); } else { @@ -102,7 +94,7 @@ const Profile = () => { if (userData[item.name] && item?.maxSelections > 1) { initialFormData[item.name] = [userData[item.name]]; } else if (item?.type === "checkbox") { - // console.log("checkbox") + // console.log("checkbox") initialFormData[item.name] = String(userData[item.name]).split(","); } else { @@ -133,14 +125,12 @@ const Profile = () => { }; const handleEditClick = async (rowData: any) => { handleClose4(); - if(submitValue) - { + if (submitValue) { setSubmitValue(false); } console.log("Edit row:", rowData); try { - const fieldValue = true; const response = await getUserDetailsInfo(userId, fieldValue); console.log(role); @@ -182,58 +172,46 @@ const Profile = () => { }; useEffect(() => { getUserName(); - - - - }, [formdata]); useEffect(() => { - getUserName(); + // getUserName(); -console.log(profileClick) + console.log(profileClick); const fetchUserDetail = async () => { - let userId; - try{ - if (typeof window !== "undefined" && window.localStorage) { - userId = localStorage.getItem(Storage.USER_ID); - } - console.log(profileClick , userId) - - if(userId && profileClick) - { - setUserId(userId) - - console.log("true") - const response=await getUserDetailsInfo(userId) - console.log(response.userData) - setUserName(response?.userData?.name); - console.log(userName) - setMobile(response?.userData?.mobile); - setEmail(response?.userData?.email); - setRole(response?.userData?.role); - const initialLetters = userName?.split(' ').map(word => word[0]) .join(''); - console.log(initialLetters) - if(initialLetters) - setInitials(initialLetters) - } - - - } - - catch(error) - { - console.log(error) - - } - } - fetchUserDetail(); - - - + let userId; + try { + if (typeof window !== "undefined" && window.localStorage) { + userId = localStorage.getItem(Storage.USER_ID); + } + console.log(profileClick, userId); + + if (userId && profileClick) { + setUserId(userId); + + console.log("true"); + const response = await getUserDetailsInfo(userId); + console.log(response.userData); + // setUserName(response?.userData?.name); + console.log(userName); + setMobile(response?.userData?.mobile); + setEmail(response?.userData?.email); + setRole(response?.userData?.role); + const initialLetters = userName + ?.split(" ") + .map((word) => word[0]) + .join(""); + console.log(initialLetters); + if (initialLetters) setInitials(initialLetters); + } + } catch (error) { + console.log(error); + } + }; + fetchUserDetail(); }, [profileClick, submitValue]); const handleModalSubmit = (value: boolean) => { - submitValue?setSubmitValue(false):setSubmitValue(true); + submitValue ? setSubmitValue(false) : setSubmitValue(true); }; return ( <> @@ -293,88 +271,91 @@ console.log(profileClick) }, }} > - - - - - - - - {initials} - - - - - {userName} - - - {role} - - - - - {mobile} - - - - - - {email} - - - - + + + + - + + + {initials} + + + + {userName} + + + {role} + + + + {mobile} + + + + {email} + + + + - - + ) +} ); }; diff --git a/src/components/layouts/header/SearchBar.tsx b/src/components/layouts/header/SearchBar.tsx index 7c2c1d5b..53ab6642 100644 --- a/src/components/layouts/header/SearchBar.tsx +++ b/src/components/layouts/header/SearchBar.tsx @@ -39,17 +39,20 @@ const SearchBar: React.FC = ({ onSearch, placeholder }) => { }; useEffect(() => { - if (keyword.trim().length >= 3 && validateKeyword(keyword)) { - onSearch(keyword); - } + const delayDebounceFn = setTimeout(() => { + if (keyword.trim().length >= 3 && validateKeyword(keyword)) { + onSearch(keyword); + } + }, 500); // Debounce delay of 500ms + + return () => clearTimeout(delayDebounceFn); }, [keyword]); const handleInputChange = (event: React.ChangeEvent) => { const value = event.target.value; - // Replace multiple spaces with a single space - const normalizedValue = value.replace(/\s{2,}/g, ' ').trimStart(); - setKeyword(normalizedValue); - // setKeyword(value.trimStart()); + // Replace multiple spaces with a single space + const normalizedValue = value.replace(/\s{2,}/g, " ").trimStart(); + setKeyword(normalizedValue); if (value === "") { onSearch(""); diff --git a/src/data/tableColumns.ts b/src/data/tableColumns.ts index 7c5ee6a5..79da3aa8 100644 --- a/src/data/tableColumns.ts +++ b/src/data/tableColumns.ts @@ -23,18 +23,18 @@ const generateColumns = ( export const getUserTableColumns = (t: any, isMobile: boolean) => { const configs: ColumnConfig[] = [ - { key: "name", titleKey: "FORM.NAME", width: 130 }, + { key: "name", titleKey: "FORM.NAME", width: 180 }, { key: "status", titleKey: "FORM.STATUS", width: 130 }, { key: "age", titleKey: "FORM.AGE", width: 100 }, { key: "gender", titleKey: "FORM.GENDER", width: 130 }, - { key: "mobile", titleKey: "FORM.MOBILE_NUMBER", width: 130 }, + { key: "mobile", titleKey: "COMMON.MOBILE", width: 130 }, { key: "state", titleKey: "FORM.STATE", width: 130, sortDirection: SortDirection.Ascend }, { key: "district", titleKey: "FORM.DISTRICT", width: 130, sortDirection: SortDirection.Ascend }, { key: "blocks", titleKey: "FORM.BLOCK", width: 130, sortDirection: SortDirection.Ascend }, { key: "centers", titleKey: "FORM.CENTER", width: 130, sortDirection: SortDirection.Ascend }, - { key: "updatedBy", titleKey: "TABLE_TITLE.UPDATED_BY", width: 130, sortDirection: SortDirection.Ascend }, - { key: "createdBy", titleKey: "TABLE_TITLE.CREATED_BY", width: 130, sortDirection: SortDirection.Ascend }, - { key: "createdAt", titleKey: "TABLE_TITLE.CREATED_DATE", width: 160, sortDirection: SortDirection.Ascend }, + { key: "updatedBy", titleKey: "TABLE_TITLE.UPDATED_BY", width: 160, sortDirection: SortDirection.Ascend }, + // { key: "createdBy", titleKey: "TABLE_TITLE.CREATED_BY", width: 130, sortDirection: SortDirection.Ascend }, + // { key: "createdAt", titleKey: "TABLE_TITLE.CREATED_DATE", width: 160, sortDirection: SortDirection.Ascend }, { key: "updatedAt", titleKey: "TABLE_TITLE.UPDATED_DATE", width: 160, sortDirection: SortDirection.Ascend }, { key: "actions", titleKey: "FORM.ACTION", width: 130 }, ]; diff --git a/src/styles/style.css b/src/styles/style.css index 54ed4ae7..ba36fbd6 100644 --- a/src/styles/style.css +++ b/src/styles/style.css @@ -15,3 +15,7 @@ .ka-table { font-size: medium; } + +.ka-cell { + line-height: 24px !important; +} \ No newline at end of file From 34ea039e075c3973124daf04b9ba108fc1c092fa Mon Sep 17 00:00:00 2001 From: Akshata Katwal Date: Sat, 10 Aug 2024 17:56:16 +0530 Subject: [PATCH 3/3] update pr --- src/components/layouts/header/Profile.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/layouts/header/Profile.tsx b/src/components/layouts/header/Profile.tsx index 2e210e9f..ddbba398 100644 --- a/src/components/layouts/header/Profile.tsx +++ b/src/components/layouts/header/Profile.tsx @@ -43,10 +43,10 @@ const Profile = () => { }; const handleLogout = () => { - // if (typeof window !== "undefined" && window.localStorage) { - // localStorage.removeItem("token"); - // } - // router.push("/logout"); + if (typeof window !== "undefined" && window.localStorage) { + localStorage.removeItem("token"); + } + router.push("/logout"); }; const mapFields = (formFields: any, response: any) => {