Fix user's Edit action defualt Tab not being shown

This commit is contained in:
Borislav Pantaleev 2024-09-03 00:51:42 +03:00 committed by Borislav Pantaleev
parent b5b593945d
commit 265b5157af

View file

@ -53,6 +53,8 @@ import {
useListContext, useListContext,
useNotify, useNotify,
ToolbarClasses, ToolbarClasses,
Identifier,
RaRecord,
} from "react-admin"; } from "react-admin";
import { Link } from "react-router-dom"; 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) => ( export const UserList = (props: ListProps) => (
<List <List
{...props} {...props}
@ -149,7 +155,7 @@ export const UserList = (props: ListProps) => (
actions={<UserListActions />} actions={<UserListActions />}
pagination={<UserPagination />} pagination={<UserPagination />}
> >
<Datagrid rowClick="edit" bulkActionButtons={<UserBulkActionButtons />}> <Datagrid rowClick={usersRowClick} bulkActionButtons={<UserBulkActionButtons />}>
<AvatarField source="avatar_src" sx={{ height: "40px", width: "40px" }} sortBy="avatar_url" /> <AvatarField source="avatar_src" sx={{ height: "40px", width: "40px" }} sortBy="avatar_url" />
<TextField source="id" sortBy="name" /> <TextField source="id" sortBy="name" />
<TextField source="displayname" /> <TextField source="displayname" />