+ <>
+ {/* Section title group; containing min age */}
@@ -86,7 +87,7 @@ export class ColdPhase extends PureComponent {
data-test-subj="enablePhaseSwitch-cold"
label={
}
@@ -101,68 +102,83 @@ export class ColdPhase extends PureComponent {
}
fullWidth
>
-
- {phaseData.phaseEnabled ? (
-
-
- errors={errors}
- phaseData={phaseData}
- phase={coldProperty}
- isShowingErrors={isShowingErrors}
- setPhaseData={setPhaseData}
- rolloverEnabled={hotPhaseRolloverEnabled}
- />
-
-
-
- phase={coldProperty}
- setPhaseData={setPhaseData}
- errors={errors}
- phaseData={phaseData}
- isShowingErrors={isShowingErrors}
- />
-
-
-
-
-
-
-
- }
- isShowingErrors={isShowingErrors}
- errors={errors?.freezeEnabled}
- helpText={i18n.translate(
- 'xpack.indexLifecycleMgmt.coldPhase.replicaCountHelpText',
- {
- defaultMessage: 'By default, the number of replicas remains the same.',
- }
- )}
- >
- {
- setPhaseData(phaseProperty('selectedReplicaCount'), e.target.value);
- }}
- min={0}
- />
-
-
-
-
- ) : (
-
- )}
-
+ {phaseData.phaseEnabled ? (
+
+ errors={errors}
+ phaseData={phaseData}
+ phase={coldProperty}
+ isShowingErrors={isShowingErrors}
+ setPhaseData={setPhaseData}
+ rolloverEnabled={hotPhaseRolloverEnabled}
+ />
+ ) : null}
{phaseData.phaseEnabled ? (
+ {/* Data tier allocation section */}
+
+
+ {/* Replicas section */}
+
+ {i18n.translate('xpack.indexLifecycleMgmt.coldPhase.replicasTitle', {
+ defaultMessage: 'Replicas',
+ })}
+
+ }
+ description={i18n.translate(
+ 'xpack.indexLifecycleMgmt.coldPhase.numberOfReplicasDescription',
+ {
+ defaultMessage:
+ 'Set the number of replicas. Remains the same as the previous phase by default.',
+ }
+ )}
+ switchProps={{
+ label: i18n.translate(
+ 'xpack.indexLifecycleMgmt.editPolicy.coldPhase.numberOfReplicas.switchLabel',
+ { defaultMessage: 'Set replicas' }
+ ),
+ initialValue: Boolean(phaseData.selectedReplicaCount),
+ onChange: (v) => {
+ if (!v) {
+ setPhaseData('selectedReplicaCount', '');
+ }
+ },
+ }}
+ fullWidth
+ >
+
+
+
+
+ }
+ isShowingErrors={isShowingErrors}
+ errors={errors?.selectedReplicaCount}
+ >
+
{
+ setPhaseData(phaseProperty('selectedReplicaCount'), e.target.value);
+ }}
+ min={0}
+ />
+
+
+ {/* Freeze section */}
@@ -191,8 +207,8 @@ export class ColdPhase extends PureComponent {
onChange={(e) => {
setPhaseData(phaseProperty('freezeEnabled'), e.target.checked);
}}
- label={freezeLabel}
- aria-label={freezeLabel}
+ label={i18nTexts.freezeLabel}
+ aria-label={i18nTexts.freezeLabel}
/>
@@ -204,7 +220,7 @@ export class ColdPhase extends PureComponent {
/>
) : null}
-
- );
- }
-}
+ >
+