From 04bf4ca21a113892b23c4d5391f84833beb71b25 Mon Sep 17 00:00:00 2001 From: Dima Arnautov Date: Wed, 1 Jul 2020 14:13:36 +0200 Subject: [PATCH] [ML] change empty state styling --- .../application/explorer/anomaly_timeline.tsx | 16 ++++++-- .../explorer_no_influencers_found.tsx | 38 +++++++------------ .../explorer/swimlane_container.tsx | 9 ++++- .../embeddable_swim_lane_container.tsx | 19 ++++++---- 4 files changed, 46 insertions(+), 36 deletions(-) diff --git a/x-pack/plugins/ml/public/application/explorer/anomaly_timeline.tsx b/x-pack/plugins/ml/public/application/explorer/anomaly_timeline.tsx index f5ec74a0328c1e..59bc6730b602dc 100644 --- a/x-pack/plugins/ml/public/application/explorer/anomaly_timeline.tsx +++ b/x-pack/plugins/ml/public/application/explorer/anomaly_timeline.tsx @@ -343,10 +343,18 @@ export const AnomalyTimeline: FC = React.memo( isLoading={loading || viewBySwimlaneDataLoading} noDataWarning={ typeof viewBySwimlaneFieldName === 'string' ? ( - + viewBySwimlaneFieldName === VIEW_BY_JOB_LABEL ? ( + + ) : ( + + ) ) : null } /> diff --git a/x-pack/plugins/ml/public/application/explorer/components/explorer_no_influencers_found/explorer_no_influencers_found.tsx b/x-pack/plugins/ml/public/application/explorer/components/explorer_no_influencers_found/explorer_no_influencers_found.tsx index 639c0f7b785043..24def01108584c 100644 --- a/x-pack/plugins/ml/public/application/explorer/components/explorer_no_influencers_found/explorer_no_influencers_found.tsx +++ b/x-pack/plugins/ml/public/application/explorer/components/explorer_no_influencers_found/explorer_no_influencers_found.tsx @@ -7,7 +7,6 @@ import React, { FC } from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; -import { EuiEmptyPrompt } from '@elastic/eui'; /* * React component for rendering EuiEmptyPrompt when no influencers were found. @@ -15,26 +14,17 @@ import { EuiEmptyPrompt } from '@elastic/eui'; export const ExplorerNoInfluencersFound: FC<{ viewBySwimlaneFieldName: string; showFilterMessage?: boolean; -}> = ({ viewBySwimlaneFieldName, showFilterMessage = false }) => ( - - {showFilterMessage === false && ( - - )} - {showFilterMessage === true && ( - - )} - - } - /> -); +}> = ({ viewBySwimlaneFieldName, showFilterMessage = false }) => + showFilterMessage === false ? ( + + ) : ( + + ); diff --git a/x-pack/plugins/ml/public/application/explorer/swimlane_container.tsx b/x-pack/plugins/ml/public/application/explorer/swimlane_container.tsx index 5ec3b91968dc31..42a3ca7f4705be 100644 --- a/x-pack/plugins/ml/public/application/explorer/swimlane_container.tsx +++ b/x-pack/plugins/ml/public/application/explorer/swimlane_container.tsx @@ -11,6 +11,7 @@ import { EuiResizeObserver, EuiFlexGroup, EuiFlexItem, + EuiEmptyPrompt, } from '@elastic/eui'; import { throttle } from 'lodash'; @@ -127,7 +128,13 @@ export const SwimlaneContainer: FC< )} - {!isLoading && !showSwimlane && noDataWarning} + {!isLoading && !showSwimlane && ( + {noDataWarning}} + /> + )} {isPaginationVisible && ( diff --git a/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/embeddable_swim_lane_container.tsx b/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/embeddable_swim_lane_container.tsx index 0bed530ae44540..ce6ce19e8f8a56 100644 --- a/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/embeddable_swim_lane_container.tsx +++ b/x-pack/plugins/ml/public/embeddables/anomaly_swimlane/embeddable_swim_lane_container.tsx @@ -5,7 +5,7 @@ */ import React, { FC, useState } from 'react'; -import { EuiCallOut, EuiText } from '@elastic/eui'; +import { EuiCallOut, EuiEmptyPrompt } from '@elastic/eui'; import { Observable } from 'rxjs'; import { CoreStart } from 'kibana/public'; @@ -99,12 +99,17 @@ export const EmbeddableSwimLaneContainer: FC = ( }} isLoading={isLoading} noDataWarning={ - - - + + + + } + /> } />