From c73cf57673e1effda752c5aae853855a4d42e248 Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 22 Dec 2024 21:29:23 -0500 Subject: [PATCH 1/6] Add build to gitignore --- .gitignore | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitignore b/.gitignore index 7ceb59f..0341e09 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,12 @@ dist-ssr *.sln *.sw? .env +dashboard/build/assets/index-Bv76DabZ.js +dashboard/build/assets/index-Bv76DabZ.js.map +dashboard/build/assets/index-DOOYmQEM.css +dashboard-server/frontend/build/assets/._index-Bv76DabZ.js +dashboard-server/frontend/build/assets/._index-Bv76DabZ.js.map +dashboard-server/frontend/build/assets/._index-DOOYmQEM.css +dashboard-server/frontend/build/assets/index-Bv76DabZ.js +dashboard-server/frontend/build/assets/index-Bv76DabZ.js.map +dashboard-server/frontend/build/assets/index-DOOYmQEM.css From 3abd63b8367517cef0374077579eddb3cc0c806f Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 22 Dec 2024 21:51:36 -0500 Subject: [PATCH 2/6] Fix app mobile layout --- dashboard/src/App.jsx | 15 +++++++++------ dashboard/src/components/dashboard/EventFeed.jsx | 2 +- dashboard/src/components/dashboard/Header.jsx | 4 ++-- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/dashboard/src/App.jsx b/dashboard/src/App.jsx index 853604e..3e7c2f8 100644 --- a/dashboard/src/App.jsx +++ b/dashboard/src/App.jsx @@ -82,29 +82,32 @@ const SmallLayout = () => { const DashboardLayout = () => { return ( -
+
-
-
+
+
-
+
-
+
+ +
+
-
+
diff --git a/dashboard/src/components/dashboard/EventFeed.jsx b/dashboard/src/components/dashboard/EventFeed.jsx index 79b0a38..c0892e3 100644 --- a/dashboard/src/components/dashboard/EventFeed.jsx +++ b/dashboard/src/components/dashboard/EventFeed.jsx @@ -1387,7 +1387,7 @@ const EventFeed = ({ ); return ( - +
diff --git a/dashboard/src/components/dashboard/Header.jsx b/dashboard/src/components/dashboard/Header.jsx index ae07cc3..6a56fc9 100644 --- a/dashboard/src/components/dashboard/Header.jsx +++ b/dashboard/src/components/dashboard/Header.jsx @@ -133,7 +133,7 @@ const Header = () => { )} > -
+
{
-
+
{weather?.main && ( <>
From 6936cf84ca39aebcfb5309a6afa7296be6949190 Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 22 Dec 2024 23:42:28 -0500 Subject: [PATCH 3/6] Fix statcards layouts + related app changes --- dashboard/src/App.jsx | 10 ++--- .../src/components/dashboard/StatCards.jsx | 43 +++++++++++-------- 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/dashboard/src/App.jsx b/dashboard/src/App.jsx index 3e7c2f8..e5b8c0a 100644 --- a/dashboard/src/App.jsx +++ b/dashboard/src/App.jsx @@ -89,25 +89,25 @@ const DashboardLayout = () => {
-
+
-
+
-
+
-
+
-
+
diff --git a/dashboard/src/components/dashboard/StatCards.jsx b/dashboard/src/components/dashboard/StatCards.jsx index fbb6345..7bd8170 100644 --- a/dashboard/src/components/dashboard/StatCards.jsx +++ b/dashboard/src/components/dashboard/StatCards.jsx @@ -69,6 +69,7 @@ import { import { Skeleton } from "@/components/ui/skeleton"; import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"; import { Button } from "@/components/ui/button"; +import { Progress } from "@/components/ui/progress"; const formatCurrency = (value, minimumFractionDigits = 0) => { if (!value || isNaN(value)) return "$0"; @@ -939,7 +940,8 @@ const StatCard = ({ onClick, info, onDetailsClick, - isLoading = false + isLoading = false, + progress }) => ( ) : ( - <> -
- {valuePrefix}{value}{valueSuffix} -
- {description && ( -
- {description} - {trend && ( - - {trend === 'up' ? : } - {trendPrefix}{trendValue}{trendSuffix} - - )} +
+
+
+ {valuePrefix}{value}{valueSuffix}
- )} - + {description && ( +
+ {description} + {trend && ( + + {trend === 'up' ? : } + {trendPrefix}{trendValue}{trendSuffix} + + )} +
+ )} +
+ +
)} @@ -1229,6 +1234,7 @@ const StatCards = ({ setDetailDataLoading(prev => ({ ...prev, [metric]: false })); } }, [timeRange, startDate, endDate, shouldUseLast30Days, setCacheData, getCacheData]); + // Corrected preloadDetailData function const preloadDetailData = useCallback(() => { const metrics = [ @@ -1595,15 +1601,16 @@ const StatCards = ({
-
+
Proj: Projected: {formatCurrency(stats.projectedRevenue)} : `Previous: ${formatCurrency(stats.prevPeriodRevenue)}` } + progress={stats?.periodProgress < 100 ? stats.periodProgress : undefined} trend={revenueTrend?.trend} trendValue={revenueTrend?.value ? formatPercentage(revenueTrend.value) : null} colorClass="text-green-600 dark:text-green-400" From 86c2c101876b8923f90ab292c430bfe68840da57 Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 22 Dec 2024 23:52:10 -0500 Subject: [PATCH 4/6] Event feed tweaks --- dashboard/src/components/dashboard/EventFeed.jsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dashboard/src/components/dashboard/EventFeed.jsx b/dashboard/src/components/dashboard/EventFeed.jsx index c0892e3..8cc8f2b 100644 --- a/dashboard/src/components/dashboard/EventFeed.jsx +++ b/dashboard/src/components/dashboard/EventFeed.jsx @@ -1121,8 +1121,7 @@ const EventCard = ({ event }) => { const DEFAULT_METRICS = Object.values(METRIC_IDS); const EventFeed = ({ - title = "Live Event Feed", - description = "Real-time event stream", + title = "Event Feed", selectedMetrics = DEFAULT_METRICS, }) => { const metrics = useMemo(() => selectedMetrics, [selectedMetrics]); @@ -1622,7 +1621,7 @@ const EventFeed = ({ )} - + {loading && !events.length ? ( From 8f047a6d1810553d61b30cb540bebf48f533509f Mon Sep 17 00:00:00 2001 From: Matt Date: Mon, 23 Dec 2024 00:15:40 -0500 Subject: [PATCH 5/6] Product grid tweaks --- dashboard/src/App.jsx | 2 +- .../src/components/dashboard/ProductGrid.jsx | 115 +++++++++++------- 2 files changed, 72 insertions(+), 45 deletions(-) diff --git a/dashboard/src/App.jsx b/dashboard/src/App.jsx index e5b8c0a..9834078 100644 --- a/dashboard/src/App.jsx +++ b/dashboard/src/App.jsx @@ -104,7 +104,7 @@ const DashboardLayout = () => {
-
+
diff --git a/dashboard/src/components/dashboard/ProductGrid.jsx b/dashboard/src/components/dashboard/ProductGrid.jsx index b746bab..39f2946 100644 --- a/dashboard/src/components/dashboard/ProductGrid.jsx +++ b/dashboard/src/components/dashboard/ProductGrid.jsx @@ -2,7 +2,7 @@ import React, { useState, useEffect } from "react"; import axios from "axios"; import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card"; import { ScrollArea } from "@/components/ui/scroll-area"; -import { Loader2, ArrowUpDown, AlertCircle, Package, Settings2, Search } from "lucide-react"; +import { Loader2, ArrowUpDown, AlertCircle, Package, Settings2, Search, X } from "lucide-react"; import { Table, TableBody, @@ -46,6 +46,7 @@ const ProductGrid = ({ direction: "desc", }); const [searchQuery, setSearchQuery] = useState(""); + const [isSearchVisible, setIsSearchVisible] = useState(false); useEffect(() => { fetchProducts(); @@ -163,41 +164,67 @@ const ProductGrid = ({ return ( -
-
- {title} - {description && ( - {description} - )} -
-
- {!error && ( -
- - setSearchQuery(e.target.value)} - className="pl-8 h-9 w-[200px]" - /> -
- )} - +
+
+
+ {title} + {description && ( + {description} + )} +
+
+ {!error && ( + + )} + +
+ {isSearchVisible && !error && ( +
+ + setSearchQuery(e.target.value)} + className="pl-9 pr-9 h-9 w-full" + autoFocus + /> + {searchQuery && ( + + )} +
+ )}
@@ -225,39 +252,39 @@ const ProductGrid = ({ - - - -
- + + + + + From 3e2c76e8a0bf89c9676864ed36ba008349e79176 Mon Sep 17 00:00:00 2001 From: Matt Date: Mon, 23 Dec 2024 00:30:07 -0500 Subject: [PATCH 6/6] Sales chart tweaks --- .../src/components/dashboard/SalesChart.jsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dashboard/src/components/dashboard/SalesChart.jsx b/dashboard/src/components/dashboard/SalesChart.jsx index ac7cc0f..ef85319 100644 --- a/dashboard/src/components/dashboard/SalesChart.jsx +++ b/dashboard/src/components/dashboard/SalesChart.jsx @@ -449,7 +449,7 @@ const SummaryStats = memo(({ stats = {} }) => { } = stats; return ( -
+
( const SalesChart = ({ timeRange = "last30days", title = "Sales Overview", - description = "Track your sales performance over time", }) => { const [data, setData] = useState([]); const [loading, setLoading] = useState(true); @@ -684,12 +683,12 @@ const SalesChart = ({ {title}
-
+
{!error && ( @@ -759,7 +758,7 @@ const SalesChart = ({ })) } > - Compare Prev Period + Compare Prev
@@ -875,7 +874,7 @@ const SalesChart = ({ {/* Show metric toggles only if not in error state */} {!error && ( -
+
- + +