Fixed an issue where copying highlighted text in the query tool data output cell editor would copy the complete string. #9372

Fixed an issue where copying a single cell should not add quoting. #9373
pull/9428/head
Aditya Toshniwal 2025-12-04 16:58:39 +05:30
parent e50d839ac0
commit d46bce2d7b
4 changed files with 12 additions and 9 deletions

View File

@ -36,5 +36,7 @@ Bug fixes
| `Issue #9297 <https://github.com/pgadmin-org/pgadmin4/issues/9297>`_ - Fixed an issue where EXPLAIN should run on query under cursor if no text is selected.
| `Issue #9351 <https://github.com/pgadmin-org/pgadmin4/issues/9351>`_ - Fixed an issue where opening file in Query Tool does not retain file name in tab.
| `Issue #9354 <https://github.com/pgadmin-org/pgadmin4/issues/9354>`_ - Fixed an issue where connection is failing via Query Tool/PSQL Tool workspaces.
| `Issue #9393 <https://github.com/pgadmin-org/pgadmin4/issues/9393>`_ - Fixed the Helm chart server definition and changed the app version.
| `Issue #9354 <https://github.com/pgadmin-org/pgadmin4/issues/9354>`_ - Fixed an issue where connection is failing via Query Tool/PSQL Tool workspaces.
| `Issue #9372 <https://github.com/pgadmin-org/pgadmin4/issues/9372>`_ - Fixed an issue where copying highlighted text in the query tool data output cell editor would copy the complete string.
| `Issue #9373 <https://github.com/pgadmin-org/pgadmin4/issues/9373>`_ - Fixed an issue where copying a single cell should not add quoting.
| `Issue #9408 <https://github.com/pgadmin-org/pgadmin4/issues/9408>`_ - Ensure the proper handling of extra volume mount configurations in the Helm deployment template by correcting the configuration value references.

View File

@ -29,9 +29,10 @@ export default class CopyData {
}
copyRowsToCsv(rows=[], columns=[], withHeaders=false) {
const isSingleCell = rows.length === 1 && columns.length === 1 && !withHeaders;
let csvRows = rows.reduce((prevCsvRows, currRow)=>{
let csvRow = columns.reduce((prevCsvCols, column)=>{
prevCsvCols.push(this.csvCell(currRow[column.key], column));
prevCsvCols.push(this.csvCell(currRow[column.key], column, false, isSingleCell));
return prevCsvCols;
}, []).join(this.CSVOptions.field_separator);
prevCsvRows.push(csvRow);
@ -80,11 +81,13 @@ export default class CopyData {
return value;
}
csvCell(value, column, header=false) {
if (this.CSVOptions.quoting == 'all' || header) {
value = this.allQuoteCell(value);
csvCell(value, column, header, isSingleCell=false) {
if(isSingleCell) {
return value;
} else if (this.CSVOptions.quoting == 'all' || header) {
return this.allQuoteCell(value);
} else if(this.CSVOptions.quoting == 'strings') {
value = this.stringQuoteCell(value, column);
return this.stringQuoteCell(value, column);
}
return value;
}

View File

@ -459,8 +459,6 @@ export default function QueryToolDataGrid({columns, rows, totalRowCount, dataCha
rowHeight={25}
mincolumnWidthBy={50}
enableCellSelect={true}
onCopy={handleCopy}
onMultiCopy={handleCopy}
onColumnResize={handleColumnResize}
renderers={{
renderRow: renderCustomRow,

View File

@ -265,7 +265,7 @@ def register_query_tool_preferences(self):
self.results_grid_quote_char = self.preference.register(
'Results_grid', 'results_grid_quote_char',
gettext("Result copy quote character"), 'options', '"',
gettext("Result copy quote character. Not applied when copying a single cell."), 'options', '"',
category_label=PREF_LABEL_RESULTS_GRID,
options=[{'label': '"', 'value': '"'},
{'label': '\'', 'value': '\''}],