Extend the room list with further attributes

Add further attributes:
- is_encrypted
- federatable
- public
- state_events
- version
- joined_local_members

Also add the ability to sort.

API was added by synapse v1.13.0.
This commit is contained in:
dklimpel
2020-05-23 17:43:33 +02:00
parent 009ce803e2
commit 3884c50012
4 changed files with 45 additions and 3 deletions

View File

@@ -1,17 +1,33 @@
import React from "react";
import { Datagrid, List, TextField, Pagination } from "react-admin";
import {
Datagrid,
List,
TextField,
Pagination,
BooleanField,
} from "react-admin";
const RoomPagination = props => (
<Pagination {...props} rowsPerPageOptions={[10, 25, 50, 100, 500, 1000]} />
);
export const RoomList = props => (
<List {...props} pagination={<RoomPagination />}>
<List
{...props}
pagination={<RoomPagination />}
sort={{ field: "name", order: "ASC" }}
>
<Datagrid>
<TextField source="room_id" />
<TextField source="room_id" sortable={false} />
<TextField source="name" />
<TextField source="canonical_alias" />
<TextField source="joined_members" />
<TextField source="joined_local_members" />
<TextField source="state_events" />
<TextField source="version" />
<BooleanField source="is_encrypted" />
<BooleanField source="federatable" />
<BooleanField source="public" />
</Datagrid>
</List>
);