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:
AAfghahi
2021-02-04 23:21:43 -05:00
committed by GitHub
parent 973306461c
commit ac3e16d0ac
2 changed files with 20 additions and 6 deletions

View File

@@ -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"
/>
),