SPRINT-21: added minheights to widgets for stability, attempt to stop multiple requests (again)

This commit is contained in:
Tim Chamberlain
2023-02-21 15:20:58 -06:00
parent a13ec1adc3
commit 07b71afa83
3 changed files with 20 additions and 17 deletions

View File

@ -174,7 +174,8 @@ function DashboardWidgets({widgetMetaDataList, tableName, entityPrimaryKey, omit
widgetIndex={i} widgetIndex={i}
widgetMetaData={widgetMetaData} widgetMetaData={widgetMetaData}
data={widgetData[i]} data={widgetData[i]}
reloadWidgetCallback={reloadWidget} reloadWidgetCallback={() =>
{}}
storeDropdownSelections={widgetMetaData.storeDropdownSelections} storeDropdownSelections={widgetMetaData.storeDropdownSelections}
/> />
) )
@ -271,7 +272,6 @@ function DashboardWidgets({widgetMetaDataList, tableName, entityPrimaryKey, omit
} }
{ {
widgetMetaData.type === "statistics" && ( widgetMetaData.type === "statistics" && (
widgetData && widgetData[i] && (
<Widget <Widget
widgetMetaData={widgetMetaData} widgetMetaData={widgetMetaData}
widgetData={widgetData[i]} widgetData={widgetData[i]}
@ -285,7 +285,6 @@ function DashboardWidgets({widgetMetaDataList, tableName, entityPrimaryKey, omit
/> />
</Widget> </Widget>
) )
)
} }
{ {
widgetMetaData.type === "multiStatistics" && ( widgetMetaData.type === "multiStatistics" && (

View File

@ -85,7 +85,7 @@ function PieChart({description, chartData}: Props): JSX.Element
} }
return ( return (
<Card sx={{boxShadow: "none", height: "100%", width: "100%", display: "flex", flexGrow: 1}}> <Card sx={{minHeight: "400px", boxShadow: "none", height: "100%", width: "100%", display: "flex", flexGrow: 1}}>
<Box mt={3}> <Box mt={3}>
<Grid container alignItems="center"> <Grid container alignItems="center">
<Grid item xs={12} justifyContent="center"> <Grid item xs={12} justifyContent="center">

View File

@ -55,6 +55,10 @@ StatisticsCard.defaultProps = {
function StatisticsCard({data, increaseIsGood}: Props): JSX.Element function StatisticsCard({data, increaseIsGood}: Props): JSX.Element
{ {
if(! data)
{
return null;
}
const {count, percentageAmount, percentageLabel} = data; const {count, percentageAmount, percentageLabel} = data;
let percentageString = ""; let percentageString = "";
@ -82,7 +86,7 @@ function StatisticsCard({data, increaseIsGood}: Props): JSX.Element
return ( return (
<Box mt={0} sx={{height: "100%", flexGrow: 1, flexDirection: "column", display: "flex", paddingTop: "0px"}}> <Box mt={0} sx={{minHeight: "112px", height: "100%", flexGrow: 1, flexDirection: "column", display: "flex", paddingTop: "0px"}}>
<Box mt={0} display="flex" justifyContent="center"> <Box mt={0} display="flex" justifyContent="center">
{ {
count !== undefined ? ( count !== undefined ? (
@ -96,7 +100,7 @@ function StatisticsCard({data, increaseIsGood}: Props): JSX.Element
} }
</Typography> </Typography>
) : ( ) : (
<CircularProgress sx={{marginTop: "1rem", marginBottom: "20px"}} color="inherit" size={data?.countFontSize ? data.countFontSize : 30}/> <CircularProgress sx={{marginTop: "1rem", paddingBottom: "25px"}} color="inherit" size={data?.countFontSize ? data.countFontSize : 23}/>
) )
} }
</Box> </Box>