-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CellActions component should hide ShowTopN action for nested fields #150347
Comments
Adding properties on demand to the kibana/src/plugins/data_views/common/types.ts Line 380 in ebc6750
It is a pretty standard type used by DataView and it has a very similar definition to Security's BrowserFields.
This way actions will have the flexibility to check any field information available. We'll have to adapt all places that use |
Added a link to an issue where the Filter actions are not working because the field is not mapped in the index. |
…7243 (#157834) issue: #150347 ## Context Some Actions need to access `FieldSpec` data, which is not present on the `CellActions` API (`subType`and `isMapped`). So we are updating the `CellActions` `field` property to be compatible with `FieldSpec`. ## Summary This PR is the first step to fix #150347. * Updates the `CellActions` to support an array of data objects, each containing field (`FieldSpec`) and value * Create a new `SecurityCellActions` component that accepts a field name and loads `FieldSpec` from the Dataview. ## Examples Before: ```tsx <SecurityCellActions value={'admin'} field={{ name: 'user.name', type: 'keyword', searchable: true, aggregatable: true, ... }} /> ``` After: ```tsx <SecurityCellActions data={{ field: 'user.name', value: 'admin' }}/> ``` `SecurityCellActions` will load the spec from the Dataview and provide it to `CellActons`. `CellActons` now also support an of fields instead of only one field. It will be useful when rendering cell actions for aggregated data like on the Entity Analytic page. But for now, the actions are not supporting multiple values, we need to rewrite them #159480. ### Next steps We must refactor the Security Solution to get `FieldSpec` from the `DataView` instead of using BrowserFields. Ideally, we have to do that for every `CellAction` call so the actions can access the `subType` property. - [x] ~Refactor the Security Solution CellActions calls to get `FieldSpec` from the `DataView`~ - [x] Refactor data grid cell actions to get `FieldSpec` from the `DataView` - [ ] Rewrite actions to support multiple fields and use them on the investigation in timeline (.andFilters) - [ ] Fix #150347 using `subType` from `fieldSpec` - [ ] Fix #154714 using `isMapped` from `fieldSpec` ### Extra information *** Previously we were mixing `esTypes` and `kbnTypes`. For example, if the `esType` is a keyword the `kbnType` has to be a `string`. [Here](https://github.com/machadoum/kibana/blob/9799dbba27c5baf594357eae0bbfc79b4e7da77c/packages/kbn-field-types/src/types.ts#L22) you can check all possible ES and KBN types and [here](https://github.com/machadoum/kibana/blob/9799dbba27c5baf594357eae0bbfc79b4e7da77c/packages/kbn-field-types/src/kbn_field_types_factory.ts) you can see the mapping between esType and kbnType ### Checklist - [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
auto-closed by mistake |
…ction for nested fields (#159645) issue: #150347 ## Summary CellActions component should hide `ShowTopN` action for nested fields because Lens doesn't support it. * Add validations to exclude field that are not supported by Lens **After:** <img width="1533" alt="Screenshot 2023-06-30 at 14 26 09" src="https://github.com/elastic/kibana/assets/1490444/e3318e05-6a07-44e6-9eb8-861670ecb161"> ### How to test * Go to Security Solutions Alerts page * Add `Endpoint.policy.applied.artifacts.global.identifiers.name` field * Check if `ShowTopN` is displayed ### Checklist Delete any items that are not applicable to this PR. - [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
Lens does not support nested fields
Lens only supports esType: keyword, and non-nested field. We have to add additional checks for esTypes and nested fields.
The major challenge here is that
CellActions
API currently doesn't supportfield?.subType
.Nested field example:
The text was updated successfully, but these errors were encountered: