Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar committed Jun 28, 2022
1 parent d26ade5 commit ed32da8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
useFormData,
useKibana,
GetFieldsOptions,
UseField,
} from '../shared_imports';

import { ensureMinimumTime, getIndices, extractTimeFields, getMatchedIndices } from '../lib';
Expand Down Expand Up @@ -372,6 +373,7 @@ const IndexPatternEditorFlyoutContentComponent = ({
<h2>{editData ? editorTitleEditMode : editorTitle}</h2>
</EuiTitle>
<Form form={form} className="indexPatternEditor__form">
<UseField path="isAdHoc" />
{indexPatternTypeSelect}
<EuiSpacer size="l" />
<EuiFlexGroup>
Expand Down Expand Up @@ -410,8 +412,8 @@ const IndexPatternEditorFlyoutContentComponent = ({
</Form>
<Footer
onCancel={onCancel}
onSubmit={(isAdHoc?: boolean) => {
form.getFields().isAdHoc.setValue(isAdHoc || false);
onSubmit={(adhoc?: boolean) => {
form.setFieldValue('isAdHoc', adhoc || false);
form.submit();
}}
submitDisabled={form.isSubmitted && !form.isValid}
Expand Down
7 changes: 7 additions & 0 deletions src/plugins/data_view_editor/public/components/form_schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,11 @@ export const schema = {
}),
defaultValue: INDEX_PATTERN_TYPE.DEFAULT,
},
isAdHoc: {
label: i18n.translate('indexPatternEditor.editor.form.IsAdHocLabel', {
defaultMessage: 'Creeate AdHoc DataView',
}),
defaultValue: false,
type: 'hidden',
},
};

0 comments on commit ed32da8

Please sign in to comment.