Skip to content

Commit

Permalink
[ILM] Copy update (elastic#91100)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
4 people committed Feb 15, 2021
1 parent 48a22ec commit 1fe456f
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -31,38 +45,19 @@ 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';

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',
},
Expand All @@ -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}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
}
),
},
Expand Down

0 comments on commit 1fe456f

Please sign in to comment.