-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security Solution] getDataViewStateFromIndexFields was using wrong t…
…ype as part of a cast (#158594) ## Summary Fixes an issue with the field browser where all types currently display as unkown, this was because in a code path where a type cast happens, we were using the wrong type. To see this, remove the as unknown from the cast, and the typescript compiler will show the problem: ``` 'BrowserField' is deprecated.ts(6385) index.ts(70, 4): The declaration was marked as deprecated here. Conversion of type 'DataViewField' to type 'BrowserField' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first. Type 'DataViewField' is missing the following properties from type 'BrowserField': category, description, example, fields, and 2 more.ts(2352) ``` DataViewField actually only has spec and kbnFieldType properties, spec is of type FieldSpec which is basically the same type as BrowserField, and has sufficient overlap for the (still unsafe, but more safe than as unknown) cast to occur. Before: <img width="338" alt="image" src="https://github.com/elastic/kibana/assets/56408403/f31c1f9e-25f0-41ee-9e1c-a70171e41d29"> After: <img width="555" alt="image" src="https://github.com/elastic/kibana/assets/56408403/8b462477-2dce-41bb-9592-f34b20634b84"> --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
a21ddd0
commit 1c75903
Showing
27 changed files
with
131 additions
and
239 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
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
93 changes: 0 additions & 93 deletions
93
...ugins/security_solution/public/common/containers/source/__snapshots__/index.test.tsx.snap
This file was deleted.
Oops, something went wrong.
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.