diff --git a/app/client/src/pages/organization/settings.tsx b/app/client/src/pages/organization/settings.tsx index 561e3511c9..1f9e2a54ba 100644 --- a/app/client/src/pages/organization/settings.tsx +++ b/app/client/src/pages/organization/settings.tsx @@ -1,11 +1,7 @@ import React, { useEffect } from "react"; import { connect } from "react-redux"; import { Icon } from "@blueprintjs/core"; -import { - GridComponent, - ColumnsDirective, - ColumnDirective, -} from "@syncfusion/ej2-react-grids"; +import { TableWrapper } from "components/designSystems/appsmith/TableStyledWrappers"; import { AppState } from "reducers"; import { getAllUsers, @@ -27,6 +23,7 @@ import Spinner from "components/editorComponents/Spinner"; import FormDialogComponent from "components/editorComponents/form/FormDialogComponent"; import { getCurrentUser } from "selectors/usersSelectors"; import { User } from "constants/userConstants"; +import { useTable, useFlexLayout } from "react-table"; type OrgProps = { allOrgs: Organization[]; changeOrgName: (value: string) => void; @@ -57,27 +54,25 @@ type DropdownProps = { username: string; }; -const StyledGridComponent = styled(GridComponent)` - &&& { - .e-altrow { - background-color: #fafafa; - } - .e-active { - background: #cccccc; - } - .e-gridcontent { +const StyledDropDown = styled.div` + cursor: pointer; +`; + +const StyledTableWrapped = styled(TableWrapper)` + width: 100%; + height: auto; + font-size: 14px; + .table { + .tbody { + overflow: auto; + height: auto; max-height: calc( 100vh - (100vh / 3) - ${props => props.theme.headerHeight} ); - overflow: auto; } } `; -const StyledDropDown = styled.div` - cursor: pointer; -`; - const StyledMenu = styled(Menu)` &&&&.bp3-menu { max-width: 250px; @@ -103,8 +98,102 @@ export const OrgSettings = (props: PageProps) => { roles: props.allRole, isCurrentUser: user.username === props.currentUser?.username, })); + const data = React.useMemo(() => userTableData, [ + props.allUsers, + props.allRole, + ]); + const columns = React.useMemo(() => { + return [ + { + Header: "Email", + accessor: "username", + }, + { + Header: "Name", + accessor: "name", + }, + { + Header: "Role", + accessor: "roleName", + Cell: (cellProps: any) => { + const { + roleName, + roles, + username, + isCurrentUser, + isChangingRole, + } = cellProps.row.original; + + if (isCurrentUser) { + return