mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[ILM] Fix bug when clearing priority field (#70154)
This commit is contained in:
parent
e19b0b0262
commit
771f3ae098
5 changed files with 14 additions and 4 deletions
|
@ -14,6 +14,9 @@ export const DELETE_PHASE_POLICY = {
|
|||
hot: {
|
||||
min_age: '0ms',
|
||||
actions: {
|
||||
set_priority: {
|
||||
priority: null,
|
||||
},
|
||||
rollover: {
|
||||
max_size: '50gb',
|
||||
},
|
|
@ -8,7 +8,7 @@ import { act } from 'react-dom/test-utils';
|
|||
|
||||
import { registerTestBed, TestBed, TestBedConfig } from '../../../../../test_utils';
|
||||
|
||||
import { POLICY_NAME } from './contants';
|
||||
import { POLICY_NAME } from './constants';
|
||||
import { TestSubjects } from '../helpers';
|
||||
|
||||
import { EditPolicy } from '../../../public/application/sections/edit_policy';
|
||||
|
|
|
@ -9,7 +9,7 @@ import { act } from 'react-dom/test-utils';
|
|||
import { setupEnvironment } from '../helpers/setup_environment';
|
||||
|
||||
import { EditPolicyTestBed, setup } from './edit_policy.helpers';
|
||||
import { DELETE_PHASE_POLICY } from './contants';
|
||||
import { DELETE_PHASE_POLICY } from './constants';
|
||||
|
||||
import { API_BASE_PATH } from '../../../common/constants';
|
||||
|
||||
|
|
|
@ -193,8 +193,11 @@ const phaseFromES = (phase, phaseName, defaultEmptyPolicy) => {
|
|||
}
|
||||
|
||||
if (actions.set_priority) {
|
||||
policy[PHASE_INDEX_PRIORITY] = actions.set_priority.priority;
|
||||
const { priority } = actions.set_priority;
|
||||
|
||||
policy[PHASE_INDEX_PRIORITY] = priority ?? '';
|
||||
}
|
||||
|
||||
if (actions.wait_for_snapshot) {
|
||||
policy[PHASE_WAIT_FOR_SNAPSHOT_POLICY] = actions.wait_for_snapshot.policy;
|
||||
}
|
||||
|
@ -311,6 +314,10 @@ export const phaseToES = (phase, originalEsPhase) => {
|
|||
esPhase.actions.set_priority = {
|
||||
priority: phase[PHASE_INDEX_PRIORITY],
|
||||
};
|
||||
} else if (phase[PHASE_INDEX_PRIORITY] === '') {
|
||||
esPhase.actions.set_priority = {
|
||||
priority: null,
|
||||
};
|
||||
}
|
||||
|
||||
if (phase[PHASE_WAIT_FOR_SNAPSHOT_POLICY]) {
|
||||
|
|
|
@ -34,7 +34,7 @@ const minAgeSchema = schema.maybe(schema.string());
|
|||
|
||||
const setPrioritySchema = schema.maybe(
|
||||
schema.object({
|
||||
priority: schema.number(),
|
||||
priority: schema.nullable(schema.number()),
|
||||
})
|
||||
);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue