mirror of
https://github.com/apache/superset.git
synced 2026-04-27 03:55:47 +00:00
fix: SqlLab Run button fix (#12956)
* button fix * tooltips disabled when it is disabled, border width changed * added isDisabled to tooltip
This commit is contained in:
@@ -91,17 +91,20 @@ const RunQueryActionButton = ({
|
||||
? (DropdownButton as React.FC)
|
||||
: Button;
|
||||
|
||||
const isDisabled = !sql.trim();
|
||||
|
||||
return (
|
||||
<StyledButton>
|
||||
<ButtonComponent
|
||||
onClick={() =>
|
||||
onClick(shouldShowStopBtn, allowAsync, runQuery, stopQuery)
|
||||
}
|
||||
disabled={!sql.trim()}
|
||||
disabled={isDisabled}
|
||||
tooltip={
|
||||
shouldShowStopBtn
|
||||
? t('Stop running (Ctrl + x)')
|
||||
: t('Run query (Ctrl + Return)')
|
||||
(!isDisabled &&
|
||||
(shouldShowStopBtn
|
||||
? t('Stop running (Ctrl + x)')
|
||||
: t('Run query (Ctrl + Return)'))) as string
|
||||
}
|
||||
cta
|
||||
{...(overlayCreateAsMenu
|
||||
@@ -109,7 +112,11 @@ const RunQueryActionButton = ({
|
||||
overlay: overlayCreateAsMenu,
|
||||
icon: (
|
||||
<Icon
|
||||
color={supersetTheme.colors.grayscale.light5}
|
||||
color={
|
||||
isDisabled
|
||||
? supersetTheme.colors.grayscale.base
|
||||
: supersetTheme.colors.grayscale.light5
|
||||
}
|
||||
name="caret-down"
|
||||
/>
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user