mirror of
https://github.com/Kingsrook/qqq-frontend-material-dashboard.git
synced 2025-07-18 05:10:45 +00:00
SPRINT-21: added minheights to widgets for stability, attempt to stop multiple requests (again)
This commit is contained in:
@ -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>
|
||||
)
|
||||
}
|
||||
{
|
||||
|
@ -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">
|
||||
|
@ -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>
|
||||
|
Reference in New Issue
Block a user