mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed issue related to shadowing variables reported by SonarQube.
This commit is contained in:
committed by
Akshay Joshi
parent
cb268075c2
commit
7c12ade161
@@ -142,20 +142,20 @@ define('pgadmin.node.tablespace', [
|
||||
// Initialize parent class
|
||||
Backform.SqlTabControl.prototype.initialize.apply(this, arguments);
|
||||
},
|
||||
onTabChange: function(obj) {
|
||||
onTabChange: function(sql_tab_obj) {
|
||||
// Fetch the information only if the SQL tab is visible at the moment.
|
||||
if (this.dialog && obj.shown == this.tabIndex) {
|
||||
if (this.dialog && sql_tab_obj.shown == this.tabIndex) {
|
||||
var self = this,
|
||||
args = self.model.toJSON();
|
||||
sql_tab_args = self.model.toJSON();
|
||||
// Add existing tablespace
|
||||
args.old_tblspc = d.label;
|
||||
sql_tab_args.old_tblspc = d.label;
|
||||
|
||||
// Fetches modified SQL
|
||||
$.ajax({
|
||||
url: msql_url,
|
||||
type: 'GET',
|
||||
cache: false,
|
||||
data: args,
|
||||
data: sql_tab_args,
|
||||
dataType: 'json',
|
||||
contentType: 'application/json',
|
||||
}).done(function(res) {
|
||||
@@ -226,15 +226,15 @@ define('pgadmin.node.tablespace', [
|
||||
//Disbale Okay button
|
||||
this.__internal.buttons[2].element.disabled = true;
|
||||
// Find current/selected node
|
||||
var t = pgBrowser.tree,
|
||||
i = t.selected(),
|
||||
d = i && i.length == 1 ? t.itemData(i) : undefined,
|
||||
node = d && pgBrowser.Nodes[d._type];
|
||||
var tree = pgBrowser.tree,
|
||||
_i = tree.selected(),
|
||||
_d = _i && _i.length == 1 ? tree.itemData(_i) : undefined,
|
||||
node = _d && pgBrowser.Nodes[_d._type];
|
||||
|
||||
if (!d)
|
||||
if (!_d)
|
||||
return;
|
||||
// Create treeInfo
|
||||
var treeInfo = node.getTreeNodeHierarchy.apply(node, [i]);
|
||||
var treeInfo = node.getTreeNodeHierarchy.apply(node, [_i]);
|
||||
// Instance of backbone model
|
||||
var newModel = new objModel({}, {node_info: treeInfo}),
|
||||
fields = Backform.generateViewSchema(
|
||||
@@ -275,20 +275,20 @@ define('pgadmin.node.tablespace', [
|
||||
}
|
||||
if (e.button.text === gettext('OK')) {
|
||||
var self = this,
|
||||
args = this.view.model.toJSON();
|
||||
args.old_tblspc = d.label;
|
||||
btn_args = this.view.model.toJSON();
|
||||
btn_args.old_tblspc = d.label;
|
||||
e.cancel = true;
|
||||
Alertify.confirm(
|
||||
gettext('Move objects...'),
|
||||
gettext(
|
||||
'Are you sure you wish to move the objects from %s to %s?',
|
||||
args.old_tblspc, args.tblspc
|
||||
btn_args.old_tblspc, btn_args.tblspc
|
||||
),
|
||||
function() {
|
||||
$.ajax({
|
||||
url: url,
|
||||
method:'PUT',
|
||||
data:{'data': JSON.stringify(args) },
|
||||
data:{'data': JSON.stringify(btn_args) },
|
||||
})
|
||||
.done(function(res) {
|
||||
if (res.success) {
|
||||
|
||||
Reference in New Issue
Block a user