diff --git a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/es_deprecations/ml_snapshots_deprecation_flyout.test.ts b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/es_deprecations/ml_snapshots_deprecation_flyout.test.ts index 9f3c4167eec1a..85515d2d00d62 100644 --- a/x-pack/plugins/upgrade_assistant/__jest__/client_integration/es_deprecations/ml_snapshots_deprecation_flyout.test.ts +++ b/x-pack/plugins/upgrade_assistant/__jest__/client_integration/es_deprecations/ml_snapshots_deprecation_flyout.test.ts @@ -23,7 +23,7 @@ describe('Machine learning deprecation flyout', () => { beforeEach(async () => { httpRequestsMockHelpers.setLoadEsDeprecationsResponse(esDeprecationsMockResponse); - httpRequestsMockHelpers.setLoadMlUpgradeModeResponse({ mlUpgradeMode: false }); + httpRequestsMockHelpers.setLoadMlUpgradeModeResponse({ mlUpgradeModeEnabled: false }); httpRequestsMockHelpers.setUpgradeMlSnapshotStatusResponse({ nodeId: 'my_node', snapshotId: MOCK_SNAPSHOT_ID, @@ -134,7 +134,7 @@ describe('Machine learning deprecation flyout', () => { }); it('Doesnt allow to take actions if ml_upgrade_mode is enabled', async () => { - httpRequestsMockHelpers.setLoadMlUpgradeModeResponse({ mlUpgradeMode: true }); + httpRequestsMockHelpers.setLoadMlUpgradeModeResponse({ mlUpgradeModeEnabled: true }); await act(async () => { testBed = await setupElasticsearchPage({ isReadOnlyMode: false }); diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/ml_snapshots/context.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/ml_snapshots/context.tsx index c13853528ef04..3a81c7f1cc8ea 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/ml_snapshots/context.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/ml_snapshots/context.tsx @@ -12,7 +12,7 @@ import { useSnapshotState, SnapshotState } from './use_snapshot_state'; export interface MlSnapshotContext { snapshotState: SnapshotState; - mlUpgradeMode: boolean; + mlUpgradeModeEnabled: boolean; upgradeSnapshot: () => Promise; deleteSnapshot: () => Promise; } @@ -32,14 +32,14 @@ interface Props { children: React.ReactNode; snapshotId: string; jobId: string; - mlUpgradeMode: boolean; + mlUpgradeModeEnabled: boolean; } export const MlSnapshotsStatusProvider: React.FunctionComponent = ({ api, snapshotId, jobId, - mlUpgradeMode, + mlUpgradeModeEnabled, children, }) => { const { updateSnapshotStatus, snapshotState, upgradeSnapshot, deleteSnapshot } = useSnapshotState( @@ -60,7 +60,7 @@ export const MlSnapshotsStatusProvider: React.FunctionComponent = ({ snapshotState, upgradeSnapshot, deleteSnapshot, - mlUpgradeMode, + mlUpgradeModeEnabled, }} > {children} diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/ml_snapshots/flyout.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/ml_snapshots/flyout.tsx index 11bb5e218ddd0..9e74ac975771b 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/ml_snapshots/flyout.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/ml_snapshots/flyout.tsx @@ -160,7 +160,7 @@ export const FixSnapshotsFlyout = ({ snapshotState, upgradeSnapshot, deleteSnapshot, - mlUpgradeMode, + mlUpgradeModeEnabled, }: FixSnapshotsFlyoutProps) => { const { services: { @@ -207,7 +207,7 @@ export const FixSnapshotsFlyout = ({ )} - {mlUpgradeMode && ( + {mlUpgradeModeEnabled && ( <> - {!isResolved && !mlUpgradeMode && ( + {!isResolved && !mlUpgradeModeEnabled && ( diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/ml_snapshots/table_row.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/ml_snapshots/table_row.tsx index 5476ae219cd07..37dddd8171c83 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/ml_snapshots/table_row.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/ml_snapshots/table_row.tsx @@ -21,7 +21,7 @@ const { useGlobalFlyout } = GlobalFlyout; interface TableRowProps { deprecation: EnrichedDeprecationInfo; rowFieldNames: DeprecationTableColumns[]; - mlUpgradeMode: boolean; + mlUpgradeModeEnabled: boolean; } export const MlSnapshotsTableRowCells: React.FunctionComponent = ({ @@ -86,7 +86,7 @@ export const MlSnapshotsTableRow: React.FunctionComponent = (prop diff --git a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/es_deprecations_table.tsx b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/es_deprecations_table.tsx index 88c5cb127a686..981e57a88c52f 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/es_deprecations_table.tsx +++ b/x-pack/plugins/upgrade_assistant/public/application/components/es_deprecations/es_deprecations_table.tsx @@ -102,14 +102,17 @@ const cellToLabelMap = { const cellTypes = Object.keys(cellToLabelMap) as DeprecationTableColumns[]; const pageSizeOptions = PAGINATION_CONFIG.pageSizeOptions; -const renderTableRowCells = (deprecation: EnrichedDeprecationInfo, mlUpgradeMode: boolean) => { +const renderTableRowCells = ( + deprecation: EnrichedDeprecationInfo, + mlUpgradeModeEnabled: boolean +) => { switch (deprecation.correctiveAction?.type) { case 'mlSnapshot': return ( ); @@ -158,7 +161,7 @@ export const EsDeprecationsTable: React.FunctionComponent = ({ } = useAppContext(); const { data } = api.useLoadMLUpgradeMode(); - const mlUpgradeMode = !!data?.mlUpgradeMode; + const mlUpgradeModeEnabled = !!data?.mlUpgradeModeEnabled; const [sortConfig, setSortConfig] = useState({ isSortAscending: true, @@ -305,7 +308,7 @@ export const EsDeprecationsTable: React.FunctionComponent = ({ {visibleDeprecations.map((deprecation, index) => { return ( - {renderTableRowCells(deprecation, mlUpgradeMode)} + {renderTableRowCells(deprecation, mlUpgradeModeEnabled)} ); })} diff --git a/x-pack/plugins/upgrade_assistant/public/application/lib/api.ts b/x-pack/plugins/upgrade_assistant/public/application/lib/api.ts index ea6ec9cb6c0c8..b3926c6db1c9c 100644 --- a/x-pack/plugins/upgrade_assistant/public/application/lib/api.ts +++ b/x-pack/plugins/upgrade_assistant/public/application/lib/api.ts @@ -183,7 +183,7 @@ export class ApiService { public useLoadMLUpgradeMode() { return this.useRequest<{ - mlUpgradeMode: boolean; + mlUpgradeModeEnabled: boolean; }>({ path: `${API_BASE_PATH}/ml_upgrade_mode`, method: 'get', diff --git a/x-pack/plugins/upgrade_assistant/server/routes/ml_snapshots.test.ts b/x-pack/plugins/upgrade_assistant/server/routes/ml_snapshots.test.ts index f2e5ae7d05030..bb4323a9bddb4 100644 --- a/x-pack/plugins/upgrade_assistant/server/routes/ml_snapshots.test.ts +++ b/x-pack/plugins/upgrade_assistant/server/routes/ml_snapshots.test.ts @@ -192,7 +192,7 @@ describe('ML snapshots APIs', () => { expect(resp.status).toEqual(200); expect(resp.payload).toEqual({ - mlUpgradeMode: true, + mlUpgradeModeEnabled: true, }); }); }); diff --git a/x-pack/plugins/upgrade_assistant/server/routes/ml_snapshots.ts b/x-pack/plugins/upgrade_assistant/server/routes/ml_snapshots.ts index 661edf54f81c8..e3f3c43dedde3 100644 --- a/x-pack/plugins/upgrade_assistant/server/routes/ml_snapshots.ts +++ b/x-pack/plugins/upgrade_assistant/server/routes/ml_snapshots.ts @@ -321,7 +321,7 @@ export function registerMlSnapshotRoutes({ router, lib: { handleEsError } }: Rou return response.ok({ body: { - mlUpgradeMode: mlInfo.upgrade_mode, + mlUpgradeModeEnabled: mlInfo.upgrade_mode, }, }); } catch (e) {