Add SearchInput to RoomFilter (#83)
This commit is contained in:
parent
2bf8a6debb
commit
5de5015655
@ -9,6 +9,7 @@ import {
|
|||||||
Pagination,
|
Pagination,
|
||||||
ReferenceField,
|
ReferenceField,
|
||||||
ReferenceManyField,
|
ReferenceManyField,
|
||||||
|
SearchInput,
|
||||||
SelectField,
|
SelectField,
|
||||||
Show,
|
Show,
|
||||||
Tab,
|
Tab,
|
||||||
@ -184,15 +185,16 @@ export const RoomShow = props => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const RoomBulkActionButtons = props => (
|
const RoomBulkActionButtons = props => (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<BulkDeleteWithConfirmButton {...props} />
|
<BulkDeleteWithConfirmButton {...props} />
|
||||||
</Fragment>
|
</Fragment>
|
||||||
);
|
);
|
||||||
|
|
||||||
const RoomFilter = ({ ...props }) => {
|
const RoomFilter = ({ ...props }) => {
|
||||||
const translate = useTranslate();
|
const translate = useTranslate();
|
||||||
return (
|
return (
|
||||||
<Filter {...props}>
|
<Filter {...props}>
|
||||||
|
<SearchInput source="search_term" alwaysOn />
|
||||||
<Chip
|
<Chip
|
||||||
label={translate("resources.rooms.fields.joined_local_members")}
|
label={translate("resources.rooms.fields.joined_local_members")}
|
||||||
source="joined_local_members"
|
source="joined_local_members"
|
||||||
@ -236,7 +238,12 @@ const FilterableRoomList = ({ ...props }) => {
|
|||||||
pagination={<RoomPagination />}
|
pagination={<RoomPagination />}
|
||||||
sort={{ field: "name", order: "ASC" }}
|
sort={{ field: "name", order: "ASC" }}
|
||||||
filters={<RoomFilter />}
|
filters={<RoomFilter />}
|
||||||
bulkActionButtons={<RoomBulkActionButtons confirmTitle={translate("synapseadmin.rooms.delete.title")} confirmContent={translate("synapseadmin.rooms.delete.message")}/>}
|
bulkActionButtons={
|
||||||
|
<RoomBulkActionButtons
|
||||||
|
confirmTitle={translate("synapseadmin.rooms.delete.title")}
|
||||||
|
confirmContent={translate("synapseadmin.rooms.delete.message")}
|
||||||
|
/>
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<Datagrid rowClick="show">
|
<Datagrid rowClick="show">
|
||||||
<EncryptionField
|
<EncryptionField
|
||||||
|
@ -137,7 +137,7 @@ function getSearchOrder(order) {
|
|||||||
const dataProvider = {
|
const dataProvider = {
|
||||||
getList: (resource, params) => {
|
getList: (resource, params) => {
|
||||||
console.log("getList " + resource);
|
console.log("getList " + resource);
|
||||||
const { user_id, name, guests, deactivated } = params.filter;
|
const { user_id, name, guests, deactivated, search_term } = params.filter;
|
||||||
const { page, perPage } = params.pagination;
|
const { page, perPage } = params.pagination;
|
||||||
const { field, order } = params.sort;
|
const { field, order } = params.sort;
|
||||||
const from = (page - 1) * perPage;
|
const from = (page - 1) * perPage;
|
||||||
@ -145,6 +145,7 @@ const dataProvider = {
|
|||||||
from: from,
|
from: from,
|
||||||
limit: perPage,
|
limit: perPage,
|
||||||
user_id: user_id,
|
user_id: user_id,
|
||||||
|
search_term: search_term,
|
||||||
name: name,
|
name: name,
|
||||||
guests: guests,
|
guests: guests,
|
||||||
deactivated: deactivated,
|
deactivated: deactivated,
|
||||||
|
Loading…
Reference in New Issue
Block a user