mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-08-04 18:33:22 -05:00
Fixed SonarQube code smell 'Variables should not be shadowed'.
This commit is contained in:
committed by
Akshay Joshi
parent
c2e875d54b
commit
6dd3ca31be
@@ -263,12 +263,12 @@ define([
|
||||
$(this.elements.commands.close).attr('aria-label', gettext('Close'));
|
||||
$(this.elements.commands.maximize).attr('aria-label', gettext('Maximize'));
|
||||
alertifyDialogResized.apply(this, arguments);
|
||||
let self = this;
|
||||
let _self = this;
|
||||
|
||||
let cmds = Object.values(this.elements.commands);
|
||||
$(cmds).on('keydown', 'button', (event) => {
|
||||
if (event.shiftKey && event.keyCode == 9 && $(this).nextAll('button:not([disabled])').length == 0){
|
||||
let container = $(self.elements.footer);
|
||||
let container = $(_self.elements.footer);
|
||||
commonUtils.findAndSetFocus(container.find('button:not([disabled]):last'));
|
||||
}
|
||||
});
|
||||
@@ -339,7 +339,7 @@ define([
|
||||
args: args,
|
||||
},
|
||||
reconnectServer = function() {
|
||||
var ctx = this,
|
||||
var ctx_local = this,
|
||||
onServerConnect = function(_sid, _i, _d) {
|
||||
// Yay - server is reconnected.
|
||||
if (this.args.info.server._id == _sid) {
|
||||
@@ -363,7 +363,7 @@ define([
|
||||
);
|
||||
}
|
||||
}
|
||||
}.bind(ctx),
|
||||
}.bind(ctx_local),
|
||||
onConnectCancel = function(_sid, _item, _data) {
|
||||
// User has cancelled the operation in between.
|
||||
if (_sid == this.args.info.server.id) {
|
||||
@@ -376,7 +376,7 @@ define([
|
||||
this.resp.data.database || _data.db, _item, _data
|
||||
);
|
||||
}
|
||||
}.bind(ctx);
|
||||
}.bind(ctx_local);
|
||||
|
||||
pgBrowser.Events.on('pgadmin:server:connected', onServerConnect);
|
||||
pgBrowser.Events.on('pgadmin:server:connect:cancelled', onConnectCancel);
|
||||
|
||||
@@ -1363,11 +1363,11 @@ define([
|
||||
var idx = that.indexOf(m);
|
||||
if (idx > -1) {
|
||||
var row = self.grid.body.rows[idx],
|
||||
editCell = row.$el.find('.subnode-edit-in-process').parent();
|
||||
rowEditCell = row.$el.find('.subnode-edit-in-process').parent();
|
||||
// Only close row if it's open.
|
||||
if (editCell.length > 0) {
|
||||
if (rowEditCell.length > 0) {
|
||||
var event = new Event('click');
|
||||
editCell[0].dispatchEvent(event);
|
||||
rowEditCell[0].dispatchEvent(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1420,11 +1420,11 @@ define([
|
||||
if (canAddRow) {
|
||||
// Close any existing expanded row before adding new one.
|
||||
_.each(self.grid.body.rows, function(row) {
|
||||
var editCell = row.$el.find('.subnode-edit-in-process').parent();
|
||||
var rowEditCell = row.$el.find('.subnode-edit-in-process').parent();
|
||||
// Only close row if it's open.
|
||||
if (editCell.length > 0) {
|
||||
if (rowEditCell.length > 0) {
|
||||
var event = new Event('click');
|
||||
editCell[0].dispatchEvent(event);
|
||||
rowEditCell[0].dispatchEvent(event);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1661,11 +1661,11 @@ define([
|
||||
var idx = ctx.indexOf(m);
|
||||
if (idx > -1) {
|
||||
var row = grid.body.rows[idx],
|
||||
editCell = row.$el.find('.subnode-edit-in-process').parent();
|
||||
rowEditCell = row.$el.find('.subnode-edit-in-process').parent();
|
||||
// Only close row if it's open.
|
||||
if (editCell.length > 0) {
|
||||
if (rowEditCell.length > 0) {
|
||||
var event = new Event('click');
|
||||
editCell[0].dispatchEvent(event);
|
||||
rowEditCell[0].dispatchEvent(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1716,11 +1716,11 @@ define([
|
||||
if (canAddRow) {
|
||||
// Close any existing expanded row before adding new one.
|
||||
_.each(grid.body.rows, function(row) {
|
||||
var editCell = row.$el.find('.subnode-edit-in-process').parent();
|
||||
var rowEditCell = row.$el.find('.subnode-edit-in-process').parent();
|
||||
// Only close row if it's open.
|
||||
if (editCell.length > 0) {
|
||||
if (rowEditCell.length > 0) {
|
||||
var event = new Event('click');
|
||||
editCell[0].dispatchEvent(event);
|
||||
rowEditCell[0].dispatchEvent(event);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import pgBrowser from 'pgadmin.browser';
|
||||
|
||||
export function url(itemData, item, treeHierarchy) {
|
||||
let treeNode = pgBrowser.treeMenu.findNodeByDomElement(item);
|
||||
let url = null;
|
||||
let return_url = null;
|
||||
|
||||
if (treeNode) {
|
||||
treeNode.anyFamilyMember(
|
||||
@@ -27,11 +27,11 @@ export function url(itemData, item, treeHierarchy) {
|
||||
browserNode, [node, nodeData, treeHierarchy]
|
||||
);
|
||||
}
|
||||
url = isString(dashboardURL) ? dashboardURL : null;
|
||||
return_url = isString(dashboardURL) ? dashboardURL : null;
|
||||
|
||||
return (url !== null);
|
||||
return (return_url !== null);
|
||||
});
|
||||
}
|
||||
|
||||
return url;
|
||||
return return_url;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user