Skip to content

Commit

Permalink
Merge pull request #2265 from headlamp-k8s/fix-types
Browse files Browse the repository at this point in the history
frontend: Fix some missing types
  • Loading branch information
illume authored Aug 27, 2024
2 parents 9b12f90 + 365a539 commit 18c8334
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/App/Home/RecentClusters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/App/Settings/NumRowsInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/account/Auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/cluster/Chooser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/cluster/ClusterChooserPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function ClusterChooserPopup(props: ChooserPopupPros) {
const isSmallScreen = useMediaQuery(theme.breakpoints.down('sm'));
const [activeDescendantIndex, setActiveDescendantIndex] = React.useState<number>(-1);

const focusedRef = React.useCallback(node => {
const focusedRef = React.useCallback((node: HTMLElement) => {
if (node !== null) {
node.focus();
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/common/ConfirmDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/common/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/common/LogViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export function SearchPopover(props: SearchPopoverProps) {
const [regexChecked, setRegexChecked] = React.useState<boolean>(false);
const { t } = useTranslation(['translation']);
const focusedRef = React.useCallback(
node => {
(node: HTMLInputElement) => {
if (open && !!node) {
node.focus();
node.select();
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/pod/Details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ interface PodLogViewerProps extends Omit<LogViewerProps, 'logs'> {
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<boolean>(false);
Expand Down

0 comments on commit 18c8334

Please sign in to comment.