mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
part of: https://github.com/elastic/kibana/issues/145666 ## Summary This PR contains changes in the `dataProvider` function for the addToTimeline action: - add support for empty values excluding the field, to make it consistent with the legacy implementation. - id changes removing the "draggable" word. - extracted `getIdForField` function to reduce the main function complexity (linter warning appeared) This PR also introduces the `CellAction` type for action creation: - `isCompatible` method parameters uses the new `CellActionCompatibilityContext` type instead of `CellActionExecutionContext`, it omits the `field.value` and the references values, they are not needed to check the compatibility and, in some situations, it is not possible to pass them. - use CellAction type in all SecuritySolution action creators - action creators now return plain objects instead of using `createAction` (deprecated) function. - all actions now check `fieldHasCellActions(field.name)` in the `inCompatible` function, to keep the consistency with legacy code. - `useLoadAction` hooks now integrate the error control, components don't need to check the `error` anymore. Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> |
||
---|---|---|
.. | ||
.storybook | ||
src | ||
index.ts | ||
jest.config.js | ||
kibana.jsonc | ||
package.json | ||
README.md | ||
tsconfig.json |
This package provides a uniform interface for displaying UI actions for a cell.
For the CellActions
component to work, it must be wrapped by CellActionsProvider
. Ideally, the wrapper should stay on the top of the rendering tree.
Example:
<CellActionsProvider getTriggerCompatibleActions={uiActions.getTriggerCompatibleActions}>
[...]
<CellActions mode={CellActionsMode.HOVER} triggerId={MY_TRIGGER_ID} config={{ field: 'fieldName', value: 'fieldValue', fieldType: 'text' }}>
Hover me
</CellActions>
</CellActionsProvider>
CellActions
component will display all compatible actions registered for the trigger id.