Skip to content

Commit

Permalink
[SecuritySolution] Fix add to library action (#212659)
Browse files Browse the repository at this point in the history
## Summary

Add to library actions are not working.
Issue description and steps to reproduce:
#212650

Update according to SaveModalComponent change:
https://github.com/elastic/kibana/pull/186642/files#diff-137261ad728b083fd39cb5d6b58d7afd3d4c4e24749b78609a9aa4b3c63e4170R290

https://github.com/user-attachments/assets/a0d0e81e-5a0f-4462-b110-370894c6bf36

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Michael Olorunnisola <michael.olorunnisola@elastic.co>
(cherry picked from commit 24d2cd3)
  • Loading branch information
angorayc committed Mar 3, 2025
1 parent 9ab1cc4 commit 15465d6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import React, { useCallback, useMemo } from 'react';
import { toMountPoint } from '@kbn/react-kibana-mount';
import type { LensEmbeddableInput } from '@kbn/lens-plugin/public';
import { unmountComponentAtNode } from 'react-dom';
import type { SaveModalContainerProps } from '@kbn/lens-plugin/public/async_services';
import { useKibana } from '../../lib/kibana';
import type { LensAttributes } from './types';
import { useRedirectToDashboardFromLens } from './use_redirect_to_dashboard_from_lens';
Expand All @@ -32,7 +32,7 @@ export const useSaveToLibrary = ({
const targetDomElement = document.createElement('div');
const mount = toMountPoint(
<SaveModalComponent
initialInput={attributes as unknown as LensEmbeddableInput}
initialInput={{ attributes } as SaveModalContainerProps['initialInput']}
onSave={() => unmountComponentAtNode(targetDomElement)}
onClose={() => unmountComponentAtNode(targetDomElement)}
originatingApp={APP_UI_ID}
Expand Down

0 comments on commit 15465d6

Please sign in to comment.