From 343c3ee49c8a4e252d0a5a22d59e85325836af1f Mon Sep 17 00:00:00 2001 From: Akshay Joshi Date: Fri, 21 Jan 2022 18:53:48 +0530 Subject: [PATCH] Fixed following code smells reported by SonarQube: 1) Remove this redundant jump. 2) Remove this commented out code. 3) Variables should not be shadowed. --- .../static/js/foreign_table.ui.js | 11 +++-- .../sequences/static/js/sequence.ui.js | 1 - .../tables/indexes/static/js/index.ui.js | 4 +- .../schemas/tables/static/js/table.ui.js | 15 ++++--- .../databases/schemas/types/static/js/type.js | 1 - .../schemas/types/static/js/type.ui.js | 10 ++--- .../schemas/views/static/js/mview.js | 1 - .../servers/databases/static/js/database.js | 4 +- .../servers/roles/static/js/role.js | 30 ++++++------- .../server_groups/servers/static/js/server.js | 1 - web/pgadmin/browser/static/js/browser.js | 2 +- web/pgadmin/browser/static/js/dialog.js | 5 +-- web/pgadmin/browser/static/js/keyboard.js | 1 - web/pgadmin/browser/static/js/node_view.jsx | 10 ++--- web/pgadmin/browser/static/js/preferences.js | 2 - .../misc/bgprocess/static/js/bgprocess.js | 2 - .../file_manager/static/js/select_dialogue.js | 4 +- .../misc/file_manager/static/js/utility.js | 4 -- .../preferences/static/js/preferences.js | 4 +- .../static/js/SchemaView/DataGridView.jsx | 9 ++-- .../static/js/SchemaView/FieldSetView.jsx | 4 +- web/pgadmin/static/js/SchemaView/FormView.jsx | 4 +- .../static/js/SchemaView/MappedControl.jsx | 16 +++---- .../static/js/components/CheckBoxTree.jsx | 4 +- web/pgadmin/static/js/components/PgTable.jsx | 4 +- web/pgadmin/static/js/slickgrid/editors.js | 1 - .../static/js/sqleditor/filter_dialog.js | 1 - web/pgadmin/static/js/sqleditor/macro.js | 1 - .../js/sqleditor/new_connection_dialog.js | 5 +-- .../static/js/sqleditor/query_tool_actions.js | 1 - web/pgadmin/static/vendor/require/require.js | 42 +++++++++---------- .../tools/backup/static/js/backup.ui.js | 14 +++---- .../tools/backup/static/js/backupGlobal.ui.js | 4 +- .../tools/debugger/static/js/debugger.js | 4 +- .../tools/erd/static/js/erd_tool/ERDCore.js | 4 +- .../grant_wizard/static/js/GrantWizard.jsx | 8 ++-- .../import_export/static/js/import_export.js | 2 - .../static/js/ImportExportServers.jsx | 4 +- .../maintenance/static/js/maintenance.js | 4 +- .../maintenance/static/js/maintenance.ui.js | 4 +- .../tools/psql/static/js/psql_module.js | 14 +++---- .../tools/restore/static/js/restore.ui.js | 14 +++---- .../schema_diff/static/js/schema_diff_ui.js | 2 +- .../javascript/browser/preferences_spec.js | 1 - .../import_export_servers.ui.spec.js | 2 +- .../schema_ui_files/index.ui.spec.js | 2 +- .../row_security_policy.ui.spec.js | 1 - .../schema_ui_files/trigger.ui.spec.js | 1 - .../sqleditor/execute_query_spec.js | 1 - .../sqleditor/query_tool_actions_spec.js | 1 - 50 files changed, 130 insertions(+), 161 deletions(-) diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/static/js/foreign_table.ui.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/static/js/foreign_table.ui.js index 428e7619d..8561131ed 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/static/js/foreign_table.ui.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/static/js/foreign_table.ui.js @@ -73,7 +73,6 @@ export default class ForeignTableSchema extends BaseUISchema { return t.value; } } - return; } @@ -133,9 +132,9 @@ export default class ForeignTableSchema extends BaseUISchema { if(tabColsResponse) { tabColsResponse.then((res)=>{ - resolve((state)=>{ + resolve((tmpstate)=>{ let finalCols = res.map((col)=>obj.columnsObj.getNewData(col)); - finalCols = [...state.columns, ...finalCols]; + finalCols = [...tmpstate.columns, ...finalCols]; return { adding_inherit_cols: false, columns: finalCols, @@ -156,9 +155,9 @@ export default class ForeignTableSchema extends BaseUISchema { removeOid = this.getTableOid(tabName); } if(removeOid) { - resolve((state)=>{ - let finalCols = state.columns; - _.remove(state.columns, (col)=>col.inheritedid==removeOid); + resolve((tmpstate)=>{ + let finalCols = tmpstate.columns; + _.remove(tmpstate.columns, (col)=>col.inheritedid==removeOid); return { adding_inherit_cols: false, columns: finalCols diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/static/js/sequence.ui.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/static/js/sequence.ui.js index 726ecd51a..66b8cfd49 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/static/js/sequence.ui.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/sequences/static/js/sequence.ui.js @@ -32,7 +32,6 @@ export class OwnedBySchema extends BaseUISchema { return t._id; } } - return; } get baseFields() { diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/static/js/index.ui.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/static/js/index.ui.js index 87fa07096..427cfbbcb 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/static/js/index.ui.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/static/js/index.ui.js @@ -208,7 +208,7 @@ function inSchema(node_info) { } export default class IndexSchema extends BaseUISchema { - constructor(getColumnSchema, fieldOptions = {}, nodeData = [], initValues={}) { + constructor(columnSchema, fieldOptions = {}, nodeData = [], initValues={}) { super({ name: undefined, oid: undefined, @@ -230,7 +230,7 @@ export default class IndexSchema extends BaseUISchema { this.node_info = { ...nodeData.node_info }; - this.getColumnSchema = getColumnSchema; + this.getColumnSchema = columnSchema; } get idAttribute() { diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.ui.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.ui.js index e62e00705..dbbc2eb6e 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.ui.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.ui.js @@ -387,7 +387,6 @@ export default class TableSchema extends BaseUISchema { return t.tid; } } - return; } // Check for column grid when to Add @@ -535,14 +534,14 @@ export default class TableSchema extends BaseUISchema { if(tabColsResponse) { tabColsResponse.then((res)=>{ - resolve((state)=>{ + resolve((tmpstate)=>{ let finalCols = res.map((col)=>obj.columnsSchema.getNewData(col)); let currentSelectedCols = []; - if (!_.isEmpty(state.columns)){ - currentSelectedCols = state.columns; + if (!_.isEmpty(tmpstate.columns)){ + currentSelectedCols = tmpstate.columns; } let colNameList = []; - state.columns.forEach((col=>{ + tmpstate.columns.forEach((col=>{ colNameList.push(col.name); })); for (let col of Object.values(finalCols)) { @@ -576,9 +575,9 @@ export default class TableSchema extends BaseUISchema { removeOid = this.getTableOid(tabName); } if(removeOid) { - resolve((state)=>{ - let finalCols = state.columns; - _.remove(state.columns, (col)=>col.inheritedid==removeOid); + resolve((tmpstate)=>{ + let finalCols = tmpstate.columns; + _.remove(tmpstate.columns, (col)=>col.inheritedid==removeOid); obj.changeColumnOptions(finalCols); return { adding_inherit_cols: false, diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.js index 1edcfb252..f0ec287f0 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.js @@ -7,7 +7,6 @@ // ////////////////////////////////////////////////////////////// -// import TypeSchema from './type.ui'; import { getNodeListByName } from '../../../../../../../static/js/node_ajax'; import { getNodePrivilegeRoleSchema } from '../../../../../static/js/privilege.ui'; import TypeSchema, { getCompositeSchema, getRangeSchema, getExternalSchema, getDataTypeSchema } from './type.ui'; diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui.js index 06ee019f5..99b9928b0 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui.js @@ -1269,7 +1269,7 @@ class DataTypeSchema extends BaseUISchema { } export default class TypeSchema extends BaseUISchema { - constructor(getPrivilegeRoleSchema, getCompositeSchema, getRangeSchema, getExternalSchema, getDataTypeSchema, fieldOptions = {}, initValues={}) { + constructor(getPrivilegeRoleSchema, compositeSchema, rangeSchema, externalSchema, dataTypeSchema, fieldOptions = {}, initValues={}) { super({ name: null, oid: undefined, @@ -1287,10 +1287,10 @@ export default class TypeSchema extends BaseUISchema { ...fieldOptions }; this.getPrivilegeRoleSchema = getPrivilegeRoleSchema; - this.compositeSchema = getCompositeSchema(); // create only once the composite schema to avoid initializing the current (i.e. top) - this.getRangeSchema = getRangeSchema; - this.getExternalSchema = getExternalSchema; - this.getDataTypeSchema = getDataTypeSchema; + this.compositeSchema = compositeSchema(); // create only once the composite schema to avoid initializing the current (i.e. top) + this.getRangeSchema = rangeSchema; + this.getExternalSchema = externalSchema; + this.getDataTypeSchema = dataTypeSchema; this.nodeInfo = this.fieldOptions.node_info; } diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/mview.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/mview.js index efe62d0f3..393707c9b 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/mview.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/mview.js @@ -310,7 +310,6 @@ define('pgadmin.node.mview', [ gettext('Utility not found'), gettext('Failed to fetch Utility information') ); - return; }); }, diff --git a/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js b/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js index 0c9c73b30..54aa7b718 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js +++ b/web/pgadmin/browser/server_groups/servers/databases/static/js/database.js @@ -424,10 +424,10 @@ define('pgadmin.node.database', [ function() { connect_to_database(_model, _data, _tree, _item, _wasConnected); }, - function(error) { + function(fun_error) { tree.setInode(_item); tree.addIcon(_item, {icon: 'icon-database-not-connected'}); - Notify.pgNotifier(error, xhr, gettext('Connect to database.')); + Notify.pgNotifier(fun_error, xhr, gettext('Connect to database.')); } ); } else { diff --git a/web/pgadmin/browser/server_groups/servers/roles/static/js/role.js b/web/pgadmin/browser/server_groups/servers/roles/static/js/role.js index 98d176623..1147e352c 100644 --- a/web/pgadmin/browser/server_groups/servers/roles/static/js/role.js +++ b/web/pgadmin/browser/server_groups/servers/roles/static/js/role.js @@ -266,14 +266,14 @@ define('pgadmin.node.role', [ deps: ['role_op'], filter: function(d) { // Exclude the currently selected - let tree = pgBrowser.tree, - _i = tree.selected(), - _d = _i && _i.length == 1 ? tree.itemData(_i) : undefined; + let ltree = pgBrowser.tree, + _idx = ltree.selected(), + _data = _idx && _idx.length == 1 ? ltree.itemData(_idx) : undefined; - if(!_d) + if(!_data) return true; - return d && (d.label != _d.label); + return d && (d.label != _data.label); }, }, { @@ -434,18 +434,18 @@ define('pgadmin.node.role', [ //Disable Okay button self.__internal.buttons[2].element.disabled = true; // Find current/selected node - var tree = pgBrowser.tree, - _i = tree.selected(), - _d = _i ? tree.itemData(_i) : undefined, - node = _d && pgBrowser.Nodes[_d._type]; + var ltree = pgBrowser.tree, + _idx = ltree.selected(), + _data = _idx ? ltree.itemData(_idx) : undefined, + node = _data && pgBrowser.Nodes[_data._type]; - finalUrl = obj.generate_url(_i, 'reassign' , _d, true); - old_role_name = _d.label; + finalUrl = obj.generate_url(_idx, 'reassign' , _data, true); + old_role_name = _data.label; - if (!_d) + if (!_data) return; // Create treeInfo - var treeInfo = pgBrowser.tree.getTreeNodeHierarchy(_i); + var treeInfo = pgBrowser.tree.getTreeNodeHierarchy(_idx); // Instance of backbone model var newModel = new RoleReassignObjectModel({}, {node_info: treeInfo}), fields = Backform.generateViewSchema( @@ -552,8 +552,8 @@ define('pgadmin.node.role', [ gettext('Role reassign/drop failed.'), err.errormsg ); - } catch (e) { - console.warn(e.stack || e); + } catch (ex) { + console.warn(ex.stack || ex); } }); }, diff --git a/web/pgadmin/browser/server_groups/servers/static/js/server.js b/web/pgadmin/browser/server_groups/servers/static/js/server.js index c943243b1..0793a52c1 100644 --- a/web/pgadmin/browser/server_groups/servers/static/js/server.js +++ b/web/pgadmin/browser/server_groups/servers/static/js/server.js @@ -831,7 +831,6 @@ define('pgadmin.node.server', [ tree.addIcon(item, {icon: 'icon-shared-server-not-connected'}); } } - return; }).always(function(){ data.is_connecting = false; }); diff --git a/web/pgadmin/browser/static/js/browser.js b/web/pgadmin/browser/static/js/browser.js index 6298b6686..53c4ac45d 100644 --- a/web/pgadmin/browser/static/js/browser.js +++ b/web/pgadmin/browser/static/js/browser.js @@ -2031,7 +2031,7 @@ define('pgadmin.browser', [ null, 'nodes', childDummyInfo, true, childTreeInfo ); - var _node = _node || arguments[1]; + _node = _node || arguments[1]; $.ajax({ url: childNodeUrl, diff --git a/web/pgadmin/browser/static/js/dialog.js b/web/pgadmin/browser/static/js/dialog.js index 00262e064..a785b60ad 100644 --- a/web/pgadmin/browser/static/js/dialog.js +++ b/web/pgadmin/browser/static/js/dialog.js @@ -22,8 +22,8 @@ function url_dialog(_title, _url, _help_filename, _width, _height) { alertify.dialog(dlgName, function factory() { return { - main: function(_title) { - this.set({'title': _title}); + main: function(_tmptitle) { + this.set({'title': _tmptitle}); }, build: function() { alertify.pgDialogBuild.apply(this); @@ -95,7 +95,6 @@ function url_dialog(_title, _url, _help_filename, _width, _height) { e.button.element.name, e.button.element.getAttribute('url'), null, null ); - return; } }, }; diff --git a/web/pgadmin/browser/static/js/keyboard.js b/web/pgadmin/browser/static/js/keyboard.js index 04ca89c13..989f8bb5b 100644 --- a/web/pgadmin/browser/static/js/keyboard.js +++ b/web/pgadmin/browser/static/js/keyboard.js @@ -244,7 +244,6 @@ _.extend(pgBrowser.keyboardNavigation, { const tree = this.getTreeDetails(); $('#tree').trigger('focus'); - // tree.t.focus(tree.i); tree.t.select(tree.i); }, bindSubMenuQueryTool: function() { diff --git a/web/pgadmin/browser/static/js/node_view.jsx b/web/pgadmin/browser/static/js/node_view.jsx index a2a47ffad..68803adf6 100644 --- a/web/pgadmin/browser/static/js/node_view.jsx +++ b/web/pgadmin/browser/static/js/node_view.jsx @@ -96,21 +96,21 @@ export function getNodeView(nodeType, treeNodeInfo, actionType, itemNodeData, fo const onHelp = (isSqlHelp=false, isNew=false)=>{ if(isSqlHelp) { let server = treeNodeInfo.server; - let url = pgAdmin.Browser.utils.pg_help_path; + let helpUrl = pgAdmin.Browser.utils.pg_help_path; let fullUrl = ''; if (server.server_type == 'ppas' && nodeObj.epasHelp) { fullUrl = getEPASHelpUrl(server.version); } else { if (nodeObj.sqlCreateHelp == '' && nodeObj.sqlAlterHelp != '') { - fullUrl = getHelpUrl(url, nodeObj.sqlAlterHelp, server.version); + fullUrl = getHelpUrl(helpUrl, nodeObj.sqlAlterHelp, server.version); } else if (nodeObj.sqlCreateHelp != '' && nodeObj.sqlAlterHelp == '') { - fullUrl = getHelpUrl(url, nodeObj.sqlCreateHelp, server.version); + fullUrl = getHelpUrl(helpUrl, nodeObj.sqlCreateHelp, server.version); } else { if (isNew) { - fullUrl = getHelpUrl(url, nodeObj.sqlCreateHelp, server.version); + fullUrl = getHelpUrl(helpUrl, nodeObj.sqlCreateHelp, server.version); } else { - fullUrl = getHelpUrl(url, nodeObj.sqlAlterHelp, server.version); + fullUrl = getHelpUrl(helpUrl, nodeObj.sqlAlterHelp, server.version); } } } diff --git a/web/pgadmin/browser/static/js/preferences.js b/web/pgadmin/browser/static/js/preferences.js index b5d42c06b..600027ac4 100644 --- a/web/pgadmin/browser/static/js/preferences.js +++ b/web/pgadmin/browser/static/js/preferences.js @@ -14,8 +14,6 @@ import * as SqlEditorUtils from 'sources/sqleditor_utils'; import pgWindow from 'sources/window'; import Notify from '../../../static/js/helpers/Notifier'; -//var modifyAnimation = require('sources/modify_animation'); - const pgBrowser = pgAdmin.Browser = pgAdmin.Browser || {}; /* Add cache related methods and properties */ diff --git a/web/pgadmin/misc/bgprocess/static/js/bgprocess.js b/web/pgadmin/misc/bgprocess/static/js/bgprocess.js index 737d858b5..633354cf4 100644 --- a/web/pgadmin/misc/bgprocess/static/js/bgprocess.js +++ b/web/pgadmin/misc/bgprocess/static/js/bgprocess.js @@ -373,8 +373,6 @@ define('misc.bgprocess', [ ev = ev || window.event; ev.cancelBubble = true; ev.stopPropagation(); - - return; }); // On Click event to stop the process. diff --git a/web/pgadmin/misc/file_manager/static/js/select_dialogue.js b/web/pgadmin/misc/file_manager/static/js/select_dialogue.js index c5b909992..678148a03 100644 --- a/web/pgadmin/misc/file_manager/static/js/select_dialogue.js +++ b/web/pgadmin/misc/file_manager/static/js/select_dialogue.js @@ -142,9 +142,7 @@ module.exports = Alertify.dialog('fileSelectionDlg', function() { Alertify.pgDialogBuild.apply(this); }, hooks: { - onshow: function() { - // $(this.elements.body).addClass('pgadmin-storage-body'); - }, + onshow: function() {/* This is intentional (SonarQube) */}, }, }; }); diff --git a/web/pgadmin/misc/file_manager/static/js/utility.js b/web/pgadmin/misc/file_manager/static/js/utility.js index 5e28fcad5..01d9ef21a 100644 --- a/web/pgadmin/misc/file_manager/static/js/utility.js +++ b/web/pgadmin/misc/file_manager/static/js/utility.js @@ -1205,7 +1205,6 @@ define([ }); } - //input_object.set_cap(data_cap); }) .fail(function() { $('.storage_dialog #uploader .input-path').prop('disabled', false); @@ -1448,7 +1447,6 @@ define([ } // Save it in preference save_show_hidden_file_option(tmp_data['is_checked'], pgAdmin.FileUtils.transId); - return; }; } @@ -1635,14 +1633,12 @@ define([ if (config.options.dialog_type == 'create_file') { var status = checkPermission(path); if (status) { - //$('.file_manager').trigger('enter-key'); $('.file_manager_ok').trigger('click'); } } else if (config.options.dialog_type == 'select_file') { var file_status = getFileInfo(path); if (file_status) { $('.file_manager_ok').trigger('click'); - //$('.file_manager').trigger('enter-key'); } } } diff --git a/web/pgadmin/preferences/static/js/preferences.js b/web/pgadmin/preferences/static/js/preferences.js index afe418bfd..ebef31cad 100644 --- a/web/pgadmin/preferences/static/js/preferences.js +++ b/web/pgadmin/preferences/static/js/preferences.js @@ -615,9 +615,7 @@ define('pgadmin.preferences', [ Alertify.pgDialogBuild.apply(this); }, hooks: { - onshow: function() { - // $(this.elements.body).addClass('pgadmin-preference-body'); - }, + onshow: function() {/* This is intentional (SonarQube) */}, }, }; }); diff --git a/web/pgadmin/static/js/SchemaView/DataGridView.jsx b/web/pgadmin/static/js/SchemaView/DataGridView.jsx index 32bddd7cf..9315732aa 100644 --- a/web/pgadmin/static/js/SchemaView/DataGridView.jsx +++ b/web/pgadmin/static/js/SchemaView/DataGridView.jsx @@ -355,7 +355,7 @@ export default function DataGridView({ disableResizing: false, sortable: true, ...widthParms, - Cell: ({value, row, ...other}) => { + Cell: ({cellValue, row, ...other}) => { /* Make sure to take the latest field info from schema */ field = _.find(schemaRef.current.fields, (f)=>f.id==field.id) || field; @@ -365,16 +365,16 @@ export default function DataGridView({ console.error('cell is required ', field); } - return { + onCellChange={(changeValue)=>{ dataDispatch({ type: SCHEMA_STATE_ACTIONS.SET_VALUE, path: accessPath.concat([row.index, field.id]), - value: value, + value: changeValue, }); }} reRenderRow={other.reRenderRow} @@ -385,6 +385,7 @@ export default function DataGridView({ colInfo.Cell.propTypes = { row: PropTypes.object.isRequired, value: PropTypes.any, + cellValue: PropTypes.any, onCellChange: PropTypes.func, }; return colInfo; diff --git a/web/pgadmin/static/js/SchemaView/FieldSetView.jsx b/web/pgadmin/static/js/SchemaView/FieldSetView.jsx index ef8502ebb..049683ce2 100644 --- a/web/pgadmin/static/js/SchemaView/FieldSetView.jsx +++ b/web/pgadmin/static/js/SchemaView/FieldSetView.jsx @@ -69,12 +69,12 @@ export default function FieldSetView({ readonly={readonly} disabled={disabled} visible={visible} - onChange={(value)=>{ + onChange={(changeValue)=>{ /* Get the changes on dependent fields as well */ dataDispatch({ type: SCHEMA_STATE_ACTIONS.SET_VALUE, path: accessPath.concat(field.id), - value: value, + value: changeValue, }); }} hasError={hasError} diff --git a/web/pgadmin/static/js/SchemaView/FormView.jsx b/web/pgadmin/static/js/SchemaView/FormView.jsx index 5d96e6c21..fc7ddca19 100644 --- a/web/pgadmin/static/js/SchemaView/FormView.jsx +++ b/web/pgadmin/static/js/SchemaView/FormView.jsx @@ -303,12 +303,12 @@ export default function FormView({ readonly={readonly} disabled={disabled} visible={visible} - onChange={(value)=>{ + onChange={(changeValue)=>{ /* Get the changes on dependent fields as well */ dataDispatch({ type: SCHEMA_STATE_ACTIONS.SET_VALUE, path: accessPath.concat(id), - value: value, + value: changeValue, }); }} hasError={hasError} diff --git a/web/pgadmin/static/js/SchemaView/MappedControl.jsx b/web/pgadmin/static/js/SchemaView/MappedControl.jsx index 62c211b08..243fff561 100644 --- a/web/pgadmin/static/js/SchemaView/MappedControl.jsx +++ b/web/pgadmin/static/js/SchemaView/MappedControl.jsx @@ -23,15 +23,15 @@ import { SelectRefresh} from '../components/SelectRefresh'; function MappedFormControlBase({type, value, id, onChange, className, visible, inputRef, noLabel, ...props}) { const name = id; const onTextChange = useCallback((e) => { - let value = e; + let val = e; if(e && e.target) { - value = e.target.value; + val = e.target.value; } - onChange && onChange(value); + onChange && onChange(val); }, []); - const onSqlChange = useCallback((value) => { - onChange && onChange(value); + const onSqlChange = useCallback((changedValue) => { + onChange && onChange(changedValue); }, []); if(!visible) { @@ -103,12 +103,12 @@ MappedFormControlBase.propTypes = { function MappedCellControlBase({cell, value, id, optionsLoaded, onCellChange, visible, reRenderRow,...props}) { const name = id; const onTextChange = useCallback((e) => { - let value = e; + let val = e; if(e && e.target) { - value = e.target.value; + val = e.target.value; } - onCellChange && onCellChange(value); + onCellChange && onCellChange(val); }, []); /* Some grid cells are based on options selected in other cells. diff --git a/web/pgadmin/static/js/components/CheckBoxTree.jsx b/web/pgadmin/static/js/components/CheckBoxTree.jsx index 11d303056..61140acaf 100644 --- a/web/pgadmin/static/js/components/CheckBoxTree.jsx +++ b/web/pgadmin/static/js/components/CheckBoxTree.jsx @@ -51,8 +51,8 @@ export default function CheckBoxTree({treeData, ...props}) { nodes={treeData} checked={checked} expanded={expanded} - onCheck={checked => setChecked(checked)} - onExpand={expanded => setExpanded(expanded)} + onCheck={checkedVal => setChecked(checkedVal)} + onExpand={expandedVal => setExpanded(expandedVal)} showNodeIcon={false} icons={{ check: , diff --git a/web/pgadmin/static/js/components/PgTable.jsx b/web/pgadmin/static/js/components/PgTable.jsx index 028be2e09..7a56ab83d 100644 --- a/web/pgadmin/static/js/components/PgTable.jsx +++ b/web/pgadmin/static/js/components/PgTable.jsx @@ -171,9 +171,9 @@ export default function PgTable({ columns, data, isSelectRow, ...props }) { return [...CLOUMNS]; } }); - hooks.useInstanceBeforeDimensions.push(({ headerGroups }) => { + hooks.useInstanceBeforeDimensions.push(({ tmpHeaderGroups }) => { // fix the parent group of the selection button to not be resizable - const selectionGroupHeader = headerGroups[0].headers[0]; + const selectionGroupHeader = tmpHeaderGroups[0].headers[0]; selectionGroupHeader.resizable = false; }); } diff --git a/web/pgadmin/static/js/slickgrid/editors.js b/web/pgadmin/static/js/slickgrid/editors.js index cc350ea59..168466225 100644 --- a/web/pgadmin/static/js/slickgrid/editors.js +++ b/web/pgadmin/static/js/slickgrid/editors.js @@ -864,7 +864,6 @@ import Notify from '../../../static/js/helpers/Notifier'; }; this.isValueChanged = function() { - // var select_value = this.serializeValue(); var select_value = $select.data('checked'); return (!(select_value === 2 && (defaultValue == null || defaultValue == undefined))) && (select_value !== defaultValue); diff --git a/web/pgadmin/static/js/sqleditor/filter_dialog.js b/web/pgadmin/static/js/sqleditor/filter_dialog.js index d870426b0..76a187b71 100644 --- a/web/pgadmin/static/js/sqleditor/filter_dialog.js +++ b/web/pgadmin/static/js/sqleditor/filter_dialog.js @@ -209,7 +209,6 @@ let FilterDialog = { e.cancel = true; pgAdmin.Browser.showHelp(e.button.element.name, e.button.element.getAttribute('url'), null, null); - return; } else if (e.button['data-btn-name'] === 'ok') { e.cancel = true; // Do not close dialog diff --git a/web/pgadmin/static/js/sqleditor/macro.js b/web/pgadmin/static/js/sqleditor/macro.js index 0b6389c2d..ff470c9d5 100644 --- a/web/pgadmin/static/js/sqleditor/macro.js +++ b/web/pgadmin/static/js/sqleditor/macro.js @@ -251,7 +251,6 @@ let MacroDialog = { e.cancel = true; pgAdmin.Browser.showHelp(e.button.element.name, e.button.element.getAttribute('url'), null, null); - return; } else if (e.button['data-btn-name'] === 'ok') { e.cancel = true; // Do not close dialog diff --git a/web/pgadmin/static/js/sqleditor/new_connection_dialog.js b/web/pgadmin/static/js/sqleditor/new_connection_dialog.js index d2ff2b86b..6752ec3d4 100644 --- a/web/pgadmin/static/js/sqleditor/new_connection_dialog.js +++ b/web/pgadmin/static/js/sqleditor/new_connection_dialog.js @@ -192,7 +192,7 @@ let NewConnectionDialog = { self.showNewConnectionProgress[0] ).addClass('d-none'); }, - get_title: function(qt_title_placeholder, selected_database_name, newConnCollectionModel, response) { + get_title: function(qt_title_placeholder, selected_database_name, newConnCollectionModel, tmpResponse) { qt_title_placeholder = qt_title_placeholder.replace(new RegExp('%DATABASE%'), selected_database_name); if(newConnCollectionModel['role']) { qt_title_placeholder = qt_title_placeholder.replace(new RegExp('%USERNAME%'), newConnCollectionModel['role']); @@ -200,7 +200,7 @@ let NewConnectionDialog = { qt_title_placeholder = qt_title_placeholder.replace(new RegExp('%USERNAME%'), newConnCollectionModel['user']); } - qt_title_placeholder = qt_title_placeholder.replace(new RegExp('%SERVER%'), response.server_name); + qt_title_placeholder = qt_title_placeholder.replace(new RegExp('%SERVER%'), tmpResponse.server_name); return qt_title_placeholder; }, callback: function(e) { @@ -209,7 +209,6 @@ let NewConnectionDialog = { e.cancel = true; pgAdmin.Browser.showHelp(e.button.element.name, e.button.element.getAttribute('url'), null, null); - return; } else if (e.button['data-btn-name'] === 'ok') { e.cancel = true; // Do not close dialog let newConnCollectionModel = this.newConnCollectionModel.toJSON(); diff --git a/web/pgadmin/static/js/sqleditor/query_tool_actions.js b/web/pgadmin/static/js/sqleditor/query_tool_actions.js index 2bf76613c..379c8c4d1 100644 --- a/web/pgadmin/static/js/sqleditor/query_tool_actions.js +++ b/web/pgadmin/static/js/sqleditor/query_tool_actions.js @@ -65,7 +65,6 @@ let queryToolActions = { }, explain: function (sqlEditorController) { - /* let explainQuery = `EXPLAIN (FORMAT JSON, ANALYZE OFF, VERBOSE ${verbose}, COSTS ${costEnabled}, BUFFERS OFF, TIMING OFF) `; */ const explainObject = { format: 'json', analyze: false, diff --git a/web/pgadmin/static/vendor/require/require.js b/web/pgadmin/static/vendor/require/require.js index 2d34ba794..07acbc3ac 100644 --- a/web/pgadmin/static/vendor/require/require.js +++ b/web/pgadmin/static/vendor/require/require.js @@ -444,8 +444,8 @@ var requirejs, require, define; normalizedName = name; } else if (pluginModule && pluginModule.normalize) { //Plugin is loaded, use its normalize method. - normalizedName = pluginModule.normalize(name, function (name) { - return normalize(name, parentName, applyMap); + normalizedName = pluginModule.normalize(name, function (tmpName) { + return normalize(tmpName, parentName, applyMap); }); } else { // If nested plugin references, then do not try to @@ -966,8 +966,8 @@ var requirejs, require, define; if (this.map.unnormalized) { //Normalize the ID if the plugin allows it. if (plugin.normalize) { - name = plugin.normalize(name, function (name) { - return normalize(name, parentName, true); + name = plugin.normalize(name, function (tmpName) { + return normalize(tmpName, parentName, true); }) || ''; } @@ -1277,20 +1277,20 @@ var requirejs, require, define; /** * Set a configuration for the context. - * @param {Object} cfg config object to integrate. + * @param {Object} cnfg config object to integrate. */ - configure: function (cfg) { + configure: function (cnfg) { //Make sure the baseUrl ends in a slash. - if (cfg.baseUrl) { - if (cfg.baseUrl.charAt(cfg.baseUrl.length - 1) !== '/') { - cfg.baseUrl += '/'; + if (cnfg.baseUrl) { + if (cnfg.baseUrl.charAt(cnfg.baseUrl.length - 1) !== '/') { + cnfg.baseUrl += '/'; } } // Convert old style urlArgs string to a function. - if (typeof cfg.urlArgs === 'string') { - var urlArgs = cfg.urlArgs; - cfg.urlArgs = function(id, url) { + if (typeof cnfg.urlArgs === 'string') { + var urlArgs = cnfg.urlArgs; + cnfg.urlArgs = function(id, url) { return (url.indexOf('?') === -1 ? '?' : '&') + urlArgs; }; } @@ -1305,7 +1305,7 @@ var requirejs, require, define; map: true }; - eachProp(cfg, function (value, prop) { + eachProp(cnfg, function (value, prop) { if (objs[prop]) { if (!config[prop]) { config[prop] = {}; @@ -1317,8 +1317,8 @@ var requirejs, require, define; }); //Reverse map the bundles - if (cfg.bundles) { - eachProp(cfg.bundles, function (value, prop) { + if (cnfg.bundles) { + eachProp(cnfg.bundles, function (value, prop) { each(value, function (v) { if (v !== prop) { bundlesMap[v] = prop; @@ -1328,8 +1328,8 @@ var requirejs, require, define; } //Merge shim - if (cfg.shim) { - eachProp(cfg.shim, function (value, id) { + if (cnfg.shim) { + eachProp(cnfg.shim, function (value, id) { //Normalize the structure if (isArray(value)) { value = { @@ -1345,8 +1345,8 @@ var requirejs, require, define; } //Adjust packages if necessary. - if (cfg.packages) { - each(cfg.packages, function (pkgObj) { + if (cnfg.packages) { + each(cnfg.packages, function (pkgObj) { var location, name; pkgObj = typeof pkgObj === 'string' ? {name: pkgObj} : pkgObj; @@ -1383,8 +1383,8 @@ var requirejs, require, define; //If a deps array or a config callback is specified, then call //require with those args. This is useful when require is defined as a //config object before require.js is loaded. - if (cfg.deps || cfg.callback) { - context.require(cfg.deps || [], cfg.callback); + if (cnfg.deps || cnfg.callback) { + context.require(cnfg.deps || [], cnfg.callback); } }, diff --git a/web/pgadmin/tools/backup/static/js/backup.ui.js b/web/pgadmin/tools/backup/static/js/backup.ui.js index 8b18b8ea6..d8002216c 100644 --- a/web/pgadmin/tools/backup/static/js/backup.ui.js +++ b/web/pgadmin/tools/backup/static/js/backup.ui.js @@ -381,7 +381,7 @@ export function getMiscellaneousSchema(fieldOptions) { } export default class BackupSchema extends BaseUISchema { - constructor(getSectionSchema, getTypeObjSchema, getSaveOptSchema, getQueryOptionSchema, getDisabledOptionSchema, getMiscellaneousSchema, fieldOptions = {}, treeNodeInfo=[], pgBrowser=null, backupType='server') { + constructor(sectionSchema, typeObjSchema, saveOptSchema, queryOptionSchema, disabledOptionSchema, miscellaneousSchema, fieldOptions = {}, treeNodeInfo=[], pgBrowser=null, backupType='server') { super({ file: undefined, format: 'custom', @@ -399,12 +399,12 @@ export default class BackupSchema extends BaseUISchema { this.treeNodeInfo = treeNodeInfo; this.pgBrowser = pgBrowser; this.backupType = backupType; - this.getSectionSchema = getSectionSchema; - this.getTypeObjSchema = getTypeObjSchema; - this.getSaveOptSchema = getSaveOptSchema; - this.getQueryOptionSchema = getQueryOptionSchema; - this.getDisabledOptionSchema = getDisabledOptionSchema; - this.getMiscellaneousSchema = getMiscellaneousSchema; + this.getSectionSchema = sectionSchema; + this.getTypeObjSchema = typeObjSchema; + this.getSaveOptSchema = saveOptSchema; + this.getQueryOptionSchema = queryOptionSchema; + this.getDisabledOptionSchema = disabledOptionSchema; + this.getMiscellaneousSchema = miscellaneousSchema; } get idAttribute() { diff --git a/web/pgadmin/tools/backup/static/js/backupGlobal.ui.js b/web/pgadmin/tools/backup/static/js/backupGlobal.ui.js index b2a4b99f7..309f1bfd3 100644 --- a/web/pgadmin/tools/backup/static/js/backupGlobal.ui.js +++ b/web/pgadmin/tools/backup/static/js/backupGlobal.ui.js @@ -46,7 +46,7 @@ export function getMiscellaneousSchema() { } export default class BackupGlobalSchema extends BaseUISchema { - constructor(getMiscellaneousSchema, fieldOptions = {}) { + constructor(miscellaneousSchema, fieldOptions = {}) { super({ id: null, verbose: true, @@ -57,7 +57,7 @@ export default class BackupGlobalSchema extends BaseUISchema { ...fieldOptions, }; - this.getMiscellaneousSchema = getMiscellaneousSchema; + this.getMiscellaneousSchema = miscellaneousSchema; } get idAttribute() { diff --git a/web/pgadmin/tools/debugger/static/js/debugger.js b/web/pgadmin/tools/debugger/static/js/debugger.js index d846f2509..cebda5812 100644 --- a/web/pgadmin/tools/debugger/static/js/debugger.js +++ b/web/pgadmin/tools/debugger/static/js/debugger.js @@ -582,9 +582,9 @@ define([ url: baseUrl, method: 'GET', }) - .done(function(res) { + .done(function(result) { - var data = res.data; + var data = result.data; var url = url_for('debugger.direct', { 'trans_id': trans_id, diff --git a/web/pgadmin/tools/erd/static/js/erd_tool/ERDCore.js b/web/pgadmin/tools/erd/static/js/erd_tool/ERDCore.js index 690534b70..e3de3670a 100644 --- a/web/pgadmin/tools/erd/static/js/erd_tool/ERDCore.js +++ b/web/pgadmin/tools/erd/static/js/erd_tool/ERDCore.js @@ -311,8 +311,8 @@ export default class ERDCore { let sourceNode = tableNodesDict[onetomanyData.referenced_table_uid]; let targetNode = tableNodesDict[onetomanyData.local_table_uid]; - fkColumn.local_column = _.find(targetNode.getColumns(), (col)=>col.attnum==onetomanyData.local_column_attnum).name; - fkColumn.referenced = _.find(sourceNode.getColumns(), (col)=>col.attnum==onetomanyData.referenced_column_attnum).name; + fkColumn.local_column = _.find(targetNode.getColumns(), (colm)=>colm.attnum==onetomanyData.local_column_attnum).name; + fkColumn.referenced = _.find(sourceNode.getColumns(), (colm)=>colm.attnum==onetomanyData.referenced_column_attnum).name; fkColumn.references = onetomanyData.referenced_table_uid; fkColumn.references_table_name = sourceNode.getData().name; diff --git a/web/pgadmin/tools/grant_wizard/static/js/GrantWizard.jsx b/web/pgadmin/tools/grant_wizard/static/js/GrantWizard.jsx index 449f7a934..a0f38ea2f 100644 --- a/web/pgadmin/tools/grant_wizard/static/js/GrantWizard.jsx +++ b/web/pgadmin/tools/grant_wizard/static/js/GrantWizard.jsx @@ -142,7 +142,7 @@ export default function GrantWizard({ sid, did, nodeInfo, nodeData }) { }, [privileges]); React.useEffect(() => { - const privSchema = new PrivilegeSchema((privileges) => getNodePrivilegeRoleSchema('', nodeInfo, nodeData, privileges)); + const privSchema = new PrivilegeSchema((privs) => getNodePrivilegeRoleSchema('', nodeInfo, nodeData, privs)); setPrivSchemaInstance(privSchema); setLoaderText('Loading...'); @@ -288,13 +288,13 @@ export default function GrantWizard({ sid, did, nodeInfo, nodeData }) { selObj.push(row.values); }); } - var privileges = new Set(); + var privs = new Set(); objectTypes.forEach((objType) => { privOptions[objType]?.acl.forEach((priv) => { - privileges.add(priv); + privs.add(priv); }); }); - setPrivileges(Array.from(privileges)); + setPrivileges(Array.from(privs)); setSelectedObject(selObj); setErrMsg(selObj.length === 0 ? gettext('Please select any database object.') : ''); }; diff --git a/web/pgadmin/tools/import_export/static/js/import_export.js b/web/pgadmin/tools/import_export/static/js/import_export.js index 2f9509077..46927352f 100644 --- a/web/pgadmin/tools/import_export/static/js/import_export.js +++ b/web/pgadmin/tools/import_export/static/js/import_export.js @@ -147,7 +147,6 @@ define([ gettext('Utility not found'), res.data.errormsg ); - return; }else{ // Open the Alertify dialog for the import/export module pgBrowser.Node.registerUtilityPanel(); @@ -179,7 +178,6 @@ define([ gettext('Utility not found'), gettext('Failed to fetch Utility information') ); - return; }); }, }; diff --git a/web/pgadmin/tools/import_export_servers/static/js/ImportExportServers.jsx b/web/pgadmin/tools/import_export_servers/static/js/ImportExportServers.jsx index fee04719c..5a591ca32 100644 --- a/web/pgadmin/tools/import_export_servers/static/js/ImportExportServers.jsx +++ b/web/pgadmin/tools/import_export_servers/static/js/ImportExportServers.jsx @@ -231,8 +231,8 @@ export default function ImportExportServers() { {gettext('Select the Server Groups/Servers to import/export:')} - { - setSelectedServers(selectedServers); + { + setSelectedServers(selServers); }}/> diff --git a/web/pgadmin/tools/maintenance/static/js/maintenance.js b/web/pgadmin/tools/maintenance/static/js/maintenance.js index a7bebebb2..9209e51d0 100644 --- a/web/pgadmin/tools/maintenance/static/js/maintenance.js +++ b/web/pgadmin/tools/maintenance/static/js/maintenance.js @@ -179,7 +179,7 @@ define([ panel.focus(); let urlShortcut = 'maintenance.create_job', - baseUrl = url_for(urlShortcut, { + jobUrl = url_for(urlShortcut, { 'sid': treeInfo.server._id, 'did': treeInfo.database._id }); @@ -191,7 +191,7 @@ define([ }); getUtilityView( - schema, treeInfo, 'select', 'dialog', j[0], panel, that.saveCallBack, extraData, 'OK', baseUrl, sqlHelpUrl, helpUrl); + schema, treeInfo, 'select', 'dialog', j[0], panel, that.saveCallBack, extraData, 'OK', jobUrl, sqlHelpUrl, helpUrl); } }) .catch(function() { diff --git a/web/pgadmin/tools/maintenance/static/js/maintenance.ui.js b/web/pgadmin/tools/maintenance/static/js/maintenance.ui.js index 3748ffbd6..f7681dce8 100644 --- a/web/pgadmin/tools/maintenance/static/js/maintenance.ui.js +++ b/web/pgadmin/tools/maintenance/static/js/maintenance.ui.js @@ -76,7 +76,7 @@ export function getVacuumSchema(fieldOptions) { //Maintenance Schema export default class MaintenanceSchema extends BaseUISchema { - constructor(getVacuumSchema, fieldOptions = {}) { + constructor(vacuumSchema, fieldOptions = {}) { super({ op: 'VACUUM', verbose: true, @@ -90,7 +90,7 @@ export default class MaintenanceSchema extends BaseUISchema { ...fieldOptions, }; - this.getVacuumSchema = getVacuumSchema; + this.getVacuumSchema = vacuumSchema; this.nodeInfo = fieldOptions.nodeInfo; } diff --git a/web/pgadmin/tools/psql/static/js/psql_module.js b/web/pgadmin/tools/psql/static/js/psql_module.js index 08780ff96..e3380152c 100644 --- a/web/pgadmin/tools/psql/static/js/psql_module.js +++ b/web/pgadmin/tools/psql/static/js/psql_module.js @@ -214,21 +214,21 @@ export function initialize(gettext, url_for, $, _, pgAdmin, csrfToken, Browser) } }, - getPanelUrls: function(transId, panelTitle, parentData) { + getPanelUrls: function(transId, panelTitle, pData) { let openUrl = url_for('psql.panel', { trans_id: transId, }); const misc_preferences = pgBrowser.get_preferences_for_module('misc'); var theme = misc_preferences.theme; - openUrl += `?sgid=${parentData.server_group._id}` - +`&sid=${parentData.server._id}` - +`&did=${parentData.database._id}` - +`&server_type=${parentData.server.server_type}` + openUrl += `?sgid=${pData.server_group._id}` + +`&sid=${pData.server._id}` + +`&did=${pData.database._id}` + +`&server_type=${pData.server.server_type}` + `&theme=${theme}`; let db_label = ''; - if(parentData.database && parentData.database._id) { - db_label = _.escape(parentData.database._label.replace('\\', '\\\\')); + if(pData.database && pData.database._id) { + db_label = _.escape(pData.database._label.replace('\\', '\\\\')); db_label = db_label.replace('\'', '\''); db_label = db_label.replace('"', '\"'); openUrl += `&db=${db_label}`; diff --git a/web/pgadmin/tools/restore/static/js/restore.ui.js b/web/pgadmin/tools/restore/static/js/restore.ui.js index 792e7f8dc..04f041af9 100644 --- a/web/pgadmin/tools/restore/static/js/restore.ui.js +++ b/web/pgadmin/tools/restore/static/js/restore.ui.js @@ -331,7 +331,7 @@ export function getRestoreMiscellaneousSchema(fieldOptions) { //Restore Schema export default class RestoreSchema extends BaseUISchema { - constructor(getRestoreSectionSchema, getRestoreTypeObjSchema, getRestoreSaveOptSchema, getRestoreQueryOptionSchema, getRestoreDisableOptionSchema, getRestoreMiscellaneousSchema, fieldOptions = {}, treeNodeInfo=[], pgBrowser=null) { + constructor(restoreSectionSchema, restoreTypeObjSchema, restoreSaveOptSchema, restoreQueryOptionSchema, restoreDisableOptionSchema, restoreMiscellaneousSchema, fieldOptions = {}, treeNodeInfo={}, pgBrowser=null) { super({ custom: false, file: undefined, @@ -355,12 +355,12 @@ export default class RestoreSchema extends BaseUISchema { ...fieldOptions, }; - this.getSectionSchema = getRestoreSectionSchema; - this.getRestoreTypeObjSchema = getRestoreTypeObjSchema; - this.getRestoreSaveOptSchema = getRestoreSaveOptSchema; - this.getRestoreQueryOptionSchema = getRestoreQueryOptionSchema; - this.getRestoreDisableOptionSchema = getRestoreDisableOptionSchema; - this.getRestoreMiscellaneousSchema = getRestoreMiscellaneousSchema; + this.getSectionSchema = restoreSectionSchema; + this.getRestoreTypeObjSchema = restoreTypeObjSchema; + this.getRestoreSaveOptSchema = restoreSaveOptSchema; + this.getRestoreQueryOptionSchema = restoreQueryOptionSchema; + this.getRestoreDisableOptionSchema = restoreDisableOptionSchema; + this.getRestoreMiscellaneousSchema = restoreMiscellaneousSchema; this.treeNodeInfo = treeNodeInfo; this.pgBrowser = pgBrowser; } 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 a668e3788..f93ccf764 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 @@ -860,7 +860,7 @@ export default class SchemaDiffUI { if (index === -1) self.sel_filters.push(filter); } else { $(filter_class).addClass('visibility-hidden'); - if(index !== -1 ) delete self.sel_filters[index]; + if(index !== -1 ) self.sel_filters.splice(index, 1); } } }); diff --git a/web/regression/javascript/browser/preferences_spec.js b/web/regression/javascript/browser/preferences_spec.js index d5577b71a..78a9a69e9 100644 --- a/web/regression/javascript/browser/preferences_spec.js +++ b/web/regression/javascript/browser/preferences_spec.js @@ -136,7 +136,6 @@ describe('preferences related functions test', function() { /* Tests */ expect(pgBrowser.editor.getWrapperElement).toHaveBeenCalled(); - //expect($.fn.css).toHaveBeenCalledWith('font-size', '1.46em'); let setOptionCalls = pgBrowser.editor.setOption.calls; expect(setOptionCalls.count()).toEqual(Object.keys(editorOptions).length); diff --git a/web/regression/javascript/schema_ui_files/import_export_servers.ui.spec.js b/web/regression/javascript/schema_ui_files/import_export_servers.ui.spec.js index dd8ca3d67..2087d1ebd 100644 --- a/web/regression/javascript/schema_ui_files/import_export_servers.ui.spec.js +++ b/web/regression/javascript/schema_ui_files/import_export_servers.ui.spec.js @@ -52,7 +52,7 @@ describe('ImportExportServers', () => { }); it('export', () => { - let schemaObj = new ImportExportSelectionSchema( + schemaObj = new ImportExportSelectionSchema( {imp_exp: 'e', filename: 'test.json'}); mount({ columnSchemaObj.op_class_types = []; options.push({label: '', value: ''}); - status = columnSchemaObj.setOpClassTypes(options); + columnSchemaObj.setOpClassTypes(options); expect(columnSchemaObj.op_class_types.length).toBe(1); }); }); diff --git a/web/regression/javascript/schema_ui_files/row_security_policy.ui.spec.js b/web/regression/javascript/schema_ui_files/row_security_policy.ui.spec.js index edc9d4a54..44ac226b8 100644 --- a/web/regression/javascript/schema_ui_files/row_security_policy.ui.spec.js +++ b/web/regression/javascript/schema_ui_files/row_security_policy.ui.spec.js @@ -14,7 +14,6 @@ import { createMount } from '@material-ui/core/test-utils'; import pgAdmin from 'sources/pgadmin'; import {messages} from '../fake_messages'; import SchemaView from '../../../pgadmin/static/js/SchemaView'; -//import BaseUISchema from 'sources/SchemaView/base_schema.ui'; import RowSecurityPolicySchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/static/js/row_security_policy.ui'; diff --git a/web/regression/javascript/schema_ui_files/trigger.ui.spec.js b/web/regression/javascript/schema_ui_files/trigger.ui.spec.js index 419dea4ec..d7a18fdef 100644 --- a/web/regression/javascript/schema_ui_files/trigger.ui.spec.js +++ b/web/regression/javascript/schema_ui_files/trigger.ui.spec.js @@ -14,7 +14,6 @@ import { createMount } from '@material-ui/core/test-utils'; import pgAdmin from 'sources/pgadmin'; import {messages} from '../fake_messages'; import SchemaView from '../../../pgadmin/static/js/SchemaView'; -//import BaseUISchema from 'sources/SchemaView/base_schema.ui'; import TriggerSchema, { EventSchema } from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/static/js/trigger.ui'; describe('TriggerSchema', ()=>{ diff --git a/web/regression/javascript/sqleditor/execute_query_spec.js b/web/regression/javascript/sqleditor/execute_query_spec.js index 8598a6278..66a2e4478 100644 --- a/web/regression/javascript/sqleditor/execute_query_spec.js +++ b/web/regression/javascript/sqleditor/execute_query_spec.js @@ -25,7 +25,6 @@ describe('ExecuteQuery', () => { const startTime = new Date(2018, 1, 29, 12, 15, 52); beforeEach(() => { networkMock = new MockAdapter(axios); - // jasmine.addMatchers({jQuerytoHaveBeenCalledWith: jQuerytoHaveBeenCalledWith}); userManagementMock = jasmine.createSpyObj('UserManagement', [ 'isPgaLoginRequired', 'pgaLogin', diff --git a/web/regression/javascript/sqleditor/query_tool_actions_spec.js b/web/regression/javascript/sqleditor/query_tool_actions_spec.js index e9225f512..043bd8c5e 100644 --- a/web/regression/javascript/sqleditor/query_tool_actions_spec.js +++ b/web/regression/javascript/sqleditor/query_tool_actions_spec.js @@ -62,7 +62,6 @@ describe('queryToolActions', () => { it('calls the execute function', () => { queryToolActions.explainAnalyze(sqlEditorController); - // let explainAnalyzeQuery = 'EXPLAIN (FORMAT JSON, ANALYZE ON, VERBOSE OFF, COSTS OFF, BUFFERS OFF, TIMING OFF) '; const explainObject = { format: 'json', analyze: true,