Skip to content

Commit

Permalink
Revert "[Upgrade Assistant] Update UX for 7.17 (elastic#119798)"
Browse files Browse the repository at this point in the history
This reverts commit 34dcc1e.
  • Loading branch information
sebelga committed Dec 15, 2021
1 parent 52e775f commit c17915e
Show file tree
Hide file tree
Showing 15 changed files with 325 additions and 215 deletions.
1 change: 0 additions & 1 deletion src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ export class DocLinksService {
migrationApiDeprecation: `${ELASTICSEARCH_DOCS}migration-api-deprecation.html`,
nodeRoles: `${ELASTICSEARCH_DOCS}modules-node.html#node-roles`,
releaseHighlights: `${ELASTICSEARCH_DOCS}release-highlights.html`,
version8ReleaseHighlights: `${ELASTIC_WEBSITE_URL}guide/en/elastic-stack/8.0/elastic-stack-highlights.html`,
remoteClusters: `${ELASTICSEARCH_DOCS}remote-clusters.html`,
remoteClustersProxy: `${ELASTICSEARCH_DOCS}remote-clusters.html#proxy-mode`,
remoteClusersProxySettings: `${ELASTICSEARCH_DOCS}remote-clusters-settings.html#remote-cluster-proxy-settings`,
Expand Down
4 changes: 4 additions & 0 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -27262,7 +27262,11 @@
"xpack.upgradeAssistant.overview.systemIndices.statusTableColumn": "ステータス",
"xpack.upgradeAssistant.overview.systemIndices.title": "システムインデックスの移行",
"xpack.upgradeAssistant.overview.systemIndices.viewSystemIndicesStatus": "移行詳細を表示",
"xpack.upgradeAssistant.overview.upgradeGuideLink": "アップグレードガイドを表示",
"xpack.upgradeAssistant.overview.upgradeStepCloudLink": "クラウドでアップグレード",
"xpack.upgradeAssistant.overview.upgradeStepDescription": "重要な問題をすべて解決し、アプリケーションの準備を確認した後に、Elastic 8.xにアップグレードできます。アップグレードする前に、必ずもう一度データをバックアップしたことを確認してください。",
"xpack.upgradeAssistant.overview.upgradeStepDescriptionForCloud": "重要な問題をすべて解決し、アプリケーションの準備を確認した後に、Elastic 8.xにアップグレードできます。アップグレードする前に、必ずもう一度データをバックアップしたことを確認してください。Elastic Cloudでデプロイをアップグレードします。",
"xpack.upgradeAssistant.overview.upgradeStepLink": "詳細",
"xpack.upgradeAssistant.overview.upgradeStepTitle": "Elastic 8.xへのアップグレード",
"xpack.upgradeAssistant.overview.verifyChanges.calloutBody": "変更した後、カウンターをリセットして監視を続け、廃止予定の機能を使用していないことを確認します。",
"xpack.upgradeAssistant.overview.verifyChanges.calloutTitle": "{previousCheck}以降{warningsCount, plural, =0 {0} other {{warningsCount}}}件の廃止予定{warningsCount, plural, other {件の問題}}",
Expand Down
4 changes: 4 additions & 0 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -27727,7 +27727,11 @@
"xpack.upgradeAssistant.overview.systemIndices.statusTableColumn": "状态",
"xpack.upgradeAssistant.overview.systemIndices.title": "迁移系统索引",
"xpack.upgradeAssistant.overview.systemIndices.viewSystemIndicesStatus": "查看迁移详情",
"xpack.upgradeAssistant.overview.upgradeGuideLink": "查看升级指南",
"xpack.upgradeAssistant.overview.upgradeStepCloudLink": "在 Cloud 上升级",
"xpack.upgradeAssistant.overview.upgradeStepDescription": "解决所有紧急问题并确认您的应用程序就绪后,便可以升级到 Elastic 8.x。在升级之前,请确保再次备份您的数据。",
"xpack.upgradeAssistant.overview.upgradeStepDescriptionForCloud": "解决所有紧急问题并确认您的应用程序就绪后,便可以升级到 Elastic 8.x。在升级之前,请确保再次备份您的数据。在 Elastic Cloud 上升级您的部署。",
"xpack.upgradeAssistant.overview.upgradeStepLink": "了解详情",
"xpack.upgradeAssistant.overview.upgradeStepTitle": "升级到 Elastic 8.x",
"xpack.upgradeAssistant.overview.verifyChanges.calloutBody": "做出更改后,请重置计数器并继续监测,以确认您不再使用过时功能。",
"xpack.upgradeAssistant.overview.verifyChanges.calloutTitle": "自 {previousCheck} 以来出现 {warningsCount, plural, other {{warningsCount}}} 个弃用{warningsCount, plural, other {问题}} ",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,35 @@
import { act } from 'react-dom/test-utils';

import { OverviewTestBed, setupOverviewPage } from '../overview.helpers';
import { setupEnvironment, kibanaVersion } from '../../helpers';
import { setupEnvironment } from '../../helpers';
import { systemIndicesMigrationStatus } from './mocks';

if (kibanaVersion.major >= 8 || kibanaVersion.minor > 16) {
describe('Overview - Migrate system indices - Flyout', () => {
let testBed: OverviewTestBed;
const { server, httpRequestsMockHelpers } = setupEnvironment();
describe('Overview - Migrate system indices - Flyout', () => {
let testBed: OverviewTestBed;
const { server, httpRequestsMockHelpers } = setupEnvironment();

beforeEach(async () => {
httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus(systemIndicesMigrationStatus);
beforeEach(async () => {
httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus(systemIndicesMigrationStatus);

await act(async () => {
testBed = await setupOverviewPage();
});

testBed.component.update();
await act(async () => {
testBed = await setupOverviewPage();
});

afterAll(() => {
server.restore();
});
testBed.component.update();
});

test('shows correct features in flyout table', async () => {
const { actions, table } = testBed;
afterAll(() => {
server.restore();
});

await actions.clickViewSystemIndicesState();
test('shows correct features in flyout table', async () => {
const { actions, table } = testBed;

const { tableCellsValues } = table.getMetaData('flyoutDetails');
await actions.clickViewSystemIndicesState();

expect(tableCellsValues.length).toBe(systemIndicesMigrationStatus.features.length);
expect(tableCellsValues).toMatchSnapshot();
});
const { tableCellsValues } = table.getMetaData('flyoutDetails');

expect(tableCellsValues.length).toBe(systemIndicesMigrationStatus.features.length);
expect(tableCellsValues).toMatchSnapshot();
});
} else {
test(`System indices migration is disabled for ${kibanaVersion.version}`, () => undefined);
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -7,73 +7,91 @@

import { act } from 'react-dom/test-utils';

import { setupEnvironment, kibanaVersion } from '../../helpers';
import { setupEnvironment } from '../../helpers';
import { OverviewTestBed, setupOverviewPage } from '../overview.helpers';

if (kibanaVersion.major >= 8 || kibanaVersion.minor > 16) {
describe('Overview - Migrate system indices', () => {
let testBed: OverviewTestBed;
const { server, httpRequestsMockHelpers } = setupEnvironment();
describe('Overview - Migrate system indices', () => {
let testBed: OverviewTestBed;
const { server, httpRequestsMockHelpers } = setupEnvironment();

beforeEach(async () => {
testBed = await setupOverviewPage();
testBed.component.update();
});

afterAll(() => {
server.restore();
});

describe('Error state', () => {
beforeEach(async () => {
httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus(undefined, {
statusCode: 400,
message: 'error',
});

testBed = await setupOverviewPage();
testBed.component.update();
});

afterAll(() => {
server.restore();
test('Is rendered', () => {
const { exists, component } = testBed;
component.update();

expect(exists('systemIndicesStatusErrorCallout')).toBe(true);
});

describe('Error state', () => {
beforeEach(async () => {
httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus(undefined, {
statusCode: 400,
message: 'error',
});
test('Lets the user attempt to reload migration status', async () => {
const { exists, component, actions } = testBed;
component.update();

testBed = await setupOverviewPage();
httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus({
migration_status: 'NO_MIGRATION_NEEDED',
});

test('Is rendered', () => {
const { exists, component } = testBed;
component.update();
await actions.clickRetrySystemIndicesButton();

expect(exists('systemIndicesStatusErrorCallout')).toBe(true);
});
expect(exists('noMigrationNeededSection')).toBe(true);
});
});

test('Lets the user attempt to reload migration status', async () => {
const { exists, component, actions } = testBed;
component.update();
test('No migration needed', async () => {
httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus({
migration_status: 'NO_MIGRATION_NEEDED',
});

httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus({
migration_status: 'NO_MIGRATION_NEEDED',
});
testBed = await setupOverviewPage();

await actions.clickRetrySystemIndicesButton();
const { exists, component } = testBed;

expect(exists('noMigrationNeededSection')).toBe(true);
});
});
component.update();

test('No migration needed', async () => {
httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus({
migration_status: 'NO_MIGRATION_NEEDED',
});
expect(exists('noMigrationNeededSection')).toBe(true);
expect(exists('startSystemIndicesMigrationButton')).toBe(false);
expect(exists('viewSystemIndicesStateButton')).toBe(false);
});

testBed = await setupOverviewPage();
test('Migration in progress', async () => {
httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus({
migration_status: 'IN_PROGRESS',
});

const { exists, component } = testBed;
testBed = await setupOverviewPage();

component.update();
const { exists, component, find } = testBed;

expect(exists('noMigrationNeededSection')).toBe(true);
expect(exists('startSystemIndicesMigrationButton')).toBe(false);
expect(exists('viewSystemIndicesStateButton')).toBe(false);
});
component.update();

test('Migration in progress', async () => {
// Start migration is disabled
expect(exists('startSystemIndicesMigrationButton')).toBe(true);
expect(find('startSystemIndicesMigrationButton').props().disabled).toBe(true);
// But we keep view system indices CTA
expect(exists('viewSystemIndicesStateButton')).toBe(true);
});

describe('Migration needed', () => {
test('Initial state', async () => {
httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus({
migration_status: 'IN_PROGRESS',
migration_status: 'MIGRATION_NEEDED',
});

testBed = await setupOverviewPage();
Expand All @@ -82,90 +100,68 @@ if (kibanaVersion.major >= 8 || kibanaVersion.minor > 16) {

component.update();

// Start migration is disabled
// Start migration should be enabled
expect(exists('startSystemIndicesMigrationButton')).toBe(true);
expect(find('startSystemIndicesMigrationButton').props().disabled).toBe(true);
// But we keep view system indices CTA
expect(find('startSystemIndicesMigrationButton').props().disabled).toBe(false);
// Same for view system indices status
expect(exists('viewSystemIndicesStateButton')).toBe(true);
});

describe('Migration needed', () => {
test('Initial state', async () => {
httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus({
migration_status: 'MIGRATION_NEEDED',
});

testBed = await setupOverviewPage();

const { exists, component, find } = testBed;

component.update();

// Start migration should be enabled
expect(exists('startSystemIndicesMigrationButton')).toBe(true);
expect(find('startSystemIndicesMigrationButton').props().disabled).toBe(false);
// Same for view system indices status
expect(exists('viewSystemIndicesStateButton')).toBe(true);
test('Handles errors when migrating', async () => {
httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus({
migration_status: 'MIGRATION_NEEDED',
});
httpRequestsMockHelpers.setSystemIndicesMigrationResponse(undefined, {
statusCode: 400,
message: 'error',
});

test('Handles errors when migrating', async () => {
httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus({
migration_status: 'MIGRATION_NEEDED',
});
httpRequestsMockHelpers.setSystemIndicesMigrationResponse(undefined, {
statusCode: 400,
message: 'error',
});

testBed = await setupOverviewPage();
testBed = await setupOverviewPage();

const { exists, component, find } = testBed;
const { exists, component, find } = testBed;

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

component.update();
component.update();

// Error is displayed
expect(exists('startSystemIndicesMigrationCalloutError')).toBe(true);
// CTA is enabled
expect(exists('startSystemIndicesMigrationButton')).toBe(true);
expect(find('startSystemIndicesMigrationButton').props().disabled).toBe(false);
});
// Error is displayed
expect(exists('startSystemIndicesMigrationCalloutError')).toBe(true);
// CTA is enabled
expect(exists('startSystemIndicesMigrationButton')).toBe(true);
expect(find('startSystemIndicesMigrationButton').props().disabled).toBe(false);
});

test('Handles errors from migration', async () => {
httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus({
migration_status: 'ERROR',
features: [
{
feature_name: 'kibana',
indices: [
{
index: '.kibana',
migration_status: 'ERROR',
failure_cause: {
error: {
type: 'mapper_parsing_exception',
},
test('Handles errors from migration', async () => {
httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus({
migration_status: 'ERROR',
features: [
{
feature_name: 'kibana',
indices: [
{
index: '.kibana',
migration_status: 'ERROR',
failure_cause: {
error: {
type: 'mapper_parsing_exception',
},
},
],
},
],
});
},
],
},
],
});

testBed = await setupOverviewPage();
testBed = await setupOverviewPage();

const { exists } = testBed;
const { exists } = testBed;

// Error is displayed
expect(exists('migrationFailedCallout')).toBe(true);
// CTA is enabled
expect(exists('startSystemIndicesMigrationButton')).toBe(true);
});
// Error is displayed
expect(exists('migrationFailedCallout')).toBe(true);
// CTA is enabled
expect(exists('startSystemIndicesMigrationButton')).toBe(true);
});
});
} else {
test(`System indices migration is disabled for ${kibanaVersion.version}`, () => undefined);
}
});
Loading

0 comments on commit c17915e

Please sign in to comment.