From 95028cb42c7d1a5cf3795b48973b374ea90d2840 Mon Sep 17 00:00:00 2001 From: JP Date: Sat, 16 Jul 2022 09:31:55 -0700 Subject: [PATCH 1/3] added new col fk set --- client/components/DBDisplay/Table.tsx | 52 +++++++++++++++++++-------- client/permissiveFn.js | 13 ++++--- 2 files changed, 46 insertions(+), 19 deletions(-) diff --git a/client/components/DBDisplay/Table.tsx b/client/components/DBDisplay/Table.tsx index e3267c27..e3b235e6 100644 --- a/client/components/DBDisplay/Table.tsx +++ b/client/components/DBDisplay/Table.tsx @@ -49,6 +49,7 @@ import MenuItem from "@mui/material/MenuItem"; import FormControl from "@mui/material/FormControl"; import Select, { SelectChangeEvent } from "@mui/material/Select"; import { getModeForFileReference } from "typescript"; +import { NetworkLockedTwoTone } from "@mui/icons-material"; interface TableProps { tableInfo: { @@ -145,7 +146,7 @@ export default function Table({ const [rowModesModel, setRowModesModel] = useState({}); const [fkReference, setfkReference] = useState({PrimaryKeyTableName: '', 'PrimaryKeyName' :'', 'ReferencesPropertyName':'', 'ReferencesTableName':'', 'isDestination': false, 'constrainName': '', type: ''}); const [opens, setOpens] = useState(false); - const [formDialogEditRow, setFormDialogEditRow] = useState({row: {column: ''}}); + const [formDialogEditRow, setFormDialogEditRow] = useState({row: {column: '', type: ''}}); const [formDialogEditCol, setFormDialogEditCol] = useState(''); function logicCheck(newRow: GridRowModel, oldRow: GridRowModel[]): string { @@ -182,15 +183,14 @@ export default function Table({ return "assignRef"; - } else - { - if (fkReference.type == 'remove') + } else if (fkReference.type == 'remove' && newRow.isNew == false) { newRow.references = fkReference; } - + else + { + newRow.references = {type:''}; } - return ""; } @@ -341,7 +341,7 @@ export default function Table({ return; } - + console.log('datastore.queryList ----->Before Store Update'); DataStore.queryList.push(...queryResult); DataStore.setQuery(DataStore.queryList.slice()); console.log("this is stored Queries", DataStore.queries); @@ -359,6 +359,7 @@ export default function Table({ { console.log('removed -------------------->') let arrayCopy = []; + console.log('\n\n--newRow --> ', newRow, '<-- newRow\n\n'); for (let i = 0; i < newRow.reference.length; i++) { // remove IsDestinations set to false.... if (newRow.reference[i].IsDestination == true) @@ -392,6 +393,16 @@ export default function Table({ headerName: "Column", width: 75, editable: true, + + valueParser: (value: string, row:GridRowModel) => { + //console.log('id:------->', id); + //setfkReference({PrimaryKeyTableName: ' ', 'PrimaryKeyName' :' ', + console.log('valueParser - Column Name', value); + let copy = formDialogEditRow; + copy.row.column = value; + setFormDialogEditRow(copy); + return value; + } }, { field: "type", @@ -415,6 +426,16 @@ export default function Table({ "timestamp", "varchar(255)", ], + valueParser: (value: string, row:GridRowModel) => { + //console.log('id:------->', id); + //setfkReference({PrimaryKeyTableName: ' ', 'PrimaryKeyName' :' ', + console.log('valueParser - type', value); + let copy = formDialogEditRow; + copy.row.type = value; + setFormDialogEditRow(copy); + return value; + } + }, { field: "constraint", @@ -442,12 +463,10 @@ export default function Table({ valueParser: (value: string, row:GridRowModel) => { //console.log('id:------->', id); setfkReference({PrimaryKeyTableName: ' ', 'PrimaryKeyName' :' ', 'ReferencesPropertyName':row.column, 'ReferencesTableName':tablename, 'isDestination': false, 'constrainName': '', type: ''}); - setFormDialogEditRow(row); + //setFormDialogEditRow(row); if (value =="true") { - - //console.log('row ----------->') - //console.log(row); + setOpens(true); } else { console.log('setfkReference toggled to remove'); @@ -642,7 +661,8 @@ export default function Table({ }}} */ processRowUpdate={processRowUpdate} - onProcessRowUpdateError={(error) => console.log("logic failed")} + onProcessRowUpdateError={(error) => {console.log("logic failed"); + console.log(error)}} components={{ Toolbar: EditToolbar, }} @@ -672,7 +692,7 @@ function EditToolbar(props: EditToolbarProps) { //console.log(id); setRows((oldRows) => [ ...oldRows, - { id, column: "", type: "", constraint: "", pk: "", fk: "", isNew: true }, + { id, column: "", type: "", constraint: "", pk: "", fk: "", reference: [], isNew: true }, ]); setRowModesModel((oldModel) => ({ ...oldModel, @@ -739,9 +759,11 @@ interface FormDialogProps { function FormDialog({setRowModesModel, setRows, opens, setOpens, setFormDialogEditRow,setFormDialogEditCol, formDialogEditCol, formDialogEditRow, rows, fetchedData, fkReference, tablename, setfkReference}: FormDialogProps) { + console.log('FormDialog rows data'); + console.log(rows); let temp:(JSX.Element | undefined)[] = []; -let references = {column_name:"", references:{}}; +let references = {column_name:"", references:{type:''}}; const [columnList, setcolumnList] = useState<(JSX.Element| null | undefined)[]>([]); const [pkList, setpkList] = useState(''); const [msg, setMsg] = useState(''); @@ -847,7 +869,7 @@ setOpens(false); label="FK Column Name" variant="outlined" defaultValue={ - formDialogEditRow == undefined ? "" : formDialogEditRow.row.column + formDialogEditRow == undefined ? "" : formDialogEditRow.row.column } contentEditable={false} inputProps={{ readOnly: true }} diff --git a/client/permissiveFn.js b/client/permissiveFn.js index 21983b34..5104177b 100644 --- a/client/permissiveFn.js +++ b/client/permissiveFn.js @@ -114,7 +114,7 @@ export default function permissiveColumnCheck( const err = {}; //error response handler //check Col Name Change Before vs. After - + console.log('col After Change.isNew Check') if (ColAfterChange.isNew) { const UQueryNewCol = "ALTER TABLE " + @@ -126,6 +126,7 @@ export default function permissiveColumnCheck( ";"; querySet.push({ type: "single", query: UQueryNewCol }); } else if (ColAfterChange.column !== ColBeforeChange.column) { + //trim column name for whitespaces ColAfterChange.column = ColAfterChange.column.trim(); @@ -197,7 +198,7 @@ export default function permissiveColumnCheck( console.log(querySet); } - + console.log('type comparasion check datatype!!') if (ColAfterChange.type !== ColBeforeChange.type && !ColAfterChange.isNew) { const typeQuery = "ALTER TABLE " + @@ -210,7 +211,7 @@ export default function permissiveColumnCheck( } - console.log("after the column is done", querySet); + console.log("after the column is done-- in permissive", querySet); //check constraint col for changes. This should be an obj of objs, so we will code both //type for now if (typeof ColAfterChange.constraint == "string") { @@ -301,7 +302,7 @@ export default function permissiveColumnCheck( } } } - +console.log('pk check'); //BeforeChange is boolean, AfterChange is string if (ColAfterChange.pk !== ColBeforeChange.pk.toString()) { // check if another pk exist in table @@ -346,7 +347,9 @@ export default function permissiveColumnCheck( querySet.push({ type: "single", query: queryPrimary }); } else if (ColAfterChange.pk === "false" && ColBeforeChange.pk === true) { + console.log('pk loop length') for (let i = 0; i < ColBeforeChange.reference.length; i++) { + console.log('pk in loop length'); if (ColBeforeChange.reference[i].IsDestination == true) { return [ { @@ -455,7 +458,9 @@ export function permissiveTableCheck( } //check if table name is already existing + console.log('Table check Before CHange length') for (let i = 0; i < Object.keys(TableBeforeChange).length; i++) { + console.log('table check in length ') const name = Object.keys(TableBeforeChange)[i]; if ("public." + tableName === name) { return [ From f50c27be564134abba22010b9d45d8548b720eec Mon Sep 17 00:00:00 2001 From: JP Date: Mon, 18 Jul 2022 11:01:16 -0700 Subject: [PATCH 2/3] added formating --- client/components/DBDisplay/Table.tsx | 239 +++++++++++++------------- client/permissiveFn.js | 12 +- 2 files changed, 126 insertions(+), 125 deletions(-) diff --git a/client/components/DBDisplay/Table.tsx b/client/components/DBDisplay/Table.tsx index e3b235e6..7c13d1b4 100644 --- a/client/components/DBDisplay/Table.tsx +++ b/client/components/DBDisplay/Table.tsx @@ -86,8 +86,7 @@ export default function Table({ setFetchedData, fetchedData, }: TableProps) { - // console.log("this is tableinfo from table: ", tableInfo); - // const { Name, Properties } = tableInfo; + // const [activeDrags, setActiveDrags] = useState(0); const [deltaPosition, setDeltaPosition] = useState({ @@ -141,8 +140,7 @@ export default function Table({ // let rows: GridRowsProp = rowArr; const [rows, setRows] = useState(rowArr); - // console.log(rows); - // rowModesModel is current table state. + const [rowModesModel, setRowModesModel] = useState({}); const [fkReference, setfkReference] = useState({PrimaryKeyTableName: '', 'PrimaryKeyName' :'', 'ReferencesPropertyName':'', 'ReferencesTableName':'', 'isDestination': false, 'constrainName': '', type: ''}); const [opens, setOpens] = useState(false); @@ -170,8 +168,7 @@ export default function Table({ if (newRow.fk === "true") { - //console.log('fk reference in logic check') - //console.log(fkReference) + if (fkReference.type == 'add') { @@ -215,7 +212,7 @@ export default function Table({ const modes: any = Object.values(rowModesModel); if (modes.length > 0) { for (let i = 0; i < modes.length; i++) { - //console.log(modes); + if (modes[i].mode === "edit") { setRowModesModel({ ...rowModesModel, @@ -234,15 +231,13 @@ export default function Table({ const currentRowEditting = ""; const handleSaveClick = (id: GridRowId, getValue: (id: GridRowId, field: string) => any) => () => { - // console.log("this is rows: ", rows); - // console.log("this is rowModesModel", rowModesModel); - // console.log("this is getValue", getValue(id, "column")); + setRowModesModel({ ...rowModesModel, [id]: { mode: GridRowModes.View } }); - // console.log("this is getValue", getValue(id, "column")); + }; const handleDeleteClick = (id: GridRowId) => () => { - updatedRowsToTable(rows.filter((row) => row.id !== id)); + updatedRowsToTable(rows.filter((row) => row.id !== id), null); setRows(rows.filter((row) => row.id !== id)); }; @@ -291,14 +286,7 @@ export default function Table({ }); return; } -/* - else if (logicCheck(newRow, rows) === "assignRef") { - //setRefOpened(true); - // if (fkReference.) - } - */ - // console.log("permissiveColumnCheck runnning"); - //iterate through the beforeChange table. + let ColBeforeChange; for (let i = 0; i < rows.length; i++) { if (rows[i].id === newRow.id) { @@ -306,23 +294,7 @@ export default function Table({ } } - console.log("ColBeforechange:---> ", ColBeforeChange); - console.log("ColeAfterChange:---> ", newRow); - // console.log("tablename: ", tablename); - //console.log( - // "tableBeforechange: ", - // DataStore.getData(DataStore.store.size - 1) - //); - // console.log( - // "this is Query", - // permissiveColumnCheck( - // ColBeforeChange, - // newRow, - // tablename, - // DataStore.store.get(DataStore.store.size - 1) - // ) - // ); - + const queryResult = permissiveColumnCheck( ColBeforeChange, newRow, @@ -341,46 +313,44 @@ export default function Table({ return; } - console.log('datastore.queryList ----->Before Store Update'); + //console.log('datastore.queryList ----->Before Store Update'); DataStore.queryList.push(...queryResult); DataStore.setQuery(DataStore.queryList.slice()); - console.log("this is stored Queries", DataStore.queries); - + //console.log("this is stored Queries", DataStore.queries); + let copyRef = null; if (newRow.references.type == 'add') { newRow.fk = true; - let copyRef = {PrimaryKeyTableName: newRow.references.PrimaryKeyTableName, 'PrimaryKeyName' :newRow.references.PrimaryKeyName, 'ReferencesPropertyName':newRow.references.ReferencesPropertyName, 'ReferencesTableName':newRow.references.ReferencesTableName, 'IsDestination': newRow.references.IsDestination, 'constrainName': newRow.references.constrainName} + copyRef = {PrimaryKeyTableName: newRow.references.PrimaryKeyTableName, 'PrimaryKeyName' :newRow.references.PrimaryKeyName, 'ReferencesPropertyName':newRow.column, 'ReferencesTableName':newRow.references.ReferencesTableName, 'IsDestination': newRow.references.IsDestination, 'constrainName': newRow.references.PrimaryKeyTableName + '_'+newRow.column + '_' + 'fkey'} newRow.reference.push(copyRef); - console.log('newRow after processing of add fk') - console.log(newRow); + + + } if (fkReference.type == 'remove') { - console.log('removed -------------------->') + let arrayCopy = []; - console.log('\n\n--newRow --> ', newRow, '<-- newRow\n\n'); + for (let i = 0; i < newRow.reference.length; i++) { // remove IsDestinations set to false.... if (newRow.reference[i].IsDestination == true) { - console.log('set new Reference') - console.log(newRow.reference[i]) + arrayCopy.push(newRow.reference[i]); } } newRow.fk = false; newRow.reference = arrayCopy; - //console.log('newRow after processing of delete fk') - //console.log(newRow); + } delete newRow.references; const updatedRow = { ...newRow, isNew: false }; - // console.log("this is currentRow", rows); - //console.log("this is updatedRow:", updatedRow); + updatedRowsToTable( - rows.map((row) => (row.id === newRow.id ? updatedRow : row)) + rows.map((row) => (row.id === newRow.id ? updatedRow : row)), updatedRow ); //console.log("this is updatedRow:", updatedRow); setRows(rows.map((row) => (row.id === newRow.id ? updatedRow : row))); @@ -397,7 +367,7 @@ export default function Table({ valueParser: (value: string, row:GridRowModel) => { //console.log('id:------->', id); //setfkReference({PrimaryKeyTableName: ' ', 'PrimaryKeyName' :' ', - console.log('valueParser - Column Name', value); + let copy = formDialogEditRow; copy.row.column = value; setFormDialogEditRow(copy); @@ -429,9 +399,11 @@ export default function Table({ valueParser: (value: string, row:GridRowModel) => { //console.log('id:------->', id); //setfkReference({PrimaryKeyTableName: ' ', 'PrimaryKeyName' :' ', - console.log('valueParser - type', value); + let copy = formDialogEditRow; copy.row.type = value; + + setFormDialogEditRow(copy); return value; } @@ -461,24 +433,31 @@ export default function Table({ type: "singleSelect", valueOptions: ["true", "false"], valueParser: (value: string, row:GridRowModel) => { - //console.log('id:------->', id); - setfkReference({PrimaryKeyTableName: ' ', 'PrimaryKeyName' :' ', 'ReferencesPropertyName':row.column, 'ReferencesTableName':tablename, 'isDestination': false, 'constrainName': '', type: ''}); + + let setCol = ''; + if (formDialogEditCol !== '') + setCol = formDialogEditCol; + else + setCol = row.column + + setfkReference({PrimaryKeyTableName: ' ', 'PrimaryKeyName' :' ', 'ReferencesPropertyName':setCol, 'ReferencesTableName':tablename, 'isDestination': false, 'constrainName': '', type: ''}); //setFormDialogEditRow(row); if (value =="true") { setOpens(true); } else { - console.log('setfkReference toggled to remove'); - setfkReference({ - PrimaryKeyTableName: " ", - PrimaryKeyName: " ", - ReferencesPropertyName: row.column, - ReferencesTableName: tablename, - isDestination: false, - constrainName: "", - type: "remove", - }); + + let ref = []; + for (let i = 0; i < row.row.reference.length; i++) + { + if (row.row.reference[i].IsDestination == false) + { + ref =row.row.reference[i] + } + } + ref.type = 'remove'; + setfkReference(ref); } return value; }, @@ -530,7 +509,7 @@ export default function Table({ // { field: "col6", headerName: "Ref", width: 50, editable: true }, ]; - function updatedRowsToTable(rows: RowProps[]) { + function updatedRowsToTable(rows: RowProps[], updatedRow: RowProps | null) { const dataAfterChange: any = {}; const col: any = {}; rows.forEach((obj: RowProps) => { @@ -546,22 +525,80 @@ export default function Table({ }; dataAfterChange[tablename] = col; }); + + + let newPKTable = null; + let Tables:any + + + + DataStore.setData({ ...DataStore.getData(DataStore.store.size - 1), ...dataAfterChange, }); + + + // set table update logic here.... + // access last element in map using map function set (ky, idnex) + + setFetchedData(DataStore.getData(DataStore.store.size - 1)); - // console.log("this is dataStore2:", DataStore.store); - //console.log("this is data After Change: ", dataAfterChange); + + + // Update References for PK Table + + if (fkReference.type == "add") + { + + Tables = DataStore.getData(DataStore.store.size-1); + + //find the updated fk + + Tables[fkReference.PrimaryKeyTableName][fkReference.PrimaryKeyName.split(' ')[0]].References.push({PrimaryKeyTableName: fkReference.PrimaryKeyTableName, + PrimaryKeyName: fkReference.PrimaryKeyName, + ReferencesPropertyName: updatedRow?.column + ' ' + updatedRow?.type, + ReferencesTableName: fkReference.ReferencesTableName, + IsDestination: true, + constrainName: fkReference.ReferencesTableName+ '_' + updatedRow?.column + '_' + 'fkey'}); + console.log('Tables before DataStore update for add fk') + console.log(Tables); + DataStore.setData({ + ...DataStore.getData(DataStore.store.size - 1), + ...Tables, + }); + } + if (fkReference.type == "remove" && updatedRow !== null) + { + let tempRef = []; + Tables = DataStore.getData(DataStore.store.size-1); + + let ref = Tables[fkReference.PrimaryKeyTableName][fkReference.PrimaryKeyName.split(' ')[0]].References; + + for (let i = 0; i < ref.length; i++) { + + if (ref[i].ReferencesPropertyName.split(' ')[0] !== updatedRow?.column.split(' ')[0]) { + tempRef.push(ref[i]); + } + + } + // assign the tempRef back to the pk table + Tables[fkReference.PrimaryKeyTableName][fkReference.PrimaryKeyName.split(' ')[0]].References = tempRef; + + console.log('tables just before store update for Remove fk:') + console.log(Tables); + DataStore.setData({ + ...DataStore.getData(DataStore.store.size - 1), + ...Tables, + }); + } + // accessing datastore.store.get ? + + } - // console.log("this is updated rows: ", rows); - // console.log("this is the table I am editing: ", id); - // for (let cols in tableInfo) { - // console.log(tableInfo[cols].References); - // } - // const {Name, Properties}: {Name: string; Properties: Array} = tableInfo + const updateXarrow = useXarrow(); return ( @@ -625,41 +662,7 @@ export default function Table({ rowModesModel={rowModesModel} onRowEditStart={handleRowEditStart} onRowEditStop={handleRowEditStop} - /* - onStateChange={(state:any) => { - // console.log('on state running'); - // console.log('fk button state: ', state); - if (state.editRows) - { - - for (let cols in state.editRows) - { - //console.log('editrow col', state.editRows[cols].fk.value) - // console.log('tableinfo row', tableInfo[cols].IsForeignKey ) - - let focus = null; - - if (state.focus) - if (state.focus.cell) - if (state.focus.cell.field) - focus = state.focus.cell.field; - - - let currentRow = null; - for (let i = 0; i < rows.length; i++){ - if (rows[i].column == cols) - { - currentRow = rows[i] - - } - - } - - - - - }}} */ - + processRowUpdate={processRowUpdate} onProcessRowUpdateError={(error) => {console.log("logic failed"); console.log(error)}} @@ -689,7 +692,7 @@ function EditToolbar(props: EditToolbarProps) { const handleClick = () => { const id = randomId(); - //console.log(id); + setRows((oldRows) => [ ...oldRows, { id, column: "", type: "", constraint: "", pk: "", fk: "", reference: [], isNew: true }, @@ -759,9 +762,6 @@ interface FormDialogProps { function FormDialog({setRowModesModel, setRows, opens, setOpens, setFormDialogEditRow,setFormDialogEditCol, formDialogEditCol, formDialogEditRow, rows, fetchedData, fkReference, tablename, setfkReference}: FormDialogProps) { - console.log('FormDialog rows data'); - console.log(rows); - let temp:(JSX.Element | undefined)[] = []; let references = {column_name:"", references:{type:''}}; const [columnList, setcolumnList] = useState<(JSX.Element| null | undefined)[]>([]); @@ -770,7 +770,7 @@ const [msg, setMsg] = useState(''); const [selectedCol, setselectedCol] = useState(''); const handleClose = () => { setFormDialogEditCol("false") -//console.log('formDialogEdit in handleClose', formDialogEditCol); + setOpens(false); }; @@ -782,7 +782,7 @@ let PrimaryKeyName= selectedCol + ' ' + fetchedData[pkList][selectedCol].data_ty let ReferencesPropertyName= formDialogEditRow.row.column+ ' ' + formDialogEditRow.row.type; let ReferencesTableName:(string | null) = tablename; let isDestination = false; -let constrainName = ReferencesTableName + '_' + ReferencesPropertyName + '_' + 'fkey'; +let constrainName = ReferencesTableName + '_' + formDialogEditRow.row.column + '_' + 'fkey'; let obj = {}; if (PrimaryKeyTableName == null ) alert('Must Select Primary Table Name') @@ -802,8 +802,7 @@ setOpens(false); const handleChange = (event: SelectChangeEvent) => { setpkList(event.target.value); - //console.log("Row in Edit in formDialogEdit ---->"); - //console.log(formDialogEditRow.row); + let temp = Object.keys(fetchedData[event.target.value]).map( (key, index) => { if (fetchedData[event.target.value][key].IsPrimaryKey == true) @@ -816,11 +815,13 @@ setOpens(false); ); setcolumnList(temp); - //console.log(columnList); + } const handleColChange = (event: SelectChangeEvent) => { + setselectedCol(event.target.value); + }; let listOfTables = Object.keys(fetchedData).map((key, index) => { diff --git a/client/permissiveFn.js b/client/permissiveFn.js index 5104177b..6809708e 100644 --- a/client/permissiveFn.js +++ b/client/permissiveFn.js @@ -114,7 +114,7 @@ export default function permissiveColumnCheck( const err = {}; //error response handler //check Col Name Change Before vs. After - console.log('col After Change.isNew Check') + if (ColAfterChange.isNew) { const UQueryNewCol = "ALTER TABLE " + @@ -387,7 +387,7 @@ console.log('pk check'); "_" + ColAfterChange.column + "_fkey FOREIGN KEY (" + - ColAfterChange.references.ReferencesPropertyName.split(" ")[0] + + ColAfterChange.column + ") REFERENCES " + ColAfterChange.references.PrimaryKeyTableName + "(" + @@ -403,10 +403,10 @@ console.log('pk check'); tableName.split(".")[0] + "' AND table_constraints.table_name='" + tableName.split(".")[1] + - "'AND constraint_type='FOREIGN KEY' AND key_column_usage.column_name= '" + + "' AND constraint_type='FOREIGN KEY' AND key_column_usage.column_name= '" + ColAfterChange.column + "' LOOP EXECUTE 'ALTER TABLE ' || row.table_name || ' DROP CONSTRAINT ' || row.constraint_name; END LOOP; END;$$"; - console.log(UQuery1); + querySet.push({ type: "single", query: UQuery1 }); } } @@ -423,7 +423,7 @@ export function permissiveTableCheck( //trim column name for whitespaces tableName = tableName.trim(); console.log( - "tableName: ", + "in permissive tableName: ", tableName, "TableBeforeChange: ", TableBeforeChange, @@ -458,7 +458,7 @@ export function permissiveTableCheck( } //check if table name is already existing - console.log('Table check Before CHange length') + for (let i = 0; i < Object.keys(TableBeforeChange).length; i++) { console.log('table check in length ') const name = Object.keys(TableBeforeChange)[i]; From da372fde42318a8430c1a7320a88a2ac886adc54 Mon Sep 17 00:00:00 2001 From: JP Date: Mon, 18 Jul 2022 11:18:59 -0700 Subject: [PATCH 3/3] added type to state def --- client/components/DBDisplay/Table.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/components/DBDisplay/Table.tsx b/client/components/DBDisplay/Table.tsx index 46fd3cff..5c1f3d76 100644 --- a/client/components/DBDisplay/Table.tsx +++ b/client/components/DBDisplay/Table.tsx @@ -158,7 +158,7 @@ export default function Table({ }); const [opens, setOpens] = useState(false); const [formDialogEditRow, setFormDialogEditRow] = useState({ - row: { column: '' }, + row: { column: '', type: '' }, }); const [formDialogEditCol, setFormDialogEditCol] = useState('');