From ddaaee7dae0f9c3d75a904c3c33bdf025e0881f6 Mon Sep 17 00:00:00 2001 From: Pablo Neves Machado Date: Fri, 13 Aug 2021 11:44:29 +0200 Subject: [PATCH] Improve security alerts t-grid loading and empty state --- .../components/t_grid/integrated/index.tsx | 107 +++++++++++------- .../timelines/public/container/index.tsx | 3 +- 2 files changed, 70 insertions(+), 40 deletions(-) diff --git a/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx b/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx index d2dfef542aca1..6b83039f3a545 100644 --- a/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx +++ b/x-pack/plugins/timelines/public/components/t_grid/integrated/index.tsx @@ -8,18 +8,20 @@ import type { AlertConsumers as AlertConsumersTyped } from '@kbn/rule-data-utils'; // @ts-expect-error import { AlertConsumers as AlertConsumersNonTyped } from '@kbn/rule-data-utils/target_node/alerts_as_data_rbac'; -import { EuiFlexGroup, EuiFlexItem, EuiPanel } from '@elastic/eui'; +import { EuiEmptyPrompt, EuiFlexGroup, EuiFlexItem, EuiPanel, EuiProgress } from '@elastic/eui'; import { isEmpty } from 'lodash/fp'; import React, { useEffect, useMemo, useState } from 'react'; import styled from 'styled-components'; import { useDispatch } from 'react-redux'; +import { FormattedMessage } from '@kbn/i18n/react'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; import { Direction, EntityType } from '../../../../common/search_strategy'; import type { DocValueFields } from '../../../../common/search_strategy'; import type { CoreStart } from '../../../../../../../src/core/public'; import type { BrowserFields } from '../../../../common/search_strategy/index_fields'; import { TGridCellAction, TimelineId, TimelineTabs } from '../../../../common/types/timeline'; + import type { CellValueElementProps, ColumnHeaderOptions, @@ -66,6 +68,7 @@ const TitleText = styled.span` const StyledEuiPanel = styled(EuiPanel)<{ $isFullScreen: boolean }>` display: flex; flex-direction: column; + position: relative; ${({ $isFullScreen }) => $isFullScreen && @@ -310,6 +313,8 @@ const TGridIntegratedComponent: React.FC = ({ return ( + {loading && } + {canQueryTimeline ? ( <> = ({ - -