diff --git a/docs/en_US/release_notes_6_21.rst b/docs/en_US/release_notes_6_21.rst index 0003a53bf..94503c37a 100644 --- a/docs/en_US/release_notes_6_21.rst +++ b/docs/en_US/release_notes_6_21.rst @@ -33,7 +33,9 @@ Bug fixes | `Issue #5269 `_ - Ensure that the schema diff tool should pick up the change in the column grants. | `Issue #5685 `_ - Ensure that Grant column permission to a view is visible in the SQL tab. + | `Issue #5747 `_ - Ensure that content on the DDL comparison panel should get refreshed on selecting the object using the up and down arrow keys. | `Issue #5756 `_ - Fix for query tool prompting for unsaved changes even if no changes have been made. | `Issue #5758 `_ - Fixed an issue where lock layout menu was not in sync with preferences. | `Issue #5764 `_ - Fix an issue where the maintenance dialog for Materialized View gives an error. + | `Issue #5773 `_ - Fixed an issue where Clear Saved Password should be disabled if the password is already cleared. | `Issue #5847 `_ - Fixed an issue where pgAdmin failed to connect when the Postgres password included special characters. diff --git a/web/pgadmin/tools/schema_diff/static/js/components/ResultGridComponent.jsx b/web/pgadmin/tools/schema_diff/static/js/components/ResultGridComponent.jsx index 9e05aa482..8185665d7 100644 --- a/web/pgadmin/tools/schema_diff/static/js/components/ResultGridComponent.jsx +++ b/web/pgadmin/tools/schema_diff/static/js/components/ResultGridComponent.jsx @@ -661,38 +661,49 @@ export function ResultGridComponent({ gridData, allRowIds, filterParams, selecte }, [filterParams]); const eventBus = useContext(SchemaDiffEventsContext); + const rowSelectionTimeoutRef = useRef(); - const rowSelection = (row) => { - - if (row.ddlData != undefined && row.status != FILTER_NAME.IDENTICAL) { - eventBus.fireEvent(SCHEMA_DIFF_EVENT.TRIGGER_CHANGE_RESULT_SQL, row.ddlData); - } else if (row.status == FILTER_NAME.IDENTICAL) { - let url_params = { - 'trans_id': transId, - 'source_sid': sourceData.sid, - 'source_did': sourceData.did, - 'source_scid': row.source_scid, - 'target_sid': targetData.sid, - 'target_did': targetData.did, - 'target_scid': row.target_scid, - 'comp_status': row.status, - 'source_oid': row.source_oid, - 'target_oid': row.target_oid, - 'node_type': row.itemType, - }; - - let baseUrl = url_for('schema_diff.ddl_compare', url_params); - schemaDiffToolContext.api.get(baseUrl).then((res) => { - row.ddlData = { - 'SQLdiff': res.data.diff_ddl, - 'sourceSQL': res.data.source_ddl, - 'targetSQL': res.data.target_ddl - }; - eventBus.fireEvent(SCHEMA_DIFF_EVENT.TRIGGER_CHANGE_RESULT_SQL, row.ddlData); - }).catch((err) => { - Notifier.alert(err.message); - }); + const rowSelection = (rowIdx) => { + if (rowSelectionTimeoutRef.current) { + clearTimeout(rowSelectionTimeoutRef.current); + rowSelectionTimeoutRef.current = null; } + + rowSelectionTimeoutRef.current = setTimeout(()=> { + rowSelectionTimeoutRef.current = null; + const row = rows[rowIdx]; + if (row.ddlData != undefined && row.status != FILTER_NAME.IDENTICAL) { + eventBus.fireEvent(SCHEMA_DIFF_EVENT.TRIGGER_CHANGE_RESULT_SQL, row.ddlData); + } else if (row.status == FILTER_NAME.IDENTICAL) { + let url_params = { + 'trans_id': transId, + 'source_sid': sourceData.sid, + 'source_did': sourceData.did, + 'source_scid': row.source_scid, + 'target_sid': targetData.sid, + 'target_did': targetData.did, + 'target_scid': row.target_scid, + 'comp_status': row.status, + 'source_oid': row.source_oid, + 'target_oid': row.target_oid, + 'node_type': row.itemType, + }; + + let baseUrl = url_for('schema_diff.ddl_compare', url_params); + schemaDiffToolContext.api.get(baseUrl).then((res) => { + row.ddlData = { + 'SQLdiff': res.data.diff_ddl, + 'sourceSQL': res.data.source_ddl, + 'targetSQL': res.data.target_ddl + }; + eventBus.fireEvent(SCHEMA_DIFF_EVENT.TRIGGER_CHANGE_RESULT_SQL, row.ddlData); + }).catch((err) => { + Notifier.alert(err.message); + }); + } else { + eventBus.fireEvent(SCHEMA_DIFF_EVENT.TRIGGER_CHANGE_RESULT_SQL, {}); + } + }, 250); }; function rowKeyGetter(row) { @@ -714,7 +725,7 @@ export function ResultGridComponent({ gridData, allRowIds, filterParams, selecte }} headerRowHeight={28} rowHeight={28} - onRowClick={rowSelection} + onItemSelect={rowSelection} enableCellSelect={false} rowKeyGetter={rowKeyGetter} direction={'vertical-lr'}