migrate rooms.js
This commit is contained in:
parent
605930c35e
commit
f509578410
@ -24,8 +24,8 @@ import {
|
|||||||
} from "react-admin";
|
} from "react-admin";
|
||||||
import get from "lodash/get";
|
import get from "lodash/get";
|
||||||
import PropTypes from "prop-types";
|
import PropTypes from "prop-types";
|
||||||
import { makeStyles } from "@mui/styles";
|
|
||||||
import { Tooltip, Typography, Chip } from "@mui/material";
|
import { Tooltip, Typography, Chip } from "@mui/material";
|
||||||
|
import Box from "@mui/material/Box";
|
||||||
import FastForwardIcon from "@mui/icons-material/FastForward";
|
import FastForwardIcon from "@mui/icons-material/FastForward";
|
||||||
import HttpsIcon from "@mui/icons-material/Https";
|
import HttpsIcon from "@mui/icons-material/Https";
|
||||||
import NoEncryptionIcon from "@mui/icons-material/NoEncryption";
|
import NoEncryptionIcon from "@mui/icons-material/NoEncryption";
|
||||||
@ -50,13 +50,6 @@ const date_format = {
|
|||||||
second: "2-digit",
|
second: "2-digit",
|
||||||
};
|
};
|
||||||
|
|
||||||
const useStyles = makeStyles(theme => ({
|
|
||||||
helper_forward_extremities: {
|
|
||||||
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
|
|
||||||
margin: "0.5em",
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
|
|
||||||
const RoomPagination = props => (
|
const RoomPagination = props => (
|
||||||
<Pagination {...props} rowsPerPageOptions={[10, 25, 50, 100, 500, 1000]} />
|
<Pagination {...props} rowsPerPageOptions={[10, 25, 50, 100, 500, 1000]} />
|
||||||
);
|
);
|
||||||
@ -129,7 +122,6 @@ const RoomShowActions = ({ basePath, data, resource }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const RoomShow = props => {
|
export const RoomShow = props => {
|
||||||
const classes = useStyles({ props });
|
|
||||||
const translate = useTranslate();
|
const translate = useTranslate();
|
||||||
return (
|
return (
|
||||||
<Show {...props} actions={<RoomShowActions />} title={<RoomTitle />}>
|
<Show {...props} actions={<RoomShowActions />} title={<RoomTitle />}>
|
||||||
@ -281,9 +273,14 @@ export const RoomShow = props => {
|
|||||||
icon={<FastForwardIcon />}
|
icon={<FastForwardIcon />}
|
||||||
path="forward_extremities"
|
path="forward_extremities"
|
||||||
>
|
>
|
||||||
<div className={classes.helper_forward_extremities}>
|
<Box
|
||||||
|
sx={{
|
||||||
|
fontFamily: "Roboto, Helvetica, Arial, sans-serif",
|
||||||
|
margin: "0.5em",
|
||||||
|
}}
|
||||||
|
>
|
||||||
{translate("resources.rooms.helper.forward_extremities")}
|
{translate("resources.rooms.helper.forward_extremities")}
|
||||||
</div>
|
</Box>
|
||||||
<ReferenceManyField
|
<ReferenceManyField
|
||||||
reference="forward_extremities"
|
reference="forward_extremities"
|
||||||
target="room_id"
|
target="room_id"
|
||||||
@ -329,25 +326,25 @@ const RoomFilter = ({ ...props }) => {
|
|||||||
label={translate("resources.rooms.fields.joined_local_members")}
|
label={translate("resources.rooms.fields.joined_local_members")}
|
||||||
source="joined_local_members"
|
source="joined_local_members"
|
||||||
defaultValue={false}
|
defaultValue={false}
|
||||||
style={{ marginBottom: 8 }}
|
sx={{ marginBottom: "8px" }}
|
||||||
/>
|
/>
|
||||||
<Chip
|
<Chip
|
||||||
label={translate("resources.rooms.fields.state_events")}
|
label={translate("resources.rooms.fields.state_events")}
|
||||||
source="state_events"
|
source="state_events"
|
||||||
defaultValue={false}
|
defaultValue={false}
|
||||||
style={{ marginBottom: 8 }}
|
sx={{ marginBottom: "8px" }}
|
||||||
/>
|
/>
|
||||||
<Chip
|
<Chip
|
||||||
label={translate("resources.rooms.fields.version")}
|
label={translate("resources.rooms.fields.version")}
|
||||||
source="version"
|
source="version"
|
||||||
defaultValue={false}
|
defaultValue={false}
|
||||||
style={{ marginBottom: 8 }}
|
sx={{ marginBottom: "8px" }}
|
||||||
/>
|
/>
|
||||||
<Chip
|
<Chip
|
||||||
label={translate("resources.rooms.fields.federatable")}
|
label={translate("resources.rooms.fields.federatable")}
|
||||||
source="federatable"
|
source="federatable"
|
||||||
defaultValue={false}
|
defaultValue={false}
|
||||||
style={{ marginBottom: 8 }}
|
sx={{ marginBottom: "8px" }}
|
||||||
/>
|
/>
|
||||||
</Filter>
|
</Filter>
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user