Fixed an issue where paste operation in query tool data grid should skip bytea columns and put the value as NULL instead. #3199

pull/7667/head
Anil Sahoo 2024-07-09 10:33:29 +05:30 committed by GitHub
parent 760e38293c
commit 5c5b61c4db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 13 additions and 0 deletions

View File

@ -194,6 +194,8 @@ Data Editing Options
| | | |
| | * Click the *Paste with SERIAL/IDENTITY values?* if you want to paste the copied column values | |
| | in the serial/identity columns. | |
| | | |
| | Note that copied row having *Bytea* datatype cell will be pasted as *Null*. | |
+----------------------+---------------------------------------------------------------------------------------------------+----------------+
| *Delete* | Click the *Delete* icon to mark the selected rows for deletion. These marked rows get deleted | Option/Alt + |
| | | Shift + D |

View File

@ -1257,6 +1257,16 @@ export function ResultSet() {
selectedRowsSorted.sort();
insPosn = _.findIndex(rows, (r)=>rowKeyGetter(r)==selectedRowsSorted[selectedRowsSorted.length-1])+1;
}
let byteaCellSelection = columns.filter(o=>o.type=='bytea');
if (byteaCellSelection.length>0) {
_rows = _rows.map(x=>{
byteaCellSelection.forEach(r=>{
x[r.pos]=null;
return x;
});
return x;
});
}
let newRows = rsu.current.processRows(_rows, columns, fromClipboard, pasteSerials);
setRows((prev)=>[
...prev.slice(0, insPosn),

View File

@ -142,6 +142,7 @@ export function ResultSetToolbar({query,canEdit, totalRowCount}) {
});
}, []);
useEffect(()=>{
eventBus.registerListener(QUERY_TOOL_EVENTS.DATAGRID_CHANGED, (isDirty)=>{
setDisableButton('save-data', !isDirty);