-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ILM] Migrate Delete phase and name field to Form Lib (#82834)
* remove use of legacy state system and legacy serialization * remove legacy min_age input component and re-add missing import * rename shared -> shared_fields for more clarity * some more cleanup and fixing regressions on policy name for creating new policy from existing policy * move extract policy static code to lib folder and remove "policies" dir from services * fix jest tests and minor policy flyout inconsistency * remove legacy helper * fix client integration tests * fix min for set index priority * moved save policy function into edit policy section * remove unused translations * refactor form files to own edit_policy/form folder * remove "fix errors" badge to fix UX - users can see errors in line before pressing save so the value of this badge has diminished * fix i18n after removing phase error badge Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
d1ef0d6
commit f2f76e1
Showing
50 changed files
with
749 additions
and
1,485 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
242 changes: 140 additions & 102 deletions
242
x-pack/plugins/index_lifecycle_management/__jest__/components/edit_policy.test.tsx
Large diffs are not rendered by default.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
x-pack/plugins/index_lifecycle_management/public/application/lib/policies.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { PolicyFromES } from '../../../common/types'; | ||
|
||
export const splitSizeAndUnits = (field: string): { size: string; units: string } => { | ||
let size = ''; | ||
let units = ''; | ||
|
||
const result = /(\d+)(\w+)/.exec(field); | ||
if (result) { | ||
size = result[1]; | ||
units = result[2]; | ||
} | ||
|
||
return { | ||
size, | ||
units, | ||
}; | ||
}; | ||
|
||
export const getPolicyByName = ( | ||
policies: PolicyFromES[] | null | undefined, | ||
policyName: string = '' | ||
): PolicyFromES | undefined => { | ||
if (policies && policies.length > 0) { | ||
return policies.find((policy: PolicyFromES) => policy.name === policyName); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
263 changes: 0 additions & 263 deletions
263
...le_management/public/application/sections/edit_policy/components/min_age_input_legacy.tsx
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
...cle_management/public/application/sections/edit_policy/components/phase_error_message.tsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.