diff --git a/src/qqq/components/DashboardWidgets.tsx b/src/qqq/components/DashboardWidgets.tsx index 29351ca..ccbccfb 100644 --- a/src/qqq/components/DashboardWidgets.tsx +++ b/src/qqq/components/DashboardWidgets.tsx @@ -110,30 +110,28 @@ function DashboardWidgets({widgetMetaDataList, entityPrimaryKey}: Props): JSX.El { widgetMetaDataList.map((widgetMetaData, i) => ( - + { widgetMetaData.type === "table" && ( - widgetData && widgetData[i] ? ( - - - - ) : null + + + ) } { widgetMetaData.type === "stepper" && ( - - + + { widgetMetaData.label && ( @@ -150,8 +148,8 @@ function DashboardWidgets({widgetMetaDataList, entityPrimaryKey}: Props): JSX.El } { widgetMetaData.type === "html" && ( - - + + {widgetMetaData.label} @@ -170,34 +168,32 @@ function DashboardWidgets({widgetMetaDataList, entityPrimaryKey}: Props): JSX.El } { widgetMetaData.type === "multiStatistics" && ( - + + + ) } { widgetMetaData.type === "quickSightChart" && ( - widgetData && widgetData[i] ? ( - - - - ) : null + + + ) } { widgetMetaData.type === "barChart" && ( - widgetData && widgetData[i] ? ( - - - - ) : null + + + ) } { diff --git a/src/qqq/pages/dashboards/CarrierPerformance.tsx b/src/qqq/pages/dashboards/CarrierPerformance.tsx index 10ab92a..f0b4fa1 100644 --- a/src/qqq/pages/dashboards/CarrierPerformance.tsx +++ b/src/qqq/pages/dashboards/CarrierPerformance.tsx @@ -259,6 +259,7 @@ function CarrierPerformance(): JSX.Element diff --git a/src/qqq/pages/dashboards/Overview.tsx b/src/qqq/pages/dashboards/Overview.tsx index 62a42f2..041eef4 100644 --- a/src/qqq/pages/dashboards/Overview.tsx +++ b/src/qqq/pages/dashboards/Overview.tsx @@ -265,7 +265,7 @@ function Overview(): JSX.Element @@ -285,9 +285,9 @@ function Overview(): JSX.Element diff --git a/src/qqq/pages/dashboards/Tables/ShipmentsByWarehouseTable.tsx b/src/qqq/pages/dashboards/Tables/ShipmentsByWarehouseTable.tsx index 40dbcab..4e5af42 100644 --- a/src/qqq/pages/dashboards/Tables/ShipmentsByWarehouseTable.tsx +++ b/src/qqq/pages/dashboards/Tables/ShipmentsByWarehouseTable.tsx @@ -77,7 +77,7 @@ function ShipmentsByWarehouseTable({title, rows, shadow}: Props): JSX.Element {title ? ( - + {title} diff --git a/src/qqq/pages/dashboards/Widgets/BarChart.tsx b/src/qqq/pages/dashboards/Widgets/BarChart.tsx index 3fe4fbe..cb09524 100644 --- a/src/qqq/pages/dashboards/Widgets/BarChart.tsx +++ b/src/qqq/pages/dashboards/Widgets/BarChart.tsx @@ -162,7 +162,7 @@ function BarChart({color, title, description, date, data}: Props): JSX.Element [data, color] )} - + {title} diff --git a/src/qqq/pages/dashboards/Widgets/DefaultLineChart.tsx b/src/qqq/pages/dashboards/Widgets/DefaultLineChart.tsx index cf1d9ee..4dde68e 100644 --- a/src/qqq/pages/dashboards/Widgets/DefaultLineChart.tsx +++ b/src/qqq/pages/dashboards/Widgets/DefaultLineChart.tsx @@ -190,7 +190,7 @@ function DefaultLineChart({icon, title, height, data}: Props): JSX.Element )} - {title && {title}} + {title && {title}} diff --git a/src/qqq/pages/dashboards/Widgets/HorizontalBarChart.tsx b/src/qqq/pages/dashboards/Widgets/HorizontalBarChart.tsx index d79224f..6e928e0 100644 --- a/src/qqq/pages/dashboards/Widgets/HorizontalBarChart.tsx +++ b/src/qqq/pages/dashboards/Widgets/HorizontalBarChart.tsx @@ -154,7 +154,7 @@ function HorizontalBarChart({icon, title, description, height, data}: Props): JS )} - {title && {title}} + {title && {title}} {description} diff --git a/src/qqq/pages/dashboards/Widgets/LineChart.tsx b/src/qqq/pages/dashboards/Widgets/LineChart.tsx index e79c9ac..5256e0a 100644 --- a/src/qqq/pages/dashboards/Widgets/LineChart.tsx +++ b/src/qqq/pages/dashboards/Widgets/LineChart.tsx @@ -182,7 +182,7 @@ function LineChart({icon, title, description, height, chart}: Props): JSX.Elemen )} - {title && {title}} + {title && {title}} {description} diff --git a/src/qqq/pages/dashboards/Widgets/MultiStatisticsCard.tsx b/src/qqq/pages/dashboards/Widgets/MultiStatisticsCard.tsx index 8486c46..272e0cb 100644 --- a/src/qqq/pages/dashboards/Widgets/MultiStatisticsCard.tsx +++ b/src/qqq/pages/dashboards/Widgets/MultiStatisticsCard.tsx @@ -65,7 +65,8 @@ interface Props function MultiStatisticsCard({title, data}: Props): JSX.Element { return ( - + + diff --git a/src/qqq/pages/dashboards/Widgets/PieChartCard.tsx b/src/qqq/pages/dashboards/Widgets/PieChartCard.tsx index 10a67cb..ad4fbc0 100644 --- a/src/qqq/pages/dashboards/Widgets/PieChartCard.tsx +++ b/src/qqq/pages/dashboards/Widgets/PieChartCard.tsx @@ -50,7 +50,7 @@ function PieChartCard({title, description, data}: Props): JSX.Element return ( - {title} + {title} diff --git a/src/qqq/pages/dashboards/Widgets/ShipmentsByWarehouse.tsx b/src/qqq/pages/dashboards/Widgets/ShipmentsByWarehouse.tsx index 39b39fa..a2e5ce4 100644 --- a/src/qqq/pages/dashboards/Widgets/ShipmentsByWarehouse.tsx +++ b/src/qqq/pages/dashboards/Widgets/ShipmentsByWarehouse.tsx @@ -52,7 +52,7 @@ function ShipmentsByWarehouseData(): JSX.Element warehouse - + Shipments by Warehouse diff --git a/src/qqq/pages/dashboards/Widgets/SimpleStatisticsCard.tsx b/src/qqq/pages/dashboards/Widgets/SimpleStatisticsCard.tsx index 7f12e19..f248a6b 100644 --- a/src/qqq/pages/dashboards/Widgets/SimpleStatisticsCard.tsx +++ b/src/qqq/pages/dashboards/Widgets/SimpleStatisticsCard.tsx @@ -28,6 +28,7 @@ import {StatisticsCardData} from "qqq/pages/dashboards/Widgets/StatisticsCard"; interface Props { + title: string; data: StatisticsCardData; increaseIsGood: boolean; dropdown?: { @@ -39,9 +40,9 @@ interface Props [key: string]: any; } -function SimpleStatisticsCard({data, increaseIsGood, dropdown}: Props): JSX.Element +function SimpleStatisticsCard({title, data, increaseIsGood, dropdown}: Props): JSX.Element { - const {title, count, percentageAmount, percentageLabel} = data; + const {count, percentageAmount, percentageLabel} = data; let percentageString = ""; if (percentageAmount) diff --git a/src/qqq/pages/dashboards/Widgets/SmallLineChart.tsx b/src/qqq/pages/dashboards/Widgets/SmallLineChart.tsx index 32ca1bc..34302df 100644 --- a/src/qqq/pages/dashboards/Widgets/SmallLineChart.tsx +++ b/src/qqq/pages/dashboards/Widgets/SmallLineChart.tsx @@ -80,7 +80,7 @@ function SmallLineChart({color, title, description, date, chart}: Props): JSX.El [chart, color] )} - + {title} diff --git a/src/qqq/pages/dashboards/Widgets/TableCard.tsx b/src/qqq/pages/dashboards/Widgets/TableCard.tsx index 6fe5c5b..2da377f 100644 --- a/src/qqq/pages/dashboards/Widgets/TableCard.tsx +++ b/src/qqq/pages/dashboards/Widgets/TableCard.tsx @@ -68,6 +68,10 @@ function TableCard({title, linkText, linkURL, noRowsFoundHTML, data, dropdownOpt const [dropdownLabel, setDropdownLabel] = useState(""); const [dropdownIcon, setDropdownIcon] = useState(openArrowIcon); + console.log(`data: ${JSON.stringify(data?.rows)}`); + console.log(`bool: ${data && data?.columns && !data?.rows}`); + console.log(`norowsfound: ${noRowsFoundHTML}`); + const openDropdown = ({currentTarget}: any) => { setDropdown(currentTarget); @@ -78,7 +82,6 @@ function TableCard({title, linkText, linkURL, noRowsFoundHTML, data, dropdownOpt setDropdown(null); setDropdownValue(currentTarget.innerText || dropdownValue); setDropdownIcon(openArrowIcon); - alert(widgetIndex); dropdownOnChange(currentTarget.innerText || dropdownValue, widgetIndex); }; @@ -114,7 +117,7 @@ function TableCard({title, linkText, linkURL, noRowsFoundHTML, data, dropdownOpt }, [dropdownOptions]); return ( - + @@ -159,7 +162,7 @@ function TableCard({title, linkText, linkURL, noRowsFoundHTML, data, dropdownOpt { - data && data.rows && data.rows.length > 0 ? ( + data && data.columns && !noRowsFoundHTML ? ( - ) : data && data.rows && data.rows.length == 0 ? ( + ) : noRowsFoundHTML ? (