Enable the save button by default when a query tool is opened with CREATE or other scripts. Fixes #4856

This commit is contained in:
Aditya Toshniwal 2020-04-07 13:54:16 +05:30 committed by Akshay Joshi
parent 33deacacee
commit 134c1802e7
2 changed files with 2 additions and 5 deletions

View File

@ -26,6 +26,7 @@ Bug fixes
| `Issue #3988 <https://redmine.postgresql.org/issues/3988>`_ - Fixed cursor disappeared issue in the query editor for some of the characters when zoomed out.
| `Issue #4206 <https://redmine.postgresql.org/issues/4206>`_ - Ensure that the grant wizard should be closed on pressing the ESC key.
| `Issue #4512 <https://redmine.postgresql.org/issues/4512>`_ - Fixed calendar opening issue on the exception tab inside the schedules tab of pgAgent.
| `Issue #4856 <https://redmine.postgresql.org/issues/4856>`_ - Enable the save button by default when a query tool is opened with CREATE or other scripts.
| `Issue #5180 <https://redmine.postgresql.org/issues/5180>`_ - Fixed an issue where the autovacuum_enabled parameter is added automatically in the RE-SQL when the table has been created using the WITH clause.
| `Issue #5268 <https://redmine.postgresql.org/issues/5268>`_ - Fixed generated SQL when any token in FTS Configuration or any option in FTS Dictionary is changed.
| `Issue #5275 <https://redmine.postgresql.org/issues/5275>`_ - Fixed tab key navigation issue for parameters in table dialog.

View File

@ -2279,6 +2279,7 @@ define('tools.querytool', [
}
});
self.init_events();
if (self.is_query_tool) {
// Fetch the SQL for Scripts (eg: CREATE/UPDATE/DELETE/SELECT)
// Call AJAX only if script type url is present
@ -2292,11 +2293,9 @@ define('tools.querytool', [
if (res && res !== '') {
self.gridView.query_tool_obj.setValue(res);
}
self.init_events();
})
.fail(function(jqx) {
let msg = '';
self.init_events();
msg = httpErrorHandler.handleQueryToolAjaxError(
pgAdmin, self, jqx, null, [], false
@ -2306,13 +2305,10 @@ define('tools.querytool', [
gettext('Error fetching SQL for script: %s.', msg)
);
});
} else {
self.init_events();
}
}
else {
// Disable codemirror by setting readOnly option to true, background to dark, and cursor, hidden.
self.init_events();
self.gridView.query_tool_obj.setOption('readOnly', true);
var cm = self.gridView.query_tool_obj.getWrapperElement();
if (cm) {