File tree Expand file tree Collapse file tree 2 files changed +18
-7
lines changed
site/src/pages/UsersPage/UsersTable Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 1
1
import TableCell from "@mui/material/TableCell" ;
2
- import { GroupsByUserId } from "api/queries/groups " ;
3
- import { User } from "api/typesGenerated" ;
2
+ import { Stack } from "components/Stack/Stack " ;
3
+ import { type Group } from "api/typesGenerated" ;
4
4
5
5
type GroupsCellProps = {
6
- user : User ;
7
- groupsByUserId : GroupsByUserId | undefined ;
6
+ groups : readonly Group [ ] | undefined ;
8
7
} ;
9
8
10
- export function GroupsCell ( { user, groupsByUserId } : GroupsCellProps ) {
11
- return < TableCell > 5 Groups</ TableCell > ;
9
+ export function GroupsCell ( { groups } : GroupsCellProps ) {
10
+ return (
11
+ < TableCell >
12
+ { groups === undefined ? (
13
+ < em > N/A</ em >
14
+ ) : (
15
+ < Stack >
16
+ < div >
17
+ { groups . length } Group{ groups . length !== 1 && "s" }
18
+ </ div >
19
+ </ Stack >
20
+ ) }
21
+ </ TableCell >
22
+ ) ;
12
23
}
Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ export const UsersTableBody: FC<
157
157
onUserRolesUpdate = { onUpdateUserRoles }
158
158
/>
159
159
160
- < GroupsCell groupsByUserId = { groupsByUserId } user = { user } />
160
+ < GroupsCell groups = { groupsByUserId ?. get ( user . id ) } />
161
161
162
162
< TableCell >
163
163
< LoginType authMethods = { authMethods ! } value = { user . login_type } />
You can’t perform that action at this time.
0 commit comments