mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[RAM] Fix bulk action for o11y for 7.17 (#126686)
* fix bulk action for o11y * review I * discuss it more with Devin * clean up
This commit is contained in:
parent
9c45883bb4
commit
8f277d4677
6 changed files with 100 additions and 13 deletions
|
@ -49,7 +49,7 @@ const FullWidthFlexGroup = styled(EuiFlexGroup)<{ $visible: boolean }>`
|
|||
`;
|
||||
|
||||
export const EVENTS_VIEWER_HEADER_HEIGHT = 90; // px
|
||||
const STANDALONE_ID = 'standalone-t-grid';
|
||||
export const STANDALONE_ID = 'standalone-t-grid';
|
||||
const EMPTY_DATA_PROVIDERS: DataProvider[] = [];
|
||||
|
||||
const TitleText = styled.span`
|
||||
|
|
|
@ -45,11 +45,11 @@ export const useUpdateAlertsStatus = (
|
|||
body: JSON.stringify({ status, query }),
|
||||
});
|
||||
} else {
|
||||
const { body } = await http.post<{ body: estypes.UpdateByQueryResponse }>(
|
||||
const response = await http.post<estypes.UpdateByQueryResponse>(
|
||||
RAC_ALERTS_BULK_UPDATE_URL,
|
||||
{ body: JSON.stringify({ index, status, query }) }
|
||||
);
|
||||
return body;
|
||||
return response;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
@ -12,6 +12,7 @@ import * as i18n from '../components/t_grid/translations';
|
|||
import type { AlertStatus, StatusBulkActionsProps } from '../../common/types/timeline';
|
||||
import { useUpdateAlertsStatus } from '../container/use_update_alerts';
|
||||
import { useAppToasts } from './use_app_toasts';
|
||||
import { STANDALONE_ID } from '../components/t_grid/standalone';
|
||||
|
||||
export const getUpdateAlertsQuery = (eventIds: Readonly<string[]>) => {
|
||||
return { bool: { filter: { terms: { _id: eventIds } } } };
|
||||
|
@ -28,7 +29,7 @@ export const useStatusBulkActionItems = ({
|
|||
onUpdateFailure,
|
||||
timelineId,
|
||||
}: StatusBulkActionsProps) => {
|
||||
const { updateAlertStatus } = useUpdateAlertsStatus(timelineId != null);
|
||||
const { updateAlertStatus } = useUpdateAlertsStatus(timelineId !== STANDALONE_ID);
|
||||
const { addSuccess, addError, addWarning } = useAppToasts();
|
||||
|
||||
const onAlertStatusUpdateSuccess = useCallback(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue