Skip to content

Commit 53b1c17

Browse files
committed
Fix ESLint warnings and backend deployment issues
1 parent edb4a8b commit 53b1c17

71 files changed

Lines changed: 1263 additions & 285 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

frontend/package-lock.json

Lines changed: 53 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"dependencies": {
88
"@emotion/react": "^11.14.0",
99
"@emotion/styled": "^11.14.0",
10+
"@hello-pangea/dnd": "^18.0.1",
1011
"@mui/icons-material": "^5.15.6",
1112
"@mui/lab": "^5.0.0-alpha.165",
1213
"@mui/material": "^5.17.1",

frontend/src/api/templates/upload-base/route.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const BUCKET = process.env.REACT_APP_SUPABASE_STORAGE_BUCKET || 'smartprobono-pd
77
export async function POST(req) {
88
try {
99
// Check authentication
10-
const user = await getUserOrThrow();
10+
await getUserOrThrow();
1111

1212
const form = await req.formData();
1313
const file = form.get('file');

frontend/src/components/AIEnhancedChat.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import {
55
IconButton,
66
Avatar,
77
Typography,
8-
Paper,
98
Divider,
10-
Alert,
119
Chip,
1210
Button,
1311
Dialog,

frontend/src/components/AuditDashboard.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState, useEffect } from 'react';
1+
import React, { useState, useEffect, useCallback } from 'react';
22
import {
33
Card,
44
CardContent,
@@ -47,7 +47,7 @@ import {
4747
const AuditDashboard = () => {
4848
const [auditLogs, setAuditLogs] = useState([]);
4949
const [securityEvents, setSecurityEvents] = useState([]);
50-
const [userActivities, setUserActivities] = useState([]);
50+
5151
const [dashboardStats, setDashboardStats] = useState(null);
5252
const [loading, setLoading] = useState(false);
5353
const [filters, setFilters] = useState({
@@ -81,7 +81,7 @@ const AuditDashboard = () => {
8181
};
8282

8383
// Fetch audit logs
84-
const fetchAuditLogs = async () => {
84+
const fetchAuditLogs = useCallback(async () => {
8585
setLoading(true);
8686
try {
8787
const params = new URLSearchParams();
@@ -115,10 +115,10 @@ const AuditDashboard = () => {
115115
} finally {
116116
setLoading(false);
117117
}
118-
};
118+
}, [filters, toast]);
119119

120120
// Fetch security events
121-
const fetchSecurityEvents = async () => {
121+
const fetchSecurityEvents = useCallback(async () => {
122122
try {
123123
const params = new URLSearchParams();
124124
if (filters.severity) params.append('severity', filters.severity);
@@ -139,7 +139,7 @@ const AuditDashboard = () => {
139139
} catch (error) {
140140
console.error('Error fetching security events:', error);
141141
}
142-
};
142+
}, [filters]);
143143

144144
// Export audit logs
145145
const exportAuditLogs = async () => {
@@ -201,7 +201,7 @@ const AuditDashboard = () => {
201201
} else if (selectedTab === 'security') {
202202
fetchSecurityEvents();
203203
}
204-
}, [selectedTab, filters]);
204+
}, [selectedTab, filters, fetchAuditLogs, fetchSecurityEvents]);
205205

206206
const getSeverityColor = (severity) => {
207207
switch (severity) {

frontend/src/components/Chat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const Chat = () => {
1515
const [messages, setMessages] = useState([]);
1616
const [input, setInput] = useState('');
1717
const [isLoading, setIsLoading] = useState(false);
18-
const [currentModel, setCurrentModel] = useState('');
18+
const [, setCurrentModel] = useState('');
1919
const messagesEndRef = useRef(null);
2020

2121
const scrollToBottom = () => {

frontend/src/components/ContractTemplates.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import { useState } from 'react';
22
import {
33
Grid, Card, CardContent, Typography, Button,
4-
Dialog, TextField, Tab, Tabs, Box, IconButton,
5-
InputAdornment, CircularProgress, Alert
4+
TextField, Tab, Tabs, Box,
5+
InputAdornment
66
} from '@mui/material';
77
import SearchIcon from '@mui/icons-material/Search';
88
import FileDownloadIcon from '@mui/icons-material/FileDownload';
9-
import PictureAsPdfIcon from '@mui/icons-material/PictureAsPdf';
9+
1010
import ContractForm from './ContractForm';
11-
import axios from 'axios';
1211
import config from '../config';
1312

1413
const ContractTemplates = () => {
@@ -18,7 +17,7 @@ const ContractTemplates = () => {
1817
const [selectedTemplate, setSelectedTemplate] = useState(null);
1918
const [formData, setFormData] = useState({});
2019
const [loading, setLoading] = useState(false);
21-
const [error, setError] = useState(null);
20+
const [, setError] = useState(null);
2221

2322
const categories = [
2423
"All",
@@ -148,12 +147,7 @@ const ContractTemplates = () => {
148147
}
149148
};
150149

151-
const handleFormChange = (e) => {
152-
setFormData({
153-
...formData,
154-
[e.target.name]: e.target.value
155-
});
156-
};
150+
157151

158152
return (
159153
<Box>

frontend/src/components/DigitalSignature.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { PDFDocument } from 'pdf-lib';
66
const DigitalSignature = ({ pdfUrl, onSignComplete }) => {
77
const [open, setOpen] = useState(false);
88
const sigPad = useRef(null);
9-
const [signatureData, setSignatureData] = useState(null);
9+
const [, setSignatureData] = useState(null);
1010

1111
const handleOpen = () => setOpen(true);
1212
const handleClose = () => setOpen(false);

frontend/src/components/DocumentChat.js

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ import {
77
Button,
88
CircularProgress,
99
Avatar,
10-
Chip,
1110
useTheme,
12-
Fade,
1311
Zoom,
1412
Divider,
1513
Alert
@@ -93,23 +91,7 @@ const DocumentChat = ({ documentId, documentTitle }) => {
9391
return timestamp.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
9492
};
9593

96-
const getMessageVariant = (type) => {
97-
switch (type) {
98-
case 'user': return 'contained';
99-
case 'ai': return 'outlined';
100-
case 'error': return 'outlined';
101-
default: return 'outlined';
102-
}
103-
};
10494

105-
const getMessageColor = (type) => {
106-
switch (type) {
107-
case 'user': return 'primary';
108-
case 'ai': return 'success';
109-
case 'error': return 'error';
110-
default: return 'default';
111-
}
112-
};
11395

11496
return (
11597
<motion.div

frontend/src/components/DocumentChecklist.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
import {
1919
CheckCircle as CheckCircleIcon,
2020
RadioButtonUnchecked as UncheckedIcon,
21-
Description as DocumentIcon,
21+
2222
Download as DownloadIcon,
2323
Print as PrintIcon
2424
} from '@mui/icons-material';

0 commit comments

Comments
 (0)