Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ILM] Migrate Delete phase and name field to Form Lib #82834

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ export const setup = async () => {
setFreeze,
setIndexPriority: setIndexPriority('cold'),
},
delete: {
enable: enable('delete'),
setMinAgeValue: setMinAgeValue('delete'),
setMinAgeUnits: setMinAgeUnits('delete'),
},
},
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,6 @@ describe('<EditPolicy />', () => {
expect(testBed.find('snapshotPolicyCombobox').prop('data-currentvalue')).toEqual([
{
label: DELETE_PHASE_POLICY.policy.phases.delete?.actions.wait_for_snapshot?.policy,
value: DELETE_PHASE_POLICY.policy.phases.delete?.actions.wait_for_snapshot?.policy,
},
]);
});
Expand Down Expand Up @@ -412,7 +411,7 @@ describe('<EditPolicy />', () => {
test('wait for snapshot field should delete action if field is empty', async () => {
const { actions } = testBed;

actions.setWaitForSnapshotPolicy('');
await actions.setWaitForSnapshotPolicy('');
await actions.savePolicy();

const expected = {
Expand Down

Large diffs are not rendered by default.

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);
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@
export { ActiveBadge } from './active_badge';
export { ErrableFormRow } from './form_errors';
export { LearnMoreLink } from './learn_more_link';
export { MinAgeInput } from './min_age_input_legacy';
export { OptionalLabel } from './optional_label';
export { PhaseErrorMessage } from './phase_error_message';
export { PolicyJsonFlyout } from './policy_json_flyout';
export { SnapshotPolicies } from './snapshot_policies';
export { DescribedFormField } from './described_form_field';

export * from './phases';

This file was deleted.

This file was deleted.

Loading