From 616b92bda6f2037f0c6535d6a82691e122f095a3 Mon Sep 17 00:00:00 2001 From: kartikvirendrar Date: Tue, 30 Jul 2024 17:29:05 +0530 Subject: [PATCH] changes for reinvite user --- src/containers/Organization/UserList.jsx | 20 ++++++++++++++++++- src/containers/UserManagement/EditProfile.jsx | 19 ------------------ 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/containers/Organization/UserList.jsx b/src/containers/Organization/UserList.jsx index 920752a1..e9ac9658 100644 --- a/src/containers/Organization/UserList.jsx +++ b/src/containers/Organization/UserList.jsx @@ -1,5 +1,5 @@ import React from "react"; -import { useSelector } from "react-redux"; +import { useDispatch, useSelector } from "react-redux"; import { Link } from "react-router-dom"; import { getColumns, getOptions } from "utils"; import { usersColumns } from "config"; @@ -9,14 +9,23 @@ import { tableTheme } from "theme"; //Icons import PreviewIcon from "@mui/icons-material/Preview"; +import MailIcon from "@mui/icons-material/Mail"; //Components import { ThemeProvider, Tooltip, IconButton } from "@mui/material"; import MUIDataTable from "mui-datatables"; +import { APITransport, ResendUserInviteAPI } from "redux/actions"; const UserList = ({ data }) => { + const dispatch = useDispatch(); const apiStatus = useSelector((state) => state.apiStatus); + const handleReinvite = (email) => { + let apiObj; + apiObj = new ResendUserInviteAPI([email]); + dispatch(APITransport(apiObj)); + }; + const actionColumn = { name: "Action", label: "Actions", @@ -29,6 +38,7 @@ const UserList = ({ data }) => { const selectedRow = tableData[rowIndex]; return ( + <> { + {selectedRow.has_accepted_invite === false && + + {handleReinvite(selectedRow.email)}}> + + + + } + ); }, }, diff --git a/src/containers/UserManagement/EditProfile.jsx b/src/containers/UserManagement/EditProfile.jsx index d020e80e..6baae5e0 100644 --- a/src/containers/UserManagement/EditProfile.jsx +++ b/src/containers/UserManagement/EditProfile.jsx @@ -38,7 +38,6 @@ import { setSnackBar, UpdateUserRoleAPI, FetchUserRolesAPI, - ResendUserInviteAPI, } from "redux/actions"; const EditProfile = () => { @@ -218,12 +217,6 @@ const EditProfile = () => { ); }; - const handleReinvite = () => { - let apiObj; - apiObj = new ResendUserInviteAPI([userData.email]); - dispatch(APITransport(apiObj)); - }; - const handleSubmit = () => { let updateProfileReqBody = { username: userDetails.username, @@ -459,20 +452,8 @@ const EditProfile = () => { direction="row" justifyContent="flex-end" alignItems="center" - gap={4} sx={{ my: 5, px: "9.75%" }} > - {userData.has_accepted_invite === false && - - }