-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[7.11] [ILM ] Fix logic for showing/hiding recommended allocation on …
…Cloud (#90592) (#92852) * [ILM ] Fix logic for showing/hiding recommended allocation on Cloud (#90592) * updated logic for hiding recommended allocation options on cloud and moved tests over from legacy test folder * added version check and tests for version check to enable pre v8 behaviour * implement feedback to make tests more legible, fix test names and minor refactors * added additional callout for data tier state, also added some new copy specific to the migration of a deployment on cloud * remove unused stackVersion context value * address windows max path length constraint * - Fix botched conflict resolution! - Addressed PR feedback, updated data allocation field for readability; added comments and refactored default allocation notice and warning - Added one more test case for on cloud; when to show the call to migrate to node roles Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.helpers.tsx # x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/reactive_form/node_allocation.test.ts * remove async describe * update component integration for 7.11 branch * remove legacy, duplicate test * remove unused variable
- Loading branch information
1 parent
9917d76
commit 3206cb8
Showing
10 changed files
with
261 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...phases/shared_fields/data_tier_allocation_field/components/default_allocation_warning.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* 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 { i18n } from '@kbn/i18n'; | ||
import React, { FunctionComponent } from 'react'; | ||
import { EuiCallOut } from '@elastic/eui'; | ||
|
||
import { PhaseWithAllocation } from '../../../../../../../../../common/types'; | ||
|
||
const i18nTexts = { | ||
warning: { | ||
warm: { | ||
title: i18n.translate( | ||
'xpack.indexLifecycleMgmt.warmPhase.dataTier.defaultAllocationNotAvailableTitle', | ||
{ defaultMessage: 'No nodes assigned to the warm tier' } | ||
), | ||
body: i18n.translate( | ||
'xpack.indexLifecycleMgmt.warmPhase.dataTier.defaultAllocationNotAvailableBody', | ||
{ | ||
defaultMessage: | ||
'Assign at least one node to the warm or hot tier to use role-based allocation. The policy will fail to complete allocation if there are no available nodes.', | ||
} | ||
), | ||
}, | ||
cold: { | ||
title: i18n.translate( | ||
'xpack.indexLifecycleMgmt.coldPhase.dataTier.defaultAllocationNotAvailableTitle', | ||
{ defaultMessage: 'No nodes assigned to the cold tier' } | ||
), | ||
body: i18n.translate( | ||
'xpack.indexLifecycleMgmt.coldPhase.dataTier.defaultAllocationNotAvailableBody', | ||
{ | ||
defaultMessage: | ||
'Assign at least one node to the cold, warm, or hot tier to use role-based allocation. The policy will fail to complete allocation if there are no available nodes.', | ||
} | ||
), | ||
}, | ||
}, | ||
}; | ||
|
||
interface Props { | ||
phase: PhaseWithAllocation; | ||
} | ||
|
||
export const DefaultAllocationWarning: FunctionComponent<Props> = ({ phase }) => { | ||
return ( | ||
<EuiCallOut | ||
data-test-subj="defaultAllocationWarning" | ||
title={i18nTexts.warning[phase].title} | ||
color="warning" | ||
> | ||
{i18nTexts.warning[phase].body} | ||
</EuiCallOut> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
.../phases/shared_fields/data_tier_allocation_field/components/missing_cold_tier_callout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* 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 { i18n } from '@kbn/i18n'; | ||
import React, { FunctionComponent } from 'react'; | ||
import { EuiCallOut, EuiLink } from '@elastic/eui'; | ||
|
||
const i18nTexts = { | ||
title: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.cloudMissingColdTierCallout.title', { | ||
defaultMessage: 'Create a cold tier', | ||
}), | ||
body: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.cloudMissingColdTierCallout.body', { | ||
defaultMessage: 'Edit your Elastic Cloud deployment to set up a cold tier.', | ||
}), | ||
linkText: i18n.translate( | ||
'xpack.indexLifecycleMgmt.editPolicy.cloudMissingColdTierCallout.linkToCloudDeploymentDescription', | ||
{ defaultMessage: 'View cloud deployment' } | ||
), | ||
}; | ||
|
||
interface Props { | ||
linkToCloudDeployment?: string; | ||
} | ||
|
||
/** | ||
* A call-to-action for users to activate their cold tier slider to provision cold tier nodes. | ||
* This may need to be change when we have autoscaling enabled on a cluster because nodes may not | ||
* yet exist, but will automatically be provisioned. | ||
*/ | ||
export const MissingColdTierCallout: FunctionComponent<Props> = ({ linkToCloudDeployment }) => { | ||
return ( | ||
<EuiCallOut title={i18nTexts.title} data-test-subj="cloudMissingColdTierCallout"> | ||
{i18nTexts.body}{' '} | ||
{Boolean(linkToCloudDeployment) && ( | ||
<EuiLink href={linkToCloudDeployment} external> | ||
{i18nTexts.linkText} | ||
</EuiLink> | ||
)} | ||
</EuiCallOut> | ||
); | ||
}; |
Oops, something went wrong.