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}
widgetMetaData={widgetMetaData}
data={widgetData[i]}
reloadWidgetCallback={reloadWidget}
reloadWidgetCallback={() =>
{}}
storeDropdownSelections={widgetMetaData.storeDropdownSelections}
/>
)
@ -271,20 +272,18 @@ function DashboardWidgets({widgetMetaDataList, tableName, entityPrimaryKey, omit
}
{
widgetMetaData.type === "statistics" && (
widgetData && widgetData[i] && (
<Widget
widgetMetaData={widgetMetaData}
widgetData={widgetData[i]}
isChild={areChildren}
<Widget
widgetMetaData={widgetMetaData}
widgetData={widgetData[i]}
isChild={areChildren}
// reloadWidgetCallback={(data) => reloadWidget(i, data)}
>
<StatisticsCard
data={widgetData[i]}
increaseIsGood={true}
/>
</Widget>
)
// reloadWidgetCallback={(data) => reloadWidget(i, data)}
>
<StatisticsCard
data={widgetData[i]}
increaseIsGood={true}
/>
</Widget>
)
}
{

View File

@ -85,7 +85,7 @@ function PieChart({description, chartData}: Props): JSX.Element
}
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}>
<Grid container alignItems="center">
<Grid item xs={12} justifyContent="center">

View File

@ -55,6 +55,10 @@ StatisticsCard.defaultProps = {
function StatisticsCard({data, increaseIsGood}: Props): JSX.Element
{
if(! data)
{
return null;
}
const {count, percentageAmount, percentageLabel} = data;
let percentageString = "";
@ -82,7 +86,7 @@ function StatisticsCard({data, increaseIsGood}: Props): JSX.Element
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">
{
count !== undefined ? (
@ -96,7 +100,7 @@ function StatisticsCard({data, increaseIsGood}: Props): JSX.Element
}
</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>