diff --git a/src/common/AddOrganizationMember.jsx b/src/common/AddOrganizationMember.jsx index 32ca81e3..518e7d98 100644 --- a/src/common/AddOrganizationMember.jsx +++ b/src/common/AddOrganizationMember.jsx @@ -1,4 +1,4 @@ -import { Fragment, useEffect } from "react"; +import { Fragment, useEffect,useState } from "react"; import { useDispatch, useSelector } from "react-redux"; import { MenuProps } from "utils"; @@ -38,6 +38,7 @@ const AddOrganizationMember = ({ isAdmin, }) => { const dispatch = useDispatch(); + const [inputValue, setInputValue] = useState(""); const userRoles = useSelector((state) => state.getUserRoles.data); @@ -45,6 +46,31 @@ const AddOrganizationMember = ({ const userObj = new FetchUserRolesAPI(); dispatch(APITransport(userObj)); }; + const handleKeyDown = (event) => { + if (event.key === "Enter" || event.key === " " || event.key === ",") { + event.preventDefault(); + if (inputValue.trim()) { + handleTextField((prev) => [...prev, inputValue.trim()]); + setInputValue(""); + } + } + }; + // const save =(event)=>{ + // if (inputValue.trim()) { + // handleTextField((prev) => [...prev, inputValue.trim()]); + // setInputValue(""); + // } + // } + + // const handleAddButtonClick = async() => { + // save(); + // await(handleTextField) + // setTimeout(() => { + // addBtnClickHandler(); + // handleUserDialogClose(); + // }, 1000); + // }; + useEffect(() => { getUserRolesList(); @@ -69,7 +95,10 @@ const AddOrganizationMember = ({ {title} { + addBtnClickHandler() + handleUserDialogClose() + }} sx={{ marginLeft: "auto" }} > @@ -82,10 +111,15 @@ const AddOrganizationMember = ({ freeSolo id="add-members" value={textFieldValue} - onChange={(event) => { - event.target.value.trim().length && - handleTextField((prev) => [...prev, event.target.value]); + onChange={(event, newValue, reason) => { + console.log("hello",event,newValue,reason); + + }} + inputValue={inputValue} + onInputChange={(event, newInputValue) => { + setInputValue(newInputValue); }} + onKeyDown={handleKeyDown} options={[]} renderTags={(tagValue) => { return tagValue.map((option) => ( @@ -150,8 +184,8 @@ const AddOrganizationMember = ({ variant="contained" sx={{ marginLeft: "10px", borderRadius: "8px" }} onClick={() => { - addBtnClickHandler(); - handleUserDialogClose(); + addBtnClickHandler() + handleUserDialogClose() }} disabled={textFieldLabel || selectFieldValue ? false : true} > diff --git a/src/common/Header.jsx b/src/common/Header.jsx index 95d97832..4a2ff3e3 100644 --- a/src/common/Header.jsx +++ b/src/common/Header.jsx @@ -205,7 +205,7 @@ const Header = () => { rowGap={2} > - (<> + <> { Admin } - ) + {/* { }), customBodyRender: (_value, tableMeta) => { const rowIndex = tableMeta.rowIndex; - const archived = orgList[rowIndex]?.archived || false; // Adjust based on your data structure + const archived = orgList[rowIndex]?.archived || false; return ( diff --git a/src/containers/Organization/Project/EditProject.jsx b/src/containers/Organization/Project/EditProject.jsx index 29640179..ec09fb87 100644 --- a/src/containers/Organization/Project/EditProject.jsx +++ b/src/containers/Organization/Project/EditProject.jsx @@ -301,13 +301,13 @@ const EditProject = () => { md={12} lg={12} xl={12} - style={{ display: "flex", justifyContent: "center" }} + style={{ display: "flex",justifyContent:"space-around"}} > - + Project Settings - + */}