Skip to content

Commit

Permalink
Rename values also
Browse files Browse the repository at this point in the history
  • Loading branch information
sabarasaba committed Oct 13, 2021
1 parent 00d307d commit 6905991
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('Overview - Migrate system indices', () => {
component.update();

httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus({
migration_status: 'NO_UPGRADE_NEEDED',
migration_status: 'NO_MIGRATION_NEEDED',
});

await actions.clickRetrySystemIndicesButton();
Expand All @@ -56,7 +56,7 @@ describe('Overview - Migrate system indices', () => {

test('No migration needed', async () => {
httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus({
migration_status: 'NO_UPGRADE_NEEDED',
migration_status: 'NO_MIGRATION_NEEDED',
});

testBed = await setupOverviewPage();
Expand Down Expand Up @@ -91,7 +91,7 @@ describe('Overview - Migrate system indices', () => {
describe('Migration needed', () => {
test('Initial state', async () => {
httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus({
migration_status: 'UPGRADE_NEEDED',
migration_status: 'MIGRATION_NEEDED',
});

testBed = await setupOverviewPage();
Expand All @@ -109,7 +109,7 @@ describe('Overview - Migrate system indices', () => {

test('Handles errors when migrating', async () => {
httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus({
migration_status: 'UPGRADE_NEEDED',
migration_status: 'MIGRATION_NEEDED',
});
httpRequestsMockHelpers.setSystemIndicesMigrationResponse(undefined, {
statusCode: 400,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { SystemIndicesMigrationStatus } from '../../../../common/types';

export const systemIndicesMigrationStatus: SystemIndicesMigrationStatus = {
migration_status: 'UPGRADE_NEEDED',
migration_status: 'MIGRATION_NEEDED',
features: [
{
feature_name: 'security',
Expand All @@ -35,7 +35,7 @@ export const systemIndicesMigrationStatus: SystemIndicesMigrationStatus = {
{
feature_name: 'kibana',
minimum_index_version: '7.1.3',
migration_status: 'UPGRADE_NEEDED',
migration_status: 'MIGRATION_NEEDED',
indices: [
{
index: '.kibana',
Expand All @@ -46,7 +46,7 @@ export const systemIndicesMigrationStatus: SystemIndicesMigrationStatus = {
{
feature_name: 'logstash',
minimum_index_version: '7.1.4',
migration_status: 'NO_UPGRADE_NEEDED',
migration_status: 'NO_MIGRATION_NEEDED',
indices: [
{
index: '.logstash-config',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('Overview - Migrate system indices - Step completion', () => {

test(`It's complete when no upgrade is needed`, async () => {
httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus({
migration_status: 'NO_UPGRADE_NEEDED',
migration_status: 'NO_MIGRATION_NEEDED',
});

await act(async () => {
Expand All @@ -37,7 +37,7 @@ describe('Overview - Migrate system indices - Step completion', () => {

test(`It's incomplete when migration is needed`, async () => {
httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus({
migration_status: 'UPGRADE_NEEDED',
migration_status: 'MIGRATION_NEEDED',
});

await act(async () => {
Expand Down Expand Up @@ -73,7 +73,7 @@ describe('Overview - Migrate system indices - Step completion', () => {
expect(exists('migrateSystemIndicesStep-incomplete')).toBe(true);

httpRequestsMockHelpers.setLoadSystemIndicesMigrationStatus({
migration_status: 'NO_UPGRADE_NEEDED',
migration_status: 'NO_MIGRATION_NEEDED',
});

// Resolve the polling timeout.
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/upgrade_assistant/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export interface DeprecationLoggingStatus {
isDeprecationLoggingEnabled: boolean;
}

export type MIGRATION_STATUS = 'UPGRADE_NEEDED' | 'NO_UPGRADE_NEEDED' | 'IN_PROGRESS' | 'ERROR';
export type MIGRATION_STATUS = 'MIGRATION_NEEDED' | 'NO_MIGRATION_NEEDED' | 'IN_PROGRESS' | 'ERROR';
export interface SystemIndicesMigrationFeature {
id?: string;
feature_name: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const i18nTexts = {
};

const renderMigrationStatus = (status: MIGRATION_STATUS) => {
if (status === 'NO_UPGRADE_NEEDED') {
if (status === 'NO_MIGRATION_NEEDED') {
return (
<EuiFlexGroup alignItems="center" gutterSize="s">
<EuiFlexItem grow={false}>
Expand All @@ -100,7 +100,7 @@ const renderMigrationStatus = (status: MIGRATION_STATUS) => {
);
}

if (status === 'UPGRADE_NEEDED') {
if (status === 'MIGRATION_NEEDED') {
return (
<EuiText size="s" data-test-subj="featureUpgradeNeeded">
<p>{i18nTexts.needsMigrationLabel}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const MigrateSystemIndicesStep: FunctionComponent<Props> = ({ setIsComplete }) =
useMigrateSystemIndices();

useEffect(() => {
setIsComplete(migrationStatus.data?.migration_status === 'NO_UPGRADE_NEEDED');
setIsComplete(migrationStatus.data?.migration_status === 'NO_MIGRATION_NEEDED');
// Depending upon setIsComplete would create an infinite loop.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [migrationStatus.data?.migration_status]);
Expand Down Expand Up @@ -111,7 +111,7 @@ const MigrateSystemIndicesStep: FunctionComponent<Props> = ({ setIsComplete }) =
);
}

if (migrationStatus.data?.migration_status === 'NO_UPGRADE_NEEDED') {
if (migrationStatus.data?.migration_status === 'NO_MIGRATION_NEEDED') {
return (
<EuiFlexGroup alignItems="center" gutterSize="s" data-test-subj="noMigrationNeededSection">
<EuiFlexItem grow={false}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('getESUpgradeStatus', () => {
{
feature_name: 'machine_learning',
minimum_index_version: '7.1.1',
migration_status: 'UPGRADE_NEEDED',
migration_status: 'MIGRATION_NEEDED',
indices: [
{
index: '.ml-config',
Expand All @@ -55,7 +55,7 @@ describe('getESUpgradeStatus', () => {
],
},
],
migration_status: 'UPGRADE_NEEDED',
migration_status: 'MIGRATION_NEEDED',
})
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const esUpgradeSystemIndicesStatusMock: SystemIndicesMigrationStatus = {
{
feature_name: 'machine_learning',
minimum_index_version: '7.1.1',
migration_status: 'UPGRADE_NEEDED',
migration_status: 'MIGRATION_NEEDED',
indices: [
{
index: '.ml-config',
Expand All @@ -28,7 +28,7 @@ const esUpgradeSystemIndicesStatusMock: SystemIndicesMigrationStatus = {
{
feature_name: 'security',
minimum_index_version: '7.1.1',
migration_status: 'UPGRADE_NEEDED',
migration_status: 'MIGRATION_NEEDED',
indices: [
{
index: '.ml-config',
Expand All @@ -37,7 +37,7 @@ const esUpgradeSystemIndicesStatusMock: SystemIndicesMigrationStatus = {
],
},
],
migration_status: 'UPGRADE_NEEDED',
migration_status: 'MIGRATION_NEEDED',
};

describe('convertFeaturesToIndicesArray', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const mockedResponse = {
{
feature_name: 'security',
minimum_index_version: '7.1.1',
migration_status: 'NO_UPGRADE_NEEDED',
migration_status: 'NO_MIGRATION_NEEDED',
indices: [
{
index: '.security-7',
Expand All @@ -30,7 +30,7 @@ const mockedResponse = {
],
},
],
migration_status: 'UPGRADE_NEEDED',
migration_status: 'MIGRATION_NEEDED',
};

/**
Expand Down

0 comments on commit 6905991

Please sign in to comment.