Ensure that the Query Editor should be focused when switching between query tool tabs. Fixes #7441

This commit is contained in:
Aditya Toshniwal 2022-06-13 14:26:01 +05:30 committed by Akshay Joshi
parent ea3203f466
commit 725726f083
3 changed files with 13 additions and 0 deletions

View File

@ -20,5 +20,6 @@ Bug fixes
*********
| `Issue #7411 <https://redmine.postgresql.org/issues/7411>`_ - Fixed an issue where the Database restriction is not working.
| `Issue #7441 <https://redmine.postgresql.org/issues/7441>`_ - Ensure that the Query Editor should be focused when switching between query tool tabs.
| `Issue #7443 <https://redmine.postgresql.org/issues/7443>`_ - Fixed and issue where 'Use spaces' not working in the query tool.
| `Issue #7468 <https://redmine.postgresql.org/issues/7468>`_ - Skip the history records if the JSON info can't be parsed instead of showing 'No history'.

View File

@ -333,6 +333,7 @@ export default function Layout({groups, getLayoutInstance, layoutId, savedLayout
groups={defaultGroups}
onLayoutChange={(_l, currentTabId, direction)=>{
saveLayout(layoutObj.current, layoutId);
direction = direction == 'update' ? 'active' : direction;
if(Object.values(LAYOUT_EVENTS).indexOf(direction) > -1) {
layoutEventBus.current.fireEvent(LAYOUT_EVENTS[direction.toUpperCase()], currentTabId);
}

View File

@ -318,6 +318,17 @@ export default function QueryToolComponent({params, pgWindow, pgAdmin, selectedN
eventBus.current.fireEvent(QUERY_TOOL_EVENTS.WARN_SAVE_DATA_CLOSE);
});
panel?.on(window.wcDocker.EVENT.VISIBILITY_CHANGED, function() {
/* Focus the appropriate panel on visible */
if(panel.isVisible()) {
if(LayoutHelper.isTabVisible(docker.current, PANELS.QUERY)) {
LayoutHelper.focus(docker.current, PANELS.QUERY);
} else if(LayoutHelper.isTabVisible(docker.current, PANELS.HISTORY)) {
LayoutHelper.focus(docker.current, PANELS.HISTORY);
}
}
});
pgAdmin.Browser.Events.on('pgadmin-storage:finish_btn:select_file', (fileName)=>{
eventBus.current.fireEvent(QUERY_TOOL_EVENTS.LOAD_FILE, fileName);
}, pgAdmin);