Skip to content

Commit 4dcda7c

Browse files
[8.19] [Rule Details] Update tooltip copy for Investigation Guide/Related Dashboards (elastic#224142) (elastic#224952)
# Backport This will backport the following commits from `main` to `8.19`: - [[Rule Details] Update tooltip copy for Investigation Guide/Related Dashboards (elastic#224142)](elastic#224142) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Justin Kambic","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-06-23T19:39:05Z","message":"[Rule Details] Update tooltip copy for Investigation Guide/Related Dashboards (elastic#224142)\n\n## Summary\n\nResolves elastic#221426.\n\nAdds tooltip content for the Related Dashboards and Investigation Guide\nfields on the Details segment of the rule create/edit flow.\n\n<img width=\"1039\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/6f812ebc-7a4c-42d5-ae20-c557665a7f17\"\n/>\n\n\n## Testing this PR\n\nHover over the info tips on the form row for the Investigation Guide and\nRelated Dashboard fields.\n\nEnsure that they work and you can view the copy.\n\n### Technical Writer Feedback\n\nThe tooltips for these two fields are the main area we'd like additional\nfeedback/refinement. If you have thoughts, please leave a review:\n\n- [Investigation\nguide](https://github.com/elastic/kibana/pull/224142/files#diff-f61636ed67a25004232d29347e88ca18b9ef0c8551dab5e192c64b524c6f077eR326)\n- [Related\ndashboards](https://github.com/elastic/kibana/pull/224142/files#diff-f61636ed67a25004232d29347e88ca18b9ef0c8551dab5e192c64b524c6f077eR117)\n\nFor additional context:\n\n- Investigation guide: at the moment it is a basic text field that\nallows users to include links and other information related to their\nrule to help with diagnosing/managing alerts.\n- Related dashboards: the user may choose to associate existing\ndashboards with their rule. These dashboards are likewise then shown on\nalerts that are subsequently triggered by the rule.","sha":"69a57a7f9f28a968e69cabba91afe3cd1585e7f4","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:obs-ux-management","backport:version","v9.1.0","v8.19.0","author:obs-ux-management"],"title":"[Rule Details] Update tooltip copy for Investigation Guide/Related Dashboards","number":224142,"url":"https://github.com/elastic/kibana/pull/224142","mergeCommit":{"message":"[Rule Details] Update tooltip copy for Investigation Guide/Related Dashboards (elastic#224142)\n\n## Summary\n\nResolves elastic#221426.\n\nAdds tooltip content for the Related Dashboards and Investigation Guide\nfields on the Details segment of the rule create/edit flow.\n\n<img width=\"1039\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/6f812ebc-7a4c-42d5-ae20-c557665a7f17\"\n/>\n\n\n## Testing this PR\n\nHover over the info tips on the form row for the Investigation Guide and\nRelated Dashboard fields.\n\nEnsure that they work and you can view the copy.\n\n### Technical Writer Feedback\n\nThe tooltips for these two fields are the main area we'd like additional\nfeedback/refinement. If you have thoughts, please leave a review:\n\n- [Investigation\nguide](https://github.com/elastic/kibana/pull/224142/files#diff-f61636ed67a25004232d29347e88ca18b9ef0c8551dab5e192c64b524c6f077eR326)\n- [Related\ndashboards](https://github.com/elastic/kibana/pull/224142/files#diff-f61636ed67a25004232d29347e88ca18b9ef0c8551dab5e192c64b524c6f077eR117)\n\nFor additional context:\n\n- Investigation guide: at the moment it is a basic text field that\nallows users to include links and other information related to their\nrule to help with diagnosing/managing alerts.\n- Related dashboards: the user may choose to associate existing\ndashboards with their rule. These dashboards are likewise then shown on\nalerts that are subsequently triggered by the rule.","sha":"69a57a7f9f28a968e69cabba91afe3cd1585e7f4"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/224142","number":224142,"mergeCommit":{"message":"[Rule Details] Update tooltip copy for Investigation Guide/Related Dashboards (elastic#224142)\n\n## Summary\n\nResolves elastic#221426.\n\nAdds tooltip content for the Related Dashboards and Investigation Guide\nfields on the Details segment of the rule create/edit flow.\n\n<img width=\"1039\" alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/6f812ebc-7a4c-42d5-ae20-c557665a7f17\"\n/>\n\n\n## Testing this PR\n\nHover over the info tips on the form row for the Investigation Guide and\nRelated Dashboard fields.\n\nEnsure that they work and you can view the copy.\n\n### Technical Writer Feedback\n\nThe tooltips for these two fields are the main area we'd like additional\nfeedback/refinement. If you have thoughts, please leave a review:\n\n- [Investigation\nguide](https://github.com/elastic/kibana/pull/224142/files#diff-f61636ed67a25004232d29347e88ca18b9ef0c8551dab5e192c64b524c6f077eR326)\n- [Related\ndashboards](https://github.com/elastic/kibana/pull/224142/files#diff-f61636ed67a25004232d29347e88ca18b9ef0c8551dab5e192c64b524c6f077eR117)\n\nFor additional context:\n\n- Investigation guide: at the moment it is a basic text field that\nallows users to include links and other information related to their\nrule to help with diagnosing/managing alerts.\n- Related dashboards: the user may choose to associate existing\ndashboards with their rule. These dashboards are likewise then shown on\nalerts that are subsequently triggered by the rule.","sha":"69a57a7f9f28a968e69cabba91afe3cd1585e7f4"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Justin Kambic <[email protected]>
1 parent 627d071 commit 4dcda7c

File tree

5 files changed

+89
-24
lines changed

5 files changed

+89
-24
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
import React from 'react';
11+
import { fireEvent, render, waitFor } from '@testing-library/react';
12+
import { LabelWithTooltip } from './label_with_tooltip';
13+
14+
describe('LabelWithTooltip', () => {
15+
it('renders label and tooltip content', async () => {
16+
const { getByText } = render(
17+
<LabelWithTooltip labelContent="Label" tooltipContent="Tooltip" />
18+
);
19+
const infoElement = getByText('Info');
20+
21+
fireEvent.mouseOver(infoElement);
22+
await waitFor(() => {
23+
expect(getByText('Tooltip')).toBeInTheDocument();
24+
});
25+
expect(getByText('Label')).toBeInTheDocument();
26+
});
27+
});
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
import React from 'react';
11+
import { EuiFlexGroup, EuiFlexItem, EuiIconTip } from '@elastic/eui';
12+
13+
export function LabelWithTooltip({
14+
labelContent,
15+
tooltipContent,
16+
}: {
17+
labelContent: string;
18+
tooltipContent: string;
19+
}) {
20+
return (
21+
<EuiFlexGroup gutterSize="xs" alignItems="center">
22+
<EuiFlexItem grow={false}>{labelContent}</EuiFlexItem>
23+
<EuiFlexItem grow={false}>
24+
<EuiIconTip type="questionInCircle" content={tooltipContent} />
25+
</EuiFlexItem>
26+
</EuiFlexGroup>
27+
);
28+
}

src/platform/packages/shared/response-ops/rule_form/src/rule_details/rule_dashboards.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ import type { ContentManagementPublicStart } from '@kbn/content-management-plugi
2121
import { OptionalFieldLabel } from '../optional_field_label';
2222
import { dashboardServiceProvider, type DashboardItem } from '../common/services/dashboard_service';
2323
import { useRuleFormState, useRuleFormDispatch } from '../hooks';
24-
import { ALERT_LINK_DASHBOARDS_TITLE, ALERT_LINK_DASHBOARDS_PLACEHOLDER } from '../translations';
24+
import {
25+
ALERT_LINK_DASHBOARDS_TITLE,
26+
ALERT_LINK_DASHBOARDS_PLACEHOLDER,
27+
ALERT_LINK_DASHBOARDS_LABEL_TOOLTIP_CONTENT,
28+
} from '../translations';
29+
import { LabelWithTooltip } from './label_with_tooltip';
2530

2631
export interface Props {
2732
contentManagement: ContentManagementPublicStart;
@@ -167,7 +172,12 @@ export const RuleDashboards = ({ contentManagement }: Props) => {
167172
<EuiFlexGroup>
168173
<EuiFlexItem>
169174
<EuiFormRow
170-
label={ALERT_LINK_DASHBOARDS_TITLE}
175+
label={
176+
<LabelWithTooltip
177+
labelContent={ALERT_LINK_DASHBOARDS_TITLE}
178+
tooltipContent={ALERT_LINK_DASHBOARDS_LABEL_TOOLTIP_CONTENT}
179+
/>
180+
}
171181
fullWidth
172182
labelAppend={OptionalFieldLabel}
173183
>

src/platform/packages/shared/response-ops/rule_form/src/rule_details/rule_details.tsx

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@ import {
1616
EuiFlexGroup,
1717
EuiFlexItem,
1818
EuiSpacer,
19-
EuiIconTip,
2019
} from '@elastic/eui';
21-
import { i18n } from '@kbn/i18n';
22-
2320
import {
2421
RULE_INVESTIGATION_GUIDE_LABEL,
22+
RULE_INVESTIGATION_GUIDE_LABEL_TOOLTIP_CONTENT,
2523
RULE_NAME_INPUT_TITLE,
2624
RULE_TAG_INPUT_TITLE,
2725
RULE_TAG_PLACEHOLDER,
@@ -31,6 +29,7 @@ import { OptionalFieldLabel } from '../optional_field_label';
3129
import { InvestigationGuideEditor } from './rule_investigation_guide_editor';
3230
import { RuleDashboards } from './rule_dashboards';
3331
import { MAX_ARTIFACTS_INVESTIGATION_GUIDE_LENGTH } from '../constants';
32+
import { LabelWithTooltip } from './label_with_tooltip';
3433

3534
export const RULE_DETAIL_MIN_ROW_WIDTH = 600;
3635

@@ -143,25 +142,10 @@ export const RuleDetails = () => {
143142
<EuiFormRow
144143
fullWidth
145144
label={
146-
<EuiFlexGroup gutterSize="xs" alignItems="center">
147-
<EuiFlexItem grow={false}>{RULE_INVESTIGATION_GUIDE_LABEL}</EuiFlexItem>
148-
<EuiFlexItem grow={false}>
149-
<EuiIconTip
150-
type="questionInCircle"
151-
content={
152-
<p>
153-
{i18n.translate(
154-
'responseOpsRuleForm.ruleDetails.investigationGuideFormRow.toolTip.content',
155-
{
156-
defaultMessage:
157-
'These details will be included in a new tab on the alert details page for every alert triggered by this rule.',
158-
}
159-
)}
160-
</p>
161-
}
162-
/>
163-
</EuiFlexItem>
164-
</EuiFlexGroup>
145+
<LabelWithTooltip
146+
labelContent={RULE_INVESTIGATION_GUIDE_LABEL}
147+
tooltipContent={RULE_INVESTIGATION_GUIDE_LABEL_TOOLTIP_CONTENT}
148+
/>
165149
}
166150
labelAppend={OptionalFieldLabel}
167151
isInvalid={

src/platform/packages/shared/response-ops/rule_form/src/translations.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ export const ALERT_LINK_DASHBOARDS_TITLE = i18n.translate(
110110
}
111111
);
112112

113+
export const ALERT_LINK_DASHBOARDS_LABEL_TOOLTIP_CONTENT = i18n.translate(
114+
'responseOpsRuleForm.ruleForm.ruleDefinition.alertLinkDashboards.label.tooltipContent',
115+
{
116+
defaultMessage:
117+
'Visualize data from various sources to investigate alerts generated by this rule. Alerts will include links to the dashboards you choose.',
118+
}
119+
);
120+
113121
export const ALERT_LINK_DASHBOARDS_PLACEHOLDER = i18n.translate(
114122
'responseOpsRuleForm.ruleForm.ruleDefinition.alertLinkDashboardsTitle',
115123
{
@@ -311,6 +319,14 @@ export const RULE_INVESTIGATION_GUIDE_LABEL = i18n.translate(
311319
}
312320
);
313321

322+
export const RULE_INVESTIGATION_GUIDE_LABEL_TOOLTIP_CONTENT = i18n.translate(
323+
'responseOpsRuleForm.ruleDetails.investigationGuideFormRow.toolTip.content',
324+
{
325+
defaultMessage:
326+
'These details will be included in a new tab on the alert details page for every alert triggered by this rule.',
327+
}
328+
);
329+
314330
export const RULE_NAME_ARIA_LABEL_TEXT = i18n.translate(
315331
'responseOpsRuleForm.ruleForm.rulePage.ruleNameAriaLabelText',
316332
{

0 commit comments

Comments
 (0)