added section on the component page to warn users of excluded nodes

This commit is contained in:
csawatzky 2025-07-25 13:14:28 -06:00
parent e586421ffa
commit 7d241e1dcb
2 changed files with 31 additions and 6 deletions

View file

@ -14,10 +14,11 @@ import {
//FormLabel,
Grid2 as Grid,
Theme,
Tooltip,
Typography
} from "@mui/material";
import { lightGreen } from "@mui/material/colors";
import { ExpandMore } from "@mui/icons-material";
import { ExpandMore, Warning } from "@mui/icons-material";
import MeasurementsChart from "charts/MeasurementsChart";
//import { GraphOrientation } from "common/Graph";
//import RangeInput, { Range } from "common/RangeInput";
@ -694,6 +695,15 @@ export default function ComponentChart(props: Props) {
}
};
const displayExcludedNodes = () => {
const {component} = props
let nodes: number[] = []
component.settings.excludedNodes.forEach(node => {
nodes.push(node+1)
})
return nodes
}
const content = () => {
const {
component,
@ -746,7 +756,22 @@ export default function ComponentChart(props: Props) {
<React.Fragment>
{/* {newStructure && ( */}
<Grid size={{ xs: 12 }}>
<Typography style={{ fontWeight: 650, fontSize: 20 }}>Status</Typography>
<Box display="flex" justifyContent="space-between">
<Box>
<Typography style={{ fontWeight: 650, fontSize: 20 }}>Status</Typography>
</Box>
{component.settings.excludedNodes.length > 0 &&
<Box display="flex" alignContent="center" margin="auto" marginX={0}>
<Typography textAlign="center" marginX={1}>
Excluded Nodes
</Typography>
<Tooltip
title={"You have excluded nodes (" + displayExcludedNodes().toLocaleString() + ") and they will not show up on this page, you can reveal them temporarily by selecting show errors"}>
<Warning color="warning"/>
</Tooltip>
</Box>
}
</Box>
<Divider variant="middle" className={classes.divider} />
</Grid>
{/* )} */}

View file

@ -887,11 +887,11 @@ export default function ComponentSettings(props: Props) {
let nodes;
if (
prevComponent &&
prevComponent.lastMeasurement[0] &&
prevComponent.lastMeasurement[0].values[0] &&
prevComponent.lastMeasurement[0].values[0].values
prevComponent.status.measurement[0] &&
prevComponent.status.measurement[0].values[0] &&
prevComponent.status.measurement[0].values[0].values
) {
nodes = prevComponent.lastMeasurement[0].values[0].values;
nodes = prevComponent.status.measurement[0].values[0].values;
}
return (