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] TS conversion of Edit policy components #74747

Merged
merged 39 commits into from
Aug 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
1781ca7
[ILM] Convert node allocation component to TS and use hooks
yuliacech Jul 22, 2020
9958274
[ILM] Fix jest tests
yuliacech Jul 23, 2020
4486489
[ILM] Fix i18n check
yuliacech Jul 23, 2020
af77efa
Merge branch 'master' into ilm_typescript
elasticmachine Jul 28, 2020
653ff5e
Merge branch 'master' into ilm_typescript
elasticmachine Jul 29, 2020
4cc9584
Merge branch 'master' into ilm_typescript
yuliacech Jul 29, 2020
fc0633e
[ILM] Implement code review suggestions
yuliacech Jul 29, 2020
1ccf12f
[ILM] Fix type check, docs link and button maxWidth in NodeAllocation…
yuliacech Jul 30, 2020
a557a5b
Merge branch 'master' into ilm_typescript
elasticmachine Jul 30, 2020
739be48
Fix internaliation error
yuliacech Jul 30, 2020
b380789
[ILM] Convert node details flyout to TS
yuliacech Jul 29, 2020
32a4dba
Merge remote-tracking branch 'origin/ilm_typescript' into ilm_node_de…
yuliacech Jul 31, 2020
1f76b82
[ILM] Fix useState declaration
yuliacech Jul 31, 2020
e9575f4
[ILM] Fix useState declaration
yuliacech Jul 31, 2020
8ad94dc
[ILM] Fix jest test
yuliacech Jul 31, 2020
062465a
Merge branch 'master' into ilm_typescript
elasticmachine Aug 3, 2020
1f04f67
Merge branch 'master' into ilm_typescript
elasticmachine Aug 5, 2020
594d017
Merge branch 'master' into ilm_typescript
elasticmachine Aug 6, 2020
22c6b86
[ILM] Change error message when unable to load node attributes
yuliacech Aug 6, 2020
07e8126
Merge branch 'ilm_typescript' into ilm_node_details_typescript
yuliacech Aug 6, 2020
1d2393f
[ILM] Change error message when unable to load node details
yuliacech Aug 6, 2020
3841a11
[ILM] Delete a period in error callout
yuliacech Aug 6, 2020
8a18859
Merge branch 'ilm_typescript' into ilm_node_details_typescript
yuliacech Aug 6, 2020
c210d49
[ILM] Delete a period in error callout
yuliacech Aug 6, 2020
abe230a
[ILM] Convert node details flyout to TS
yuliacech Jul 29, 2020
d88cab0
[ILM] Fix i18n check
yuliacech Jul 23, 2020
03e3972
[ILM] Fix useState declaration
yuliacech Jul 31, 2020
5ae1dd7
[ILM] Fix useState declaration
yuliacech Jul 31, 2020
1366535
[ILM] Fix jest test
yuliacech Jul 31, 2020
3ab56aa
[ILM] Change error message when unable to load node details
yuliacech Aug 6, 2020
be2e6a5
[ILM] Delete a period in error callout
yuliacech Aug 6, 2020
d8bda51
Merge remote-tracking branch 'origin/ilm_node_details_typescript' int…
yuliacech Aug 6, 2020
ffa4f85
Merge branch 'master' into ilm_node_details_typescript
elasticmachine Aug 6, 2020
3caa6cc
Merge branch 'master' into ilm_node_details_typescript
elasticmachine Aug 10, 2020
5c9d733
Merge branch 'master' into ilm_ts_edit_policy_components
yuliacech Aug 11, 2020
54ff2de
[ILM] edit components
yuliacech Aug 11, 2020
8a654ac
Merge branch 'master' into ilm_ts_edit_policy_components
elasticmachine Aug 13, 2020
6e333bd
[ILM] Fix review suggestions
yuliacech Aug 14, 2020
0676949
Merge branch 'master' into ilm_ts_edit_policy_components
elasticmachine Aug 14, 2020
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

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
*/

