You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by be...@apache.org on 2021/02/05 04:22:34 UTC

[superset] branch master updated: fix: SqlLab Run button fix (#12956)

This is an automated email from the ASF dual-hosted git repository.

beto pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new ac3e16d  fix: SqlLab Run button fix (#12956)
ac3e16d is described below

commit ac3e16d0acb0caae3a65fd1757ec985b574f7086
Author: AAfghahi <48...@users.noreply.github.com>
AuthorDate: Thu Feb 4 23:21:43 2021 -0500

    fix: SqlLab Run button fix (#12956)
    
    * button fix
    
    * tooltips disabled when it is disabled, border width changed
    
    * added isDisabled to tooltip
---
 .../src/SqlLab/components/RunQueryActionButton.tsx      | 17 ++++++++++++-----
 superset-frontend/src/common/components/Dropdown.tsx    |  9 ++++++++-
 2 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/superset-frontend/src/SqlLab/components/RunQueryActionButton.tsx b/superset-frontend/src/SqlLab/components/RunQueryActionButton.tsx
index 1208de3..c2534c6 100644
--- a/superset-frontend/src/SqlLab/components/RunQueryActionButton.tsx
+++ b/superset-frontend/src/SqlLab/components/RunQueryActionButton.tsx
@@ -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"
                 />
               ),
diff --git a/superset-frontend/src/common/components/Dropdown.tsx b/superset-frontend/src/common/components/Dropdown.tsx
index ff9dba8..0dc1883 100644
--- a/superset-frontend/src/common/components/Dropdown.tsx
+++ b/superset-frontend/src/common/components/Dropdown.tsx
@@ -82,7 +82,11 @@ const StyledDropdownButton = styled.div`
         margin: 0;
         width: 120px;
       }
-      &:last-of-type {
+      :disabled {
+        background-color: ${({ theme }) => theme.colors.grayscale.light2};
+        color: ${({ theme }) => theme.colors.grayscale.base};
+      }
+      &:nth-child(2) {
         margin: 0;
         border-radius: ${({ theme }) =>
           `0 ${theme.gridUnit}px ${theme.gridUnit}px 0`};
@@ -98,6 +102,9 @@ const StyledDropdownButton = styled.div`
           top: ${({ theme }) => theme.gridUnit * 0.75}px;
           width: ${({ theme }) => theme.gridUnit * 0.25}px;
         }
+        :disabled:before {
+          border-left: 1px solid ${({ theme }) => theme.colors.grayscale.base};
+        }
       }
     }
   }