[DataViews] Fix form validation UX when the same data view name already exists (#146126)

Closes https://github.com/elastic/kibana/issues/138958

## Summary

This PR fixes form UX when the same data view name already exists.

![Nov-23-2022
11-35-34](https://user-images.githubusercontent.com/1415710/203527157-6659b74b-774f-4619-a6c7-553f0f87e6e6.gif)
This commit is contained in:
Julia Rechkunova 2022-11-25 16:16:47 +01:00 committed by GitHub
parent 2c9043ab43
commit 0e327d3c67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -339,7 +339,12 @@ const IndexPatternEditorFlyoutContentComponent = ({
})}
</EuiLink>
)}
<Form form={form} className="indexPatternEditor__form">
<Form
form={form}
className="indexPatternEditor__form"
error={form.getErrors()}
isInvalid={form.isSubmitted && !form.isValid}
>
<UseField path="isAdHoc" />
{indexPatternTypeSelect}
<EuiSpacer size="l" />