1) Fixed an issue where the Save button is enabled by default in Macro. Fixes #5905

2) Remove extra line after Manage Macros menu while clearing all macros. Fixes #5906
3) Ensure that 'Clear All Rows' should not work if there is no existing macro available and the user does not specify any value. Fixes #5907
4) Fixed an issue where the server is disconnected error message displayed if the user creates Macro with invalid SQL. Fixes #5929
This commit is contained in:
Khushboo Vashi 2021-01-20 13:52:00 +05:30 committed by Akshay Joshi
parent b3ca172f3a
commit 9bee91b6f6
5 changed files with 30 additions and 16 deletions

View File

@ -27,6 +27,10 @@ Bug fixes
| `Issue #5571 <https://redmine.postgresql.org/issues/5571>`_ - Added support for expression in exclusion constraints.
| `Issue #5829 <https://redmine.postgresql.org/issues/5829>`_ - Fixed incorrect log information for AUTHENTICATION_SOURCES.
| `Issue #5875 <https://redmine.postgresql.org/issues/5875>`_ - Ensure that the 'template1' database should not be visible after pg_upgrade.
| `Issue #5905 <https://redmine.postgresql.org/issues/5905>`_ - Fixed an issue where the Save button is enabled by default in Macro.
| `Issue #5906 <https://redmine.postgresql.org/issues/5906>`_ - Remove extra line after Manage Macros menu while clearing all macros.
| `Issue #5907 <https://redmine.postgresql.org/issues/5907>`_ - Ensure that 'Clear All Rows' should not work if there is no existing macro available and the user does not specify any value.
| `Issue #5929 <https://redmine.postgresql.org/issues/5929>`_ - Fixed an issue where the server is disconnected error message displayed if the user creates Macro with invalid SQL.
| `Issue #5965 <https://redmine.postgresql.org/issues/5965>`_ - Ensure that the macro query result should be download properly.
| `Issue #5973 <https://redmine.postgresql.org/issues/5973>`_ - Added appropriate help message and a placeholder for letting users know about the account password expiry for Login/Group Role.
| `Issue #5997 <https://redmine.postgresql.org/issues/5997>`_ - Updated Flask-BabelEx to the latest.

View File

@ -182,7 +182,7 @@ def dump_header():
print(textwrap.fill(
"pgAdmin 4 is built on C++, Python and Javascript, and is "
"dependent on various third party libraries. These are "
"automatically compiled from the system, requirements.txt."
"automatically compiled from the system, requirements.txt "
"and packages.json and listed below.",
width=79) + "\n")

View File

@ -194,6 +194,8 @@ let MacroDialog = {
// We got the latest attributes of the object. Render the view
// now.
$container.append(self.view.render().$el);
self.__internal.buttons[2].element.disabled = true;
// Enable/disable save button and show/hide statusbar based on session
self.view.listenTo(self.view.model, 'pgadmin-session:start', function() {
@ -272,11 +274,12 @@ let MacroDialog = {
<a class="dropdown-item" id="btn-manage-macros" href="#" tabindex="0">
<span> ${gettext('Manage Macros...')} </span>
</a>
</li>
<li class="dropdown-divider"></li>`;
</li>`;
let macro_list_tmpl = '';
_.each(macros, function(m) {
if (m.name) {
str += `<li>
macro_list_tmpl += `<li>
<a class="dropdown-item btn-macro" data-macro-id="${m.id}" href="#" tabindex="0">
<span> ${_.escape(m.name)} </span>
<span> (${m.key_label}) </span>
@ -285,6 +288,7 @@ let MacroDialog = {
}
});
if (macro_list_tmpl.length > 0) str += '<li class="dropdown-divider"></li>' + macro_list_tmpl;
$($.find('div.btn-group.mr-1.user_macros ul.dropdown-menu')).html($(str));
self.close(); // Close the dialog now

View File

@ -126,18 +126,22 @@ export default function macroModel(transId) {
var that = this;
// We will check if row is deletable or not
Alertify.confirm(
gettext('Clear All Rows'),
gettext('Are you sure you wish to clear all rows?'),
function() {
_.each(that.collection.toJSON(), function(m) {
that.collection.get(m.id).set({'name': null, 'sql': null});
});
},
function() {
return true;
}
);
let macros = that.collection.toJSON().filter(m => m.name !== undefined && m.name !== null);
if (macros.length > 0) {
Alertify.confirm(
gettext('Clear All Rows'),
gettext('Are you sure you wish to clear all rows?'),
function() {
_.each(that.collection.toJSON(), function(m) {
that.collection.get(m.id).set({'name': null, 'sql': null});
});
},
function() {
return true;
}
);
}
},
render: function() {
this.$el.empty();

View File

@ -4376,6 +4376,8 @@ define('tools.querytool', [
// Find the next space from the character or end of line
var error_line = self.gridView.query_tool_obj.getLine(error_line_no);
if (_.isUndefined(error_line)) return;
end_marker = error_line.indexOf(' ', start_marker);
if (end_marker < 0)
end_marker = error_line.length;