import React, { Fragment } from "react"; import { connect } from "react-redux"; import { BooleanField, BulkDeleteButton, DateField, Datagrid, DeleteButton, Filter, List, Pagination, ReferenceField, ReferenceManyField, SearchInput, SelectField, Show, Tab, TabbedShowLayout, TextField, TopToolbar, useTranslate, } from "react-admin"; import get from "lodash/get"; import { Tooltip, Typography, Chip } from "@material-ui/core"; import HttpsIcon from "@material-ui/icons/Https"; import NoEncryptionIcon from "@material-ui/icons/NoEncryption"; import PageviewIcon from "@material-ui/icons/Pageview"; import UserIcon from "@material-ui/icons/Group"; import ViewListIcon from "@material-ui/icons/ViewList"; import VisibilityIcon from "@material-ui/icons/Visibility"; import EventIcon from "@material-ui/icons/Event"; import { RoomDirectoryBulkDeleteButton, RoomDirectoryBulkSaveButton, RoomDirectoryDeleteButton, RoomDirectorySaveButton, } from "./RoomDirectory"; const RoomPagination = props => ( ); const EncryptionField = ({ source, record = {}, emptyText }) => { const translate = useTranslate(); const value = get(record, source); let ariaLabel = value === false ? "ra.boolean.false" : "ra.boolean.true"; if (value === false || value === true) { return ( {value === true ? ( ) : ( )} ); } return ( {emptyText} ); }; const RoomTitle = ({ record }) => { const translate = useTranslate(); var name = ""; if (record) { name = record.name !== "" ? record.name : record.id; } return ( {translate("resources.rooms.name", 1)} {name} ); }; const RoomShowActions = ({ basePath, data, resource }) => { var roomDirectoryStatus = ""; if (data) { roomDirectoryStatus = data.public; } return ( {roomDirectoryStatus === false && ( )} {roomDirectoryStatus === true && ( )} ); }; export const RoomShow = props => { const translate = useTranslate(); return ( } title={}> }> } path="detail" > }> "/users/" + id} > } path="permission" > } path="state" > ); }; const RoomBulkActionButtons = props => ( ); const RoomFilter = ({ ...props }) => { const translate = useTranslate(); return ( ); }; const FilterableRoomList = ({ ...props }) => { const filter = props.roomFilters; const localMembersFilter = filter && filter.joined_local_members ? true : false; const stateEventsFilter = filter && filter.state_events ? true : false; const versionFilter = filter && filter.version ? true : false; const federateableFilter = filter && filter.federatable ? true : false; return ( } sort={{ field: "name", order: "ASC" }} filters={} bulkActionButtons={} > } /> {localMembersFilter && } {stateEventsFilter && } {versionFilter && } {federateableFilter && } ); }; function mapStateToProps(state) { return { roomFilters: state.admin.resources.rooms.list.params.displayedFilters, }; } export const RoomList = connect(mapStateToProps)(FilterableRoomList);