[data view editor] Revalidate index pattern when 'allow hidden' changes (#147807)

## Summary

Steps to reproduce problem -

1) Open create data view flyout
2) Enter `.kibana` as index pattern
  - no indices will match, the field will display an error
3) Click on 'Advanced Options'
4) Click 'Allow Hidden'
  - the index pattern will still show an error

This PR fixes the index pattern error state after step four. It will
revalidate the index pattern field and load the timestamp field list
again.
This commit is contained in:
Matthew Kime 2022-12-20 07:24:45 -06:00 committed by GitHub
parent 9a5df11ea0
commit 6b29787e6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -29,11 +29,13 @@ const customIndexPatternIdLabel = i18n.translate(
interface AdvancedParamsContentProps {
disableAllowHidden: boolean;
disableId: boolean;
onAllowHiddenChange?: (value: boolean) => void;
}
export const AdvancedParamsContent = ({
disableAllowHidden,
disableId,
onAllowHiddenChange,
}: AdvancedParamsContentProps) => (
<AdvancedParamsSection>
<EuiFlexGroup>
@ -48,6 +50,7 @@ export const AdvancedParamsContent = ({
disabled: disableAllowHidden,
},
}}
onChange={onAllowHiddenChange}
/>
</EuiFlexItem>
</EuiFlexGroup>

View file

@ -281,6 +281,9 @@ const IndexPatternEditorFlyoutContentComponent = ({
<AdvancedParamsContent
disableAllowHidden={type === INDEX_PATTERN_TYPE.ROLLUP}
disableId={!!editData}
onAllowHiddenChange={() => {
form.getFields().title.validate();
}}
/>
</Form>
<Footer