mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed the following SonarQube code smells:
1) Do not use Array index in keys. 2) Unnecessary escape character. 3) Rename this local variable to match the regular expression ^[_a-z][a-z0-9_]*$ 4) Remove the unused local variable.
This commit is contained in:
@@ -133,7 +133,7 @@ export function Search({closeModal}) {
|
||||
let menuItemsHtmlElement = [];
|
||||
items.forEach((i) => {
|
||||
menuItemsHtmlElement.push(
|
||||
<li key={ 'li-menu-' + i }><a tabIndex='0' id={ 'li-menu-' + i.label } href={'#'} className={ (i.isDisabled ? 'dropdown-item menu-groups-a disabled':'dropdown-item menu-groups-a')} key={ 'menu-' + i.label } onClick={
|
||||
<li key={ 'li-menu-' + i.label }><a tabIndex='0' id={ 'li-menu-' + i.label } href={'#'} className={ (i.isDisabled ? 'dropdown-item menu-groups-a disabled':'dropdown-item menu-groups-a')} onClick={
|
||||
() => {
|
||||
closeModal();
|
||||
i.callback();
|
||||
@@ -257,7 +257,7 @@ export function Search({closeModal}) {
|
||||
</div>
|
||||
|
||||
{Object.keys(helpSearchResult.data).map( (value, index) => {
|
||||
if(index <= 9) { return <li key={ 'li-help-' + index }><a tabIndex='0' href={helpSearchResult.data[value]} key={ 'help-' + index } className='dropdown-item' target='_blank' rel='noreferrer'>{value}</a></li>; }
|
||||
if(index <= 9) { return <li key={ 'li-help-' + value }><a tabIndex='0' href={helpSearchResult.data[value]} className='dropdown-item' target='_blank' rel='noreferrer'>{value}</a></li>; }
|
||||
})}
|
||||
|
||||
{(Object.keys(helpSearchResult.data).length == 0) ? (<div className='pad-12 no-results'><span className='fa fa-info-circle'></span> {gettext('No search results')}</div>):''}
|
||||
|
||||
Reference in New Issue
Block a user