Skip to content

Commit

Permalink
[main] [UA] ES deprecation logs in its own page (#118659) (#119134)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebelga authored Nov 20, 2021
1 parent 8e8b623 commit 9fa409f
Show file tree
Hide file tree
Showing 31 changed files with 459 additions and 331 deletions.
1 change: 1 addition & 0 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ export class DocLinksService {
mappingTermVector: `${ELASTICSEARCH_DOCS}term-vector.html`,
mappingTypesRemoval: `${ELASTICSEARCH_DOCS}removal-of-types.html`,
migrateIndexAllocationFilters: `${ELASTICSEARCH_DOCS}migrate-index-allocation-filters.html`,
migrationApiDeprecation: `${ELASTICSEARCH_DOCS}migration-api-deprecation.html`,
nodeRoles: `${ELASTICSEARCH_DOCS}modules-node.html#node-roles`,
releaseHighlights: `${ELASTICSEARCH_DOCS}release-highlights.html`,
remoteClusters: `${ELASTICSEARCH_DOCS}remote-clusters.html`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ interface Props {
isLoading: boolean;
hasPrivileges: boolean;
privilegesMissing: MissingPrivileges;
}) => JSX.Element;
}) => JSX.Element | null;
}

type Privilege = [string, string];
Expand Down
8 changes: 3 additions & 5 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -17555,7 +17555,7 @@
"xpack.ml.ruleEditor.scopeSection.noPermissionToViewFilterListsTitle": "フィルターリストを表示するパーミッションがありません",
"xpack.ml.ruleEditor.scopeSection.scopeTitle": "範囲",
"xpack.ml.ruleEditor.selectRuleAction.createRuleLinkText": "ルールを作成",
"xpack.ml.ruleEditor.selectRuleAction.orText": "OR ",
"xpack.ml.ruleEditor.selectRuleAction.orText": "OR ",
"xpack.ml.ruleEditor.typicalAppliesTypeText": "通常",
"xpack.ml.sampleDataLinkLabel": "ML ジョブ",
"xpack.ml.settings.anomalyDetection.anomalyDetectionTitle": "異常検知",
Expand Down Expand Up @@ -23489,9 +23489,9 @@
"xpack.securitySolution.open.timeline.showingLabel": "表示中:",
"xpack.securitySolution.open.timeline.singleTemplateLabel": "テンプレート",
"xpack.securitySolution.open.timeline.singleTimelineLabel": "タイムライン",
"xpack.securitySolution.open.timeline.successfullyDeletedTimelinesTitle": "{totalTimelines, plural, =0 {すべてのタイムライン} other {{totalTimelines} 個のタイムライン}}の削除が正常に完了しました",
"xpack.securitySolution.open.timeline.successfullyDeletedTimelinesTitle": "{totalTimelines, plural, =0 {すべてのタイムライン} other {{totalTimelines} 個のタイムライン}}の削除が正常に完了しました",
"xpack.securitySolution.open.timeline.successfullyDeletedTimelineTemplatesTitle": "{totalTimelineTemplates, plural, =0 {すべてのタイムライン} other {{totalTimelineTemplates}個のタイムラインテンプレート}}が正常に削除されました",
"xpack.securitySolution.open.timeline.successfullyExportedTimelinesTitle": "{totalTimelines, plural, =0 {すべてのタイムライン} other {{totalTimelines} 個のタイムライン}}のエクスポートが正常に完了しました",
"xpack.securitySolution.open.timeline.successfullyExportedTimelinesTitle": "{totalTimelines, plural, =0 {すべてのタイムライン} other {{totalTimelines} 個のタイムライン}}のエクスポートが正常に完了しました",
"xpack.securitySolution.open.timeline.successfullyExportedTimelineTemplatesTitle": "{totalTimelineTemplates, plural, =0 {すべてのタイムライン} other {{totalTimelineTemplates} タイムラインテンプレート}}が正常にエクスポートされました",
"xpack.securitySolution.open.timeline.timelineNameTableHeader": "タイムライン名",
"xpack.securitySolution.open.timeline.timelineTemplateNameTableHeader": "テンプレート名",
Expand Down Expand Up @@ -26568,9 +26568,7 @@
"xpack.upgradeAssistant.overview.deprecationLogs.updateErrorMessage": "ログ状態を更新できませんでした。",
"xpack.upgradeAssistant.overview.deprecationsCountCheckpointTitle": "廃止予定の問題を解決して変更を検証",
"xpack.upgradeAssistant.overview.documentationLinkText": "ドキュメント",
"xpack.upgradeAssistant.overview.fixIssuesStepDescription": "Elastic 8.xとの互換になるように、ElasticsearchおよびKibanaデプロイを更新します。アップグレード前に、重大な問題を解決する必要があります。警告の問題は独自の裁量で無視できます。",
"xpack.upgradeAssistant.overview.fixIssuesStepTitle": "廃止予定設定を確認し、問題を解決",
"xpack.upgradeAssistant.overview.identifyStepTitle": "廃止予定APIの使用を特定し、アプリケーションを更新",
"xpack.upgradeAssistant.overview.loadingLogsLabel": "廃止予定ログ収集状態を読み込んでいます...",
"xpack.upgradeAssistant.overview.observe.discoveryDescription": "廃止予定ログを検索およびフィルターし、必要な変更のタイプを把握します。",
"xpack.upgradeAssistant.overview.observe.observabilityDescription": "使用中のAPIのうち廃止予定のAPIと、更新が必要なアプリケーションを特定できます。",
Expand Down
4 changes: 1 addition & 3 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -17820,7 +17820,7 @@
"xpack.ml.ruleEditor.scopeSection.noPermissionToViewFilterListsTitle": "您无权查看筛选列表",
"xpack.ml.ruleEditor.scopeSection.scopeTitle": "范围",
"xpack.ml.ruleEditor.selectRuleAction.createRuleLinkText": "创建规则",
"xpack.ml.ruleEditor.selectRuleAction.orText": "或 ",
"xpack.ml.ruleEditor.selectRuleAction.orText": "或 ",
"xpack.ml.ruleEditor.typicalAppliesTypeText": "典型",
"xpack.ml.sampleDataLinkLabel": "ML 作业",
"xpack.ml.settings.anomalyDetection.anomalyDetectionTitle": "异常检测",
Expand Down Expand Up @@ -27026,9 +27026,7 @@
"xpack.upgradeAssistant.overview.deprecationLogs.updateErrorMessage": "无法更新日志记录状态。",
"xpack.upgradeAssistant.overview.deprecationsCountCheckpointTitle": "解决弃用问题并验证您的更改",
"xpack.upgradeAssistant.overview.documentationLinkText": "文档",
"xpack.upgradeAssistant.overview.fixIssuesStepDescription": "更新您的 Elasticsearch 和 Kibana 部署以兼容 Elastic 8.x。在升级之前必须解决紧急问题。您可以酌情忽略警告问题。",
"xpack.upgradeAssistant.overview.fixIssuesStepTitle": "复查已弃用设置并解决问题",
"xpack.upgradeAssistant.overview.identifyStepTitle": "识别已弃用 API 的使用并更新您的应用程序",
"xpack.upgradeAssistant.overview.loadingLogsLabel": "正在加载弃用日志收集状态……",
"xpack.upgradeAssistant.overview.observe.discoveryDescription": "搜索并筛选弃用日志以了解需要进行的更改类型。",
"xpack.upgradeAssistant.overview.observe.observabilityDescription": "深入了解正在使用哪些已弃用 API 以及需要更新哪些应用程序。",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,14 @@ describe('Cluster upgrade', () => {
});
});

