chore: Use queryEditorId in SqlEditor child components (#21650)

This commit is contained in:
EugeneTorap
2022-11-16 16:06:20 +03:00
committed by GitHub
parent 2f0d5f16f3
commit d76f305343
17 changed files with 240 additions and 254 deletions

View File

@@ -24,7 +24,7 @@ import { Store } from 'redux';
import { render, fireEvent, waitFor } from 'spec/helpers/testing-library';
import { initialState, defaultQueryEditor } from 'src/SqlLab/fixtures';
import RunQueryActionButton, {
Props,
RunQueryActionButtonProps,
} from 'src/SqlLab/components/RunQueryActionButton';
const middlewares = [thunk];
@@ -51,7 +51,7 @@ const defaultProps = {
overlayCreateAsMenu: null,
};
const setup = (props?: Partial<Props>, store?: Store) =>
const setup = (props?: Partial<RunQueryActionButtonProps>, store?: Store) =>
render(<RunQueryActionButton {...defaultProps} {...props} />, {
useRedux: true,
...(store && { store }),

View File

@@ -27,7 +27,7 @@ import { detectOS } from 'src/utils/common';
import { QueryButtonProps } from 'src/SqlLab/types';
import useQueryEditor from 'src/SqlLab/hooks/useQueryEditor';
export interface Props {
export interface RunQueryActionButtonProps {
queryEditorId: string;
allowAsync: boolean;
queryState?: string;
@@ -81,14 +81,14 @@ const StyledButton = styled.span`
}
`;
const RunQueryActionButton: React.FC<Props> = ({
const RunQueryActionButton = ({
allowAsync = false,
queryEditorId,
queryState,
overlayCreateAsMenu,
runQuery,
stopQuery,
}) => {
}: RunQueryActionButtonProps) => {
const theme = useTheme();
const userOS = detectOS();