Skip to content

Conversation

@kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.3:

Questions ?

Please refer to the Backport tool documentation

## Summary

A new Security Solution feature (#131475) was added in `8.3` that displays a field name and icon token using the reusable `FieldIcon` component. In testing an issue was reported (#133291) that the wrong icon token was being displayed.

I had [previously updated](https://github.com/elastic/kibana/pull/131475/files#diff-d79a8297783f3177da25dd13fe807425d9136a0e235fe170f7c0a61f2448dacaR23) `FieldIcon` to support `match_only_text` however this new issue was with the `float` type not displaying correctly. After some searching I found the `castEsToKbnFieldTypeName` utility which solved the issue with `float` fields not displaying, but then `match_only_text` field types would not show since it is missing from `ES_FIELD_TYPES` and so would resolve as `unknown`.

This PR adds the `match_only_text` [ES type](https://www.elastic.co/guide/en/elasticsearch/reference/current/text.html#match-only-text-field-type) to `ES_FIELD_TYPES` to resolve this missing icon token issue so that `castEsToKbnFieldTypeName` can be used in conjunction with the resuable `FieldIcon` component.

I imagine this is fine as it's a sibling type to `text`, but am curious here since `sortable: true,` is set for the KbnFieldType even though it includes `ES_FIELD_TYPES.TEXT` (which is not sortable) as well?

(cherry picked from commit de3410e)
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Jun 7, 2022
@kibanamachine kibanamachine enabled auto-merge (squash) June 7, 2022 15:29
@kibanamachine kibanamachine merged commit 3c870c4 into 8.3 Jun 7, 2022
@kibana-ci
Copy link

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
dataViewManagement 122.3KB 122.3KB +55.0B
lens 1.2MB 1.2MB +55.0B
ml 3.3MB 3.3MB +55.0B
unifiedSearch 176.7KB 176.8KB +108.0B
total +273.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
data 415.9KB 415.9KB +54.0B
dataViewFieldEditor 21.7KB 21.8KB +54.0B
dataViews 40.4KB 40.5KB +54.0B
fieldFormats 44.4KB 44.5KB +54.0B
total +216.0B

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @spong

@kibanamachine kibanamachine deleted the backport/8.3/pr-133690 branch June 7, 2022 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants