Replace Inspector's EuiPopover with EuiComboBox#113566
Replace Inspector's EuiPopover with EuiComboBox#1135661Copenut merged 22 commits intoelastic:masterfrom 1Copenut:tp-inspector-combobox
Conversation
* The combobox will help alleviate issues when the list of options is very long
* Added an onChange handler * Renamed the method to render the combobox * Commented out additional blocks of code before final refactor
* Removed three helper methods for the EUIPopover. * `togglePopover()` * `closePopover()` * `renderRequestDropdownItem()` * Removed the local state object and interface (no longer needed) * Renamed the const `options` to `selectedOptions` in `handleSelectd()` method to better reflect where the options array was coming from.
* Fixed the inspector functional test to use comboBox service * Removed two unused translations
Master merge
* Updated the test expectations to the default string * Both tests were looking for a named string instead of a default message
* Checking for the item status code * Adding a " (failed)" message if the status code returns `2` * Updating test to look for "Chart_data" instead of "Chartdata"
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
|
Quick heads up this PR has been updated and is ready for review. Thank you! @mdefazio |
| const inProgress = request.status === RequestStatus.PENDING; | ||
| return { | ||
| 'data-test-subj': `inspectorRequestChooser${testLabel}`, | ||
| label: hasFailed ? `${item.name} (failed)` : item.name, |
There was a problem hiding this comment.
I may need to add back the translation for the string (failed). Please let me know if that's the case and I'll update the PR tomorrow.
There was a problem hiding this comment.
You should be able to replace this with:
label: hasFailed ? `${item.name} ${i18n.translate("inspector.requests.failedLabel", { defaultMessage: ' (failed)' })}` : item.name,It probably would be better i18n usage to make it parameterized like:
i18n.translate("inspector.requests.failedLabel", { defaultMessage: '{itemName} (failed)', values: { itemName }})Since the fact that "failed" comes afterward and it in parentheses is language dependent. If you do this the translation will need to be updated, and since you're reusing the key that was there you might need to let @Bamieh know that this has changed, since I'm not sure if the i18n check will catch it.
I'd be ok with leaving it as-is, but if you would like to improve it by adding the parameter that would be good too.
|
Sorry for being a bit late on this one. Didn't run this PR locally yet, but @1Copenut can you explain a bit better why we want to change this? I don't see an issue attached to this PR so I'm unsure of the context. In most cases the list of options to pick there is relatively short like in the screenshot provided, is this done because of maps? Also, did a designer look at this? The super wide combo box looks pretty weird to me |
This is a fix for #110507.
APM and Uptime are using it, and they both have pages with many requests.
We've spoken with @mdefazio about it and he's a reviewer on this PR. |
|
I'll add the issue ticket and a before and after pic to the description too. |
|
Thanks @smith , this makes sense. I was so used to seeing the Discover/Visualize names in there which are super short. It makes a lot of sense for this use case. |
flash1293
left a comment
There was a problem hiding this comment.
vis editors changes LGTM, code review only. Just a test change.
Agreed. I noticed that too. I'm working on a fix as part of an EUI improvement in progress: elastic/eui#5229 |
|
@elasticmachine merge upstream |
mdefazio
left a comment
There was a problem hiding this comment.
In regards to simply swapping the popover for the combobox, I think this looks good. It's tough to judge whether the select box is too long. It looks like the request names from apm are pretty long.
Doesn't seem like there's a width set on the flyout which would likely help this too.
So just in regards to the simple swap, I think is definitely an improvement.
However, there's definitely room for improvement and I'm. not sure what the scope of the PR is. Here is a layout suggestion that moves several things around. I imagine this likely makes sense in a separate PR, and some of these suggestions probably need some further thinking with all the various scenarios in O11y taken into consideration.
|
@elasticmachine merge upstream |
Dosant
left a comment
There was a problem hiding this comment.
app-services code lgtm, tested
💛 Build succeeded, but was flaky
Test FailuresKibana Pipeline / general / X-Pack Detection Engine API Integration Tests.x-pack/test/detection_engine_api_integration/security_and_spaces/tests/create_endpoint_exceptions·ts.detection engine api security and spaces enabled Rule exception operators for endpoints operating system types (os_types) endpoints should filter multiple operating system types (os_type) with multiple filter items for an endpointStandard OutStack TraceMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: cc @1Copenut |
* Replacing EuiPopover with EuiComboBox * The combobox will help alleviate issues when the list of options is very long * Refactoring the Combobox to listen for change events * Added an onChange handler * Renamed the method to render the combobox * Commented out additional blocks of code before final refactor * Finished refactoring the Request Selector to use EUI Combobox * Removed three helper methods for the EUIPopover. * `togglePopover()` * `closePopover()` * `renderRequestDropdownItem()` * Removed the local state object and interface (no longer needed) * Renamed the const `options` to `selectedOptions` in `handleSelectd()` method to better reflect where the options array was coming from. * Updating tests and translations * Fixed the inspector functional test to use comboBox service * Removed two unused translations * Updating Combobox options to pass data-test-sub string * Updated two tests for Combobox single option * Updated the test expectations to the default string * Both tests were looking for a named string instead of a default message * Adding error handling to Inspector combobox * Checking for the item status code * Adding a " (failed)" message if the status code returns `2` * Updating test to look for "Chart_data" instead of "Chartdata" * Updating two tests to validate single combobox options * Added helper method to check default text against combobox options * Added helper method to get the selected combobox option * Checking two inspector instances using helpers * Adding a defensive check to helper method. * Correct a type error in test return * Adding back translated failLabel Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Nathan L Smith <smith@nlsmith.com>
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
* Replacing EuiPopover with EuiComboBox * The combobox will help alleviate issues when the list of options is very long * Refactoring the Combobox to listen for change events * Added an onChange handler * Renamed the method to render the combobox * Commented out additional blocks of code before final refactor * Finished refactoring the Request Selector to use EUI Combobox * Removed three helper methods for the EUIPopover. * `togglePopover()` * `closePopover()` * `renderRequestDropdownItem()` * Removed the local state object and interface (no longer needed) * Renamed the const `options` to `selectedOptions` in `handleSelectd()` method to better reflect where the options array was coming from. * Updating tests and translations * Fixed the inspector functional test to use comboBox service * Removed two unused translations * Updating Combobox options to pass data-test-sub string * Updated two tests for Combobox single option * Updated the test expectations to the default string * Both tests were looking for a named string instead of a default message * Adding error handling to Inspector combobox * Checking for the item status code * Adding a " (failed)" message if the status code returns `2` * Updating test to look for "Chart_data" instead of "Chartdata" * Updating two tests to validate single combobox options * Added helper method to check default text against combobox options * Added helper method to get the selected combobox option * Checking two inspector instances using helpers * Adding a defensive check to helper method. * Correct a type error in test return * Adding back translated failLabel Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Nathan L Smith <smith@nlsmith.com> Co-authored-by: Trevor Pierce <1Copenut@users.noreply.github.com> Co-authored-by: Nathan L Smith <smith@nlsmith.com>

UPDATE 10/14
Added a before picture and the original issue ticket.
Summary
We replaced the EuiPopover with an EuiCombobox in the Inspect pane. The combobox will help alleviate issues when the list of options is very long.
Original Issue
Checklist
Delete any items that are not applicable to this PR.
Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n supportDocumentation was added for features that require explanation or tutorialsIf a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the docker listFindings
There was one new axe error caused when we added the
prependlabel. I traced it to a missing ID in EUI and opened elastic/eui#5183 to track. I am working on a solution in EUI.Risk Matrix
I've deleted the risk matrix because I do not believe it to be a new risk or one to services outside the Inspector. This feature was a change of an existing Eui component inside the Inspector panel, and did not appear or require changes outside the key files.
For maintainers