From 6dab60d9e4f48911447eb3716d54477ade14932c Mon Sep 17 00:00:00 2001 From: Aditya Toshniwal Date: Fri, 3 Jan 2025 14:03:33 +0530 Subject: [PATCH] Fixed an issue where copying query tool output cell is not working if any SQL text is selected. #8273 Rebase react-data-grid fork to latest. --- docs/en_US/release_notes_9_0.rst | 1 + web/package.json | 2 +- .../static/js/components/QueryToolDataGrid/index.jsx | 5 +++-- web/yarn.lock | 10 +++++----- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/en_US/release_notes_9_0.rst b/docs/en_US/release_notes_9_0.rst index 8cb0d2cd514..f04e52e574c 100644 --- a/docs/en_US/release_notes_9_0.rst +++ b/docs/en_US/release_notes_9_0.rst @@ -40,3 +40,4 @@ Bug fixes | `Issue #8254 `_ - Fix a formatting issue in View/Edit tool generated SQL where some filters are applied. | `Issue #8255 `_ - Fixed an issue where tooltip on a dropdown button is blocking access to dropdown menu. | `Issue #8256 `_ - Fix the error occurring while loading preferences on startup. + | `Issue #8273 `_ - Fixed an issue where copying query tool output cell is not working if any SQL text is selected. diff --git a/web/package.json b/web/package.json index 1e6b4aae198..42ed8f7c5ae 100644 --- a/web/package.json +++ b/web/package.json @@ -129,7 +129,7 @@ "react-arborist": "^3.2.0", "react-aspen": "^1.1.0", "react-checkbox-tree": "^1.7.2", - "react-data-grid": "https://github.com/pgadmin-org/react-data-grid.git#4e10a5a327ff58198ac83c7b0c62549b20b78ae5", + "react-data-grid": "https://github.com/pgadmin-org/react-data-grid.git#rebase-01-Jan-2025", "react-dnd": "^16.0.1", "react-dnd-html5-backend": "^16.0.1", "react-dom": "^18.2.0", diff --git a/web/pgadmin/tools/sqleditor/static/js/components/QueryToolDataGrid/index.jsx b/web/pgadmin/tools/sqleditor/static/js/components/QueryToolDataGrid/index.jsx index d519fbe1efc..57ec612950d 100644 --- a/web/pgadmin/tools/sqleditor/static/js/components/QueryToolDataGrid/index.jsx +++ b/web/pgadmin/tools/sqleditor/static/js/components/QueryToolDataGrid/index.jsx @@ -24,6 +24,7 @@ import gettext from 'sources/gettext'; import PgReactDataGrid from '../../../../../../static/js/components/PgReactDataGrid'; import { isMac } from '../../../../../../static/js/keyboard_shortcuts'; import { measureText } from '../../../../../../static/js/utils'; +import { useHeaderRowSelection } from 'react-data-grid'; export const ROWNUM_KEY = '$_pgadmin_rownum_key_$'; export const GRID_ROW_SELECT_KEY = '$_pgadmin_gridrowselect_key_$'; @@ -128,7 +129,7 @@ CustomRow.propTypes = { }; function SelectAllHeaderRenderer({isCellSelected}) { - const [isRowSelected, onRowSelectionChange] = useRowSelection(); + const {isRowSelected, onRowSelectionChange} = useHeaderRowSelection(); const cellRef = useRef(); const eventBus = useContext(QueryToolEventsContext); const dataGridExtras = useContext(DataGridExtrasContext); @@ -293,7 +294,7 @@ function initialiseColumns(columns, rows, totalRowCount, columnWidthBy) { return retColumns; } function RowNumColFormatter({row, rowKeyGetter, rowIdx, dataChangeStore, onSelectedColumnsChange}) { - const [isRowSelected, onRowSelectionChange] = useRowSelection(); + const {isRowSelected, onRowSelectionChange} = useRowSelection(); const {startRowNum} = useContext(DataGridExtrasContext); let rowKey = rowKeyGetter(row); diff --git a/web/yarn.lock b/web/yarn.lock index eeb9e9b98c0..6a91b628531 100644 --- a/web/yarn.lock +++ b/web/yarn.lock @@ -12835,15 +12835,15 @@ __metadata: languageName: node linkType: hard -"react-data-grid@https://github.com/pgadmin-org/react-data-grid.git#4e10a5a327ff58198ac83c7b0c62549b20b78ae5": - version: 7.0.0-beta.44 - resolution: "react-data-grid@https://github.com/pgadmin-org/react-data-grid.git#commit=4e10a5a327ff58198ac83c7b0c62549b20b78ae5" +"react-data-grid@https://github.com/pgadmin-org/react-data-grid.git#rebase-01-Jan-2025": + version: 7.0.0-beta.47 + resolution: "react-data-grid@https://github.com/pgadmin-org/react-data-grid.git#commit=3dfc2ca01a046d55c1c7a45392dcec104815dc76" dependencies: clsx: ^2.0.0 peerDependencies: react: ^18.0 || ^19.0 react-dom: ^18.0 || ^19.0 - checksum: 75e8910f9b69c60c28223e82647cb8323e08d13d1b56eec94e918e7feadc50f5f4257205a3cd628b9fba019577c3ffab62bdecda7d950e7647ba75988de28261 + checksum: 47c06eebc3b957e22256552a54193e234d4ea7117f8efa6842abcb2f7f9f6c9f8a936a39ff4870dd5fc4f8a9c834a05a301c4bff065ebd0bac7735d7bb53a8d3 languageName: node linkType: hard @@ -13641,7 +13641,7 @@ __metadata: react-arborist: ^3.2.0 react-aspen: ^1.1.0 react-checkbox-tree: ^1.7.2 - react-data-grid: "https://github.com/pgadmin-org/react-data-grid.git#4e10a5a327ff58198ac83c7b0c62549b20b78ae5" + react-data-grid: "https://github.com/pgadmin-org/react-data-grid.git#rebase-01-Jan-2025" react-dnd: ^16.0.1 react-dnd-html5-backend: ^16.0.1 react-dom: ^18.2.0