diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/static/js/fts_configuration.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/static/js/fts_configuration.js index 6d8cf7398..3d2b34614 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/static/js/fts_configuration.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/static/js/fts_configuration.js @@ -347,11 +347,11 @@ define('pgadmin.node.fts_configuration', [ idx = -1; // Find if token exists in grid - self.collection.each(function(m) { + self.collection.each(function(local_model) { _.each(checkVars, function(v) { - var val = m.get(v); + var val = local_model.get(v); if(val == token) { - idx = coll.indexOf(m); + idx = coll.indexOf(local_model); } }); }); diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.js index 6ccb59526..0af5ca0b0 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.js @@ -203,29 +203,29 @@ define('pgadmin.node.foreign_key', [ formatter: Backform.ControlFormatter, template: headerSelectControlTemplate, render: function() { - var self = this, - url = self.field.get('url') || self.defaults.url, - m = self.model, + var self_referenced = this, + url = self_referenced.field.get('url') || self_referenced.defaults.url, + m = self_referenced.model, tid = m.get('references'); // Store name for selected table var a = $('select[name="references"]').find(':selected').text(); this.model.set('references_table_name', a,{silent: true}); // Clear any existing value before setting new options. - m.set(self.field.get('name'), null, {silent: true}); + m.set(self_referenced.field.get('name'), null, {silent: true}); if (url && !_.isUndefined(tid) && !_.isNull(tid) && tid != '') { - var node = this.field.get('schema_node'), + var schema_node = this.field.get('schema_node'), node_info = this.field.get('node_info'), - full_url = node.generate_url.apply( - node, [ + full_url = schema_node.generate_url.apply( + schema_node, [ null, url, this.field.get('node_data'), this.field.get('url_with_id') || false, node_info, ]), data = []; if (this.field.get('version_compatible')) { - m.trigger('pgadmin:view:fetching', m, self.field); + m.trigger('pgadmin:view:fetching', m, self_referenced.field); $.ajax({ async: false, data : {tid:tid}, @@ -235,24 +235,24 @@ define('pgadmin.node.foreign_key', [ data = res.data; }) .fail(function() { - m.trigger('pgadmin:view:fetch:error', m, self.field); + m.trigger('pgadmin:view:fetch:error', m, self_referenced.field); }); - m.trigger('pgadmin:view:fetched', m, self.field); + m.trigger('pgadmin:view:fetched', m, self_referenced.field); } /* * Transform the data */ - var transform = this.field.get('transform') || self.defaults.transform; + var transform = this.field.get('transform') || self_referenced.defaults.transform; if (transform && _.isFunction(transform)) { // We will transform the data later, when rendering. // It will allow us to generate different data based on the // dependencies. - self.field.set('options', transform.bind(self, data)); + self_referenced.field.set('options', transform.bind(self_referenced, data)); } else { - self.field.set('options', data); + self_referenced.field.set('options', data); } } else { - self.field.set('options', []); + self_referenced.field.set('options', []); } Backform.Select2Control.prototype.render.apply(this, arguments); return this; @@ -555,8 +555,8 @@ define('pgadmin.node.foreign_key', [ coveringindex = null, url_jump_after_node = 'schema'; - self.collection.each(function(m){ - cols.push(m.get('local_column')); + self.collection.each(function(local_model){ + cols.push(local_model.get('local_column')); }); if (cols.length > 0) { diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.js index 3cb5cac81..f7e67cb1f 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.js @@ -616,8 +616,8 @@ define('pgadmin.node.table', [ var removedCols = primary_key_column_coll.where({column:column_name}); if (removedCols.length > 0) { primary_key_column_coll.remove(removedCols); - _.each(removedCols, function(m) { - m.destroy(); + _.each(removedCols, function(local_model) { + local_model.destroy(); }); if (primary_key_column_coll.length == 0) { /* Ideally above line of code should be "primary_key_coll.reset()". diff --git a/web/pgadmin/static/js/select2/configure_show_on_scroll.js b/web/pgadmin/static/js/select2/configure_show_on_scroll.js index c98a41b77..137c0753b 100644 --- a/web/pgadmin/static/js/select2/configure_show_on_scroll.js +++ b/web/pgadmin/static/js/select2/configure_show_on_scroll.js @@ -11,10 +11,10 @@ export default function (options) { * The trick is, ajax: {} will also work even if you're actually not * using ajax. */ - let ScrollDataAdapter = function ($element, options) { + let ScrollDataAdapter = function ($element, dropdownOptions) { this.$element = $element; - this.options = options; - this._dataToConvert = options.get('data') || []; + this.options = dropdownOptions; + this._dataToConvert = dropdownOptions.get('data') || []; }; let BaseAdapter = null; diff --git a/web/pgadmin/static/js/selection/xcell_selection_model.js b/web/pgadmin/static/js/selection/xcell_selection_model.js index 28dbabc71..f987d2a53 100644 --- a/web/pgadmin/static/js/selection/xcell_selection_model.js +++ b/web/pgadmin/static/js/selection/xcell_selection_model.js @@ -142,12 +142,12 @@ define([ function shouldScrollToRightmostColumn() { return anchorActiveCell.cell === newSelectedRange.fromCell; } function getMobileCellFromRange(range, activeCell) { - var mobileCell = {}; + var localMobileCell = {}; - mobileCell.row = range.fromRow === activeCell.row ? range.toRow : range.fromRow; - mobileCell.cell = range.fromCell === activeCell.cell ? range.toCell : range.fromCell; + localMobileCell.row = range.fromRow === activeCell.row ? range.toRow : range.fromRow; + localMobileCell.cell = range.fromCell === activeCell.cell ? range.toCell : range.fromCell; - return mobileCell; + return localMobileCell; } function getNewRange(rangeCorner, oppositeCorner) { diff --git a/web/pgadmin/static/js/sqleditor/filter_dialog.js b/web/pgadmin/static/js/sqleditor/filter_dialog.js index 0ca1fed66..4263d4280 100644 --- a/web/pgadmin/static/js/sqleditor/filter_dialog.js +++ b/web/pgadmin/static/js/sqleditor/filter_dialog.js @@ -230,9 +230,9 @@ let FilterDialog = { self.showFilterProgress[0] ).addClass('d-none'); - let response = result.data.data; + let filterResponse = result.data.data; - if (response.status) { + if (filterResponse.status) { setTimeout( function() { self.close(); // Close the dialog now @@ -243,7 +243,7 @@ let FilterDialog = { } else { Alertify.alert( gettext('Validation Error'), - response.result + filterResponse.result ); } diff --git a/web/pgadmin/static/js/window.js b/web/pgadmin/static/js/window.js index 8377b2787..b7db38bee 100644 --- a/web/pgadmin/static/js/window.js +++ b/web/pgadmin/static/js/window.js @@ -12,22 +12,22 @@ let getWindowOpener = (opener) => { }; let pgWindow = function() { - let pgWindow = null; + let localPgWindow = null; try { if(window.opener && window.opener.pgAdmin) { /* Windows can be opened at multiple levels */ - pgWindow = getWindowOpener(window.opener); + localPgWindow = getWindowOpener(window.opener); } else if(window.parent && window.parent.pgAdmin){ - pgWindow = window.parent; + localPgWindow = window.parent; } else if(window.top && window.top.pgAdmin){ - pgWindow = window.top; + localPgWindow = window.top; } else { - pgWindow = window; + localPgWindow = window; } } catch (error) { - pgWindow = window; + localPgWindow = window; } - return pgWindow; + return localPgWindow; }(); export default pgWindow; diff --git a/web/pgadmin/static/vendor/backgrid/backgrid-select-all.js b/web/pgadmin/static/vendor/backgrid/backgrid-select-all.js index aa3757fa5..46cbbb029 100644 --- a/web/pgadmin/static/vendor/backgrid/backgrid-select-all.js +++ b/web/pgadmin/static/vendor/backgrid/backgrid-select-all.js @@ -57,13 +57,13 @@ } var column = this.column, model = this.model, $el = this.$el; - this.listenTo(column, "change:renderable", function (column, renderable) { + this.listenTo(column, "change:renderable", function (col, renderable) { $el.toggleClass("renderable", renderable); }); if (Backgrid.callByNeed(column.renderable(), column, model)) $el.addClass("renderable"); - this.listenTo(model, "backgrid:select", function (model, selected) { + this.listenTo(model, "backgrid:select", function (mod, selected) { this.checkbox().prop("checked", selected).change(); }); }, @@ -214,7 +214,7 @@ }); var column = this.column, $el = this.$el; - this.listenTo(column, "change:renderable", function (column, renderable) { + this.listenTo(column, "change:renderable", function (col, renderable) { $el.toggleClass("renderable", renderable); }); diff --git a/web/pgadmin/tools/grant_wizard/static/js/grant_wizard.js b/web/pgadmin/tools/grant_wizard/static/js/grant_wizard.js index df0505a32..8124a2f19 100644 --- a/web/pgadmin/tools/grant_wizard/static/js/grant_wizard.js +++ b/web/pgadmin/tools/grant_wizard/static/js/grant_wizard.js @@ -1158,7 +1158,7 @@ define([ self.releaseObjects(); self.close(); }, - error: function(m, jqxhr) { + error: function(model, jqxhr) { Alertify.pgNotifier( 'error', jqxhr, gettext('Error saving properties') diff --git a/web/pgadmin/tools/schema_diff/static/js/schema_diff_ui.js b/web/pgadmin/tools/schema_diff/static/js/schema_diff_ui.js index 9159134bc..095136922 100644 --- a/web/pgadmin/tools/schema_diff/static/js/schema_diff_ui.js +++ b/web/pgadmin/tools/schema_diff/static/js/schema_diff_ui.js @@ -373,8 +373,8 @@ export default class SchemaDiffUI { // Grid filter self.filter = function (item) { - let self = this; - if (self.sel_filters.indexOf(item.status) !== -1) return true; + let self_local = this; + if (self_local.sel_filters.indexOf(item.status) !== -1) return true; return false; }; @@ -586,12 +586,12 @@ export default class SchemaDiffUI { placeholder: gettext('Select database...'), }, disabled: function(m) { - let self = this; + let self_local = this; if (!_.isUndefined(m.get('source_sid')) && !_.isNull(m.get('source_sid')) && m.get('source_sid') !== '') { setTimeout(function() { - if (self.options.length > 0) { - m.set('source_did', self.options[0].value); + if (self_local.options.length > 0) { + m.set('source_did', self_local.options[0].value); } }, 10); return false; @@ -620,12 +620,12 @@ export default class SchemaDiffUI { placeholder: gettext('Select schema...'), }, disabled: function(m) { - let self = this; + let self_local = this; if (!_.isUndefined(m.get('source_did')) && !_.isNull(m.get('source_did')) && m.get('source_did') !== '') { setTimeout(function() { - if (self.options.length > 0) { - m.set('source_scid', self.options[0].value); + if (self_local.options.length > 0) { + m.set('source_scid', self_local.options[0].value); } }, 10); return false; diff --git a/web/pgadmin/tools/user_management/static/js/user_management.js b/web/pgadmin/tools/user_management/static/js/user_management.js index 388b57127..1de5abb98 100644 --- a/web/pgadmin/tools/user_management/static/js/user_management.js +++ b/web/pgadmin/tools/user_management/static/js/user_management.js @@ -89,10 +89,10 @@ define([ if (!alertify.ChangePassword) { alertify.dialog('ChangePassword', function factory() { return { - main: function(title, url) { + main: function(alertTitle, alertUrl) { this.set({ - 'title': title, - 'url': url, + 'title': alertTitle, + 'url': alertUrl, }); }, build: function() { @@ -195,10 +195,10 @@ define([ if(!alertify.PgaLogin) { alertify.dialog('PgaLogin' ,function factory() { return { - main: function(title, url) { + main: function(alertTitle, alertUrl) { this.set({ - 'title': title, - 'url': url, + 'title': alertTitle, + 'url': alertUrl, }); }, build: function() { @@ -241,11 +241,11 @@ define([ // create the iframe element var self = this, iframe = document.createElement('iframe'), - url = this.setting('url'); + frameUrl = this.setting('url'); iframe.onload = function() { var doc = this.contentDocument || this.contentWindow.document; - if (doc.location.href.indexOf(url) == -1) { + if (doc.location.href.indexOf(frameUrl) == -1) { // login successful. this.contentWindow.stop(); @@ -260,7 +260,7 @@ define([ iframe.frameBorder = 'no'; iframe.width = '100%'; iframe.height = '100%'; - iframe.src = url; + iframe.src = frameUrl; // add it to the dialog self.elements.content.appendChild(iframe); }, diff --git a/web/regression/javascript/selection/column_selector_spec.js b/web/regression/javascript/selection/column_selector_spec.js index 481250bbd..11458bc3e 100644 --- a/web/regression/javascript/selection/column_selector_spec.js +++ b/web/regression/javascript/selection/column_selector_spec.js @@ -378,10 +378,10 @@ describe('ColumnSelector', function () { }); }); - function setupGrid(columns) { + function setupGrid(gridColumns) { var columnSelector = new ColumnSelector(); - columns = columnSelector.getColumnDefinitions(columns); - var grid = new SlickGrid(container, data, columns, options); + gridColumns = columnSelector.getColumnDefinitions(gridColumns); + var grid = new SlickGrid(container, data, gridColumns, options); var cellSelectionModel = new XCellSelectionModel(); grid.setSelectionModel(cellSelectionModel); diff --git a/web/regression/javascript/sqleditor/execute_query_spec.js b/web/regression/javascript/sqleditor/execute_query_spec.js index c63d5a260..dd37342c9 100644 --- a/web/regression/javascript/sqleditor/execute_query_spec.js +++ b/web/regression/javascript/sqleditor/execute_query_spec.js @@ -839,13 +839,13 @@ describe('ExecuteQuery', () => { errormsg: 'Some error in JSON', }; let errorMessageText = 'Some plain text error'; - let response; + let res; describe('when the connection to the server was lost', () => { describe('when JSON response is available', () => { beforeEach(() => { - response = {responseJSON: errorMessageJson}; - networkMock.onGet('/sqleditor/query_tool/poll/123').reply(401, response); + res = {responseJSON: errorMessageJson}; + networkMock.onGet('/sqleditor/query_tool/poll/123').reply(401, res); executeQuery.poll(); }); @@ -906,8 +906,8 @@ describe('ExecuteQuery', () => { }); describe('when no JSON response is available', () => { beforeEach(() => { - response = {errormsg: errorMessageText}; - networkMock.onGet('/sqleditor/query_tool/poll/123').reply(401, response); + res = {errormsg: errorMessageText}; + networkMock.onGet('/sqleditor/query_tool/poll/123').reply(401, res); executeQuery.poll(); }); diff --git a/web/regression/javascript/sqleditor/query_tool_actions_spec.js b/web/regression/javascript/sqleditor/query_tool_actions_spec.js index afdc6ab45..15021c463 100644 --- a/web/regression/javascript/sqleditor/query_tool_actions_spec.js +++ b/web/regression/javascript/sqleditor/query_tool_actions_spec.js @@ -607,9 +607,9 @@ describe('queryToolActions', () => { }); }); - function setUpSpies(selectedQueryString, entireQueryString) { - getValueSpy = jasmine.createSpy('getValueSpy').and.returnValue(entireQueryString); - getSelectionSpy = jasmine.createSpy('getSelectionSpy').and.returnValue(selectedQueryString); + function setUpSpies(selectedQueryStringArg, entireQueryStringArg) { + getValueSpy = jasmine.createSpy('getValueSpy').and.returnValue(entireQueryStringArg); + getSelectionSpy = jasmine.createSpy('getSelectionSpy').and.returnValue(selectedQueryStringArg); replaceSelectionSpy = jasmine.createSpy('replaceSelectionSpy'); sqlEditorController = { @@ -622,7 +622,7 @@ describe('queryToolActions', () => { uncomment: jasmine.createSpy('uncommentSpy'), replaceSelection: replaceSelectionSpy, getCursor: (isFrom) => { - return entireQueryString.indexOf(selectedQueryString) + (isFrom ? 0 : selectedQueryString.length); + return entireQueryStringArg.indexOf(selectedQueryStringArg) + (isFrom ? 0 : selectedQueryStringArg.length); }, }, },