@@ -39,13 +39,13 @@ import {
3939 Query ,
4040 IndexPatternAttributes ,
4141 DataPublicPluginStart ,
42+ AggConfigs ,
4243} from '../../../../data/public' ;
4344import { Chart } from '../angular/helpers/point_series' ;
4445import { AppState } from '../angular/discover_state' ;
4546import { SavedSearch } from '../../saved_searches' ;
4647
4748import { SavedObject } from '../../../../../core/types' ;
48- import { Vis } from '../../../../visualizations/public' ;
4949import { TopNavMenuData } from '../../../../navigation/public' ;
5050
5151export interface DiscoverLegacyProps {
@@ -66,14 +66,15 @@ export interface DiscoverLegacyProps {
6666 onSkipBottomButtonClick : ( ) => void ;
6767 onSort : ( sort : string [ ] [ ] ) => void ;
6868 opts : {
69- savedSearch : SavedSearch ;
69+ chartAggConfigs ?: AggConfigs ;
7070 config : IUiSettingsClient ;
71+ data : DataPublicPluginStart ;
72+ fixedScroll : ( el : HTMLElement ) => void ;
7173 indexPatternList : Array < SavedObject < IndexPatternAttributes > > ;
72- timefield : string ;
7374 sampleSize : number ;
74- fixedScroll : ( el : HTMLElement ) => void ;
75+ savedSearch : SavedSearch ;
7576 setHeaderActionMenu : ( menuMount : MountPoint | undefined ) => void ;
76- data : DataPublicPluginStart ;
77+ timefield : string ;
7778 } ;
7879 resetQuery : ( ) => void ;
7980 resultState : string ;
@@ -87,7 +88,6 @@ export interface DiscoverLegacyProps {
8788 topNavMenu : TopNavMenuData [ ] ;
8889 updateQuery : ( payload : { dateRange : TimeRange ; query ?: Query } , isUpdate ?: boolean ) => void ;
8990 updateSavedQueryId : ( savedQueryId ?: string ) => void ;
90- vis ?: Vis ;
9191}
9292
9393export function DiscoverLegacy ( {
@@ -119,12 +119,11 @@ export function DiscoverLegacy({
119119 topNavMenu,
120120 updateQuery,
121121 updateSavedQueryId,
122- vis,
123122} : DiscoverLegacyProps ) {
124123 const [ isSidebarClosed , setIsSidebarClosed ] = useState ( false ) ;
125124 const { TopNavMenu } = getServices ( ) . navigation . ui ;
126125 const { savedSearch, indexPatternList } = opts ;
127- const bucketAggConfig = vis ?. data ?. aggs ?. aggs [ 1 ] ;
126+ const bucketAggConfig = opts . chartAggConfigs ?. aggs [ 1 ] ;
128127 const bucketInterval =
129128 bucketAggConfig && search . aggs . isDateHistogramBucketAggConfig ( bucketAggConfig )
130129 ? bucketAggConfig . buckets ?. getInterval ( )
@@ -242,7 +241,7 @@ export function DiscoverLegacy({
242241 } ) }
243242 className = "dscTimechart"
244243 >
245- { vis && rows . length !== 0 && (
244+ { opts . chartAggConfigs && rows . length !== 0 && (
246245 < div className = "dscHistogram" data-test-subj = "discoverChart" >
247246 < DiscoverHistogram
248247 chartData = { histogramData }
0 commit comments