From 642e1256a8257a7d83c1876ad8869dec958a2656 Mon Sep 17 00:00:00 2001 From: Yulia Cech Date: Thu, 11 Feb 2021 11:01:43 +0100 Subject: [PATCH 1/3] Added copy adjustments, fixed wrong capitalization of titles and swap primary buttons back to correct order --- .../client_integration/app/app.test.ts | 4 +- .../components/phase_footer/phase_footer.tsx | 4 +- .../components/timeline/timeline.tsx | 2 +- .../sections/edit_policy/edit_policy.tsx | 54 +++++++++---------- .../sections/edit_policy/i18n_texts.ts | 10 ++-- 5 files changed, 37 insertions(+), 37 deletions(-) diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/app/app.test.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/app/app.test.ts index 38cfad1a3b188b..36f04be3b30b1d 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/app/app.test.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/app/app.test.ts @@ -22,8 +22,8 @@ const PERCENT_SIGN_NAME = 'test%'; const PERCENT_SIGN_WITH_OTHER_CHARS_NAME = 'test%#'; const PERCENT_SIGN_25_SEQUENCE = 'test%25'; -const createPolicyTitle = 'Create Policy'; -const editPolicyTitle = 'Edit Policy'; +const createPolicyTitle = 'Create policy'; +const editPolicyTitle = 'Edit policy'; window.scrollTo = jest.fn(); diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phase_footer/phase_footer.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phase_footer/phase_footer.tsx index 82f0725bfe7d0f..6538a5e3ce0c06 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phase_footer/phase_footer.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phase_footer/phase_footer.tsx @@ -34,10 +34,10 @@ export const PhaseFooter: FunctionComponent = ({ phase }) => { const phaseDescription = isDeletePhaseEnabled ? i18n.translate('xpack.indexLifecycleMgmt.editPolicy.phaseTiming.beforeDeleteDescription', { - defaultMessage: 'Data will be deleted after this phase', + defaultMessage: 'Policy deletes data after this phase', }) : i18n.translate('xpack.indexLifecycleMgmt.editPolicy.phaseTiming.foreverTimingDescription', { - defaultMessage: 'Data will remain in this phase forever', + defaultMessage: 'Data remains in this phase forever', }); const selectedButton = isDeletePhaseEnabled diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/timeline/timeline.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/timeline/timeline.tsx index 8097ab51eb59e3..f6067d2c5dda24 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/timeline/timeline.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/timeline/timeline.tsx @@ -47,7 +47,7 @@ const SCORE_BUFFER_AMOUNT = 50; const i18nTexts = { title: i18n.translate('xpack.indexLifecycleMgmt.timeline.title', { - defaultMessage: 'Policy Summary', + defaultMessage: 'Policy summary', }), description: i18n.translate('xpack.indexLifecycleMgmt.timeline.description', { defaultMessage: 'This policy moves data through the following phases.', diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/edit_policy.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/edit_policy.tsx index 0c7b5565372a55..befb8faf51aa19 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/edit_policy.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/edit_policy.tsx @@ -142,10 +142,10 @@ export const EditPolicy: React.FunctionComponent = ({ history }) => {

{isNewPolicy ? i18n.translate('xpack.indexLifecycleMgmt.editPolicy.createPolicyMessage', { - defaultMessage: 'Create Policy', + defaultMessage: 'Create policy', }) : i18n.translate('xpack.indexLifecycleMgmt.editPolicy.editPolicyMessage', { - defaultMessage: 'Edit Policy {originalPolicyName}', + defaultMessage: 'Edit policy {originalPolicyName}', values: { originalPolicyName }, })}

@@ -258,33 +258,8 @@ export const EditPolicy: React.FunctionComponent = ({ history }) => { - - - {isShowingPolicyJsonFlyout ? ( - - ) : ( - - )} - - - - - - - - - = ({ history }) => { )} + + + + + + + + + + {isShowingPolicyJsonFlyout ? ( + + ) : ( + + )} + + {isShowingPolicyJsonFlyout ? ( diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/i18n_texts.ts b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/i18n_texts.ts index 3923cf93cd0d33..6551a08186308c 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/i18n_texts.ts +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/i18n_texts.ts @@ -189,27 +189,27 @@ export const i18nTexts = { defaultMessage: 'Cold phase', }), delete: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.deletePhase.deletePhaseTitle', { - defaultMessage: 'Delete Data', + defaultMessage: 'Delete data', }), }, 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.', + 'You store and query your data on hot nodes, your most performant hardware. Highest search speed for the biggest 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.', + 'Your data is read-only and you query it on warm nodes, less performant hardware. Slightly slower search for the smaller cost.', }), 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.', + 'You query your data less frequently and move it to cold nodes, your significantly less performant hardware. Slower search for the cheapest cost.', }), 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.', + 'You no longer need your data. You can define when it is safe to delete it.', } ), }, From c806392f8f53d7f5a75368a32908d15aee7b3ee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yulia=20=C4=8Cech?= <6585477+yuliacech@users.noreply.github.com> Date: Mon, 15 Feb 2021 15:09:00 +0100 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com> Co-authored-by: debadair --- .../components/phase_footer/phase_footer.tsx | 4 ++-- .../application/sections/edit_policy/i18n_texts.ts | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phase_footer/phase_footer.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phase_footer/phase_footer.tsx index 6538a5e3ce0c06..4162a7a484e11f 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phase_footer/phase_footer.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phase_footer/phase_footer.tsx @@ -34,10 +34,10 @@ export const PhaseFooter: FunctionComponent = ({ phase }) => { const phaseDescription = isDeletePhaseEnabled ? i18n.translate('xpack.indexLifecycleMgmt.editPolicy.phaseTiming.beforeDeleteDescription', { - defaultMessage: 'Policy deletes data after this phase', + defaultMessage: 'Delete data after this phase', }) : i18n.translate('xpack.indexLifecycleMgmt.editPolicy.phaseTiming.foreverTimingDescription', { - defaultMessage: 'Data remains in this phase forever', + defaultMessage: 'Keep data in this phase forever', }); const selectedButton = isDeletePhaseEnabled diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/i18n_texts.ts b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/i18n_texts.ts index 6551a08186308c..e76f8cfdeee2a0 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/i18n_texts.ts +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/i18n_texts.ts @@ -189,27 +189,27 @@ 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 store and query your data on hot nodes, your most performant hardware. Highest search speed for the biggest cost.', + '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: - 'Your data is read-only and you query it on warm nodes, less performant hardware. Slightly slower search for the smaller cost.', + '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 query your data less frequently and move it to cold nodes, your significantly less performant hardware. Slower search for the cheapest cost.', + '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 data. You can define when it is safe to delete it.', + 'Delete data you no longer need.', } ), }, From d2f49db96ef1f6054e8ad431ea1fe7f0ba874c9a Mon Sep 17 00:00:00 2001 From: Yulia Cech Date: Mon, 15 Feb 2021 15:12:28 +0100 Subject: [PATCH 3/3] Fixed eslint issues and added labels for buttons --- .../components/phase_footer/phase_footer.tsx | 39 ++++++++----------- .../sections/edit_policy/i18n_texts.ts | 5 +-- 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phase_footer/phase_footer.tsx b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phase_footer/phase_footer.tsx index 4162a7a484e11f..22422ceab8a040 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phase_footer/phase_footer.tsx +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phase_footer/phase_footer.tsx @@ -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 = ({ phase }) => { if (!phaseConfiguration.isFinalDataPhase) { return null; } - - const phaseDescription = isDeletePhaseEnabled - ? i18n.translate('xpack.indexLifecycleMgmt.editPolicy.phaseTiming.beforeDeleteDescription', { - defaultMessage: 'Delete data after this phase', - }) - : i18n.translate('xpack.indexLifecycleMgmt.editPolicy.phaseTiming.foreverTimingDescription', { - defaultMessage: 'Keep data in this phase forever', - }); - const selectedButton = isDeletePhaseEnabled ? 'ilmEnableDeletePhaseButton' : 'ilmDisableDeletePhaseButton'; @@ -47,22 +52,12 @@ export const PhaseFooter: FunctionComponent = ({ 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 = ({ phase }) => { - {phaseDescription} + {isDeletePhaseEnabled ? deleteDataLabel : keepDataLabel} diff --git a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/i18n_texts.ts b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/i18n_texts.ts index e76f8cfdeee2a0..1d75fb5031216e 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/i18n_texts.ts +++ b/x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/i18n_texts.ts @@ -203,13 +203,12 @@ export const i18nTexts = { }), cold: i18n.translate('xpack.indexLifecycleMgmt.editPolicy.coldPhase.coldPhaseDescription', { defaultMessage: - 'Move data to the cold tier, which is optimized for cost savings over search performance. Data is normally read-only in the cold phase., + '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: - 'Delete data you no longer need.', + defaultMessage: 'Delete data you no longer need.', } ), },