mirror of
https://github.com/apache/superset.git
synced 2026-04-24 02:25:13 +00:00
fix(sqllab): throw errors of commented out query (#23378)
This commit is contained in:
@@ -26,6 +26,7 @@ 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;
|
||||
@@ -105,9 +106,7 @@ const RunQueryActionButton = ({
|
||||
: Button;
|
||||
|
||||
const sqlContent = selectedText || sql || '';
|
||||
const isDisabled =
|
||||
!sqlContent ||
|
||||
!sqlContent.replace(/(\/\*[^*]*\*\/)|(\/\/[^*]*)|(--[^.].*)/gm, '').trim();
|
||||
const isDisabled = cleanSqlComments(sqlContent).length === 0;
|
||||
|
||||
const stopButtonTooltipText = useMemo(
|
||||
() =>
|
||||
|
||||
Reference in New Issue
Block a user