From ed9d467c9f63b5da11a8dc0446921997bd00c214 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Tue, 17 Jun 2025 19:54:45 +0000 Subject: [PATCH] feat(client): update grid import and dependency --- .../AdvancedSearchPanel/AdvancedSearchPanel.tsx | 1 + frontend/src/components/Dashboard/Dashboard.tsx | 2 +- .../EnhancedSearchGuide/EnhancedSearchGuide.tsx | 2 +- frontend/src/pages/DocumentDetailsPage.tsx | 6 +++--- frontend/src/pages/DocumentsPage.tsx | 2 +- frontend/src/pages/FailedOcrPage.tsx | 4 ++-- frontend/src/pages/SearchPage.tsx | 17 ++++++++--------- frontend/src/pages/SettingsPage.tsx | 2 +- frontend/src/pages/SourcesPage.tsx | 2 +- frontend/src/pages/UploadPage.tsx | 2 +- frontend/src/pages/WatchFolderPage.tsx | 4 ++-- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/frontend/src/components/AdvancedSearchPanel/AdvancedSearchPanel.tsx b/frontend/src/components/AdvancedSearchPanel/AdvancedSearchPanel.tsx index 7d2608f..2792482 100644 --- a/frontend/src/components/AdvancedSearchPanel/AdvancedSearchPanel.tsx +++ b/frontend/src/components/AdvancedSearchPanel/AdvancedSearchPanel.tsx @@ -30,6 +30,7 @@ import { CardContent, Collapse, Badge, + Grid, } from '@mui/material'; import { ExpandMore as ExpandMoreIcon, diff --git a/frontend/src/components/Dashboard/Dashboard.tsx b/frontend/src/components/Dashboard/Dashboard.tsx index 419cf48..0056d90 100644 --- a/frontend/src/components/Dashboard/Dashboard.tsx +++ b/frontend/src/components/Dashboard/Dashboard.tsx @@ -1,7 +1,6 @@ import React, { useState, useEffect } from 'react'; import { Box, - Grid, Card, CardContent, Typography, @@ -19,6 +18,7 @@ import { useTheme, alpha, } from '@mui/material'; +import Grid from '@mui/material/GridLegacy'; import { CloudUpload as UploadIcon, Article as DocumentIcon, diff --git a/frontend/src/components/EnhancedSearchGuide/EnhancedSearchGuide.tsx b/frontend/src/components/EnhancedSearchGuide/EnhancedSearchGuide.tsx index 45bb3e5..1ef726d 100644 --- a/frontend/src/components/EnhancedSearchGuide/EnhancedSearchGuide.tsx +++ b/frontend/src/components/EnhancedSearchGuide/EnhancedSearchGuide.tsx @@ -7,7 +7,6 @@ import { Chip, IconButton, Collapse, - Grid, Button, Tabs, Tab, @@ -20,6 +19,7 @@ import { Divider, Alert, } from '@mui/material'; +import Grid from '@mui/material/GridLegacy'; import { ExpandMore as ExpandMoreIcon, ContentCopy as CopyIcon, diff --git a/frontend/src/pages/DocumentDetailsPage.tsx b/frontend/src/pages/DocumentDetailsPage.tsx index 48fb698..2dabd5a 100644 --- a/frontend/src/pages/DocumentDetailsPage.tsx +++ b/frontend/src/pages/DocumentDetailsPage.tsx @@ -8,7 +8,6 @@ import { Button, Chip, Stack, - Grid, Divider, IconButton, Paper, @@ -20,6 +19,7 @@ import { DialogTitle, DialogActions, } from '@mui/material'; +import Grid from '@mui/material/GridLegacy'; import { ArrowBack as BackIcon, Download as DownloadIcon, @@ -111,10 +111,10 @@ const DocumentDetailsPage: React.FC = () => { try { const response = await documentService.download(document.id); const url = window.URL.createObjectURL(new Blob([response.data])); - const link = document.createElement('a'); + const link = window.document.createElement('a'); link.href = url; link.setAttribute('download', document.original_filename); - document.body.appendChild(link); + window.document.body.appendChild(link); link.click(); link.remove(); window.URL.revokeObjectURL(url); diff --git a/frontend/src/pages/DocumentsPage.tsx b/frontend/src/pages/DocumentsPage.tsx index b23f61f..257a6f6 100644 --- a/frontend/src/pages/DocumentsPage.tsx +++ b/frontend/src/pages/DocumentsPage.tsx @@ -3,7 +3,6 @@ import { useNavigate } from 'react-router-dom'; import { Box, Typography, - Grid, Card, CardContent, CardActions, @@ -27,6 +26,7 @@ import { InputLabel, Select, } from '@mui/material'; +import Grid from '@mui/material/GridLegacy'; import { GridView as GridViewIcon, ViewList as ListViewIcon, diff --git a/frontend/src/pages/FailedOcrPage.tsx b/frontend/src/pages/FailedOcrPage.tsx index 538a5e4..6c656d2 100644 --- a/frontend/src/pages/FailedOcrPage.tsx +++ b/frontend/src/pages/FailedOcrPage.tsx @@ -4,7 +4,6 @@ import { Typography, Card, CardContent, - Grid, Button, Chip, Alert, @@ -31,6 +30,7 @@ import { Tab, useTheme, } from '@mui/material'; +import Grid from '@mui/material/GridLegacy'; import { Refresh as RefreshIcon, Error as ErrorIcon, @@ -142,7 +142,7 @@ const FailedOcrPage: React.FC = () => { const [detailsOpen, setDetailsOpen] = useState(false); const [expandedRows, setExpandedRows] = useState>(new Set()); const [expandedDuplicateGroups, setExpandedDuplicateGroups] = useState>(new Set()); - const [snackbar, setSnackbar] = useState<{ open: boolean; message: string; severity: 'success' | 'error' }>({ + const [snackbar, setSnackbar] = useState<{ open: boolean; message: string; severity: 'success' | 'error' | 'info' | 'warning' }>({ open: false, message: '', severity: 'success' diff --git a/frontend/src/pages/SearchPage.tsx b/frontend/src/pages/SearchPage.tsx index f2ba237..d7e2c9f 100644 --- a/frontend/src/pages/SearchPage.tsx +++ b/frontend/src/pages/SearchPage.tsx @@ -3,7 +3,6 @@ import { useNavigate, useSearchParams } from 'react-router-dom'; import { Box, Typography, - Grid, Card, CardContent, TextField, @@ -37,6 +36,7 @@ import { Skeleton, SelectChangeEvent, } from '@mui/material'; +import Grid from '@mui/material/GridLegacy'; import { Search as SearchIcon, FilterList as FilterIcon, @@ -295,14 +295,13 @@ const SearchPage: React.FC = () => { setSuggestions(response.data.suggestions || []); // Extract unique tags for filter options - const tags = [...new Set(results.flatMap(doc => doc.tags))]; + const tags = [...new Set(results.flatMap(doc => doc.tags || []))].filter(tag => typeof tag === 'string'); setAvailableTags(tags); // Clear progress after a brief delay setTimeout(() => setSearchProgress(0), 500); } catch (err) { - clearInterval(progressInterval); setSearchProgress(0); setError('Search failed. Please try again.'); console.error(err); @@ -382,10 +381,10 @@ const SearchPage: React.FC = () => { try { const response = await documentService.download(doc.id); const url = window.URL.createObjectURL(new Blob([response.data])); - const link = document.createElement('a'); + const link = window.document.createElement('a'); link.href = url; link.setAttribute('download', doc.original_filename); - document.body.appendChild(link); + window.document.body.appendChild(link); link.click(); link.remove(); window.URL.revokeObjectURL(url); @@ -456,7 +455,7 @@ const SearchPage: React.FC = () => { const handleSearchModeChange = (event: React.MouseEvent, newMode: SearchMode | null): void => { if (newMode) { - setSearchMode(newMode); + setAdvancedSettings(prev => ({ ...prev, searchMode: newMode })); } }; @@ -616,7 +615,7 @@ const SearchPage: React.FC = () => { size="small" variant="outlined" /> - {useEnhancedSearch && ( + {advancedSettings.useEnhancedSearch && ( } label="Enhanced" @@ -629,7 +628,7 @@ const SearchPage: React.FC = () => { {/* Simplified Search Mode Selector */} { Select Tags -