Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/shell #212

Merged
merged 2 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/refine/src/components/Shell/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
onReconnect?: () => void;
onSocketInit?: (socket: WebSocket) => void;
onTermInit?: (term: Terminal) => void;
onClear?: () => void;
onSocketMessage?: (e: MessageEvent, socket: WebSocket, term: Terminal | null) => void;
onSocketOpen?: (socket: WebSocket) => void;
onSocketClose?: (socket: WebSocket, term: Terminal | null) => void;
Expand Down Expand Up @@ -161,7 +162,7 @@
cols
});
}
}, [encode, send, props.fit]);

Check warning on line 165 in packages/refine/src/components/Shell/index.tsx

View workflow job for this annotation

GitHub Actions / Run Test on Node 16

React Hook useCallback has a missing dependency: 'props'. Either include it or remove the dependency array. However, 'props' will change when *any* prop changes, so the preferred fix is to destructure the 'props' object outside of the useCallback call and refer to those specific props inside useCallback
const debouncedFit = useMemo(() => debounce(fit, 200), [fit]);
const flush = useCallback(() => {
const backlog = backlogRef.current.slice();
Expand Down Expand Up @@ -241,7 +242,7 @@
}
};
}
}, [url, protocols, decode, props.onSocketClose, props.onSocketMessage, props.onSocketOpen, reset, flush, fit, onSocketInit, timeout]);

Check warning on line 245 in packages/refine/src/components/Shell/index.tsx

View workflow job for this annotation

GitHub Actions / Run Test on Node 16

React Hook useCallback has a missing dependency: 'props'. Either include it or remove the dependency array. However, 'props' will change when *any* prop changes, so the preferred fix is to destructure the 'props' object outside of the useCallback call and refer to those specific props inside useCallback
const setupTerminal = useCallback(() => {
if (terminalRef.current) {
if (termInstanceRef.current) {
Expand Down Expand Up @@ -359,6 +360,10 @@
const writeln = useCallback((data: string) => {
termInstanceRef.current?.writeln(data);
}, []);
const onClear = useCallback(() => {
clear();
props.onClear?.();
}, [clear, props.onClear]);

useEffect(() => {
const destroy = setupTerminal();
Expand Down Expand Up @@ -434,7 +439,7 @@
operations={operations}
onSearchNext={searchNext}
onSearchPre={searchPrevious}
onClear={clear}
onClear={onClear}
onDownloadLog={downloadContent}
onSetFontSize={(fontSize) => {
setOptions({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Loading, Space } from '@cloudtower/eagle';
import { css } from '@linaria/core';
import { css, cx } from '@linaria/core';
import { LabelSelector } from 'kubernetes-types/meta/v1';
import React, { useState, useContext } from 'react';
import { useTranslation } from 'react-i18next';
Expand All @@ -21,6 +21,7 @@ import BaseTable, { Column } from '../InternalBaseTable';
import { TableToolBar } from '../TableToolbar';

interface WorkloadPodsTableProps {
className?: string;
namespace?: string;
selector?: LabelSelector;
filter?: (item: PodModel) => boolean;
Expand All @@ -31,6 +32,7 @@ interface WorkloadPodsTableProps {
export const WorkloadPodsTable: React.FC<WorkloadPodsTableProps> = ({
namespace,
selector,
className,
hideToolbar,
filter,
hideNodeColumn,
Expand Down Expand Up @@ -89,10 +91,10 @@ export const WorkloadPodsTable: React.FC<WorkloadPodsTableProps> = ({
return (
<Space
direction="vertical"
className={css`
className={cx(css`
width: 100%;
vertical-align: top;
`}
`, className)}
>
{hideToolbar ? null : (
<TableToolBar selectedKeys={selectedKeys} hideCreate />
Expand Down
Loading