+
+
+ {/* Search Box */}
+
+ setSearchQuery(e.target.value)}
+ InputProps={{
+ startAdornment: (
+
+
+
+ ),
+ }}
+ sx={{
+ backgroundColor: '#fff',
+ '& .MuiOutlinedInput-root': {
+ borderRadius: 2,
+ },
+ }}
+ />
+
+
+ {/* Staff List Table */}
+
+
+
+
+ Sr. No.
+ Appointment Type
+
+
+
+ {staffList.length > 0 ? (
+ staffList
+ .filter(
+ (staff) =>
+ `${staff.appointmentType}`
+ .toLowerCase()
+ .includes(searchQuery.toLowerCase())
+ )
+ .slice((page - 1) * rowsPerPage, page * rowsPerPage)
+ .map((staff, index) => (
+
+
+ {(page - 1) * rowsPerPage + index + 1}
+
+ {staff.appointmentType}
+
+ ))
+ ) : (
+
+
+ No Appointment Type added yet
+
+
+ )}
+
+
+
+
+ {/* Pagination */}
+ {staffList.length > 0 && (
+
+ setPage((prev) => Math.max(prev - 1, 1))}
+ disabled={page === 1}
+ startIcon={}
+ sx={{ mx: 1, color: '#666' }}
+ >
+ Previous
+
+
+
+ {page}
+
+
+ setPage((prev) => prev + 1)}
+ disabled={page * rowsPerPage >= staffList.length}
+ endIcon={}
+ sx={{ mx: 1, color: '#666' }}
+ >
+ Next
+
+
+ )}
+
+
+ {/* Add Staff Dialog */}
+
+
+ {/* Notification */}
+
+
+ {notification.message}
+
+
+
+ );
+};
+
+export default MasterDataManagement;
diff --git a/src/views/Signup/YourDetailsForm.jsx b/src/views/Signup/YourDetailsForm.jsx
index 562d420..1d4f127 100644
--- a/src/views/Signup/YourDetailsForm.jsx
+++ b/src/views/Signup/YourDetailsForm.jsx
@@ -144,6 +144,9 @@ function YourDetailsForm() {
practiceManagementSystem: "",
practiceId: "",
practiceName: "",
+
+ // contract management
+ contract: "",
});
// Field references for focus and validation
@@ -176,6 +179,9 @@ function YourDetailsForm() {
fullAddress: useRef(null),
companyPANImage: useRef(null),
companyTANNumber: useRef(null),
+
+ // contract management
+ contract: useRef(null),
};
if (yourDetailsFormData) {
@@ -262,6 +268,7 @@ function YourDetailsForm() {
companyTANImage: Yup.string().required(
"Clinic MEDICARE document is required"
),
+ contract: Yup.string().required("Contract is required"),
termsAccepted: Yup.boolean()
.oneOf([true], "You must accept the terms and conditions")
.required("You must accept the terms and conditions"),
@@ -551,6 +558,7 @@ function YourDetailsForm() {
documentType: "PAN",
},
],
+ contract: inputData.contract || "",
};
return data;
}
@@ -644,7 +652,9 @@ function YourDetailsForm() {
padding={`0 ${theme.spacing(3.2)}`}
className={classes.formRoot}
>
-
+
+
+
{/* Personal Details Section */}
@@ -1769,7 +1779,7 @@ function YourDetailsForm() {
+ {/* contract grid */}
+
+
+
+
{/* terms and condition grid */}
diff --git a/src/views/User/index.jsx b/src/views/User/index.jsx
index 6a2b06b..9c26b40 100644
--- a/src/views/User/index.jsx
+++ b/src/views/User/index.jsx
@@ -1,9 +1,10 @@
import { LoadingButton } from "@mui/lab";
-import { Box, Button, Grid, MenuItem, Select, Switch, TextField } from "@mui/material";
+import { Box, Button, Chip, Grid, MenuItem, Select, Switch, TextField } from "@mui/material";
import { useFormik } from "formik";
import React, { useMemo, useRef, useState } from "react";
import { useSelector } from "react-redux";
import * as Yup from "yup";
+import EditIcon from '@mui/icons-material/Edit';
/* ----------------- Custom Imports ----------------- */
import PageHeader from "../../components/PageHeader";
@@ -13,11 +14,7 @@ import CustomModal from "../Modal/Modal";
import { useStyles } from "./userStyles";
/* ----------------- Assets ----------------- */
-import SendIcon from "@mui/icons-material/Send";
import AddIcon from "@mui/icons-material/Add";
-import DeleteIcon from "@mui/icons-material/Delete";
-import EditIcon from "@mui/icons-material/Edit";
-import RemoveIcon from "@mui/icons-material/Remove";
import {
getUsers,
deleteUserById,
@@ -98,6 +95,36 @@ function Users() {
return { data: resp?.data?.records, rowCount: resp?.data?.totalCount };
};
+ const editUser = async (row) => {
+ try {
+ const userData = await getUserById(row?.original?.id);
+ const formData = {
+ userName: userData?.name,
+ email: userData?.email,
+ mobile: userData?.mobile,
+ isEditUser: true,
+ };
+ // const updatedCheckboxes = roles.reduce(
+ // (acc, role) => ({
+ // ...acc,
+ // [role?.id]: userData?.roles.some(
+ // (roleData) => roleData?.id === role?.id
+ // ),
+ // }),
+ // {}
+ // );
+
+ // setSelectedCheckboxes(updatedCheckboxes);
+ // formik.setValues(formData);
+ // toggle();
+ // setIsEditUser(true);
+ // setUserId(row?.original?.id);
+ } catch ({ resp }) {
+ // eslint-disable-next-line no-console
+ console.error(resp?.data?.message);
+ }
+ };
+
const handleToggleButton = async (row) => {
try {
// Replace this with your actual API call to update user status
@@ -204,14 +231,63 @@ function Users() {
isBold: true,
},
{
- accessorFn: ({ mobile }) => mobile || NOT_AVAILABLE_TEXT,
+ accessorFn: ({ userType }) => userType || NOT_AVAILABLE_TEXT,
accessorKey: "userType",
header: "User Type",
},
{
- accessorFn: ({ email }) => email || NOT_AVAILABLE_TEXT,
- accessorKey: "specialities",
- header: "Specialties",
+ accessorKey: "appointmentTypes",
+ header: "Appointment Types",
+ Cell: ({ row }) => {
+ const appointmentTypes = row?.original?.appointmentTypes;
+
+ // Convert to array if it's a string (comma-separated values)
+ const typesArray = Array.isArray(appointmentTypes) && appointmentTypes.length > 0
+ ? appointmentTypes
+ : typeof appointmentTypes === 'string' && appointmentTypes.trim() !== ''
+ ? appointmentTypes.split(',').map(type => type.trim())
+ : [];
+
+ return (
+
+ {typesArray.length > 0 ? (
+ typesArray.map((type, index) => {
+ const label = typeof type === 'string'
+ ? type
+ : type?.name || type?.type || String(type);
+
+ return (
+
+ );
+ })
+ ) : (
+
+ )}
+
+ );
+ },
},
{
accessorKey: "createdAt",
@@ -362,26 +438,25 @@ function Users() {
columns={columns}
getData={getData}
options={{ enableRowSelection: false }}
- // showAction={true}
+ showAction={true}
hideShowPerPage={true}
showSearchBox={true}
ref={ref}
searchText={"user"}
getRowStyle={getRowStyle}
- // actions={[
- // {
- // title: "Action",
- // field: "isActive",
- // render: (rowData) => (
- // handleToggleButton(rowData)}
- // inputProps={{ "aria-label": "Status toggle" }}
- // color="primary"
- // />
- // ),
- // },
- // ]}
+ actions={[
+ {
+ onClick: editUser,
+ text: 'Edit',
+ icon: (
+
+ ),
+ // permissionName: "CREATE_USERS",
+ },
+ ]}
/>