Skip to content

Commit ee87018

Browse files
committed
feat: add support to disable keybindings in LogResizeButton
1 parent 52daa53 commit ee87018

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/Shared/Components/CICDHistory/History.components.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ import { ReactComponent as ZoomIn } from '../../../Assets/Icon/ic-fullscreen.svg
2727
import { ReactComponent as ZoomOut } from '../../../Assets/Icon/ic-exit-fullscreen.svg'
2828
import './cicdHistory.scss'
2929

30-
export const LogResizeButton = ({ fullScreenView, setFullScreenView }: LogResizeButtonType): JSX.Element => {
30+
export const LogResizeButton = ({
31+
onlyOnLogs = true,
32+
disableKeybindings = false,
33+
fullScreenView,
34+
setFullScreenView,
35+
}: LogResizeButtonType): JSX.Element => {
3136
const { pathname } = useLocation()
3237

3338
const keys = useKeyDown()
@@ -37,7 +42,7 @@ export const LogResizeButton = ({ fullScreenView, setFullScreenView }: LogResize
3742
}
3843

3944
useEffect(() => {
40-
if (!pathname.includes('/logs')) {
45+
if ((!pathname.includes('/logs') && onlyOnLogs) || disableKeybindings) {
4146
return
4247
}
4348
// eslint-disable-next-line default-case
@@ -52,7 +57,7 @@ export const LogResizeButton = ({ fullScreenView, setFullScreenView }: LogResize
5257
}, [keys])
5358

5459
return (
55-
pathname.includes('/logs') && (
60+
(pathname.includes('/logs') || !onlyOnLogs) && (
5661
<Tippy
5762
placement="top"
5863
arrow={false}

src/Shared/Components/CICDHistory/types.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ export enum FetchIdDataStatus {
4646
}
4747

4848
export interface LogResizeButtonType {
49+
onlyOnLogs?: boolean
50+
disableKeybindings?: boolean
4951
fullScreenView: boolean
5052
setFullScreenView: React.Dispatch<React.SetStateAction<boolean>>
5153
}

0 commit comments

Comments
 (0)