-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Uptime] Fix: Adjust tooltip on Run test button for Private Locations #138863
[Uptime] Fix: Adjust tooltip on Run test button for Private Locations #138863
Conversation
Pinging @elastic/uptime (Team:uptime) |
|
||
<EuiToolTip | ||
position="top" | ||
content={<p>Works on any kind of element — buttons, inputs, you name it!</p>} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What content is this supposed to have?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at this further, I think this whole code block isn't supposed to be here.
export const PRIVATE_AVAILABLE_LABEL = i18n.translate( | ||
'xpack.synthetics.monitorList.testNow.available.private', | ||
{ | ||
defaultMessage: `You can't currently test monitors running on private locations on demand.`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defaultMessage: `You can't currently test monitors running on private locations on demand.`, | |
defaultMessage: `Test now is currently not available for monitors running on private locations`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The copy comes from here #137912 (comment).
export const TEST_NOW_ARIA_LABEL = i18n.translate( | ||
'xpack.synthetics.monitorList.testNow.AriaLabel', | ||
{ | ||
defaultMessage: 'CLick to run test now', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defaultMessage: 'CLick to run test now', | |
defaultMessage: 'Click to run test now', |
<EuiToolTip | ||
position="top" | ||
content={<p>Works on any kind of element — buttons, inputs, you name it!</p>} | ||
> | ||
<EuiButton disabled={true} onClick={() => {}}> | ||
Hover me | ||
</EuiButton> | ||
</EuiToolTip> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<EuiToolTip | |
position="top" | |
content={<p>Works on any kind of element — buttons, inputs, you name it!</p>} | |
> | |
<EuiButton disabled={true} onClick={() => {}}> | |
Hover me | |
</EuiButton> | |
</EuiToolTip> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops! Checked-in the example piece. Thanks for spotting.
{onTestNow && ( | ||
<EuiFlexItem grow={false}> | ||
{/* Popover is used instead of EuiTooltip until the resolution of https://github.com/elastic/eui/issues/5604 */} | ||
<EuiPopover | ||
repositionOnScroll={true} | ||
ownFocus={false} | ||
initialFocus={''} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this do when a value isn't specified?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we don't want the popover to capture focus when it's opened, to behave like a tooltip. Providing an empty selector is the only option as undefined
is the default value.
Without specifying the prop, it focuses the popover, stealing the focus from monitor form.
3eafdd1
to
dc539d0
Compare
@dominiqueclarke the suggested changes are ready. |
941a48f
to
651761a
Compare
@elasticmachine merge upstream |
…-run-test-for-on-private-locations
@elasticmachine merge upstream |
LGTM generally, but I wonder about one thing. On prem, before selecting a location, the test now button still displays information about test now. Only when you add a location do you realize you can't actually use test now. I think that for on-prem, we should display that you cannot use test now immediately. |
…oltip-on-run-test-for-on-private-locations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
1 similar comment
Friendly reminder: Looks like this PR hasn’t been backported yet. |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…elastic#138863) * Control popover logic with MouseOver and MouseOut to be able to show popover on a disabled button. * Run "Test now" only on public locations. * Show specific tooltip when only private locations are available. (cherry picked from commit f3331b9) # Conflicts: # x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/action_bar/action_bar.tsx
…#138863) (#141778) * Control popover logic with MouseOver and MouseOut to be able to show popover on a disabled button. * Run "Test now" only on public locations. * Show specific tooltip when only private locations are available. (cherry picked from commit f3331b9) # Conflicts: # x-pack/plugins/synthetics/public/legacy_uptime/components/monitor_management/action_bar/action_bar.tsx
Fixes: #137886
Summary
On Uptime -> Monitor Management -> Add Monitor page, Ru test is disabled if only Private Locations are selected without a tooltip. This PR adds a tooltip for this case.
If Add Monitor form is all in valid state and only Private Locations are selected, Run test will be disabled with the following tooltip:
Note that the tooltip content is the same as shown on Uptime -> Monitors page for monitors with only Private Locations.
Note that since we cannot use EuiTooltip because of the scroll issue, A workaround was needed to make EuiPopover be able to be shown on a disabled button. The PR uses
onMouseOver
andonMouseOut
instead ofonMouseEnter
andonMouseLeave
to achieve this.Additional Enhancements
The PR also adds a tooltip when the test is in-progress and Run test is disabled. It's the same tooltip that is shown on Uptime -> Monitors page when on-demand test is in progress. (see below screenshot)
Additional Fixes
In Addition to the above, the PR fixes the behavior where Run test was running tests on all selected location (both public and private). After the fix, Run test will only run the on-demand test on public locations. (see below screenshot)