Skip to content

Commit 6aa5b0b

Browse files
authored
Merge pull request #2968 from RedisInsight/fe/feature/RI-5340
#RI-5340 - add tooltip for run button
2 parents d5f443a + 0fd9d59 commit 6aa5b0b

File tree

1 file changed

+20
-15
lines changed
  • redisinsight/ui/src/components/database-side-panels/panels/enablement-area/EnablementArea/components/CodeButtonBlock

1 file changed

+20
-15
lines changed

redisinsight/ui/src/components/database-side-panels/panels/enablement-area/EnablementArea/components/CodeButtonBlock/CodeButtonBlock.tsx

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiPopover, EuiSpacer, EuiTitle } from '@elastic/eui'
1+
import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiPopover, EuiSpacer, EuiTitle, EuiToolTip } from '@elastic/eui'
22
import cx from 'classnames'
33
import React, { useEffect, useState } from 'react'
44
import { monaco } from 'react-monaco-editor'
@@ -31,7 +31,7 @@ export interface Props {
3131
params?: CodeButtonParams
3232
}
3333

34-
const FINISHED_COMMAND_INDICATOR_TIME_MS = 3_000
34+
const FINISHED_COMMAND_INDICATOR_TIME_MS = 5_000
3535

3636
const CodeButtonBlock = (props: Props) => {
3737
const {
@@ -136,20 +136,25 @@ const CodeButtonBlock = (props: Props) => {
136136
scrollLock: true
137137
}}
138138
button={(
139-
<EuiButton
140-
onClick={handleRunClicked}
141-
iconType={isRunned ? 'check' : 'play'}
142-
iconSide="right"
143-
color="success"
144-
size="s"
145-
disabled={isLoading || isRunned}
146-
isLoading={isLoading}
147-
className={cx(styles.actionBtn, styles.runBtn)}
148-
{...rest}
149-
data-testid={`run-btn-${label}`}
139+
<EuiToolTip
140+
content={isPopoverOpen ? undefined : 'Open Workbench in the left menu to see the command results.'}
141+
data-testid="run-btn-open-workbench-tooltip"
150142
>
151-
Run
152-
</EuiButton>
143+
<EuiButton
144+
onClick={handleRunClicked}
145+
iconType={isRunned ? 'check' : 'play'}
146+
iconSide="right"
147+
color="success"
148+
size="s"
149+
disabled={isLoading || isRunned}
150+
isLoading={isLoading}
151+
className={cx(styles.actionBtn, styles.runBtn)}
152+
{...rest}
153+
data-testid={`run-btn-${label}`}
154+
>
155+
Run
156+
</EuiButton>
157+
</EuiToolTip>
153158
)}
154159
>
155160
{!!notLoadedModule && (

0 commit comments

Comments
 (0)