diff --git a/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx b/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx index 2a9e0fbaf8..9da467685b 100644 --- a/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx +++ b/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; +import React, { useMemo } from 'react'; import { t, styled, useTheme } from '@superset-ui/core'; import { Menu } from 'src/components/Menu'; @@ -26,6 +26,7 @@ import { DropdownButton, DropdownButtonProps, } from 'src/components/DropdownButton'; +import { detectOS } from 'src/utils/common'; interface Props { allowAsync: boolean; @@ -95,6 +96,8 @@ const RunQueryActionButton = ({ }: Props) => { const theme = useTheme(); + const userOS = detectOS(); + const shouldShowStopBtn = !!queryState && ['running', 'pending'].indexOf(queryState) > -1; @@ -104,6 +107,14 @@ const RunQueryActionButton = ({ const isDisabled = !sql.trim(); + const stopButtonTooltipText = useMemo( + () => + userOS === 'MacOS' + ? t('Stop running (Ctrl + x)') + : t('Stop running (Ctrl + e)'), + [userOS], + ); + return (