Skip to content

Commit df07ac5

Browse files
committed
remove "fix errors" badge to fix UX - users can see errors in line before pressing save so the value of this badge has diminished
1 parent ed2070f commit df07ac5

6 files changed

Lines changed: 11 additions & 61 deletions

File tree

x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export { ActiveBadge } from './active_badge';
88
export { ErrableFormRow } from './form_errors';
99
export { LearnMoreLink } from './learn_more_link';
1010
export { OptionalLabel } from './optional_label';
11-
export { PhaseErrorMessage } from './phase_error_message';
1211
export { PolicyJsonFlyout } from './policy_json_flyout';
1312
export { DescribedFormField } from './described_form_field';
1413

x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phase_error_message.tsx

Lines changed: 0 additions & 19 deletions
This file was deleted.

x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/cold_phase/cold_phase.tsx

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,11 @@ import { EuiDescribedFormGroup, EuiTextColor } from '@elastic/eui';
1313

1414
import { Phases } from '../../../../../../../common/types';
1515

16-
import {
17-
useFormData,
18-
useFormContext,
19-
UseField,
20-
ToggleField,
21-
NumericField,
22-
} from '../../../../../../shared_imports';
16+
import { useFormData, UseField, ToggleField, NumericField } from '../../../../../../shared_imports';
2317

2418
import { useEditPolicyContext } from '../../../edit_policy_context';
2519

26-
import { LearnMoreLink, ActiveBadge, PhaseErrorMessage, DescribedFormField } from '../../';
20+
import { LearnMoreLink, ActiveBadge, DescribedFormField } from '../../';
2721

2822
import { MinAgeInputField, DataTierAllocationField, SetPriorityInput } from '../shared_fields';
2923

