Skip to content

Commit b25dd4e

Browse files
authored
Add LevelIconTips to be more explicit about the difference between critical and warning issues. (#115121)
1 parent 66ebd9c commit b25dd4e

File tree

4 files changed

+54
-8
lines changed

4 files changed

+54
-8
lines changed

x-pack/plugins/upgrade_assistant/public/application/components/overview/fix_issues_step/fix_issues_step.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export const getFixIssuesStep = ({
7070
<p>
7171
<FormattedMessage
7272
id="xpack.upgradeAssistant.overview.fixIssuesStepDescription"
73-
defaultMessage="Update your Elasticsearch and Kibana deployments to be compatible with {nextMajor}.0. Critical issues must be resolved before you upgrade."
73+
defaultMessage="Update your Elasticsearch and Kibana deployments to be compatible with {nextMajor}.0. Critical issues must be resolved before you upgrade. Warning issues can be ignored at your discretion."
7474
values={{ nextMajor }}
7575
/>
7676
</p>

x-pack/plugins/upgrade_assistant/public/application/components/shared/deprecation_count.tsx

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
*/
77

88
import React, { FunctionComponent } from 'react';
9-
109
import { EuiFlexGroup, EuiFlexItem, EuiHealth } from '@elastic/eui';
1110
import { i18n } from '@kbn/i18n';
1211

12+
import { LevelInfoTip } from './level_info_tip';
13+
1314
const i18nTexts = {
1415
getCriticalStatusLabel: (count: number) =>
1516
i18n.translate('xpack.upgradeAssistant.deprecationCount.criticalStatusLabel', {
@@ -39,14 +40,31 @@ export const DeprecationCount: FunctionComponent<Props> = ({
3940
return (
4041
<EuiFlexGroup>
4142
<EuiFlexItem grow={false}>
42-
<EuiHealth color="danger" data-test-subj="criticalDeprecationsCount">
43-
{i18nTexts.getCriticalStatusLabel(totalCriticalDeprecations)}
44-
</EuiHealth>
43+
<EuiFlexGroup gutterSize="xs" alignItems="center">
44+
<EuiFlexItem grow={false}>
45+
<EuiHealth color="danger" data-test-subj="criticalDeprecationsCount">
46+
{i18nTexts.getCriticalStatusLabel(totalCriticalDeprecations)}
47+
</EuiHealth>
48+
</EuiFlexItem>
49+
50+
<EuiFlexItem>
51+
<LevelInfoTip level="critical" />
52+
</EuiFlexItem>
53+
</EuiFlexGroup>
4554
</EuiFlexItem>
55+
4656
<EuiFlexItem grow={false}>
47-
<EuiHealth color="subdued" data-test-subj="warningDeprecationsCount">
48-
{i18nTexts.getWarningStatusLabel(totalWarningDeprecations)}
49-
</EuiHealth>
57+
<EuiFlexGroup gutterSize="xs" alignItems="center">
58+
<EuiFlexItem grow={false}>
59+
<EuiHealth color="subdued" data-test-subj="warningDeprecationsCount">
60+
{i18nTexts.getWarningStatusLabel(totalWarningDeprecations)}
61+
</EuiHealth>
62+
</EuiFlexItem>
63+
64+
<EuiFlexItem>
65+
<LevelInfoTip level="warning" />
66+
</EuiFlexItem>
67+
</EuiFlexGroup>
5068
</EuiFlexItem>
5169
</EuiFlexGroup>
5270
);

x-pack/plugins/upgrade_assistant/public/application/components/shared/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ export { NoDeprecationsPrompt } from './no_deprecations';
99
export { DeprecationCount } from './deprecation_count';
1010
export { DeprecationBadge } from './deprecation_badge';
1111
export { DeprecationsPageLoadingError } from './deprecations_page_loading_error';
12+
export { LevelInfoTip } from './level_info_tip';
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; you may not use this file except in compliance with the Elastic License
5+
* 2.0.
6+
*/
7+
8+
import React, { FunctionComponent } from 'react';
9+
import { i18n } from '@kbn/i18n';
10+
import { EuiIconTip } from '@elastic/eui';
11+
12+
const i18nTexts = {
13+
critical: i18n.translate('xpack.upgradeAssistant.levelInfoTip.criticalLabel', {
14+
defaultMessage: 'Critical issues must be resolved before you upgrade',
15+
}),
16+
warning: i18n.translate('xpack.upgradeAssistant.levelInfoTip.warningLabel', {
17+
defaultMessage: 'Warning issues can be ignored at your discretion',
18+
}),
19+
};
20+
21+
interface Props {
22+
level: 'critical' | 'warning';
23+
}
24+
25+
export const LevelInfoTip: FunctionComponent<Props> = ({ level }) => {
26+
return <EuiIconTip content={i18nTexts[level]} position="top" type="iInCircle" />;
27+
};

0 commit comments

Comments
 (0)