Fixed SonarQube code smell 'Unnecessary use of boolean literals in conditional expression'.

This commit is contained in:
Akshay Joshi
2024-04-08 17:19:51 +05:30
committed by GitHub
parent c9345ad618
commit edec9adbfb
38 changed files with 104 additions and 108 deletions

View File

@@ -451,7 +451,7 @@ export default function CloudWizard({ nodeInfo, nodeData, onClose, cloudPanelId}
<br/>{gettext('By clicking the below button, you will be redirected to the EDB BigAnimal authentication page in a new tab.')}
</Box>
</Box>}
{cloudProvider == CLOUD_PROVIDERS.BIGANIMAL && <PrimaryButton onClick={authenticateBigAnimal} disabled={verificationIntiated ? true: false}>
{cloudProvider == CLOUD_PROVIDERS.BIGANIMAL && <PrimaryButton onClick={authenticateBigAnimal} disabled={verificationIntiated}>
{gettext('Click here to authenticate yourself to EDB BigAnimal')}
</PrimaryButton>}
{cloudProvider == CLOUD_PROVIDERS.BIGANIMAL && <Box className={classes.messageBox}>

View File

@@ -67,7 +67,7 @@ class AzureCredSchema extends BaseUISchema {
value: 'azure_cli_credential',
},
],
disabled: pgAdmin.server_mode == 'True' ? true : false,
disabled: pgAdmin.server_mode == 'True',
helpMessage: gettext(
'Azure CLI will use the currently logged in identity through the Azure CLI on the local machine. Interactive Browser will open a browser window to authenticate a user interactively.'
),
@@ -82,9 +82,7 @@ class AzureCredSchema extends BaseUISchema {
'Enter the Azure tenant ID against which the user is authenticated.'
),
disabled: (state) => {
return state.auth_type == 'interactive_browser_credential'
? false
: true;
return state.auth_type !== 'interactive_browser_credential';
},
depChange: (state) => {
if (state.auth_type == 'azure_cli_credential') {

View File

@@ -53,7 +53,7 @@ class GoogleCredSchema extends BaseUISchema{
btnName: gettext('Click here to authenticate yourself to Google'),
helpMessage: gettext('After clicking the button above you will be redirected to the Google authentication page in a new browser tab.'),
disabled: (state)=>{
return state.client_secret_file ? false : true;
return !state.client_secret_file;
},
deferredDepChange: (state, source)=>{
return new Promise((resolve, reject)=>{
@@ -223,7 +223,7 @@ class GoogleInstanceSchema extends BaseUISchema {
}
];
}
}
}
class GoogleStorageSchema extends BaseUISchema {
constructor() {
@@ -235,22 +235,22 @@ class GoogleStorageSchema extends BaseUISchema {
get baseFields() {
return [
{
id: 'storage_type',
label: gettext('Storage type'),
id: 'storage_type',
label: gettext('Storage type'),
type: 'select',
mode: ['create'],
noEmpty: true,
options: [
{'label': gettext('SSD'), 'value': 'PD_SSD'},
{'label': gettext('HDD'), 'value': 'PD_HDD'},
],
],
},
{
id: 'storage_size',
label: gettext('Storage capacity'),
id: 'storage_size',
label: gettext('Storage capacity'),
type: 'int',
mode: ['create'],
noEmpty: true,
mode: ['create'],
noEmpty: true,
deps: ['storage_type'],
helpMessage: gettext('Size in GB.'),
}
@@ -445,11 +445,11 @@ class GoogleClusterSchema extends BaseUISchema {
},
{}
);
this.googleStorageDetails = new GoogleStorageSchema(
{},
{}
);
);
this.googleNetworkDetails = new GoogleNetworkSchema({}, {});