Ensure that when pasting rows the rows are added right below the selected rows for copying. #5921
parent
a026353df8
commit
319701dbbd
|
@ -781,6 +781,7 @@ export function ResultSet() {
|
||||||
dispatchDataChange({type: 'reset'});
|
dispatchDataChange({type: 'reset'});
|
||||||
setSelectedRows(new Set());
|
setSelectedRows(new Set());
|
||||||
setSelectedColumns(new Set());
|
setSelectedColumns(new Set());
|
||||||
|
rsu.current.resetClientPKIndex();
|
||||||
setLoaderText(gettext('Waiting for the query to complete...'));
|
setLoaderText(gettext('Waiting for the query to complete...'));
|
||||||
return await rsu.current.startExecution(
|
return await rsu.current.startExecution(
|
||||||
query, explainObject,
|
query, explainObject,
|
||||||
|
@ -1207,8 +1208,18 @@ export function ResultSet() {
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
const triggerAddRows = (_rows, fromClipboard)=>{
|
const triggerAddRows = (_rows, fromClipboard)=>{
|
||||||
|
let insPosn = 0;
|
||||||
|
if(selectedRows.size > 0) {
|
||||||
|
let selectedRowsSorted = Array.from(selectedRows);
|
||||||
|
selectedRowsSorted.sort();
|
||||||
|
insPosn = _.findIndex(rows, (r)=>rowKeyGetter(r)==selectedRowsSorted[selectedRowsSorted.length-1])+1;
|
||||||
|
}
|
||||||
let newRows = rsu.current.processRows(_rows, columns, fromClipboard);
|
let newRows = rsu.current.processRows(_rows, columns, fromClipboard);
|
||||||
setRows((prev)=>[...newRows, ...prev]);
|
setRows((prev)=>[
|
||||||
|
...prev.slice(0, insPosn),
|
||||||
|
...newRows,
|
||||||
|
...prev.slice(insPosn)
|
||||||
|
]);
|
||||||
let add = {};
|
let add = {};
|
||||||
newRows.forEach((row)=>{
|
newRows.forEach((row)=>{
|
||||||
add[rowKeyGetter(row)] = {
|
add[rowKeyGetter(row)] = {
|
||||||
|
@ -1222,7 +1233,7 @@ export function ResultSet() {
|
||||||
};
|
};
|
||||||
eventBus.registerListener(QUERY_TOOL_EVENTS.TRIGGER_ADD_ROWS, triggerAddRows);
|
eventBus.registerListener(QUERY_TOOL_EVENTS.TRIGGER_ADD_ROWS, triggerAddRows);
|
||||||
return ()=>eventBus.deregisterListener(QUERY_TOOL_EVENTS.TRIGGER_ADD_ROWS, triggerAddRows);
|
return ()=>eventBus.deregisterListener(QUERY_TOOL_EVENTS.TRIGGER_ADD_ROWS, triggerAddRows);
|
||||||
}, [columns]);
|
}, [columns, selectedRows.size]);
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
const renderGeometries = (column)=>{
|
const renderGeometries = (column)=>{
|
||||||
|
|
Loading…
Reference in New Issue