export { ActiveBadge } from './active_badge';
export { ErrableFormRow } from './form_errors';
export { LearnMoreLink } from './learn_more_link';
export { PhaseErrorMessage } from './phase_error_message';
export { MinAgeInput } from './min_age_input';
export { NodeAllocation } from './node_allocation';
export { NodeAttrsDetails } from './node_attrs_details';
export { OptionalLabel } from './optional_label';
export { PhaseErrorMessage } from './phase_error_message';
export { PolicyJsonFlyout } from './policy_json_flyout';
export { SetPriorityInput } from './set_priority_input';
export { SnapshotPolicies } from './snapshot_policies';
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React, { ReactNode } from 'react';
import { EuiLink } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';

import { createDocLink } from '../../services/documentation';
import { createDocLink } from '../../../services/documentation';

interface Props {
docPath: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import {
PHASE_COLD,
PHASE_DELETE,
} from '../../../constants';
import { LearnMoreLink } from '../../components';
import { ErrableFormRow } from '../form_errors';
import { LearnMoreLink } from './learn_more_link';
import { ErrableFormRow } from './form_errors';

function getTimingLabelForPhase(phase) {
function getTimingLabelForPhase(phase: string) {
// NOTE: Hot phase isn't necessary, because indices begin in the hot phase.
switch (phase) {
case PHASE_WARM:
Expand All @@ -39,7 +39,7 @@ function getTimingLabelForPhase(phase) {
}
}

function getUnitsAriaLabelForPhase(phase) {
function getUnitsAriaLabelForPhase(phase: string) {
// NOTE: Hot phase isn't necessary, because indices begin in the hot phase.
switch (phase) {
case PHASE_WARM:
Expand Down Expand Up @@ -68,9 +68,24 @@ function getUnitsAriaLabelForPhase(phase) {
}
}

export const MinAgeInput = (props) => {
const { rolloverEnabled, errors, phaseData, phase, setPhaseData, isShowingErrors } = props;
interface Props {
rolloverEnabled: boolean;
errors: Record<string, string[]>;
phase: string;
// TODO add types for phaseData and setPhaseData after policy is typed
phaseData: any;
setPhaseData: (dataKey: string, value: any) => void;
isShowingErrors: boolean;
}

export const MinAgeInput: React.FunctionComponent<Props> = ({
rolloverEnabled,
errors,
phaseData,
phase,
setPhaseData,
isShowingErrors,
}) => {
let daysOptionLabel;
let hoursOptionLabel;
let minutesOptionLabel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@ import {
EuiButton,
} from '@elastic/eui';

import { PHASE_NODE_ATTRS } from '../../../../constants';
import { LearnMoreLink } from '../../../components/learn_more_link';
import { ErrableFormRow } from '../../form_errors';
import { useLoadNodes } from '../../../../services/api';
import { NodeAttrsDetails } from '../node_attrs_details';
import { PHASE_NODE_ATTRS } from '../../../constants';
import { LearnMoreLink } from './learn_more_link';
import { ErrableFormRow } from './form_errors';
import { useLoadNodes } from '../../../services/api';
import { NodeAttrsDetails } from './node_attrs_details';

interface Props {
phase: string;
setPhaseData: (dataKey: string, value: any) => void;
errors: any;
errors: Record<string, string[]>;
// TODO add types for phaseData and setPhaseData after policy is typed
phaseData: any;
setPhaseData: (dataKey: string, value: any) => void;
isShowingErrors: boolean;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
EuiButton,
} from '@elastic/eui';

import { useLoadNodeDetails } from '../../../../services/api';
import { useLoadNodeDetails } from '../../../services/api';

interface Props {
close: () => void;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import React from 'react';
import { EuiBadge } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';

export const PhaseErrorMessage = ({ isShowingErrors }) => {
export const PhaseErrorMessage = ({ isShowingErrors }: { isShowingErrors: boolean }) => {
return isShowingErrors ? (
<EuiBadge className="eui-alignMiddle" color="danger">
<FormattedMessage
Expand Down

This file was deleted.

Loading