Fixed SonarQube issues.

This commit is contained in:
Nikhil Mohite
2022-01-07 19:58:19 +05:30
committed by Akshay Joshi
parent ad862f4084
commit af6ff20020
7 changed files with 9 additions and 26 deletions

View File

@@ -34,7 +34,7 @@ export class DefaultWithSchema extends BaseUISchema {
id: 'evnt_truncate', label: gettext('TRUNCATE'),
type: 'switch', group: gettext('With'),
visible: function() {
if(!_.isUndefined(this.node_info['node_info']) && !_.isUndefined(this.node_info['node_info'])
if(!_.isUndefined(this.node_info['node_info'])
&& !_.isUndefined(this.node_info['node_info'].version) &&
this.node_info['node_info'].version >= 110000)
return true;
@@ -45,7 +45,7 @@ export class DefaultWithSchema extends BaseUISchema {
id: 'publish_via_partition_root', label: gettext('Publish via root?'),
type: 'switch', group: gettext('With'),
visible: function() {
if(!_.isUndefined(this.node_info['node_info']) && !_.isUndefined(this.node_info['node_info'])
if(!_.isUndefined(this.node_info['node_info'])
&& !_.isUndefined(this.node_info['node_info'].version) &&
this.node_info['node_info'].version >= 130000)
return true;

View File

@@ -46,26 +46,16 @@ export function getUtilityView(schema, treeNodeInfo, actionType, formType, conta
});
/* Callback for help button */
const onHelp = (isSqlHelp=false, isNew=false)=>{
const onHelp = (isSqlHelp=false)=>{
if(isSqlHelp) {
let server = treeNodeInfo.server;
let url = pgAdmin.Browser.utils.pg_help_path;
let help_url = pgAdmin.Browser.utils.pg_help_path;
let fullUrl = '';
if (server.server_type == 'ppas') {
fullUrl = getEPASHelpUrl(server.version);
} else {
if (sqlHelpUrl == '') {
fullUrl = getHelpUrl(url, sqlHelpUrl, server.version);
} else if (sqlHelpUrl != '') {
fullUrl = getHelpUrl(url, sqlHelpUrl, server.version);
} else {
if (isNew) {
fullUrl = getHelpUrl(url, sqlHelpUrl, server.version);
} else {
fullUrl = getHelpUrl(url, sqlHelpUrl, server.version);
}
}
fullUrl = getHelpUrl(help_url, sqlHelpUrl, server.version);
}
window.open(fullUrl, 'postgres_help');
@@ -97,8 +87,7 @@ export function getUtilityView(schema, treeNodeInfo, actionType, formType, conta
onSave={onSaveClick}
onClose={()=>containerPanel.close()}
onHelp={onHelp}
onDataChange={()=>{
}}
onDataChange={()=>{}}
confirmOnCloseReset={confirmOnReset}
hasSQL={false}
disableSqlHelp={sqlHelpUrl == undefined || sqlHelpUrl == ''}