feat(client): update grid import and dependency

This commit is contained in:
perf3ct 2025-06-17 19:54:45 +00:00
parent cf6ca2daed
commit ed9d467c9f
11 changed files with 22 additions and 22 deletions

View File

@ -30,6 +30,7 @@ import {
CardContent, CardContent,
Collapse, Collapse,
Badge, Badge,
Grid,
} from '@mui/material'; } from '@mui/material';
import { import {
ExpandMore as ExpandMoreIcon, ExpandMore as ExpandMoreIcon,

View File

@ -1,7 +1,6 @@
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { import {
Box, Box,
Grid,
Card, Card,
CardContent, CardContent,
Typography, Typography,
@ -19,6 +18,7 @@ import {
useTheme, useTheme,
alpha, alpha,
} from '@mui/material'; } from '@mui/material';
import Grid from '@mui/material/GridLegacy';
import { import {
CloudUpload as UploadIcon, CloudUpload as UploadIcon,
Article as DocumentIcon, Article as DocumentIcon,

View File

@ -7,7 +7,6 @@ import {
Chip, Chip,
IconButton, IconButton,
Collapse, Collapse,
Grid,
Button, Button,
Tabs, Tabs,
Tab, Tab,
@ -20,6 +19,7 @@ import {
Divider, Divider,
Alert, Alert,
} from '@mui/material'; } from '@mui/material';
import Grid from '@mui/material/GridLegacy';
import { import {
ExpandMore as ExpandMoreIcon, ExpandMore as ExpandMoreIcon,
ContentCopy as CopyIcon, ContentCopy as CopyIcon,

View File

@ -8,7 +8,6 @@ import {
Button, Button,
Chip, Chip,
Stack, Stack,
Grid,
Divider, Divider,
IconButton, IconButton,
Paper, Paper,
@ -20,6 +19,7 @@ import {
DialogTitle, DialogTitle,
DialogActions, DialogActions,
} from '@mui/material'; } from '@mui/material';
import Grid from '@mui/material/GridLegacy';
import { import {
ArrowBack as BackIcon, ArrowBack as BackIcon,
Download as DownloadIcon, Download as DownloadIcon,
@ -111,10 +111,10 @@ const DocumentDetailsPage: React.FC = () => {
try { try {
const response = await documentService.download(document.id); const response = await documentService.download(document.id);
const url = window.URL.createObjectURL(new Blob([response.data])); const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a'); const link = window.document.createElement('a');
link.href = url; link.href = url;
link.setAttribute('download', document.original_filename); link.setAttribute('download', document.original_filename);
document.body.appendChild(link); window.document.body.appendChild(link);
link.click(); link.click();
link.remove(); link.remove();
window.URL.revokeObjectURL(url); window.URL.revokeObjectURL(url);

View File

@ -3,7 +3,6 @@ import { useNavigate } from 'react-router-dom';
import { import {
Box, Box,
Typography, Typography,
Grid,
Card, Card,
CardContent, CardContent,
CardActions, CardActions,
@ -27,6 +26,7 @@ import {
InputLabel, InputLabel,
Select, Select,
} from '@mui/material'; } from '@mui/material';
import Grid from '@mui/material/GridLegacy';
import { import {
GridView as GridViewIcon, GridView as GridViewIcon,
ViewList as ListViewIcon, ViewList as ListViewIcon,

View File

@ -4,7 +4,6 @@ import {
Typography, Typography,
Card, Card,
CardContent, CardContent,
Grid,
Button, Button,
Chip, Chip,
Alert, Alert,
@ -31,6 +30,7 @@ import {
Tab, Tab,
useTheme, useTheme,
} from '@mui/material'; } from '@mui/material';
import Grid from '@mui/material/GridLegacy';
import { import {
Refresh as RefreshIcon, Refresh as RefreshIcon,
Error as ErrorIcon, Error as ErrorIcon,
@ -142,7 +142,7 @@ const FailedOcrPage: React.FC = () => {
const [detailsOpen, setDetailsOpen] = useState(false); const [detailsOpen, setDetailsOpen] = useState(false);
const [expandedRows, setExpandedRows] = useState<Set<string>>(new Set()); const [expandedRows, setExpandedRows] = useState<Set<string>>(new Set());
const [expandedDuplicateGroups, setExpandedDuplicateGroups] = useState<Set<string>>(new Set()); const [expandedDuplicateGroups, setExpandedDuplicateGroups] = useState<Set<string>>(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, open: false,
message: '', message: '',
severity: 'success' severity: 'success'

View File

@ -3,7 +3,6 @@ import { useNavigate, useSearchParams } from 'react-router-dom';
import { import {
Box, Box,
Typography, Typography,
Grid,
Card, Card,
CardContent, CardContent,
TextField, TextField,
@ -37,6 +36,7 @@ import {
Skeleton, Skeleton,
SelectChangeEvent, SelectChangeEvent,
} from '@mui/material'; } from '@mui/material';
import Grid from '@mui/material/GridLegacy';
import { import {
Search as SearchIcon, Search as SearchIcon,
FilterList as FilterIcon, FilterList as FilterIcon,
@ -295,14 +295,13 @@ const SearchPage: React.FC = () => {
setSuggestions(response.data.suggestions || []); setSuggestions(response.data.suggestions || []);
// Extract unique tags for filter options // 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); setAvailableTags(tags);
// Clear progress after a brief delay // Clear progress after a brief delay
setTimeout(() => setSearchProgress(0), 500); setTimeout(() => setSearchProgress(0), 500);
} catch (err) { } catch (err) {
clearInterval(progressInterval);
setSearchProgress(0); setSearchProgress(0);
setError('Search failed. Please try again.'); setError('Search failed. Please try again.');
console.error(err); console.error(err);
@ -382,10 +381,10 @@ const SearchPage: React.FC = () => {
try { try {
const response = await documentService.download(doc.id); const response = await documentService.download(doc.id);
const url = window.URL.createObjectURL(new Blob([response.data])); const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a'); const link = window.document.createElement('a');
link.href = url; link.href = url;
link.setAttribute('download', doc.original_filename); link.setAttribute('download', doc.original_filename);
document.body.appendChild(link); window.document.body.appendChild(link);
link.click(); link.click();
link.remove(); link.remove();
window.URL.revokeObjectURL(url); window.URL.revokeObjectURL(url);
@ -456,7 +455,7 @@ const SearchPage: React.FC = () => {
const handleSearchModeChange = (event: React.MouseEvent<HTMLElement>, newMode: SearchMode | null): void => { const handleSearchModeChange = (event: React.MouseEvent<HTMLElement>, newMode: SearchMode | null): void => {
if (newMode) { if (newMode) {
setSearchMode(newMode); setAdvancedSettings(prev => ({ ...prev, searchMode: newMode }));
} }
}; };
@ -616,7 +615,7 @@ const SearchPage: React.FC = () => {
size="small" size="small"
variant="outlined" variant="outlined"
/> />
{useEnhancedSearch && ( {advancedSettings.useEnhancedSearch && (
<Chip <Chip
icon={<SpeedIcon />} icon={<SpeedIcon />}
label="Enhanced" label="Enhanced"
@ -629,7 +628,7 @@ const SearchPage: React.FC = () => {
{/* Simplified Search Mode Selector */} {/* Simplified Search Mode Selector */}
<ToggleButtonGroup <ToggleButtonGroup
value={searchMode} value={advancedSettings.searchMode}
exclusive exclusive
onChange={handleSearchModeChange} onChange={handleSearchModeChange}
size="small" size="small"
@ -766,7 +765,7 @@ const SearchPage: React.FC = () => {
<AccordionDetails> <AccordionDetails>
<FormControl fullWidth size="small"> <FormControl fullWidth size="small">
<InputLabel>Select Tags</InputLabel> <InputLabel>Select Tags</InputLabel>
<Select <Select<string[]>
multiple multiple
value={selectedTags} value={selectedTags}
onChange={handleTagsChange} onChange={handleTagsChange}

View File

@ -26,7 +26,6 @@ import {
DialogTitle, DialogTitle,
DialogContent, DialogContent,
DialogActions, DialogActions,
Grid,
Card, Card,
CardContent, CardContent,
Divider, Divider,
@ -36,6 +35,7 @@ import {
LinearProgress, LinearProgress,
CircularProgress, CircularProgress,
} from '@mui/material'; } from '@mui/material';
import Grid from '@mui/material/GridLegacy';
import { Edit as EditIcon, Delete as DeleteIcon, Add as AddIcon, import { Edit as EditIcon, Delete as DeleteIcon, Add as AddIcon,
CloudSync as CloudSyncIcon, Folder as FolderIcon, CloudSync as CloudSyncIcon, Folder as FolderIcon,
Assessment as AssessmentIcon, PlayArrow as PlayArrowIcon, Assessment as AssessmentIcon, PlayArrow as PlayArrowIcon,

View File

@ -5,7 +5,6 @@ import {
Typography, Typography,
Paper, Paper,
Button, Button,
Grid,
Card, Card,
CardContent, CardContent,
Chip, Chip,
@ -40,6 +39,7 @@ import {
TableHead, TableHead,
TableRow, TableRow,
} from '@mui/material'; } from '@mui/material';
import Grid from '@mui/material/GridLegacy';
import { import {
Add as AddIcon, Add as AddIcon,
CloudSync as CloudSyncIcon, CloudSync as CloudSyncIcon,

View File

@ -4,7 +4,6 @@ import {
Typography, Typography,
Container, Container,
Paper, Paper,
Grid,
Card, Card,
CardContent, CardContent,
List, List,
@ -12,6 +11,7 @@ import {
ListItemIcon, ListItemIcon,
ListItemText, ListItemText,
} from '@mui/material'; } from '@mui/material';
import Grid from '@mui/material/GridLegacy';
import { import {
CloudUpload as UploadIcon, CloudUpload as UploadIcon,
AutoAwesome as AutoIcon, AutoAwesome as AutoIcon,

View File

@ -6,7 +6,6 @@ import {
Paper, Paper,
Card, Card,
CardContent, CardContent,
Grid,
Chip, Chip,
LinearProgress, LinearProgress,
Table, Table,
@ -20,6 +19,7 @@ import {
IconButton, IconButton,
CircularProgress, CircularProgress,
} from '@mui/material'; } from '@mui/material';
import Grid from '@mui/material/GridLegacy';
import { import {
Refresh as RefreshIcon, Refresh as RefreshIcon,
Folder as FolderIcon, Folder as FolderIcon,
@ -84,7 +84,7 @@ const WatchFolderPage: React.FC = () => {
const requeueFailedJobs = async (): Promise<void> => { const requeueFailedJobs = async (): Promise<void> => {
try { try {
setRequeuingFailed(true); setRequeuingFailed(true);
const response = await queueService.requeueFailedItems(); const response = await queueService.requeueFailed();
const requeued = response.data.requeued_count || 0; const requeued = response.data.requeued_count || 0;
if (requeued > 0) { if (requeued > 0) {