Fixes SonarQube issues.

This commit is contained in:
Ashesh Vashi 2021-05-29 12:55:59 +05:30 committed by Akshay Joshi
parent 2d58f60a53
commit a487a51135
5 changed files with 4 additions and 9 deletions

View File

@ -95,7 +95,7 @@ export function Search() {
if(items.length > 0){
let menuItemsHtmlElement = [];
for(let i=0; i < items.length; i++){
Object.keys(items[i]).map( (value) => {
Object.keys(items[i]).forEach( (value) => {
if(value != 'element' && value != 'No object selected'){
menuItemsHtmlElement.push( <li key={ 'li-menu-' + i }><a tabIndex='0' id={ 'li-menu-' + i } href={'#'} className={ (items[i]['element'].classList.contains('disabled') == true ? 'dropdown-item menu-groups-a disabled':'dropdown-item menu-groups-a')} key={ 'menu-' + i } onClick={() => {items[i]['element'].click(); toggleDropdownMenu();}}>
{value}

View File

@ -54,7 +54,6 @@ define('pgadmin.browser.utils',
/* GET PSQL Tool related config */
pgAdmin['enable_psql'] = '{{ current_app.config.get('ENABLE_PSQL') }}' == 'True';
pgAdmin['allow_psql_shell_commands'] = '{{ current_app.config.get('ALLOW_PSQL_SHELL_COMMANDS') }}' == 'True';
// Define list of nodes on which Query tool option doesn't appears
var unsupported_nodes = pgAdmin.unsupported_nodes = [

View File

@ -64,7 +64,7 @@
if (nextOpen < 0) nextOpen = text.length;
if (nextClose < 0) nextClose = text.length;
pos = Math.min(nextOpen, nextClose);
if (pos == text.length) break;
if (pos == text.length) { whileloopvar=1; break; }
if (cm.getTokenAt(CodeMirror.Pos(i, pos + 1)).type == tokenType) {
if (pos == nextOpen) ++count;
else if (!--count) {

View File

@ -415,11 +415,7 @@ export function initialize(gettext, url_for, $, _, pgAdmin, csrfToken, Browser)
});
term.onKey(function (ev) {
if (pgAdmin['allow_psql_shell_commands']) {
socket.emit('socket_input', {'input': ev.key, 'key_name': ev.domEvent.code});
} else {
socket.emit('socket_input', {'input': ev.key, 'key_name': ev.domEvent.code});
}
socket.emit('socket_input', {'input': ev.key, 'key_name': ev.domEvent.code});
});
}
};

View File

@ -335,7 +335,7 @@ var getThemeWebpackConfig = function(theme_name) {
};
var pgadminThemesWebpack = [];
Object.keys(pgadminThemes).map((theme_name)=>{
Object.keys(pgadminThemes).forEach((theme_name)=>{
pgadminThemesWebpack.push(getThemeWebpackConfig(theme_name));
});