Skip to content

Commit

Permalink
Fix user's Edit action defualt Tab not being shown
Browse files Browse the repository at this point in the history
  • Loading branch information
beastafk committed Sep 2, 2024
1 parent b5b5939 commit 265b515
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/resources/users.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ import {
useListContext,
useNotify,
ToolbarClasses,
Identifier,
RaRecord,
} from "react-admin";
import { Link } from "react-router-dom";

Expand Down Expand Up @@ -140,6 +142,10 @@ const UserBulkActionButtons = () => {
</>
};

const usersRowClick = (id: Identifier, resource: string, record: RaRecord): string => {
return `/users/${id}`;
};

export const UserList = (props: ListProps) => (
<List
{...props}
Expand All @@ -149,7 +155,7 @@ export const UserList = (props: ListProps) => (
actions={<UserListActions />}
pagination={<UserPagination />}
>
<Datagrid rowClick="edit" bulkActionButtons={<UserBulkActionButtons />}>
<Datagrid rowClick={usersRowClick} bulkActionButtons={<UserBulkActionButtons />}>
<AvatarField source="avatar_src" sx={{ height: "40px", width: "40px" }} sortBy="avatar_url" />
<TextField source="id" sortBy="name" />
<TextField source="displayname" />
Expand Down

0 comments on commit 265b515

Please sign in to comment.