),
})
}
mutateUpdateTableRow({
projectRef: project.ref,
connectionString: project.connectionString,
table: gridTable as SupaTable,
configuration,
payload: updatedData,
enumArrayColumns,
impersonatedRole: getImpersonatedRole(),
})
}
/** [Joshen] We're going to need to refactor SupabaseGrid eventually to make the code here more readable
* For context we previously built the SupabaseGrid as a reusable npm component, but eventually decided
* to just integrate it directly into the dashboard. The header, and body (+footer) should be decoupled.
*/
return (
<>
}
onAddColumn={snap.onAddColumn}
onEditColumn={onSelectEditColumn}
onDeleteColumn={onSelectDeleteColumn}
onAddRow={snap.onAddRow}
updateTableRow={updateTableRow}
onEditRow={snap.onEditRow}
onImportData={snap.onImportData}
onError={onError}
onExpandJSONEditor={(column, row) => {
snap.onExpandJSONEditor({ column, row, value: JSON.stringify(row[column]) || '' })
}}
onExpandTextEditor={(column, row) => {
snap.onExpandTextEditor(column, row)
}}
onEditForeignKeyColumnValue={snap.onEditForeignKeyColumnValue}
showCustomChildren={(isViewSelected || isTableSelected) && selectedView === 'definition'}
customHeader={
(isViewSelected || isTableSelected) && selectedView === 'definition' ? (