SPRINT-12: added 'multi statitistics' widget

This commit is contained in:
Tim Chamberlain
2022-09-27 14:16:26 -05:00
parent 3e97c156a8
commit 1a0d8d9f3b
15 changed files with 172 additions and 18 deletions

View File

@ -29,6 +29,7 @@ import MDBox from "qqq/components/Temporary/MDBox";
import MDTypography from "qqq/components/Temporary/MDTypography";
import BarChart from "qqq/pages/dashboards/Widgets/BarChart";
import LineChart from "qqq/pages/dashboards/Widgets/LineChart";
import MultiStatisticsCard from "qqq/pages/dashboards/Widgets/MultiStatisticsCard";
import QuickSightChart from "qqq/pages/dashboards/Widgets/QuickSightChart";
import TableCard from "qqq/pages/dashboards/Widgets/TableCard";
import QClient from "qqq/utils/QClient";
@ -100,6 +101,8 @@ function DashboardWidgets({widgetNameList, entityPrimaryKey}: Props): JSX.Elemen
const widgetCount = widgets ? widgets.length : 0;
console.log(widgets);
return (
widgetCount > 0 ? (
<Grid item xs={12} lg={12}>
@ -112,6 +115,7 @@ function DashboardWidgets({widgetNameList, entityPrimaryKey}: Props): JSX.Elemen
<TableCard
color="info"
title={widget.title}
noRowsFoundHTML={widget.noRowsFoundHTML}
data={widget}
dropdownOptions={widget.dropdownOptions}
dropdownOnChange={handleDropdownOnChange}
@ -135,6 +139,15 @@ function DashboardWidgets({widgetNameList, entityPrimaryKey}: Props): JSX.Elemen
</MDBox>
)
}
{
widget.type === "multiStatistics" && (
<MultiStatisticsCard
color="info"
title={widget.title}
data={widget}
/>
)
}
</Grid>
))
}

View File

@ -51,10 +51,10 @@ function QDynamicForm(props: Props): JSX.Element
const fileChanged = (event: React.FormEvent<HTMLInputElement>, field: any) =>
{
setFileName(null)
if(event.currentTarget.files && event.currentTarget.files[0])
setFileName(null);
if (event.currentTarget.files && event.currentTarget.files[0])
{
setFileName(event.currentTarget.files[0].name)
setFileName(event.currentTarget.files[0].name);
}
formikProps.setFieldValue(field.name, event.currentTarget.files[0]);

View File

@ -37,6 +37,7 @@ function DataTableBodyCell({noBorder, align, children}: Props): JSX.Element
<MDBox
component="td"
textAlign={align}
verticalAlign="top"
py={1.5}
px={3}
sx={({palette: {light}, typography: {size}, borders: {borderWidth}}: Theme) => ({
@ -48,7 +49,6 @@ function DataTableBodyCell({noBorder, align, children}: Props): JSX.Element
display="inline-block"
width="max-content"
color="text"
sx={{verticalAlign: "middle"}}
>
{children}
</MDBox>

View File

@ -268,7 +268,7 @@ function DataTable({
{
prepareRow(row);
return (
<TableRow key={key} {...row.getRowProps()}>
<TableRow sx={{verticalAlign: "top"}} key={key} {...row.getRowProps()}>
{row.cells.map((cell: any) => (
cell.column.type !== "hidden" && (
<DataTableBodyCell