mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Security Solution] [Exceptions] fixes download from list details page (#150933)
## Summary Fixes: https://github.com/elastic/kibana/issues/148139 When exporting a shared exception list from that lists' detailed view, the exported file would not have the `.ndjson` extension appended to it. I think we should update this to be a single hook used between the two views.
This commit is contained in:
parent
39197628d2
commit
2749e95fe0
2 changed files with 8 additions and 1 deletions
|
@ -190,6 +190,10 @@ export const useListDetailsView = (exceptionListId: string) => {
|
|||
[list, exportExceptionList, handleErrorStatus, toasts]
|
||||
);
|
||||
|
||||
const handleOnDownload = useCallback(() => {
|
||||
setExportedList(undefined);
|
||||
}, []);
|
||||
|
||||
// #region DeleteList
|
||||
|
||||
const handleDeleteSuccess = useCallback(
|
||||
|
@ -366,6 +370,7 @@ export const useListDetailsView = (exceptionListId: string) => {
|
|||
canUserEditList,
|
||||
linkedRules,
|
||||
exportedList,
|
||||
handleOnDownload,
|
||||
viewerStatus,
|
||||
showManageRulesFlyout,
|
||||
headerBackOptions,
|
||||
|
|
|
@ -39,6 +39,7 @@ export const ListsDetailViewComponent: FC = () => {
|
|||
listId,
|
||||
linkedRules,
|
||||
exportedList,
|
||||
handleOnDownload,
|
||||
viewerStatus,
|
||||
listName,
|
||||
listDescription,
|
||||
|
@ -91,7 +92,7 @@ export const ListsDetailViewComponent: FC = () => {
|
|||
onManageRules={onManageRules}
|
||||
/>
|
||||
|
||||
<AutoDownload blob={exportedList} name={listId} />
|
||||
<AutoDownload blob={exportedList} name={`${listId}.ndjson`} onDownload={handleOnDownload} />
|
||||
<ListWithSearch list={list} refreshExceptions={refreshExceptions} isReadOnly={isReadOnly} />
|
||||
<ReferenceErrorModal
|
||||
cancelText={i18n.REFERENCE_MODAL_CANCEL_BUTTON}
|
||||
|
@ -126,6 +127,7 @@ export const ListsDetailViewComponent: FC = () => {
|
|||
canUserEditList,
|
||||
disableManageButton,
|
||||
exportedList,
|
||||
handleOnDownload,
|
||||
headerBackOptions,
|
||||
invalidListId,
|
||||
isLoading,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue