Fixed following issues found while testing v9.6 candidate build:

1. Migration failed on Debian 11.
2. Menu shortcuts should not for opening search object and query tool when not in default workspace.

Co-authored-by: Yogesh Mahajan <yogesh.mahajan@enterprisedb.com>
Co-authored-by: Pravesh Sharma <pravesh.sharma@enterprisedb.com>
This commit is contained in:
Aditya Toshniwal
2025-07-22 16:00:29 +05:30
co-authored by Yogesh Mahajan Pravesh Sharma
parent fdc38f75f8
commit c4f7a18ec5
5 changed files with 15 additions and 10 deletions
+3 -2
View File
@@ -19,8 +19,9 @@ def upgrade():
# delete all data from the table
op.execute("DELETE FROM application_state")
# drop the 'tool_name' column
op.drop_column('application_state', 'tool_name')
# Drop unused columns
with op.batch_alter_table('application_state') as batch_op:
batch_op.drop_column('tool_name')
def downgrade():
@@ -129,7 +129,7 @@ export default class MainMenuFactory {
}
static enableDisableMenus(item) {
let itemData = item ? pgAdmin.Browser.tree.itemData(item) : undefined;
let itemData = item ? pgAdmin.Browser.tree.itemData(item) : pgAdmin.Browser.tree?.selected();
const checkForItems = (items)=>{
items.forEach((mitem) => {
+6 -2
View File
@@ -212,8 +212,10 @@ _.extend(pgBrowser.keyboardNavigation, {
if (!tree.d)
return;
// Check if the query tool is enabled for the current node
let disabled = pgBrowser.MainMenus.find((m)=>(m.name=='tools'))?.menuItems?.find((m)=>(m.name=='query_tool'))?.isDisabled;
// Call data grid method to render query tool
pgAdmin.Tools.SQLEditor.showQueryTool('', tree.i);
!disabled && pgAdmin.Tools.SQLEditor.showQueryTool('', tree.i);
},
bindSubMenuViewData: function() {
const tree = this.getTreeDetails();
@@ -230,8 +232,10 @@ _.extend(pgBrowser.keyboardNavigation, {
if (!tree.d)
return;
// Check if the search objects is enabled for the current node
let disabled = pgBrowser.MainMenus.find((m)=>(m.name=='tools'))?.menuItems?.find((m)=>(m.name=='search_objects'))?.isDisabled;
// Call show search object to open the search object dialog.
pgAdmin.Tools.SearchObjects.show_search_objects('', tree.i);
!disabled && pgAdmin.Tools.SearchObjects.show_search_objects('', tree.i);
},
bindSubMenuProperties: function() {
const tree = this.getTreeDetails();
+1 -1
View File
@@ -40,7 +40,7 @@ ToolForm.propTypes = {
export function getToolTabParams(panelId, toolUrl, formParams, tabParams, restore=false) {
if(tabParams?.internal?.orig_title){
tabParams.title = tabParams.internal.title;
tabParams.title = tabParams.internal.isDirty ? tabParams.internal.title.slice(0, -1): tabParams.internal.title;
}
return {
id: panelId,
@@ -389,7 +389,7 @@ export default class ERDTool extends React.Component {
if(toolContent?.modifiedExternally){
toolContent = await this.fmUtilsObj.warnFileReload(toolContent?.fileName, toolContent?.data, '');
}
if(toolContent.loadFile){
this.openFile(toolContent.fileName);
}else{
@@ -632,7 +632,7 @@ export default class ERDTool extends React.Component {
dirty: false,
});
this.eventBus.fireEvent(ERD_EVENTS.DIRTY, false, toolContent, fileName);
this.setTitle(fileName);
this.setTitle(fileName);
this.diagram.deserialize(toolContent);
this.diagram.clearSelection();
this.registerModelEvents();
@@ -670,7 +670,7 @@ export default class ERDTool extends React.Component {
dirty: false,
});
this.eventBus.fireEvent(ERD_EVENTS.DIRTY, false);
this.setTitle(this.state.current_file);
this.setTitle(fileName);
this.setLoading(null);
if(this.closeOnSave) {
this.forceClose();
@@ -896,7 +896,7 @@ export default class ERDTool extends React.Component {
try {
let response = await this.apiObj.post(
initUrl,
initUrl,
{server_name: this.props.params.server_name,
server_type : this.props.params.server_type,
user: this.props.params.user,