From e5dae9c11553f8a06b2b986e2e4e6b01bb08d8d7 Mon Sep 17 00:00:00 2001 From: Sergi Massaneda Date: Wed, 25 Aug 2021 13:11:33 +0200 Subject: [PATCH] fix empty actions popover button (#110015) --- .../pages/alerts/alerts_table_t_grid.tsx | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/x-pack/plugins/observability/public/pages/alerts/alerts_table_t_grid.tsx b/x-pack/plugins/observability/public/pages/alerts/alerts_table_t_grid.tsx index 3b62538fa3e30..0fa36aff7a456 100644 --- a/x-pack/plugins/observability/public/pages/alerts/alerts_table_t_grid.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/alerts_table_t_grid.tsx @@ -217,18 +217,22 @@ function ObservabilityActions({ const actionsMenuItems = useMemo(() => { return [ - timelines.getAddToExistingCaseButton({ - event, - casePermissions, - appId: observabilityFeatureId, - onClose: afterCaseSelection, - }), - timelines.getAddToNewCaseButton({ - event, - casePermissions, - appId: observabilityFeatureId, - onClose: afterCaseSelection, - }), + ...(casePermissions?.crud + ? [ + timelines.getAddToExistingCaseButton({ + event, + casePermissions, + appId: observabilityFeatureId, + onClose: afterCaseSelection, + }), + timelines.getAddToNewCaseButton({ + event, + casePermissions, + appId: observabilityFeatureId, + onClose: afterCaseSelection, + }), + ] + : []), ...(alertPermissions.crud ? statusActionItems : []), ]; }, [afterCaseSelection, casePermissions, timelines, event, statusActionItems, alertPermissions]);