fix(sqllab): rollback clean comments out (#24009)

This commit is contained in:
JUST.in DO IT
2023-05-11 09:41:21 -07:00
committed by GitHub
parent c963416c09
commit 7a55625243
3 changed files with 4 additions and 101 deletions

View File

@@ -26,7 +26,6 @@ import { DropdownButton } from 'src/components/DropdownButton';
import { detectOS } from 'src/utils/common';
import { QueryButtonProps } from 'src/SqlLab/types';
import useQueryEditor from 'src/SqlLab/hooks/useQueryEditor';
import { cleanSqlComments } from 'src/SqlLab/actions/sqlLab';
export interface RunQueryActionButtonProps {
queryEditorId: string;
@@ -106,7 +105,9 @@ const RunQueryActionButton = ({
: Button;
const sqlContent = selectedText || sql || '';
const isDisabled = cleanSqlComments(sqlContent).length === 0;
const isDisabled =
!sqlContent ||
!sqlContent.replace(/(\/\*[^*]*\*\/)|(\/\/[^*]*)|(--[^.].*)/gm, '').trim();
const stopButtonTooltipText = useMemo(
() =>