From a42efe7edab01bfc6fc86141caf971e0872be6e2 Mon Sep 17 00:00:00 2001 From: Aine Date: Fri, 4 Oct 2024 00:16:11 +0300 Subject: [PATCH] do not color failed federation destinations, use an icon instead --- src/resources/destinations.tsx | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/src/resources/destinations.tsx b/src/resources/destinations.tsx index 8790169d..bf95ab68 100644 --- a/src/resources/destinations.tsx +++ b/src/resources/destinations.tsx @@ -4,6 +4,7 @@ import AutorenewIcon from "@mui/icons-material/Autorenew"; import DestinationsIcon from "@mui/icons-material/CloudQueue"; import FolderSharedIcon from "@mui/icons-material/FolderShared"; import ViewListIcon from "@mui/icons-material/ViewList"; +import ErrorIcon from '@mui/icons-material/Error'; import { Button, Datagrid, @@ -21,6 +22,7 @@ import { Tab, TabbedShowLayout, TextField, + FunctionField, TopToolbar, useRecordContext, useDelete, @@ -35,13 +37,6 @@ import { get } from "lodash"; const DestinationPagination = () => ; -const destinationRowSx = (record: RaRecord) => ({ - backgroundColor: record.retry_last_ts > 0 ? "warning.light" : "primary.contrastText", - "& .MuiButtonBase-root": { - color: "primary.dark", - }, -}); - const destinationFilters = []; export const DestinationReconnectButton = () => { @@ -105,7 +100,22 @@ const RetryDateField = (props: DateFieldProps) => { return ; }; + +const destinationFieldRender = (record: RaRecord) => { + if (record.retry_last_ts > 0) { + return ( + <> + + + {record.destination} + + ); + } + return <> {record.destination} ; +} + export const DestinationList = (props: ListProps) => { + const record = useRecordContext(props); return ( { pagination={} sort={{ field: "destination", order: "ASC" }} > - `${id}/show/rooms`} bulkActionButtons={false}> - + `${id}/show/rooms`} bulkActionButtons={false}> +