MCPcopy
hub / github.com/FlowiseAI/Flowise / Users

Function Users

packages/ui/src/views/users/index.jsx:238–537  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

236// ==============================|| Users ||============================== //
237
238const Users = () => {
239 const theme = useTheme()
240 const customization = useSelector((state) => state.customization)
241 const dispatch = useDispatch()
242 useNotifier()
243 const { error, setError } = useError()
244 const currentUser = useSelector((state) => state.auth.user)
245
246 const enqueueSnackbar = (...args) => dispatch(enqueueSnackbarAction(...args))
247 const closeSnackbar = (...args) => dispatch(closeSnackbarAction(...args))
248
249 const [isLoading, setLoading] = useState(true)
250 const [showInviteDialog, setShowInviteDialog] = useState(false)
251 const [showEditDialog, setShowEditDialog] = useState(false)
252 const [inviteDialogProps, setInviteDialogProps] = useState({})
253 const [users, setUsers] = useState([])
254 const [search, setSearch] = useState('')
255 const [deletingUserId, setDeletingUserId] = useState(null)
256
257 const { confirm } = useConfirm()
258
259 const getAllUsersByOrganizationIdApi = useApi(userApi.getAllUsersByOrganizationId)
260
261 const onSearchChange = (event) => {
262 setSearch(event.target.value)
263 }
264
265 function filterUsers(data) {
266 return (
267 data.user.name?.toLowerCase().indexOf(search.toLowerCase()) > -1 ||
268 data.user.email.toLowerCase().indexOf(search.toLowerCase()) > -1
269 )
270 }
271
272 const addNew = () => {
273 const dialogProp = {
274 type: 'ADD',
275 cancelButtonName: 'Cancel',
276 confirmButtonName: 'Send Invite',
277 data: null
278 }
279 setInviteDialogProps(dialogProp)
280 setShowInviteDialog(true)
281 }
282
283 const edit = (user) => {
284 if (user.status.toUpperCase() === 'INVITED') {
285 editInvite(user)
286 } else {
287 editUser(user)
288 }
289 }
290
291 const editInvite = (user) => {
292 const dialogProp = {
293 type: 'EDIT',
294 cancelButtonName: 'Cancel',
295 confirmButtonName: 'Update Invite',

Callers

nothing calls this directly

Calls 3

useErrorFunction · 0.90
useNotifierFunction · 0.85
useConfirmFunction · 0.85

Tested by

no test coverage detected