chore: Remove actions prop and refactor code in SQL Lab (#22231)

This commit is contained in:
EugeneTorap
2022-12-05 14:12:52 +03:00
committed by GitHub
parent b2d909f529
commit f3bf3ec2ed
15 changed files with 127 additions and 247 deletions

View File

@@ -20,16 +20,8 @@ import React from 'react';
import { render, screen } from 'spec/helpers/testing-library';
import QueryHistory from 'src/SqlLab/components/QueryHistory';
const NOOP = () => {};
const mockedProps = {
queries: [],
actions: {
queryEditorSetAndSaveSql: NOOP,
cloneQueryToNewTab: NOOP,
fetchQueryResults: NOOP,
clearQueryResults: NOOP,
removeQuery: NOOP,
},
displayLimit: 1000,
latestQueryId: 'yhMUZCGb',
};

View File

@@ -23,13 +23,6 @@ import QueryTable from 'src/SqlLab/components/QueryTable';
interface QueryHistoryProps {
queries: QueryResponse[];
actions: {
queryEditorSetAndSaveSql: Function;
cloneQueryToNewTab: Function;
fetchQueryResults: Function;
clearQueryResults: Function;
removeQuery: Function;
};
displayLimit: number;
latestQueryId: string | undefined;
}
@@ -47,7 +40,6 @@ const StyledEmptyStateWrapper = styled.div`
const QueryHistory = ({
queries,
actions,
displayLimit,
latestQueryId,
}: QueryHistoryProps) =>
@@ -64,7 +56,6 @@ const QueryHistory = ({
'actions',
]}
queries={queries}
actions={actions}
displayLimit={displayLimit}
latestQueryId={latestQueryId}
/>