UI: Fixed exception in service view rendering
Some checks failed
checks-impure / test (pull_request) Successful in 25s
checks / test (pull_request) Failing after 1m26s

This commit is contained in:
2024-01-15 19:41:57 +01:00
parent 422a3f4da1
commit 4918f84e85
5 changed files with 73 additions and 88 deletions

View File

@@ -10,6 +10,7 @@ import { NoDataOverlay } from "@/components/noDataOverlay";
import { StyledTableCell, StyledTableRow } from "./style";
import { ICustomTable, CustomTableConfiguration } from "@/types";
import { Checkbox, Skeleton } from "@mui/material";
import ErrorBoundary from "@/components/error_boundary";
const CustomTable = ({ configuration, data, loading, tkey }: ICustomTable) => {
if (loading)
@@ -35,11 +36,15 @@ const CustomTable = ({ configuration, data, loading, tkey }: ICustomTable) => {
// cover use case if we want to render a component
if (render) renderedValue = render(value);
if (typeof renderedValue === "object" && render === undefined) {
console.warn("Missing render function for column " + cellKey);
}
return (
<StyledTableCell key={cellKey} align="left">
{renderedValue}
</StyledTableCell>
<ErrorBoundary>
<StyledTableCell key={cellKey} align="left">
{renderedValue}
</StyledTableCell>
</ErrorBoundary>
);
};