Fix WebSocket authentication and duplicate filters
Some checks failed
CI/CD Pipeline / Lint and Test (push) Has been cancelled
CI/CD Pipeline / E2E Tests (push) Has been cancelled
CI/CD Pipeline / Build Application (push) Has been cancelled

- Remove mock authentication from authSlice to enable real user login
- Fix WebSocket connection errors by using real JWT tokens
- Consolidate duplicate filters on insights page into single shared filter
- Update InsightsDashboard to accept props instead of managing own state
- Add MUI Grid styling for 20% min-width and centering
- Improve UX with unified filter controls for both insights and predictions
This commit is contained in:
2025-10-05 18:13:27 +00:00
parent d0b78181a3
commit 010c30637b
4 changed files with 53 additions and 120 deletions

View File

@@ -187,9 +187,9 @@ export function UnifiedInsightsDashboard() {
</Alert>
)}
{/* Child Selector */}
{children.length > 1 && (
<Box sx={{ mb: 3 }}>
{/* Shared Filters */}
<Box sx={{ mb: 3, display: 'flex', gap: 2, flexWrap: 'wrap', alignItems: 'center' }}>
{children.length > 1 && (
<FormControl sx={{ minWidth: 200 }}>
<InputLabel>Child</InputLabel>
<Select
@@ -204,8 +204,20 @@ export function UnifiedInsightsDashboard() {
))}
</Select>
</FormControl>
</Box>
)}
)}
<FormControl sx={{ minWidth: 150 }}>
<InputLabel>Time Period</InputLabel>
<Select
value={days}
label="Time Period"
onChange={(e) => setDays(Number(e.target.value))}
>
<MenuItem value={7}>Last 7 days</MenuItem>
<MenuItem value={30}>Last 30 days</MenuItem>
<MenuItem value={90}>Last 3 months</MenuItem>
</Select>
</FormControl>
</Box>
{/* Growth Spurt Alert */}
{insights?.growthSpurt && <GrowthSpurtAlert growthSpurt={insights.growthSpurt} />}
@@ -221,7 +233,7 @@ export function UnifiedInsightsDashboard() {
{/* Tab Panels */}
<TabPanel value={tabValue} index={0}>
{/* Insights tab shows the existing InsightsDashboard */}
<InsightsDashboard />
<InsightsDashboard selectedChildId={selectedChildId} days={days} />
</TabPanel>
<TabPanel value={tabValue} index={1}>