Skip to content

Commit

Permalink
Reset state of pipeline flyout on close or completion (#155760)
Browse files Browse the repository at this point in the history
## Summary

Fixes a bug where adding a second pipeline would pop you into the last
page of the previously added pipeline flyout.

![can't create new
pipeline](https://user-images.githubusercontent.com/5288246/234373486-fb2c6a6a-b2d4-4ed6-96ed-27a938675664.gif)



### For maintainers

- [ ] This was checked for breaking API changes and was [labeled
appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
  • Loading branch information
seanstory authored Apr 26, 2023
1 parent a3f66bd commit c0033a1
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ import {
sortModels,
sortSourceFields,
} from '../../../shared/ml_inference/utils';
import { PipelinesLogic } from '../pipelines_logic';

import {
AddInferencePipelineFormErrors,
Expand Down Expand Up @@ -227,6 +228,8 @@ export const MLInferenceLogic = kea<
'apiSuccess as attachApiSuccess',
'makeRequest as makeAttachPipelineRequest',
],
PipelinesLogic,
['closeAddMlInferencePipelineModal as closeAddMlInferencePipelineModal'],
],
values: [
CachedFetchIndexApiLogic,
Expand Down Expand Up @@ -348,6 +351,20 @@ export const MLInferenceLogic = kea<
selectedSourceFields: [],
};
},
closeAddMlInferencePipelineModal: () => ({
configuration: {
...EMPTY_PIPELINE_CONFIGURATION,
},
indexName: '',
step: AddInferencePipelineSteps.Configuration,
}),
createApiSuccess: () => ({
configuration: {
...EMPTY_PIPELINE_CONFIGURATION,
},
indexName: '',
step: AddInferencePipelineSteps.Configuration,
}),
removeFieldFromMapping: (modal, { fieldName }) => {
const {
configuration: { fieldMappings },
Expand Down

0 comments on commit c0033a1

Please sign in to comment.