mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed following code smells reported by SonarQube:
1) Immediately return this expression instead of assigning it to the temporary variable. 2) Extract this nested ternary operation into an independent statement. 3) Expected a `for-of` loop instead of a `for` loop with this simple iteration.
This commit is contained in:
@@ -632,13 +632,17 @@ const customReactSelectStyles = (theme, readonly)=>({
|
||||
color: 'inherit',
|
||||
}),
|
||||
option: (provided, state)=>{
|
||||
let bgColor = 'inherit';
|
||||
if (state.isFocused) {
|
||||
bgColor = theme.palette.grey[400];
|
||||
} else if (state.isSelected) {
|
||||
bgColor = theme.palette.primary.light;
|
||||
}
|
||||
return {
|
||||
...provided,
|
||||
padding: '0.5rem',
|
||||
color: 'inherit',
|
||||
backgroundColor: state.isFocused ?
|
||||
theme.palette.grey[400] : (state.isSelected ?
|
||||
theme.palette.primary.light : 'inherit'),
|
||||
backgroundColor: bgColor,
|
||||
};
|
||||
},
|
||||
multiValue: (provided)=>({
|
||||
|
||||
@@ -185,9 +185,8 @@ export default function PgTable({ columns, data, isSelectRow, ...props }) {
|
||||
.filter((column) => {
|
||||
if (column.isVisible === undefined || columns.isVisible === true) {
|
||||
return false;
|
||||
} else{
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
)
|
||||
.map((column) => column.accessor)
|
||||
|
||||
Reference in New Issue
Block a user