Fixed an issue where query tool title did not change after 'Save As' until any new change is made. #6193

This commit is contained in:
Aditya Toshniwal 2023-12-21 17:40:24 +05:30
parent c85a9be621
commit c8d6ff8a6d
5 changed files with 5 additions and 3 deletions

View File

@ -30,4 +30,5 @@ Housekeeping
Bug fixes
*********
| `Issue #6781 <https://github.com/pgadmin-org/pgadmin4/issues/6193>`_ - Fixed an issue where query tool title did not change after "Save As" until any new change is made.
| `Issue #6781 <https://github.com/pgadmin-org/pgadmin4/issues/6781>`_ - Fixed an issue where export servers was not adding extension if not specified.

View File

@ -146,7 +146,6 @@ export class LayoutDocker {
...panelData.internal,
...attrs,
};
this.eventBus.fireEvent(LAYOUT_EVENTS.REFRESH_TITLE, panelId);
}
getInternalAttrs(panelId) {

View File

@ -457,7 +457,7 @@ export default function QueryToolComponent({params, pgWindow, pgAdmin, selectedN
current_file: fileName,
});
isDirtyRef.current = false;
setPanelTitle(qtPanelDocker, qtPanelId, fileName, {...qtState, current_file: fileName});
setPanelTitle(qtPanelDocker, qtPanelId, fileName, {...qtState, current_file: fileName}, isDirtyRef.current);
}
eventBus.current.fireEvent(QUERY_TOOL_EVENTS.EDITOR_LAST_FOCUS);
};

View File

@ -256,6 +256,9 @@ export function MainToolBar({containerRef, onFilterClick, onManageMacros}) {
eventBus.registerListener(QUERY_TOOL_EVENTS.LOAD_FILE_DONE, ()=>{
setDisableButton('save', true);
});
eventBus.registerListener(QUERY_TOOL_EVENTS.SAVE_FILE_DONE, ()=>{
setDisableButton('save', true);
});
eventBus.registerListener(QUERY_TOOL_EVENTS.DATAGRID_CHANGED, (isDirty)=>{
setDisableButton('save-data', !isDirty);
});

View File

@ -396,7 +396,6 @@ export default function Query() {
}).then(()=>{
lastSavedText.current = editorValue;
eventBus.fireEvent(QUERY_TOOL_EVENTS.SAVE_FILE_DONE, fileName, true);
eventBus.fireEvent(QUERY_TOOL_EVENTS.QUERY_CHANGED, isDirty());
pgAdmin.Browser.notifier.success(gettext('File saved successfully.'));
}).catch((err)=>{
eventBus.fireEvent(QUERY_TOOL_EVENTS.SAVE_FILE_DONE, null, false);