mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Cases] Move disabling features to the cases context (#119864)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
d874c4c798
commit
319fc9fb7f
26 changed files with 169 additions and 155 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
import React, { memo, useMemo, useCallback } from 'react';
|
||||
import { useDispatch } from 'react-redux';
|
||||
import { CaseStatuses, StatusAll } from '../../../../../../cases/common';
|
||||
import { CaseStatuses, StatusAll, CasesContextValue } from '../../../../../../cases/common';
|
||||
import { TimelineItem } from '../../../../../common/';
|
||||
import { useAddToCase, normalizedEventFields } from '../../../../hooks/use_add_to_case';
|
||||
import { useKibana } from '../../../../../../../../src/plugins/kibana_react/public';
|
||||
|
@ -24,7 +24,7 @@ export interface AddToCaseActionProps {
|
|||
appId: string;
|
||||
owner: string;
|
||||
onClose?: Function;
|
||||
disableAlerts?: boolean;
|
||||
casesFeatures?: CasesContextValue['features'];
|
||||
}
|
||||
|
||||
const AddToCaseActionComponent: React.FC<AddToCaseActionProps> = ({
|
||||
|
@ -34,7 +34,7 @@ const AddToCaseActionComponent: React.FC<AddToCaseActionProps> = ({
|
|||
appId,
|
||||
owner,
|
||||
onClose,
|
||||
disableAlerts,
|
||||
casesFeatures,
|
||||
}) => {
|
||||
const eventId = event?.ecs._id ?? '';
|
||||
const eventIndex = event?.ecs._index ?? '';
|
||||
|
@ -94,8 +94,8 @@ const AddToCaseActionComponent: React.FC<AddToCaseActionProps> = ({
|
|||
onSuccess: onCaseSuccess,
|
||||
useInsertTimeline,
|
||||
owner: [owner],
|
||||
disableAlerts,
|
||||
userCanCrud: casePermissions?.crud ?? false,
|
||||
features: casesFeatures,
|
||||
};
|
||||
}, [
|
||||
attachAlertToCase,
|
||||
|
@ -103,8 +103,8 @@ const AddToCaseActionComponent: React.FC<AddToCaseActionProps> = ({
|
|||
onCaseSuccess,
|
||||
useInsertTimeline,
|
||||
owner,
|
||||
disableAlerts,
|
||||
casePermissions,
|
||||
casesFeatures,
|
||||
]);
|
||||
|
||||
return (
|
||||
|
|
|
@ -75,6 +75,8 @@ const ScrollableFlexItem = styled(EuiFlexItem)`
|
|||
overflow: auto;
|
||||
`;
|
||||
|
||||
const casesFeatures = { alerts: { sync: false } };
|
||||
|
||||
export interface TGridStandaloneProps {
|
||||
appId: string;
|
||||
casesOwner: string;
|
||||
|
@ -416,7 +418,7 @@ const TGridStandaloneComponent: React.FC<TGridStandaloneProps> = ({
|
|||
</EventsContainerLoading>
|
||||
</TimelineContext.Provider>
|
||||
) : null}
|
||||
<AddToCaseAction {...addToCaseActionProps} disableAlerts />
|
||||
<AddToCaseAction {...addToCaseActionProps} casesFeatures={casesFeatures} />
|
||||
</AlertsTableWrapper>
|
||||
</InspectButtonContainer>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue