diff --git a/src/Pages/ManageHumanResource/ManageDepartmentAndRoles/AddRoleModalAdvance.jsx b/src/Pages/ManageHumanResource/ManageDepartmentAndRoles/AddRoleModalAdvance.jsx index 3750a05..3c034aa 100644 --- a/src/Pages/ManageHumanResource/ManageDepartmentAndRoles/AddRoleModalAdvance.jsx +++ b/src/Pages/ManageHumanResource/ManageDepartmentAndRoles/AddRoleModalAdvance.jsx @@ -61,43 +61,135 @@ const AddRoleModalAdvance = ({ isOpen, onClose }) => { const data = [ { - action: "Dashboard", - all: "John Doe", - view: 28, - add: "Text", - edit: "Text", - delete: "Text", + Title: "Manage Human Resource", }, { action: "Dashboard", - all: "John Doe", - view: 28, - add: "Text", - edit: "Text", - delete: "Text", + all: , + view: , + add: , + edit: , + delete: , + }, + { + action: "Employees", + all: , + view: , + add: , + edit: , + delete: , + }, + { + action: "Approvers", + all: , + view: , + add: , + edit: , + delete: , + }, + { + action: "Subadmins", + all: , + view: , + add: , + edit: , + delete: , + }, + { + Title: "Expense Management", }, { action: "Dashboard", - all: "John Doe", - view: 28, - add: "Text", - edit: "Text", - delete: "Text", + all: , + view: , + add: , + edit: , + delete: , }, { - action: "Dashboard", - all: "John Doe", - view: 28, - add: "Text", - edit: "Text", - delete: "Text", + action: "Card program", + all: , + view: , + add: , + edit: , + delete: , }, + { + action: "Wallet program", + all: , + view: , + add: , + edit: , + delete: , + }, + { + action: "Reimbursement Request", + all: , + view: , + add: , + edit: , + delete: , + }, + { + action: "Expense Request", + all: , + view: , + add: , + edit: , + delete: , + }, + { + action: "EVM Card Request", + all: , + view: , + add: , + edit: , + delete: , + }, + { + Title: "Gifting Management", + }, + { + action: "Dashboard", + all: , + view: , + add: , + edit: , + delete: , + }, + { + action: "Employees", + all: , + view: , + add: , + edit: , + delete: , + }, + { + Title: "Manage Human Resource", + }, + { + action: "Dashboard", + all: , + view: , + add: , + edit: , + delete: , + }, + { + action: "Employees", + all: , + view: , + add: , + edit: , + delete: , + }, ]; return ( - + - + Add Role Advance @@ -212,50 +304,40 @@ const AddRoleModalAdvance = ({ isOpen, onClose }) => { - - - - - {" "} - Advance Setting - - - Enable this to provide Corporate dashboard access to this - role. - - - - - {/* Employee Details */} +
- - - - - - + + + + + + - {data.map((row) => ( - - - - - - - - + {data.map((row, index) => ( + <> + {row.Title && ( + + + + )} + {row.action && ( + + + + + + + + + )} + ))}
ActionsAllViewAddEditDeleteActionsAllViewAddEditDelete
{row.action}{row.all}{row.view}{row.add}{row.edit}{row.delete}
+ {row.Title} +
{row.action}{row.all}{row.view}{row.add}{row.edit}{row.delete}
diff --git a/src/Pages/ManageHumanResource/ManageDepartmentAndRoles/EmployeePermissions.jsx b/src/Pages/ManageHumanResource/ManageDepartmentAndRoles/EmployeePermissions.jsx index 732a986..c93d981 100644 --- a/src/Pages/ManageHumanResource/ManageDepartmentAndRoles/EmployeePermissions.jsx +++ b/src/Pages/ManageHumanResource/ManageDepartmentAndRoles/EmployeePermissions.jsx @@ -20,11 +20,10 @@ import { import { LuListFilter } from "react-icons/lu"; import GlobalStateContext from "../../../Contexts/GlobalStateContext"; import { OPACITY_ON_LOAD } from "../../../Layout/animations"; - import PrimaryButton from "../../../Components/Buttons/PrimaryButton"; import NormalTable from "../../../Components/DataTable/NormalTable"; import SwitchButton from "../../../Components/SwitchButton"; import AddDepartment from "./AddDepartmentModal"; - import { PiReceipt } from "react-icons/pi"; + import { MdOutlineEdit } from "react-icons/md"; const EmployeePermissions = () => { const { employeePermissions } = useContext(GlobalStateContext); @@ -78,9 +77,10 @@ import { "Department": item?.department, "Role": item?.role, "Permissions":( - - {item?.permissions} - + + {item?.permissions} + + ), "Action": ( { "Created duration": item?.createdDuration, "Created By": item?.createdBy, Permissions:( - - {item?.permissions} + + {item?.permissions} + {item?.permissions} + {item?.permissions} + {item?.permissions} ), Status: ( diff --git a/src/Pages/OptiFiiExpense/OptiFiiExpenseDashboard.jsx b/src/Pages/OptiFiiExpense/OptiFiiExpenseDashboard.jsx new file mode 100644 index 0000000..f2dc4a1 --- /dev/null +++ b/src/Pages/OptiFiiExpense/OptiFiiExpenseDashboard.jsx @@ -0,0 +1,203 @@ +import { + Box, + Button, + Card, + CardBody, + CardFooter, + CardHeader, + Checkbox, + Heading, + Icon, + Input, + InputGroup, + InputLeftElement, + Menu, + MenuButton, + MenuItem, + MenuList, + Radio, + SimpleGrid, + Text, + useDisclosure, + VStack, + } from "@chakra-ui/react"; + import React, { useContext, useEffect, useState } from "react"; + import { AddIcon, ChevronDownIcon, SearchIcon } from "@chakra-ui/icons"; + import { LuListFilter } from "react-icons/lu"; + import NormalTable from "../../Components/DataTable/NormalTable"; + import { MdOutlineEdit } from "react-icons/md"; +import GlobalStateContext from "../../Contexts/GlobalStateContext"; +import { OPACITY_ON_LOAD } from "../../Layout/animations"; + + const OptiFiiExpenseDashboard = () => { + const { employeePermissions } = useContext(GlobalStateContext); + const [isLoading, setIsLoading] = useState(false); + const [searchTerm, setSearchTerm] = useState(""); + const [isSwitchOn, setIsSwitchOn] = useState(true); + + useEffect(() => { + // Set isLoading to true + setIsLoading(true); + + // Simulate a 3-second delay + const timer = setTimeout(() => { + setIsLoading(false); // Set isLoading to false after 3 seconds + }, 500); + + // Cleanup the timer when the component unmounts or when the useEffect re-runs + return () => clearTimeout(timer); + }, []); // Empty dependency array means this effect runs once after the component mounts + + // ===============================[ Table Header ] + const tableHeadRow = [ + "Employee ID", + "Name", + "Email ID", + "Department", + "Role", + "Permissions", + "Action", + ]; + + // const extractedArray = reportsHistory.map((item)=>({ })) + + const extractedArray = employeePermissions.map((item, index) => ({ + "Employee ID": ( + + + {item?.id} + + + ), + "Name": item?.name, + "Email ID": item?.emailID, + "Department": item?.department, + "Role": item?.role, + "Permissions":( + + {item?.permissions} + + + ), + "Action": ( + + Btn + + ), + })); + + return ( + + + + + Customer dashboard + + + View a summary of all your customers over the last month. + + + View here + + + + + Customer dashboard + + + View a summary of all your customers over the last month. + + + View here + + + + + Customer dashboard + + + View a summary of all your customers over the last month. + + + View here + + + + + + + + + + + setSearchTerm(e.target.value)} + /> + + + + } + rightIcon={} + fontSize={"xs"} + color={"gray.700"} + variant="outline" + size={"sm"} + me={2} + > + Filter + + + Ascending + Descending + Recently Viewed + Recently Added + + + + + + + + + ); + }; + + export default OptiFiiExpenseDashboard; + \ No newline at end of file diff --git a/src/Routes/Nav.js b/src/Routes/Nav.js index d41d977..f15c335 100644 --- a/src/Routes/Nav.js +++ b/src/Routes/Nav.js @@ -66,26 +66,22 @@ export const nav = [ submenu: [ { title: "Dashboard", - path: "/dashboard", - icon: TbSquareRoundedFilled, + path: "/optiFii-expense-dashboard", colorCode:"#70a1ff" }, { title: "Wallet program", path: "/wallet-program", - icon: TbSquareRoundedFilled, colorCode:"#70a1ff" }, { title: "Reimbursement request", path: "/reimbursement-request", - icon: TbSquareRoundedFilled, colorCode:"#7bed9f" }, { title: "Advance expense request", path: "/advance-expense-request", - icon: TbSquareRoundedFilled, colorCode:"#7bed9f" }, ], diff --git a/src/Routes/Routes.js b/src/Routes/Routes.js index 144a470..8a793df 100644 --- a/src/Routes/Routes.js +++ b/src/Routes/Routes.js @@ -15,6 +15,7 @@ import AdvanceExpenseRequest from "../Pages/OptiFiiExpense/AdvanceExpenseRequest import ManageDepartmentAndRoles from "../Pages/ManageHumanResource/ManageDepartmentAndRoles/ManageDepartmentAndRoles"; import Department from "../Pages/ManageHumanResource/ManageDepartmentAndRoles/Department"; import Roles from "../Pages/ManageHumanResource/ManageDepartmentAndRoles/Roles"; +import OptiFiiExpenseDashboard from "../Pages/OptiFiiExpense/OptiFiiExpenseDashboard"; export const RouteLink = [ @@ -35,5 +36,6 @@ export const RouteLink = [ { path: "/settings", Component: Settings }, { path: "/department", Component: Department }, { path: "/roles", Component: Roles }, + { path: "/optiFii-expense-dashboard", Component: OptiFiiExpenseDashboard }, ];