Skip to content

Commit

Permalink
Hide zero last retry timestamps in federation list
Browse files Browse the repository at this point in the history
  • Loading branch information
rkfg committed Jul 18, 2024
1 parent 4adf2c2 commit fc1a02b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/resources/destinations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
useNotify,
useRefresh,
useTranslate,
DateFieldProps,
} from "react-admin";

import { DATE_FORMAT } from "../components/date";
Expand Down Expand Up @@ -92,6 +93,14 @@ const DestinationTitle = () => {
);
};

const RetryDateField = (props: DateFieldProps) => {
const record = useRecordContext(props);
if (props.source && get(record, props.source) === 0) {
return <DateField {...props} record={{...record, [props.source]: null}} />
}
return <DateField {...props} />
}

export const DestinationList = (props: ListProps) => {
return (
<List
Expand All @@ -103,7 +112,7 @@ export const DestinationList = (props: ListProps) => {
<Datagrid rowSx={destinationRowSx} rowClick={id => `${id}/show/rooms`} bulkActionButtons={false}>
<TextField source="destination" />
<DateField source="failure_ts" showTime options={DATE_FORMAT} />
<DateField source="retry_last_ts" showTime options={DATE_FORMAT} />
<RetryDateField source="retry_last_ts" showTime options={DATE_FORMAT} />
<TextField source="retry_interval" />
<TextField source="last_successful_stream_ordering" />
<DestinationReconnectButton />
Expand Down

0 comments on commit fc1a02b

Please sign in to comment.