[ILM] Copy update (#91100)

* Added copy adjustments, fixed wrong capitalization of titles and swap primary buttons back to correct order

* Apply suggestions from code review

Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
Co-authored-by: debadair <debadair@elastic.co>

* Fixed eslint issues and added labels for buttons

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
Co-authored-by: debadair <debadair@elastic.co>
This commit is contained in:
Yulia Čech 2021-02-15 18:00:47 +01:00 committed by GitHub
parent 4d4856c9ce
commit 91d3a6ac94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 47 additions and 53 deletions

View file

@ -17,6 +17,20 @@ import { usePhaseTimings } from '../../form';
import { InfinityIconSvg } from '../infinity_icon/infinity_icon.svg';
const deleteDataLabel = i18n.translate(
'xpack.indexLifecycleMgmt.editPolicy.phaseTiming.beforeDeleteDescription',
{
defaultMessage: 'Delete data after this phase',
}
);
const keepDataLabel = i18n.translate(
'xpack.indexLifecycleMgmt.editPolicy.phaseTiming.foreverTimingDescription',
{
defaultMessage: 'Keep data in this phase forever',
}
);
interface Props {
phase: PhasesExceptDelete;
}
@ -31,15 +45,6 @@ export const PhaseFooter: FunctionComponent<Props> = ({ phase }) => {
if (!phaseConfiguration.isFinalDataPhase) {
return null;
}
const phaseDescription = isDeletePhaseEnabled
? i18n.translate('xpack.indexLifecycleMgmt.editPolicy.phaseTiming.beforeDeleteDescription', {
defaultMessage: 'Data will be deleted after this phase',
})
: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.phaseTiming.foreverTimingDescription', {
defaultMessage: 'Data will remain in this phase forever',
});
const selectedButton = isDeletePhaseEnabled
? 'ilmEnableDeletePhaseButton'
: 'ilmDisableDeletePhaseButton';
@ -47,22 +52,12 @@ export const PhaseFooter: FunctionComponent<Props> = ({ phase }) => {
const buttons = [
{
id: `ilmDisableDeletePhaseButton`,
label: i18n.translate(
'xpack.indexLifecycleMgmt.editPolicy.deletePhase.disablePhaseButtonLabel',
{
defaultMessage: 'Keep data in this phase forever',
}
),
label: keepDataLabel,
iconType: InfinityIconSvg,
},
{
id: `ilmEnableDeletePhaseButton`,
label: i18n.translate(
'xpack.indexLifecycleMgmt.editPolicy.deletePhase.enablePhaseButtonLabel',
{
defaultMessage: 'Delete data after this phase',
}
),
label: deleteDataLabel,
iconType: 'trash',
'data-test-subj': 'enableDeletePhaseButton',
},
@ -72,7 +67,7 @@ export const PhaseFooter: FunctionComponent<Props> = ({ phase }) => {
<EuiFlexGroup alignItems="center" gutterSize="s" wrap>
<EuiFlexItem grow={false}>
<EuiText size="s" color="subdued">
{phaseDescription}
{isDeletePhaseEnabled ? deleteDataLabel : keepDataLabel}
</EuiText>
</EuiFlexItem>
<EuiFlexItem grow={false}>

View file

@ -258,33 +258,8 @@ export const EditPolicy: React.FunctionComponent<Props> = ({ history }) => {
<FormErrorsCallout />
<EuiFlexGroup justifyContent="spaceBetween">
<EuiFlexItem grow={false}>
<EuiButtonEmpty onClick={togglePolicyJsonFlyout} data-test-subj="requestButton">
{isShowingPolicyJsonFlyout ? (
<FormattedMessage
id="xpack.indexLifecycleMgmt.editPolicy.hidePolicyJsonButto"
defaultMessage="Hide request"
/>
) : (
<FormattedMessage
id="xpack.indexLifecycleMgmt.editPolicy.showPolicyJsonButto"
defaultMessage="Show request"
/>
)}
</EuiButtonEmpty>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiFlexGroup>
<EuiFlexItem grow={false}>
<EuiButtonEmpty data-test-subj="cancelTestPolicy" onClick={backToPolicyList}>
<FormattedMessage
id="xpack.indexLifecycleMgmt.editPolicy.cancelButton"
defaultMessage="Cancel"
/>
</EuiButtonEmpty>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton
data-test-subj="savePolicyButton"
@ -307,8 +282,33 @@ export const EditPolicy: React.FunctionComponent<Props> = ({ history }) => {
)}
</EuiButton>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonEmpty data-test-subj="cancelTestPolicy" onClick={backToPolicyList}>
<FormattedMessage
id="xpack.indexLifecycleMgmt.editPolicy.cancelButton"
defaultMessage="Cancel"
/>
</EuiButtonEmpty>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonEmpty onClick={togglePolicyJsonFlyout} data-test-subj="requestButton">
{isShowingPolicyJsonFlyout ? (
<FormattedMessage
id="xpack.indexLifecycleMgmt.editPolicy.hidePolicyJsonButto"
defaultMessage="Hide request"
/>
) : (
<FormattedMessage
id="xpack.indexLifecycleMgmt.editPolicy.showPolicyJsonButto"
defaultMessage="Show request"
/>
)}
</EuiButtonEmpty>
</EuiFlexItem>
</EuiFlexGroup>
{isShowingPolicyJsonFlyout ? (

View file

@ -189,27 +189,26 @@ export const i18nTexts = {
defaultMessage: 'Cold phase',
}),
delete: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.deletePhase.deletePhaseTitle', {
defaultMessage: 'Delete Data',
defaultMessage: 'Delete phase',
}),
},
descriptions: {
hot: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.hotPhase.hotPhaseDescription', {
defaultMessage:
'You actively store and query data in the hot phase. All policies have a hot phase.',
'Store your most-recent, most frequently-searched data in the hot tier, which provides the best indexing and search performance at the highest cost.',
}),
warm: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.warmPhase.warmPhaseDescription', {
defaultMessage:
'You are still querying your index, but it is read-only. You can allocate shards to less performant hardware. For faster searches, you can reduce the number of shards and force merge segments.',
'Move data to the warm tier, which is optimized for search performance over indexing performance. Data is infrequently added or updated in the warm phase.',
}),
cold: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.coldPhase.coldPhaseDescription', {
defaultMessage:
'You are querying your index less frequently, so you can allocate shards on significantly less performant hardware. Because your queries are slower, you can reduce the number of replicas.',
'Move data to the cold tier, which is optimized for cost savings over search performance. Data is normally read-only in the cold phase.',
}),
delete: i18n.translate(
'xpack.indexLifecycleMgmt.editPolicy.deletePhase.deletePhaseDescription',
{
defaultMessage:
'You no longer need your index. You can define when it is safe to delete it.',
defaultMessage: 'Delete data you no longer need.',
}
),
},