Skip to content

Commit

Permalink
Use consistent 'issues' and 'critical' vs. 'warning' terminology in U…
Browse files Browse the repository at this point in the history
…A. (#111221)
  • Loading branch information
cjcenizal authored Sep 8, 2021
1 parent 66de538 commit 7515700
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ describe('ES deprecations table', () => {

expect(exists('noDeprecationsRow')).toBe(true);
expect(find('noDeprecationsRow').text()).toContain(
'No Elasticsearch deprecation warnings found'
'No Elasticsearch deprecation issues found'
);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('Error handling', () => {

expect(exists('kibanaDeprecationErrors')).toBe(true);
expect(find('kibanaDeprecationErrors').text()).toContain(
'Deprecation warnings may be incomplete'
'List of deprecation issues might be incomplete'
);
});

Expand All @@ -78,6 +78,8 @@ describe('Error handling', () => {
component.update();

expect(exists('kibanaRequestError')).toBe(true);
expect(find('kibanaRequestError').text()).toContain('Could not retrieve Kibana deprecations');
expect(find('kibanaRequestError').text()).toContain(
'Could not retrieve Kibana deprecation issues'
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ const getDeprecationCountByLevel = (deprecations: EnrichedDeprecationInfo[]) =>

const i18nTexts = {
pageTitle: i18n.translate('xpack.upgradeAssistant.esDeprecations.pageTitle', {
defaultMessage: 'Elasticsearch deprecation warnings',
defaultMessage: 'Elasticsearch deprecation issues',
}),
pageDescription: i18n.translate('xpack.upgradeAssistant.esDeprecations.pageDescription', {
defaultMessage:
'You must resolve all critical issues before upgrading. Back up recommended. Make sure you have a current snapshot before modifying your configuration or reindexing.',
}),
isLoading: i18n.translate('xpack.upgradeAssistant.esDeprecations.loadingText', {
defaultMessage: 'Loading deprecations…',
defaultMessage: 'Loading deprecation issues…',
}),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const i18nTexts = {
noDeprecationsMessage: i18n.translate(
'xpack.upgradeAssistant.esDeprecations.table.noDeprecationsMessage',
{
defaultMessage: 'No Elasticsearch deprecation warnings found',
defaultMessage: 'No Elasticsearch deprecation issues found',
}
),
typeFilterLabel: i18n.translate('xpack.upgradeAssistant.esDeprecations.table.typeFilterLabel', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ const i18nTexts = {
defaultMessage: 'Critical',
}
),
warningBadgeLabel: i18n.translate(
'xpack.upgradeAssistant.esDeprecations.defaultDeprecation.warningBadgeLabel',
{
defaultMessage: 'Warning',
}
),
manualCellLabel: i18n.translate(
'xpack.upgradeAssistant.esDeprecations.defaultDeprecation.manualCellLabel',
{
Expand All @@ -52,7 +58,7 @@ export const EsDeprecationsTableCells: React.FunctionComponent<Props> = ({
return <EuiBadge color="danger">{i18nTexts.criticalBadgeLabel}</EuiBadge>;
}

return <>{''}</>;
return <EuiBadge color="default">{i18nTexts.warningBadgeLabel}</EuiBadge>;
}

// "Issue" column
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const { useGlobalFlyout } = GlobalFlyout;

const i18nTexts = {
pageTitle: i18n.translate('xpack.upgradeAssistant.kibanaDeprecations.pageTitle', {
defaultMessage: 'Kibana deprecation warnings',
defaultMessage: 'Kibana deprecation issues',
}),
pageDescription: (
<FormattedMessage
Expand All @@ -50,25 +50,25 @@ const i18nTexts = {
defaultMessage: 'Kibana',
}),
isLoading: i18n.translate('xpack.upgradeAssistant.kibanaDeprecations.loadingText', {
defaultMessage: 'Loading deprecations…',
defaultMessage: 'Loading deprecation issues…',
}),
kibanaDeprecationErrorTitle: i18n.translate(
'xpack.upgradeAssistant.kibanaDeprecations.kibanaDeprecationErrorTitle',
{
defaultMessage: 'Deprecation warnings may be incomplete',
defaultMessage: 'List of deprecation issues might be incomplete',
}
),
getKibanaDeprecationErrorDescription: (pluginIds: string[]) =>
i18n.translate('xpack.upgradeAssistant.kibanaDeprecations.kibanaDeprecationErrorDescription', {
defaultMessage:
'Failed to get deprecation warnings for {pluginCount, plural, one {this plugin} other {these plugins}}: {pluginIds}. Check the Kibana server logs for more details.',
'Failed to get deprecation issues for {pluginCount, plural, one {this plugin} other {these plugins}}: {pluginIds}. Check the Kibana server logs for more information.',
values: {
pluginCount: pluginIds.length,
pluginIds: pluginIds.join(', '),
},
}),
requestErrorTitle: i18n.translate('xpack.upgradeAssistant.kibanaDeprecations.requestErrorTitle', {
defaultMessage: 'Could not retrieve Kibana deprecations',
defaultMessage: 'Could not retrieve Kibana deprecation issues',
}),
requestErrorDescription: i18n.translate(
'xpack.upgradeAssistant.kibanaDeprecationErrors.requestErrorDescription',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ const i18nTexts = {
defaultMessage: 'critical',
}
),
warningBadgeLabel: i18n.translate(
'xpack.upgradeAssistant.kibanaDeprecations.table.warningBadgeLabel',
{
defaultMessage: 'warning',
}
),
searchPlaceholderLabel: i18n.translate(
'xpack.upgradeAssistant.kibanaDeprecations.table.searchPlaceholderLabel',
{
Expand Down Expand Up @@ -115,11 +121,16 @@ export const KibanaDeprecationsTable: React.FunctionComponent<Props> = ({
truncateText: true,
sortable: true,
render: (level: KibanaDeprecationDetails['level']) => {
if (level === 'critical') {
return <EuiBadge color="danger">{i18nTexts.criticalBadgeLabel}</EuiBadge>;
}
switch (level) {
case 'critical':
return <EuiBadge color="danger">{i18nTexts.criticalBadgeLabel}</EuiBadge>;

return <>{''}</>;
case 'warning':
return <EuiBadge color="default">{i18nTexts.warningBadgeLabel}</EuiBadge>;

default:
return <>{''}</>;
}
},
},
{
Expand Down

0 comments on commit 7515700

Please sign in to comment.