-
Notifications
You must be signed in to change notification settings - Fork 8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[8.10] [ESRE] Update UX of pipeline selection (#161575)
## Summary We're updating the looks of the existing pipeline selection dropdown's items in preparation for streamlining the UX of field configuration: - Listing all source fields that are configured in the pipeline - "Destination field" is dropped as it's visible in the next screens - If a pipeline cannot be selected due to the index missing some configured fields, the missing fields are listed in the reason - Updated text and style Example - selectable pipelines ![Screenshot 2023-07-10 at 11 44 04](https://github.com/elastic/kibana/assets/14224983/cb21683a-f8b7-444f-ab2b-5dd3d49b4723) Example - some disabled pipelines ![Screenshot 2023-07-10 at 11 43 37](https://github.com/elastic/kibana/assets/14224983/a82a7829-5acf-4273-91b5-c62ed38c2713) ### Checklist - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [x] This renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
bfaf5e0
commit 4439121
Showing
8 changed files
with
158 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
...ch_content/components/search_index/pipelines/ml_inference/pipeline_select_option.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
|
||
import { shallow } from 'enzyme'; | ||
|
||
import { EuiText, EuiTitle } from '@elastic/eui'; | ||
|
||
import { MLModelTypeBadge } from '../ml_model_type_badge'; | ||
|
||
import { MLInferencePipelineOption } from './ml_inference_logic'; | ||
import { PipelineSelectOption, PipelineSelectOptionDisabled } from './pipeline_select_option'; | ||
|
||
import { MODEL_REDACTED_VALUE } from './utils'; | ||
|
||
describe('PipelineSelectOption', () => { | ||
const pipeline: MLInferencePipelineOption = { | ||
disabled: false, | ||
disabledReason: undefined, | ||
modelId: 'my-model-id', | ||
modelType: 'my-model-type', | ||
pipelineName: 'my-pipeline', | ||
sourceFields: ['my-source-field1', 'my-source-field2'], | ||
indexFields: [], | ||
}; | ||
|
||
beforeEach(() => { | ||
jest.clearAllMocks(); | ||
}); | ||
it('renders pipeline selection option', () => { | ||
const wrapper = shallow(<PipelineSelectOption pipeline={pipeline} />); | ||
expect(wrapper.find(EuiTitle)).toHaveLength(1); | ||
expect(wrapper.find(MLModelTypeBadge)).toHaveLength(1); | ||
}); | ||
it('does not render model type badge if model type is unknown', () => { | ||
const wrapper = shallow( | ||
<PipelineSelectOption | ||
pipeline={{ | ||
...pipeline, | ||
modelType: '', | ||
}} | ||
/> | ||
); | ||
expect(wrapper.find(MLModelTypeBadge)).toHaveLength(0); | ||
}); | ||
it("redacts model ID if it's unavailable", () => { | ||
const wrapper = shallow( | ||
<PipelineSelectOption | ||
pipeline={{ | ||
...pipeline, | ||
modelId: '', | ||
}} | ||
/> | ||
); | ||
expect(wrapper.find(EuiText)).toHaveLength(4); | ||
expect(wrapper.find(EuiText).at(1).children().text()).toEqual(MODEL_REDACTED_VALUE); | ||
}); | ||
it('renders disable warning text if the pipeline is disabled', () => { | ||
const wrapper = shallow( | ||
<PipelineSelectOption | ||
pipeline={{ | ||
...pipeline, | ||
disabled: true, | ||
disabledReason: 'my-reason', | ||
}} | ||
/> | ||
); | ||
expect(wrapper.find(PipelineSelectOptionDisabled)).toHaveLength(1); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.