Fix ESLint errors for successful deployment
- Fixed mixed operators in contentExtractor.js with proper parentheses - Removed unused variables and imports across all components - Fixed useCallback dependencies in ObjectEditor.js - Corrected == to === comparisons in TableEditor.js - Fixed undefined variable references - Wrapped serializeToPhp in useCallback to resolve dependency warning - Updated table column width styling from min-w to w for consistent layout Build now passes successfully with only non-blocking warnings remaining.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { useState, useEffect } from "react";
|
||||
import React, { useState } from "react";
|
||||
import {
|
||||
Table,
|
||||
Database,
|
||||
@@ -7,13 +7,10 @@ import {
|
||||
FileText,
|
||||
Search,
|
||||
Plus,
|
||||
Minus,
|
||||
X,
|
||||
Edit,
|
||||
Braces,
|
||||
Code,
|
||||
Eye,
|
||||
Columns,
|
||||
Trash2,
|
||||
ArrowUpDown,
|
||||
Edit3,
|
||||
@@ -51,7 +48,6 @@ const TableEditor = () => {
|
||||
const [availableTables, setAvailableTables] = useState([]); // List of discovered table names
|
||||
const [currentTable, setCurrentTable] = useState(""); // Currently active table name
|
||||
const [originalFileName, setOriginalFileName] = useState(""); // For export naming
|
||||
const [editingTableName, setEditingTableName] = useState(false); // For single table name editing
|
||||
const [isTableFullscreen, setIsTableFullscreen] = useState(false); // For fullscreen table view
|
||||
const [frozenColumns, setFrozenColumns] = useState(0); // Number of columns to freeze on horizontal scroll
|
||||
const [showClearConfirmModal, setShowClearConfirmModal] = useState(false); // For clear confirmation modal
|
||||
@@ -174,10 +170,10 @@ const TableEditor = () => {
|
||||
const expected = expectedSampleData[index];
|
||||
return (
|
||||
expected &&
|
||||
row.col_0 == expected.id &&
|
||||
row.col_0 === expected.id &&
|
||||
row.col_1 === expected.name &&
|
||||
row.col_2 === expected.email &&
|
||||
row.col_3 == expected.age &&
|
||||
row.col_3 === expected.age &&
|
||||
row.col_4 === expected.city
|
||||
);
|
||||
});
|
||||
@@ -646,7 +642,6 @@ const TableEditor = () => {
|
||||
|
||||
// Open Object Editor modal for structured data
|
||||
const openObjectEditor = (rowId, columnId, value, format) => {
|
||||
const row = data.find((r) => r.id === rowId);
|
||||
const column = columns.find((c) => c.id === columnId);
|
||||
|
||||
// Value should already be properly unescaped by the SQL parser
|
||||
@@ -793,7 +788,6 @@ const TableEditor = () => {
|
||||
);
|
||||
}
|
||||
|
||||
const tableName = tableMatch[1];
|
||||
const columnsPart = tableMatch[2];
|
||||
|
||||
// Parse column names
|
||||
@@ -1619,7 +1613,7 @@ const TableEditor = () => {
|
||||
}
|
||||
|
||||
// Phone detection (basic)
|
||||
if (/^[\+\d\s\-\(\)]{10,}$/.test(strVal)) {
|
||||
if (/^[+\d\s\-()]{10,}$/.test(strVal)) {
|
||||
hasPhone = true;
|
||||
}
|
||||
});
|
||||
@@ -1835,7 +1829,6 @@ const TableEditor = () => {
|
||||
setAvailableTables([]);
|
||||
setCurrentTable("");
|
||||
setOriginalFileName("");
|
||||
setEditingTableName(false);
|
||||
setFrozenColumns(0);
|
||||
|
||||
// Close modal
|
||||
@@ -2141,7 +2134,7 @@ const TableEditor = () => {
|
||||
<h3 className="text-lg font-semibold text-gray-900 dark:text-white flex items-center gap-2">
|
||||
{availableTables.length > 1 ? "Multi-Table Database" : "Table Editor"}
|
||||
</h3>
|
||||
{availableTables.length == 1 && (
|
||||
{availableTables.length === 1 && (
|
||||
<p className="text-sm text-gray-600 dark:text-gray-400">
|
||||
{data.length} rows, {columns.length} columns
|
||||
</p>
|
||||
@@ -2398,7 +2391,7 @@ const TableEditor = () => {
|
||||
})}
|
||||
|
||||
{/* System Column - Add Column */}
|
||||
<th className="px-4 py-3 text-center border-l-2 border-dashed border-gray-300 dark:border-gray-600 hover:bg-blue-50 dark:hover:bg-blue-900/20 min-w-[60px]">
|
||||
<th className="px-4 py-3 text-center border-l-2 border-dashed border-gray-300 dark:border-gray-600 hover:bg-blue-50 dark:hover:bg-blue-900/20 w-[60px]">
|
||||
<button
|
||||
onClick={addColumn}
|
||||
className="flex items-center justify-center text-gray-500 hover:text-blue-600 p-2 rounded-lg transition-colors group"
|
||||
@@ -2576,7 +2569,7 @@ const TableEditor = () => {
|
||||
})}
|
||||
|
||||
{/* Empty cell for system column alignment */}
|
||||
<td className="px-4 py-3 border-l-2 border-dashed border-gray-300 dark:border-gray-600 min-w-[60px]">
|
||||
<td className="px-4 py-3 border-l-2 border-dashed border-gray-300 dark:border-gray-600 w-[60px]">
|
||||
{/* Empty cell to align with system column header */}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user