From 365a5398e58beba5ca71c48af1637ce021a34598 Mon Sep 17 00:00:00 2001 From: Oleksandr Dubenko Date: Mon, 26 Aug 2024 13:19:59 +0200 Subject: [PATCH] frontend: Fix some missing types Signed-off-by: Oleksandr Dubenko --- frontend/src/components/App/Home/RecentClusters.tsx | 2 +- frontend/src/components/App/Settings/NumRowsInput.tsx | 2 +- frontend/src/components/account/Auth.tsx | 2 +- frontend/src/components/cluster/Chooser.tsx | 2 +- frontend/src/components/cluster/ClusterChooserPopup.tsx | 2 +- frontend/src/components/common/ConfirmDialog.tsx | 2 +- frontend/src/components/common/Dialog.tsx | 2 +- frontend/src/components/common/LogViewer.tsx | 2 +- frontend/src/components/pod/Details.tsx | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/frontend/src/components/App/Home/RecentClusters.tsx b/frontend/src/components/App/Home/RecentClusters.tsx index d1b15f7d80..eafad82498 100644 --- a/frontend/src/components/App/Home/RecentClusters.tsx +++ b/frontend/src/components/App/Home/RecentClusters.tsx @@ -43,7 +43,7 @@ export interface RecentClustersProps { export default function RecentClusters(props: RecentClustersProps) { const { clusters } = props; const history = useHistory(); - const focusedRef = React.useCallback(node => { + const focusedRef = React.useCallback((node: HTMLElement) => { if (node !== null) { node.focus(); } diff --git a/frontend/src/components/App/Settings/NumRowsInput.tsx b/frontend/src/components/App/Settings/NumRowsInput.tsx index 6094968a8c..18016dfe31 100644 --- a/frontend/src/components/App/Settings/NumRowsInput.tsx +++ b/frontend/src/components/App/Settings/NumRowsInput.tsx @@ -22,7 +22,7 @@ export default function NumRowsInput(props: { defaultValue: number[] }) { const { defaultValue } = props; const [isSelectOpen, setIsSelectOpen] = useState(false); const [options, setOptions] = useState(defaultValue); - const focusedRef = useCallback(node => { + const focusedRef = useCallback((node: HTMLElement) => { if (node !== null) { node.focus(); } diff --git a/frontend/src/components/account/Auth.tsx b/frontend/src/components/account/Auth.tsx index 891ea30e7f..f76235ff24 100644 --- a/frontend/src/components/account/Auth.tsx +++ b/frontend/src/components/account/Auth.tsx @@ -94,7 +94,7 @@ export function PureAuthToken({ }: PureAuthTokenProps) { const { t } = useTranslation(); const cluster = getCluster(); - const focusedRef = React.useCallback(node => { + const focusedRef = React.useCallback((node: HTMLDivElement) => { if (node !== null) { // node.setAttribute('tabindex', '-1'); node.focus(); diff --git a/frontend/src/components/cluster/Chooser.tsx b/frontend/src/components/cluster/Chooser.tsx index 586814a1bd..5abb06e5a5 100644 --- a/frontend/src/components/cluster/Chooser.tsx +++ b/frontend/src/components/cluster/Chooser.tsx @@ -153,7 +153,7 @@ interface ClusterListProps { function ClusterList(props: ClusterListProps) { const { clusters, onButtonClick } = props; const theme = useTheme(); - const focusedRef = React.useCallback(node => { + const focusedRef = React.useCallback((node: HTMLElement) => { if (node !== null) { node.focus(); } diff --git a/frontend/src/components/cluster/ClusterChooserPopup.tsx b/frontend/src/components/cluster/ClusterChooserPopup.tsx index 52a31f9c4b..1791af2e7b 100644 --- a/frontend/src/components/cluster/ClusterChooserPopup.tsx +++ b/frontend/src/components/cluster/ClusterChooserPopup.tsx @@ -67,7 +67,7 @@ function ClusterChooserPopup(props: ChooserPopupPros) { const isSmallScreen = useMediaQuery(theme.breakpoints.down('sm')); const [activeDescendantIndex, setActiveDescendantIndex] = React.useState(-1); - const focusedRef = React.useCallback(node => { + const focusedRef = React.useCallback((node: HTMLElement) => { if (node !== null) { node.focus(); } diff --git a/frontend/src/components/common/ConfirmDialog.tsx b/frontend/src/components/common/ConfirmDialog.tsx index 37de604d45..a503fd43d9 100644 --- a/frontend/src/components/common/ConfirmDialog.tsx +++ b/frontend/src/components/common/ConfirmDialog.tsx @@ -23,7 +23,7 @@ export function ConfirmDialog(props: ConfirmDialogProps) { onConfirm(); } - const focusedRef = React.useCallback(node => { + const focusedRef = React.useCallback((node: HTMLElement) => { if (node !== null) { node.setAttribute('tabindex', '-1'); node.focus(); diff --git a/frontend/src/components/common/Dialog.tsx b/frontend/src/components/common/Dialog.tsx index 2b649b1f75..5779fa50b6 100644 --- a/frontend/src/components/common/Dialog.tsx +++ b/frontend/src/components/common/Dialog.tsx @@ -30,7 +30,7 @@ export interface OurDialogTitleProps extends DialogTitleProps { export function DialogTitle(props: OurDialogTitleProps) { const { children, focusTitle, buttons, disableTypography = false, ...other } = props; - const focusedRef = React.useCallback(node => { + const focusedRef = React.useCallback((node: HTMLElement) => { if (node !== null) { if (focusTitle) { node.setAttribute('tabindex', '-1'); diff --git a/frontend/src/components/common/LogViewer.tsx b/frontend/src/components/common/LogViewer.tsx index 64bded5175..347e22c4c6 100644 --- a/frontend/src/components/common/LogViewer.tsx +++ b/frontend/src/components/common/LogViewer.tsx @@ -254,7 +254,7 @@ export function SearchPopover(props: SearchPopoverProps) { const [regexChecked, setRegexChecked] = React.useState(false); const { t } = useTranslation(['translation']); const focusedRef = React.useCallback( - node => { + (node: HTMLInputElement) => { if (open && !!node) { node.focus(); node.select(); diff --git a/frontend/src/components/pod/Details.tsx b/frontend/src/components/pod/Details.tsx index 071dacf369..7968924ae9 100644 --- a/frontend/src/components/pod/Details.tsx +++ b/frontend/src/components/pod/Details.tsx @@ -37,7 +37,7 @@ interface PodLogViewerProps extends Omit { item: Pod; } -function PodLogViewer(props: PodLogViewerProps) { +export function PodLogViewer(props: PodLogViewerProps) { const { item, onClose, open, ...other } = props; const [container, setContainer] = React.useState(getDefaultContainer()); const [showPrevious, setShowPrevious] = React.useState(false);