Skip to content

Commit

Permalink
[Index Management] Fix errors with validation (#56072)
Browse files Browse the repository at this point in the history
alisonelizabeth authored Jan 28, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 92a1062 commit b7eef03
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -67,7 +67,8 @@ export class EditSettingsJson extends React.PureComponent {
const editor = (this.editor = createAceEditor(this.aceDiv, prettyJson, false, settingsKeys));
const session = editor.getSession();
session.on('changeAnnotation', () => {
this.setState({ valid: session.getAnnotations().length === 0 });
const isEmptyString = session.getValue() === '';
this.setState({ valid: !isEmptyString && session.getAnnotations().length === 0 });
});
}
}
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ import {
EuiButton,
EuiCallOut,
EuiContextMenu,
EuiFieldText,
EuiFieldNumber,
EuiForm,
EuiFormRow,
EuiPopover,
@@ -368,7 +368,7 @@ export class IndexActionsContextMenu extends Component {
<EuiSpacer size="m" />

<EuiForm
isInvalid={this.forcemergeSegmentsError()}
isInvalid={!!this.forcemergeSegmentsError()}
error={this.forcemergeSegmentsError()}
>
<EuiFormRow
@@ -380,10 +380,11 @@ export class IndexActionsContextMenu extends Component {
)}
helpText={helpText}
>
<EuiFieldText
<EuiFieldNumber
onChange={event => {
this.setState({ forcemergeSegments: event.target.value });
}}
min={1}
name="maxNumberSegments"
/>
</EuiFormRow>

0 comments on commit b7eef03

Please sign in to comment.