// The way we detect if we are currently upgrading or if the upgrade has been completed is if
// we ever get back a 426 error in *any* API response that UA makes. For that reason we can
// just mock one of the APIs that are being called from the overview page to return an error
// in order to trigger these interstitial states. In this case we're going to mock the
// `es deprecations` response.
describe('when cluster is in the process of a rolling upgrade', () => {
beforeEach(async () => {
httpRequestsMockHelpers.setLoadDeprecationLoggingResponse(undefined, {
httpRequestsMockHelpers.setLoadEsDeprecationsResponse(undefined, {
statusCode: 426,
message: '',
attributes: {
Expand All @@ -62,7 +67,7 @@ describe('Cluster upgrade', () => {

describe('when cluster has been upgraded', () => {
beforeEach(async () => {
httpRequestsMockHelpers.setLoadDeprecationLoggingResponse(undefined, {
httpRequestsMockHelpers.setLoadEsDeprecationsResponse(undefined, {
statusCode: 426,
message: '',
attributes: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { act } from 'react-dom/test-utils';
import { registerTestBed, TestBed, AsyncTestBedConfig } from '@kbn/test/jest';
import { EsDeprecationLogs } from '../../../public/application/components/es_deprecation_logs';
import { WithAppDependencies } from '../helpers';

const testBedConfig: AsyncTestBedConfig = {
memoryRouter: {
initialEntries: ['/es_deprecation_logs'],
componentRoutePath: '/es_deprecation_logs',
},
doMountAsync: true,
};

export type EsDeprecationLogsTestBed = TestBed & {
actions: ReturnType<typeof createActions>;
};

const createActions = (testBed: TestBed) => {
/**
* User Actions
*/

const clickDeprecationToggle = async () => {
const { find, component } = testBed;

await act(async () => {
find('deprecationLoggingToggle').simulate('click');
});

component.update();
};

const clickRetryButton = async () => {
const { find, component } = testBed;

await act(async () => {
find('retryButton').simulate('click');
});

component.update();
};

const clickResetButton = async () => {
const { find, component } = testBed;

await act(async () => {
find('resetLastStoredDate').simulate('click');
});

component.update();
};

return {
clickDeprecationToggle,
clickRetryButton,
clickResetButton,
};
};

export const setupESDeprecationLogsPage = async (
overrides?: Record<string, unknown>
): Promise<EsDeprecationLogsTestBed> => {
const initTestBed = registerTestBed(
WithAppDependencies(EsDeprecationLogs, overrides),
testBedConfig
);
const testBed = await initTestBed();

return {
...testBed,
actions: createActions(testBed),
};
};
Loading

0 comments on commit 9fa409f

Please sign in to comment.