Skip to content

Commit

Permalink
don't show index-pattern creation form once created (#927)
Browse files Browse the repository at this point in the history
Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
(cherry picked from commit 16d11f3)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Mar 15, 2024
1 parent 3cdad4c commit 621491d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
3 changes: 1 addition & 2 deletions public/pages/Findings/components/CreateIndexPatternForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const CreateIndexPatternForm: React.FC<CreateIndexPatternFormProps> = ({

return errors;
}}
onSubmit={async (values, { setSubmitting }) => {
onSubmit={async (values) => {
try {
const newIndex = await indexPatternsService.createAndSave({
title: values.name,
Expand All @@ -125,7 +125,6 @@ export const CreateIndexPatternForm: React.FC<CreateIndexPatternFormProps> = ({
} catch (e) {
console.warn(e);
}
setSubmitting(false);
}}
>
{(props) => (
Expand Down
25 changes: 19 additions & 6 deletions public/pages/Findings/components/FindingDetailsFlyout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -419,12 +419,25 @@ export default class FindingDetailsFlyout extends Component<
this.setState({ ...this.state, isCreateIndexPatternModalVisible: false })
}
created={(indexPatternId) => {
this.setState({
...this.state,
indexPatternId,
isCreateIndexPatternModalVisible: false,
});
window.open(`discover#/context/${indexPatternId}/${related_doc_ids[0]}`, '_blank');
this.setState(
{
...this.state,
indexPatternId,
isCreateIndexPatternModalVisible: false,
},
() => {
this.setState({
selectedTab: {
id: FindingFlyoutTabId.DETAILS,
content: this.getTabContent(FindingFlyoutTabId.DETAILS),
},
});
window.open(
`discover#/context/${indexPatternId}/${related_doc_ids[0]}`,
'_blank'
);
}
);
}}
></CreateIndexPatternForm>
</EuiModalBody>
Expand Down

0 comments on commit 621491d

Please sign in to comment.