Add manual pagination to Rooms tab in User's profile

This commit is contained in:
Borislav Pantaleev
2025-02-04 23:13:43 +02:00
parent b7e308fe85
commit 3e9bfb605c
3 changed files with 27 additions and 7 deletions

View File

@@ -497,7 +497,7 @@ export const UserEdit = (props: EditProps) => {
target="user_id"
label={false}
pagination={<UserPagination />}
perPage={50}
perPage={10}
sort={{ field: "created_ts", order: "DESC" }}
>
<Datagrid sx={{ width: "100%" }} bulkActionButtons={<BulkDeleteButton/>}>
@@ -516,7 +516,7 @@ export const UserEdit = (props: EditProps) => {
</FormTab>
<FormTab label={translate("resources.rooms.name", { smart_count: 2 })} icon={<ViewListIcon />} path="rooms">
<ReferenceManyField reference="joined_rooms" target="user_id" label={false}>
<ReferenceManyField reference="joined_rooms" target="user_id" label={false} perPage={25} pagination={<Pagination />}>
<Datagrid sx={{ width: "100%" }} rowClick={id => "/rooms/" + id + "/show"} bulkActionButtons={false}>
<ReferenceField reference="rooms" source="id" label={false} link={false} sortable={false}>
<AvatarField source="avatar" sx={{ height: "40px", width: "40px" }} />