Skip to content

Commit f2f2c85

Browse files
committed
fix: sonarlint issues
1 parent 3d7206f commit f2f2c85

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

src/components/app/details/main.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { lazy, PropsWithChildren, Suspense, useEffect, useRef, useState } from 'react'
17+
import { lazy, PropsWithChildren, Suspense, useEffect, useState } from 'react'
1818
import { Switch, Route, Redirect, useParams, useRouteMatch } from 'react-router-dom'
1919
import {
2020
showError,
@@ -35,7 +35,6 @@ import { MultiValue } from 'react-select'
3535
import {
3636
ErrorBoundary,
3737
getAndSetAppGroupFilters,
38-
importComponentFromFELibrary,
3938
setAppGroupFilterInLocalStorage,
4039
sortOptionsByLabel,
4140
} from '../../common'

src/components/common/SidePanel/SidePanelContent.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { KeyboardEvent } from 'react'
2+
13
import {
24
Button,
35
ButtonStyleType,
@@ -87,20 +89,27 @@ export const SidePanelContent = ({ onClose, setSidePanelConfig, sidePanelConfig
8789
{TABS_CONFIG.map(({ label, iconName, id }) => {
8890
const isSelected = tab === id
8991

90-
const handleTabClick = () => {
92+
const onTabClick = () => {
9193
setSidePanelConfig((prev) => ({ ...prev, state: id }))
9294
}
9395

96+
const onKeyDown = (e: KeyboardEvent<HTMLDivElement>) => {
97+
if (e.key === 'Enter' || e.key === ' ') {
98+
e.currentTarget.click()
99+
}
100+
}
101+
94102
return (
95103
<div
96104
key={id}
97105
role="button"
98106
data-testid={`side-panel-tab-${id}`}
99107
className={`flex dc__gap-6 dc__border-right px-16 dc__transition--background ${isSelected ? 'bg__primary' : ''}`}
100-
onClick={handleTabClick}
108+
onClick={onTabClick}
101109
style={{ ...(isSelected ? { boxShadow: '0 1px 0 0 var(--bg-primary)' } : {}) }}
102110
tabIndex={0}
103111
data-config={JSON.stringify(getConfigForTab(id))}
112+
onKeyDown={onKeyDown}
104113
>
105114
<Icon name={iconName} color={isSelected ? 'N900' : 'N700'} />
106115

@@ -113,7 +122,7 @@ export const SidePanelContent = ({ onClose, setSidePanelConfig, sidePanelConfig
113122
</div>
114123

115124
<div className="flex dc__gap-8 pr-16 pt-12 pb-11">
116-
<div id="devtron-side-panel-actions" />
125+
<div id="devtron-side-panel-actions" className="flexbox" />
117126

118127
<Button
119128
dataTestId="close-side-panel-button"

src/components/common/navigation/NavigationRoutes.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ import * as Sentry from '@sentry/browser'
5555
import ReactGA from 'react-ga4'
5656
import TagManager from 'react-gtm-module'
5757
import Navigation from './Navigation'
58-
import { ErrorBoundary, AppContext, AppContextType } from '..'
58+
import { ErrorBoundary, AppContext } from '..'
5959
import { URLS, ViewType, SERVER_MODE, ModuleNameMap } from '../../../config'
6060
import { Security } from '../../security/Security'
6161
import {

0 commit comments

Comments
 (0)