Fix Alert exception flyout don't open for ESQL alerts (#184389)

Fix Alert exception flyout not opening for ESQL and ML alerts
This commit is contained in:
Khristinin Nikita 2024-05-30 18:22:52 +02:00 committed by GitHub
parent 913b494d18
commit be3503c711
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -109,7 +109,7 @@ export interface EcsSecurityExtension {
};
// I believe these parameters are all snake cased to correspond with how they are sent "over the wire" as request / response
// Not representative of the parsed types that are camel cased.
'kibana.alert.rule.parameters'?: { index: string[]; data_view_id?: string };
'kibana.alert.rule.parameters'?: { index: string[]; data_view_id?: string; type?: string };
'kibana.alert.workflow_status'?: 'open' | 'acknowledged' | 'in-progress' | 'closed';
// eslint-disable-next-line @typescript-eslint/naming-convention
Memory_protection?: MemoryProtection;

View file

@ -426,10 +426,15 @@ export const AddExceptionFlyoutWrapper: React.FC<AddExceptionFlyoutWrapperProps>
return null;
}, [maybeRule]);
const ruleType = enrichedAlert?.['kibana.alert.rule.parameters']?.type;
const isAlertWithoutIndex = ruleType === 'esql' || ruleType === 'machine_learning';
const isWaitingForIndexOrDataView =
!isAlertWithoutIndex && memoRuleIndices == null && memoDataViewId == null;
const isLoading =
(isLoadingAlertData && isSignalIndexLoading) ||
enrichedAlert == null ||
(memoRuleIndices == null && memoDataViewId == null);
isWaitingForIndexOrDataView;
if (isLoading || isRuleLoading) return null;