Skip to content

Commit

Permalink
[ILM] Fix type check issues
Browse files Browse the repository at this point in the history
  • Loading branch information
yuliacech committed Sep 17, 2024
1 parent 881c583 commit ac13f14
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export const defaultIndexPriority = {
hot: '100',
warm: '50',
cold: '0',
frozen: '0',
};

export const defaultRolloverAction: RolloverAction = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import React, { FunctionComponent, useMemo } from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
import { EuiSpacer, EuiTextColor } from '@elastic/eui';

import { PhaseExceptDelete } from '../../../../../../../common/types';

import { NumericField } from '../../../../../../shared_imports';
import { useEditPolicyContext } from '../../../edit_policy_context';

Expand All @@ -20,7 +18,7 @@ import { LearnMoreLink, DescribedFormRow } from '../..';
import { useKibana } from '../../../../../../shared_imports';

interface Props {
phase: PhaseExceptDelete;
phase: 'hot' | 'warm' | 'cold';
}

export const IndexPriorityField: FunctionComponent<Props> = ({ phase }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { i18nTexts } from '../../../i18n_texts';
import { DescribedFormRow } from '../../described_form_row';

interface Props {
phase: 'warm' | 'cold' | 'frozen';
phase: 'warm' | 'cold';
}

export const ReplicasField: FunctionComponent<Props> = ({ phase }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export const createDeserializer =
},
frozen: {
enabled: Boolean(frozen),
dataTierAllocationType: determineDataTierAllocationType(frozen?.actions),
minAgeToMilliSeconds: -1,
},
delete: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import { i18n } from '@kbn/i18n';

import {
PhaseExceptDelete,
PhaseWithDownsample,
PhaseWithTiming,
} from '../../../../../common/types';
Expand Down Expand Up @@ -129,7 +128,7 @@ const allowWriteAfterShrinkField = {
defaultValue: false,
};

const getPriorityField = (phase: PhaseExceptDelete) => ({
const getPriorityField = (phase: 'hot' | 'warm' | 'cold') => ({
defaultValue: defaultIndexPriority[phase],
label: i18nTexts.editPolicy.indexPriorityFieldLabel,
validations: [
Expand Down Expand Up @@ -495,12 +494,6 @@ export const getSchema = (isCloudEnabled: boolean): FormSchema => ({
frozen: {
min_age: getMinAgeField('frozen'),
actions: {
allocate: {
number_of_replicas: numberOfReplicasField,
},
set_priority: {
priority: getPriorityField('frozen'),
},
searchable_snapshot: searchableSnapshotFields,
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ interface ColdPhaseMetaFields extends DataAllocationMetaFields, MinAgeField, Dow
readonlyEnabled: boolean;
}

interface FrozenPhaseMetaFields extends DataAllocationMetaFields, MinAgeField {
interface FrozenPhaseMetaFields extends MinAgeField {
enabled: boolean;
}

Expand Down

0 comments on commit ac13f14

Please sign in to comment.