Skip to content
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

[7.x] [Upgrade Assistant] Align code between branches (#91862) #92718

Merged
merged 2 commits into from
Feb 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -21502,10 +21502,6 @@
"xpack.upgradeAssistant.checkupTab.deprecations.indexTable.indexColumnLabel": "インデックス",
"xpack.upgradeAssistant.checkupTab.deprecations.warningActionTooltip": "アップグレード前にこの問題を解決することをお勧めしますが、必須ではありません。",
"xpack.upgradeAssistant.checkupTab.deprecations.warningLabel": "警告",
"xpack.upgradeAssistant.checkupTab.fixMetricbeatIndexButton.failedLabel": "失敗",
"xpack.upgradeAssistant.checkupTab.fixMetricbeatIndexButton.fixedLabel": "修正済み",
"xpack.upgradeAssistant.checkupTab.fixMetricbeatIndexButton.fixingLabel": "修正中…",
"xpack.upgradeAssistant.checkupTab.fixMetricbeatIndexButton.reindexLabel": "修正",
"xpack.upgradeAssistant.checkupTab.indexLabel": "インデックス",
"xpack.upgradeAssistant.checkupTab.indicesBadgeLabel": "{numIndices, plural, other {インデックス}}",
"xpack.upgradeAssistant.checkupTab.indicesTabLabel": "インデックス",
Expand All @@ -21515,8 +21511,6 @@
"xpack.upgradeAssistant.checkupTab.noIssues.noIssuesLabel": "{strongCheckupLabel} の問題がありません。",
"xpack.upgradeAssistant.checkupTab.noIssues.noIssuesTitle": "完璧です!",
"xpack.upgradeAssistant.checkupTab.numDeprecationsShownLabel": "{total} 件中 {numShown} 件を表示中",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.apmIndexPatternCallout.apmSetupLinkLabel": "APMのセットアップ手順",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.apmIndexPatternCallout.calloutTitle": "APMインデックスの再インデックス後、{apmSetupLink}に戻ってKibanaオブジェクトを再度読み込んでください。これは1度だけ必要な作業です。",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.cancelButtonLabel": "キャンセル",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.closeButtonLabel": "閉じる",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.continueButtonLabel": "再インデックスを続ける",
Expand Down Expand Up @@ -21547,10 +21541,6 @@
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.indexClosedCallout.calloutDetails.reindexingTakesLongerEmphasis": "再インデックスには通常よりも時間がかかることがあります",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.indexClosedCallout.calloutTitle": "インデックスが閉じました",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.openAndCloseDocumentation": "ドキュメンテーション",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.apmReindexWarningDetail": "バージョン 7.0.0 以降、APM データは Elastic Common Schema で表示されます。過去の APM データは再インデックスされるまで表示されません。",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.apmReindexWarningTitle": "このインデックスは ECS 形式に変換されます",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.customTypeNameWarningDetail": "マッピングタイプは8.xではサポートされていません。このインデックスマッピングはデフォルトのタイプ名、{defaultType}を使用しておらず、再インデックス時に更新されます。アプリケーションコードまたはスクリプトが異なるタイプに依存していないことを確認してください。",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.customTypeNameWarningTitle": "マッピングタイプが{defaultType}に変更されます",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.destructiveCallout.calloutDetail": "インデックスをバックアップして、互換性を破るそれぞれの変更に同意することで再インデックスしてください。",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.destructiveCallout.calloutTitle": "このインデックスには元に戻すことのできない破壊的な変更が含まれています",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.documentationLinkLabel": "ドキュメント",
Expand Down
10 changes: 0 additions & 10 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -21552,10 +21552,6 @@
"xpack.upgradeAssistant.checkupTab.deprecations.indexTable.indexColumnLabel": "索引",
"xpack.upgradeAssistant.checkupTab.deprecations.warningActionTooltip": "建议在升级之前先解决此问题,但这不是必需的。",
"xpack.upgradeAssistant.checkupTab.deprecations.warningLabel": "警告",
"xpack.upgradeAssistant.checkupTab.fixMetricbeatIndexButton.failedLabel": "失败",
"xpack.upgradeAssistant.checkupTab.fixMetricbeatIndexButton.fixedLabel": "已修复",
"xpack.upgradeAssistant.checkupTab.fixMetricbeatIndexButton.fixingLabel": "正在修复……",
"xpack.upgradeAssistant.checkupTab.fixMetricbeatIndexButton.reindexLabel": "修复",
"xpack.upgradeAssistant.checkupTab.indexLabel": "索引",
"xpack.upgradeAssistant.checkupTab.indicesBadgeLabel": "{numIndices, plural, other { 个索引}}",
"xpack.upgradeAssistant.checkupTab.indicesTabLabel": "索引",
Expand All @@ -21565,8 +21561,6 @@
"xpack.upgradeAssistant.checkupTab.noIssues.noIssuesLabel": "您没有 {strongCheckupLabel} 问题。",
"xpack.upgradeAssistant.checkupTab.noIssues.noIssuesTitle": "全部清除!",
"xpack.upgradeAssistant.checkupTab.numDeprecationsShownLabel": "显示 {numShown} 个,共 {total} 个",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.apmIndexPatternCallout.apmSetupLinkLabel": "APM 设置说明",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.apmIndexPatternCallout.calloutTitle": "重新索引 APM 索引后,返回 {apmSetupLink} 以重新加载 Kibana 对象。您只需执行一次此操作。",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.cancelButtonLabel": "取消",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.closeButtonLabel": "关闭",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.checklistStep.continueButtonLabel": "继续重新索引",
Expand Down Expand Up @@ -21597,10 +21591,6 @@
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.indexClosedCallout.calloutDetails.reindexingTakesLongerEmphasis": "重新索引可能比通常花费更多的时间",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.indexClosedCallout.calloutTitle": "索引已关闭",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.openAndCloseDocumentation": "文档",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.apmReindexWarningDetail": "从版本 7.0.0 开始,将以 Elastic Common Schema 格式表示 APM 数据。只有重新索引历史 APM 数据后,其才可见。",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.apmReindexWarningTitle": "此索引将转换成 ECS 格式",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.customTypeNameWarningDetail": "映射类型在 8.x 中不再受支持。此索引映射不使用默认类型名称 {defaultType},并将在重新索引时更新。确保没有应用程序代码或脚本依赖其他类型。",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.customTypeNameWarningTitle": "映射类型将更改为 {defaultType}",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.destructiveCallout.calloutDetail": "备份您的索引,然后通过接受每个重大更改来继续重新索引。",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.destructiveCallout.calloutTitle": "此索引需要无法撤消的破坏性更改",
"xpack.upgradeAssistant.checkupTab.reindexing.flyout.warningsStep.documentationLinkLabel": "文档",
Expand Down
15 changes: 15 additions & 0 deletions x-pack/plugins/upgrade_assistant/common/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* 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 SemVer from 'semver/classes/semver';

/*
* These constants are used only in tests to add conditional logic based on Kibana version
* On master, the version should represent the next major version (e.g., master --> 8.0.0)
* The release branch should match the release version (e.g., 7.x --> 7.0.0)
*/
export const mockKibanaVersion = '7.0.0';
export const mockKibanaSemverVersion = new SemVer(mockKibanaVersion);
3 changes: 2 additions & 1 deletion x-pack/plugins/upgrade_assistant/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ export type ReindexSavedObject = SavedObject<ReindexOperation>;

export enum ReindexWarning {
// 7.0 -> 8.0 warnings
apmReindex,
customTypeName,

// 8.0 -> 9.0 warnings
}

export enum IndexGroup {
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/upgrade_assistant/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"server": true,
"ui": true,
"configPath": ["xpack", "upgrade_assistant"],
"requiredPlugins": ["management", "licensing", "apmOss", "features"],
"requiredPlugins": ["management", "licensing", "features"],
"optionalPlugins": ["cloud", "usageCollection"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
*/

import React from 'react';
import SemVer from 'semver/classes/semver';
import { mountWithIntl } from '@kbn/test/jest';
import { httpServiceMock } from 'src/core/public/mocks';
import { mockKibanaSemverVersion } from '../../../common/constants';
import { UpgradeAssistantTabs } from './tabs';
import { LoadingState } from './types';

Expand All @@ -18,7 +18,6 @@ import { OverviewTab } from './tabs/overview';
const promisesToResolve = () => new Promise((resolve) => setTimeout(resolve, 0));

const mockHttp = httpServiceMock.createSetupContract();
const mockKibanaVersion = new SemVer('7.0.0');

jest.mock('../app_context', () => {
return {
Expand All @@ -29,9 +28,9 @@ jest.mock('../app_context', () => {
ELASTIC_WEBSITE_URL: 'https://www.elastic.co/',
},
kibanaVersionInfo: {
currentMajor: mockKibanaVersion.major,
prevMajor: mockKibanaVersion.major - 1,
nextMajor: mockKibanaVersion.major + 1,
currentMajor: mockKibanaSemverVersion.major,
prevMajor: mockKibanaSemverVersion.major - 1,
nextMajor: mockKibanaSemverVersion.major + 1,
},
};
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { shallow } from 'enzyme';
import React from 'react';
import SemVer from 'semver/classes/semver';
import { mockKibanaSemverVersion } from '../../../../../common/constants';

import { LoadingState } from '../../types';
import AssistanceData from '../__fixtures__/checkup_api_response.json';
Expand All @@ -22,8 +22,6 @@ const defaultProps = {
setSelectedTabIndex: jest.fn(),
};

const mockKibanaVersion = new SemVer('7.0.0');

jest.mock('../../../app_context', () => {
return {
useAppContext: () => {
Expand All @@ -33,9 +31,9 @@ jest.mock('../../../app_context', () => {
ELASTIC_WEBSITE_URL: 'https://www.elastic.co/',
},
kibanaVersionInfo: {
currentMajor: mockKibanaVersion.major,
prevMajor: mockKibanaVersion.major - 1,
nextMajor: mockKibanaVersion.major + 1,
currentMajor: mockKibanaSemverVersion.major,
prevMajor: mockKibanaSemverVersion.major - 1,
nextMajor: mockKibanaSemverVersion.major + 1,
},
};
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
EuiTitle,
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { FixDefaultFieldsButton } from './default_fields/button';
import { ReindexButton } from './reindex';
import { AppContext } from '../../../../app_context';
import { EnrichedDeprecationInfo } from '../../../../../../common/types';
Expand Down Expand Up @@ -99,14 +98,6 @@ export const DeprecationCell: FunctionComponent<DeprecationCellProps> = ({
</AppContext.Consumer>
</EuiFlexItem>
)}

{needsDefaultFields && (
<EuiFlexItem grow={false}>
<AppContext.Consumer>
{({ http }) => <FixDefaultFieldsButton indexName={indexName!} http={http} />}
</AppContext.Consumer>
</EuiFlexItem>
)}
</EuiFlexGroup>

<EuiSpacer size="s" />
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import React from 'react';

import { EuiBasicTable } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FixDefaultFieldsButton } from './default_fields/button';
import { ReindexButton } from './reindex';
import { AppContext } from '../../../../app_context';
import { EnrichedDeprecationInfo } from '../../../../../../common/types';
Expand Down Expand Up @@ -145,40 +144,32 @@ export class IndexDeprecationTable extends React.Component<

private generateActionsColumn() {
// NOTE: this naive implementation assumes all indices in the table are
// should show the reindex button. This should work for known usecases.
// should show the reindex button. This should work for known use cases.
const { indices } = this.props;
const showReindexButton = indices.find((i) => i.reindex === true);
const showNeedsDefaultFieldsButton = indices.find((i) => i.needsDefaultFields === true);
if (!showReindexButton && !showNeedsDefaultFieldsButton) {
const hasActionsColumn = Boolean(indices.find((i) => i.reindex === true));

if (hasActionsColumn === false) {
return null;
}

return {
actions: [
{
render(indexDep: IndexDeprecationDetails) {
if (showReindexButton) {
return (
<AppContext.Consumer>
{({ http, docLinks }) => {
return (
<ReindexButton
docLinks={docLinks}
reindexBlocker={indexDep.blockerForReindexing}
indexName={indexDep.index!}
http={http}
/>
);
}}
</AppContext.Consumer>
);
} else {
return (
<AppContext.Consumer>
{({ http }) => <FixDefaultFieldsButton indexName={indexDep.index!} http={http} />}
</AppContext.Consumer>
);
}
return (
<AppContext.Consumer>
{({ http, docLinks }) => {
return (
<ReindexButton
docLinks={docLinks}
reindexBlocker={indexDep.blockerForReindexing}
indexName={indexDep.index!}
http={http}
/>
);
}}
</AppContext.Consumer>
);
},
},
],
Expand Down
Loading