Skip to content

Commit

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

This will backport the following commits from `main` to `8.18`:
- [[SecuritySolution] Fix add to library action
(#212659)](#212659)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Angela
Chuang","email":"6295984+angorayc@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-03-03T16:33:10Z","message":"[SecuritySolution]
Fix add to library action (#212659)\n\n## Summary\n\nAdd to library
actions are not working.\nIssue description and steps to
reproduce:\nhttps://github.com//issues/212650\n\n\nUpdate
according to SaveModalComponent
change:\nhttps://github.com//pull/186642/files#diff-137261ad728b083fd39cb5d6b58d7afd3d4c4e24749b78609a9aa4b3c63e4170R290\n\n\nhttps://github.com/user-attachments/assets/a0d0e81e-5a0f-4462-b110-370894c6bf36\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Michael Olorunnisola
<michael.olorunnisola@elastic.co>","sha":"24d2cd3e4f31fd75c6481934119ca380931cd6d0","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","v9.0.0","Team:Threat
Hunting:Explore","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[SecuritySolution]
Fix add to library
action","number":212659,"url":"https://github.com/elastic/kibana/pull/212659","mergeCommit":{"message":"[SecuritySolution]
Fix add to library action (#212659)\n\n## Summary\n\nAdd to library
actions are not working.\nIssue description and steps to
reproduce:\nhttps://github.com//issues/212650\n\n\nUpdate
according to SaveModalComponent
change:\nhttps://github.com//pull/186642/files#diff-137261ad728b083fd39cb5d6b58d7afd3d4c4e24749b78609a9aa4b3c63e4170R290\n\n\nhttps://github.com/user-attachments/assets/a0d0e81e-5a0f-4462-b110-370894c6bf36\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Michael Olorunnisola
<michael.olorunnisola@elastic.co>","sha":"24d2cd3e4f31fd75c6481934119ca380931cd6d0"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/212659","number":212659,"mergeCommit":{"message":"[SecuritySolution]
Fix add to library action (#212659)\n\n## Summary\n\nAdd to library
actions are not working.\nIssue description and steps to
reproduce:\nhttps://github.com//issues/212650\n\n\nUpdate
according to SaveModalComponent
change:\nhttps://github.com//pull/186642/files#diff-137261ad728b083fd39cb5d6b58d7afd3d4c4e24749b78609a9aa4b3c63e4170R290\n\n\nhttps://github.com/user-attachments/assets/a0d0e81e-5a0f-4462-b110-370894c6bf36\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Michael Olorunnisola
<michael.olorunnisola@elastic.co>","sha":"24d2cd3e4f31fd75c6481934119ca380931cd6d0"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Angela Chuang <6295984+angorayc@users.noreply.github.com>
  • Loading branch information
kibanamachine and angorayc authored Mar 3, 2025
1 parent d62f116 commit a571f30
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 a571f30

Please sign in to comment.