Fix WebSocket authentication and duplicate filters
- 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:
@@ -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}>
|
||||
|
||||
Reference in New Issue
Block a user