mirror of
https://github.com/escalante29/WealthySmart.git
synced 2026-05-19 11:08:47 +02:00
Fix analytics case() bug, add privacy mode, add prod DB sync script
All checks were successful
Deploy to VPS / deploy (push) Successful in 28s
All checks were successful
Deploy to VPS / deploy (push) Successful in 28s
Fix SQLAlchemy case() import in monthly-trend endpoint. Add data-sensitive attributes to Analytics charts and tables for privacy blur. Add scripts/sync-db.sh for one-click prod-to-local PostgreSQL sync. Remove SQLite artifacts from gitignore. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -46,9 +46,8 @@ interface DailySpending {
|
||||
}
|
||||
|
||||
const COLORS = [
|
||||
'var(--chart-1)', 'var(--chart-2)', 'var(--chart-3)', 'var(--chart-4)', 'var(--chart-5)',
|
||||
'oklch(0.7 0.15 30)', 'oklch(0.65 0.2 300)', 'oklch(0.6 0.15 150)',
|
||||
'oklch(0.75 0.12 60)', 'oklch(0.55 0.18 250)',
|
||||
'#B45309', '#16A34A', '#2563EB', '#DC2626', '#7C3AED',
|
||||
'#D97706', '#0F766E', '#DB2777', '#EA580C', '#4F46E5',
|
||||
];
|
||||
|
||||
function formatCRC(value: number) {
|
||||
@@ -132,7 +131,7 @@ export default function Analytics() {
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex flex-col items-center">
|
||||
<ChartContainer config={pieChartConfig} className="h-[260px] w-full">
|
||||
<ChartContainer data-sensitive config={pieChartConfig} className="h-[260px] w-full">
|
||||
<PieChart>
|
||||
<Pie
|
||||
data={byCategory}
|
||||
@@ -168,7 +167,7 @@ export default function Analytics() {
|
||||
style={{ background: COLORS[i % COLORS.length] }}
|
||||
/>
|
||||
<span className="text-muted-foreground truncate">{cat.category_name}</span>
|
||||
<span className="text-muted-foreground/60 ml-auto">{cat.percentage}%</span>
|
||||
<span data-sensitive className="text-muted-foreground/60 ml-auto">{cat.percentage}%</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
@@ -190,7 +189,7 @@ export default function Analytics() {
|
||||
No data
|
||||
</div>
|
||||
) : (
|
||||
<ChartContainer config={trendChartConfig} className="h-[300px] w-full">
|
||||
<ChartContainer data-sensitive config={trendChartConfig} className="h-[300px] w-full">
|
||||
<BarChart data={trend}>
|
||||
<XAxis
|
||||
dataKey="label"
|
||||
@@ -229,7 +228,7 @@ export default function Analytics() {
|
||||
No data for this period
|
||||
</div>
|
||||
) : (
|
||||
<ChartContainer config={dailyChartConfig} className="h-[240px] w-full">
|
||||
<ChartContainer data-sensitive config={dailyChartConfig} className="h-[240px] w-full">
|
||||
<LineChart data={daily}>
|
||||
<XAxis
|
||||
dataKey="date"
|
||||
@@ -287,11 +286,11 @@ export default function Analytics() {
|
||||
style={{ background: COLORS[i % COLORS.length] }}
|
||||
/>
|
||||
<span className="text-sm flex-1">{cat.category_name}</span>
|
||||
<span className="text-xs text-muted-foreground">{cat.count} txns</span>
|
||||
<span className="text-sm font-mono font-medium w-32 text-right">
|
||||
<span data-sensitive className="text-xs text-muted-foreground">{cat.count} txns</span>
|
||||
<span data-sensitive className="text-sm font-mono font-medium w-32 text-right">
|
||||
{formatCRC(cat.total)}
|
||||
</span>
|
||||
<div className="w-24 bg-muted rounded-full h-1.5">
|
||||
<div data-sensitive className="w-24 bg-muted rounded-full h-1.5">
|
||||
<div
|
||||
className="h-1.5 rounded-full"
|
||||
style={{
|
||||
|
||||
Reference in New Issue
Block a user