Merge pull request #8 from etkecc/fix-users-edit-tab

Fix user's Edit action defualt Tab not being shown
This commit is contained in:
Aine 2024-09-03 07:09:35 +03:00 committed by GitHub
commit 4a4fae104e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -53,6 +53,8 @@ import {
useListContext,
useNotify,
ToolbarClasses,
Identifier,
RaRecord,
} from "react-admin";
import { Link } from "react-router-dom";
@ -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}
@ -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" />