diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/components/edit_policy.test.tsx b/x-pack/plugins/index_lifecycle_management/__jest__/components/edit_policy.test.tsx index 541a2c184b084..c7664f2d837b9 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/components/edit_policy.test.tsx +++ b/x-pack/plugins/index_lifecycle_management/__jest__/components/edit_policy.test.tsx @@ -834,23 +834,6 @@ describe('edit policy', () => { expect(findTestSubject(rendered, 'cloudDataTierCallout').exists()).toBeFalsy(); }); - test('should show cloud notice when warm tier nodes do not exist', async () => { - http.setupNodeListResponse({ - nodesByAttributes: {}, - nodesByRoles: { data: ['test'], data_hot: ['test'], data_cold: ['test'] }, - isUsingDeprecatedDataRoleConfig: false, - }); - const rendered = mountWithIntl(component); - noRollover(rendered); - setPolicyName(rendered, 'mypolicy'); - await activatePhase(rendered, 'warm'); - expect(rendered.find('.euiLoadingSpinner').exists()).toBeFalsy(); - expect(findTestSubject(rendered, 'cloudDataTierCallout').exists()).toBeTruthy(); - // Assert that other notices are not showing - expect(findTestSubject(rendered, 'defaultAllocationNotice').exists()).toBeFalsy(); - expect(findTestSubject(rendered, 'noNodeAttributesWarning').exists()).toBeFalsy(); - }); - test('should show cloud notice when cold tier nodes do not exist', async () => { http.setupNodeListResponse({ nodesByAttributes: {}, diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/data_tier_allocation/cloud_data_tier_callout.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/data_tier_allocation/cloud_data_tier_callout.tsx index 21206a9f0fd7d..fc87b553ba521 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/data_tier_allocation/cloud_data_tier_callout.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/data_tier_allocation/cloud_data_tier_callout.tsx @@ -9,7 +9,6 @@ import { FormattedMessage } from '@kbn/i18n/react'; import React, { FunctionComponent } from 'react'; import { EuiCallOut, EuiLink } from '@elastic/eui'; -import { PhaseWithAllocation } from '../../../../../../common/types'; import { useKibana } from '../../../../../shared_imports'; const deployment = i18n.translate( @@ -20,70 +19,36 @@ const deployment = i18n.translate( ); const i18nTexts = { - warm: { - title: i18n.translate( - 'xpack.indexLifecycleMgmt.editPolicy.cloudDataTierCallout.warmTierTitle', - { - defaultMessage: 'Create a warm tier', - } - ), - body: (deploymentUrl?: string) => { - return ( - - {deployment} - - ) : ( - deployment - ), - }} - /> - ); - }, - }, - cold: { - title: i18n.translate( - 'xpack.indexLifecycleMgmt.editPolicy.cloudDataTierCallout.coldTierTitle', - { - defaultMessage: 'Create a cold tier', - } - ), - body: (deploymentUrl?: string) => { - return ( - - {deployment} - - ) : ( - deployment - ), - }} - /> - ); - }, + title: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.cloudDataTierCallout.coldTierTitle', { + defaultMessage: 'Create a cold tier', + }), + body: (deploymentUrl?: string) => { + return ( + + {deployment} + + ) : ( + deployment + ), + }} + /> + ); }, }; -interface Props { - phase: PhaseWithAllocation; -} - -export const CloudDataTierCallout: FunctionComponent = ({ phase }) => { +export const CloudDataTierCallout: FunctionComponent = () => { const { services: { cloud }, } = useKibana(); return ( - - {i18nTexts[phase].body(cloud?.cloudDeploymentUrl)} + + {i18nTexts.body(cloud?.cloudDeploymentUrl)} ); }; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared/data_tier_allocation_field.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared/data_tier_allocation_field.tsx index c11c14de7a0d9..df59efcbfd299 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared/data_tier_allocation_field.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/shared/data_tier_allocation_field.tsx @@ -61,19 +61,16 @@ export const DataTierAllocationField: FunctionComponent = ({ switch (phaseData.dataTierAllocationType) { case 'default': const isCloudEnabled = cloud?.isCloudEnabled ?? false; - if (isCloudEnabled && (phase === 'warm' || phase === 'cold')) { + if (isCloudEnabled && phase === 'cold') { const isUsingNodeRolesAllocation = !isUsingDeprecatedDataRoleConfig; - const hasNoNodesWithNodeRole = - phase === 'warm' - ? !nodesByRoles.data_warm?.length - : !nodesByRoles.data_cold?.length; + const hasNoNodesWithNodeRole = !nodesByRoles.data_cold?.length; if (isUsingNodeRolesAllocation && hasNoNodesWithNodeRole) { // Tell cloud users they can deploy nodes on cloud. return ( <> - + ); }