@@ -44,14 +38,12 @@ const formFieldPaths = {
4438

4539
export const ColdPhase: FunctionComponent = () => {
4640
const { policy } = useEditPolicyContext();
47-
const form = useFormContext();
4841

4942
const [formData] = useFormData({
5043
watch: [formFieldPaths.enabled],
5144
});
5245

5346
const enabled = get(formData, formFieldPaths.enabled);
54-
const isShowingErrors = form.isValid === false;
5547

5648
return (
5749
<div id="coldPhaseContent" aria-live="polite" role="region">
@@ -66,8 +58,7 @@ export const ColdPhase: FunctionComponent = () => {
6658
defaultMessage="Cold phase"
6759
/>
6860
</h2>{' '}
69-
{enabled && !isShowingErrors ? <ActiveBadge /> : null}
70-
<PhaseErrorMessage isShowingErrors={isShowingErrors} />
61+
{enabled && <ActiveBadge />}
7162
</div>
7263
}
7364
titleSize="s"

x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/delete_phase/delete_phase.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,9 @@ import { get } from 'lodash';
99
import { FormattedMessage } from '@kbn/i18n/react';
1010
import { EuiDescribedFormGroup, EuiTextColor, EuiFormRow } from '@elastic/eui';
1111

12-
import {
13-
useFormData,
14-
UseField,
15-
ToggleField,
16-
useFormContext,
17-
} from '../../../../../../shared_imports';
12+
import { useFormData, UseField, ToggleField } from '../../../../../../shared_imports';
1813

19-
import { ActiveBadge, LearnMoreLink, OptionalLabel, PhaseErrorMessage } from '../../index';
14+
import { ActiveBadge, LearnMoreLink, OptionalLabel } from '../../index';
2015

2116
import { MinAgeInputField, SnapshotPoliciesField } from '../shared_fields';
2217

@@ -25,13 +20,11 @@ const formFieldPaths = {
2520
};
2621

2722
export const DeletePhase: FunctionComponent = () => {
28-
const form = useFormContext();
2923
const [formData] = useFormData({
3024
watch: formFieldPaths.enabled,
3125
});
3226

3327
const enabled = get(formData, formFieldPaths.enabled);
34-
const isShowingErrors = form.isValid === false;
3528

3629
return (
3730
<div id="deletePhaseContent" aria-live="polite" role="region">
@@ -44,8 +37,7 @@ export const DeletePhase: FunctionComponent = () => {
4437
defaultMessage="Delete phase"
4538
/>
4639
</h2>{' '}
47-
{enabled && !isShowingErrors ? <ActiveBadge /> : null}
48-
<PhaseErrorMessage isShowingErrors={isShowingErrors} />
40+
{enabled && <ActiveBadge />}
4941
</div>
5042
}
5143
titleSize="s"

x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/hot_phase/hot_phase.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {
1919
import { Phases } from '../../../../../../../common/types';
2020

2121
import {
22-
useFormContext,
2322
useFormData,
2423
UseField,
2524
SelectField,
@@ -33,7 +32,7 @@ import { ROLLOVER_EMPTY_VALIDATION } from '../../../form';
3332

3433
import { ROLLOVER_FORM_PATHS } from '../../../constants';
3534

36-
import { LearnMoreLink, ActiveBadge, PhaseErrorMessage } from '../../';
35+
import { LearnMoreLink, ActiveBadge } from '../../';
3736

3837
import { Forcemerge, SetPriorityInput, useRolloverPath } from '../shared_fields';
3938

@@ -42,13 +41,11 @@ import { maxSizeStoredUnits, maxAgeUnits } from './constants';
4241
const hotProperty: keyof Phases = 'hot';
4342

4443
export const HotPhase: FunctionComponent = () => {
45-
const form = useFormContext();
4644
const [formData] = useFormData({
4745
watch: useRolloverPath,
4846
});
4947
const isRolloverEnabled = get(formData, useRolloverPath);
5048

51-
const isShowingErrors = form.isValid === false;
5249
const [showEmptyRolloverFieldsError, setShowEmptyRolloverFieldsError] = useState(false);
5350

5451
return (
@@ -62,8 +59,7 @@ export const HotPhase: FunctionComponent = () => {
6259
defaultMessage="Hot phase"
6360
/>
6461
</h2>{' '}
65-
{isShowingErrors ? null : <ActiveBadge />}
66-
<PhaseErrorMessage isShowingErrors={isShowingErrors} />
62+
<ActiveBadge />
6763
</div>
6864
}
6965
titleSize="s"

x-pack/plugins/index_lifecycle_management/public/application/sections/edit_policy/components/phases/warm_phase/warm_phase.tsx

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,15 @@ import {
1717
EuiDescribedFormGroup,
1818
} from '@elastic/eui';
1919

20-
import {
21-
useFormData,
22-
UseField,
23-
ToggleField,
24-
useFormContext,
25-
NumericField,
26-
} from '../../../../../../shared_imports';
20+
import { useFormData, UseField, ToggleField, NumericField } from '../../../../../../shared_imports';
2721

2822
import { Phases } from '../../../../../../../common/types';
2923

3024
import { useRolloverPath, MinAgeInputField, Forcemerge, SetPriorityInput } from '../shared_fields';
3125

3226
import { useEditPolicyContext } from '../../../edit_policy_context';
3327

34-
import { LearnMoreLink, ActiveBadge, PhaseErrorMessage, DescribedFormField } from '../../';
28+
import { LearnMoreLink, ActiveBadge, DescribedFormField } from '../../';
3529

3630
import { DataTierAllocationField } from '../shared_fields';
3731

@@ -55,15 +49,13 @@ const formFieldPaths = {
5549

5650
export const WarmPhase: FunctionComponent = () => {
5751
const { policy } = useEditPolicyContext();
58-
const form = useFormContext();
5952
const [formData] = useFormData({
6053
watch: [useRolloverPath, formFieldPaths.enabled, formFieldPaths.warmPhaseOnRollover],
6154
});
6255

6356
const enabled = get(formData, formFieldPaths.enabled);
6457
const hotPhaseRolloverEnabled = get(formData, useRolloverPath);
6558
const warmPhaseOnRollover = get(formData, formFieldPaths.warmPhaseOnRollover);
66-
const isShowingErrors = form.isValid === false;
6759

6860
return (
6961
<div id="warmPhaseContent" aria-live="polite" role="region" aria-relevant="additions">
@@ -77,8 +69,7 @@ export const WarmPhase: FunctionComponent = () => {
7769
defaultMessage="Warm phase"
7870
/>
7971
</h2>{' '}
80-
{enabled && !isShowingErrors ? <ActiveBadge /> : null}
81-
<PhaseErrorMessage isShowingErrors={isShowingErrors} />
72+
{enabled && <ActiveBadge />}
8273
</div>
8374
}
8475
titleSize="s"

0 commit comments

Comments
 (0)