Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Search] Fix index_name not proposed if query matches existing index (#…
…178480) ## Summary If user input partially matches existing index name in the attach index box, then the user is only presented with options to select existing index names. Only when the user input doesn't match existing index names, the user is shown the option to `Create new {} index`. Current logic still "works" for partially matched index names, as the user can hit `enter` key to accept current input, but it's not communicated clearly. We want be clear that any valid index name can be attached to the connector. In a case that user input matches existing index name, we want to somehow communicate that user is not forced to only select existing indices. #### Proposed solution - [customOptionText](https://github.com/elastic/eui/blob/0396b26fd04796a1d5580cf59ba73fc377fa3c42/src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx#L47-L51) shows up only when there are no matches with existing index names. The EUI component doesn't allow us to show it `always` - it's a limitation - My workaround is to inject to list of options, a custom option related to user input, if the user input is partial, but not a full match to existing index names. - Additionally group options in the `Create new index` and `Select existing index` categories ### Preview #### Status quo <img width="857" alt="Screenshot 2024-03-12 at 13 48 41" src="https://github.com/elastic/kibana/assets/14121688/91b9813b-11d2-48ca-9f99-8ea34d5ba9ab"> #### Changed flow Screenshot <img width="699" alt="Screenshot 2024-03-12 at 13 53 59" src="https://github.com/elastic/kibana/assets/14121688/3c2eb294-ef18-4be9-b930-e9ee3bf01f78"> Video https://github.com/elastic/kibana/assets/14121688/b57e9cd6-6922-420f-a020-1ae77564752f ### Checklist Delete any items that are not applicable to this PR. - [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) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [ ] [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 - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [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)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) --------- Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information