1
1
import { debounce } from 'lodash' ;
2
2
import { PureComponent } from 'react' ;
3
+ import { connect } from 'react-redux' ;
3
4
import { Subscription } from 'rxjs' ;
4
5
5
6
import {
@@ -41,6 +42,7 @@ import { applyFilterFromTable } from 'app/features/variables/adhoc/actions';
41
42
import { onUpdatePanelSnapshotData } from 'app/plugins/datasource/grafana/utils' ;
42
43
import { changeSeriesColorConfigFactory } from 'app/plugins/panel/timeseries/overrides/colorSeriesConfigFactory' ;
43
44
import { dispatch } from 'app/store/store' ;
45
+ import { StoreState } from 'app/types' ;
44
46
import { RenderEvent } from 'app/types/events' ;
45
47
46
48
import { deleteAnnotation , saveAnnotation , updateAnnotation } from '../../annotations/api' ;
@@ -71,6 +73,7 @@ export interface Props {
71
73
onInstanceStateChange : ( value : unknown ) => void ;
72
74
timezone ?: string ;
73
75
hideMenu ?: boolean ;
76
+ isFnDashboard ?: boolean ;
74
77
}
75
78
76
79
export interface State {
@@ -82,7 +85,7 @@ export interface State {
82
85
liveTime ?: TimeRange ;
83
86
}
84
87
85
- export class PanelStateWrapper extends PureComponent < Props , State > {
88
+ export class PanelStateWrapperDisConnected extends PureComponent < Props , State > {
86
89
private readonly timeSrv : TimeSrv = getTimeSrv ( ) ;
87
90
private subs = new Subscription ( ) ;
88
91
private eventFilter : EventFilterOptions = { onlyLocal : true } ;
@@ -555,7 +558,7 @@ export class PanelStateWrapper extends PureComponent<Props, State> {
555
558
debouncedSetPanelAttention ( ) { }
556
559
557
560
render ( ) {
558
- const { dashboard, panel, width, height, plugin } = this . props ;
561
+ const { dashboard, panel, width, height, plugin, isFnDashboard } = this . props ;
559
562
const { errorMessage, data } = this . state ;
560
563
const { transparent } = panel ;
561
564
const panelChromeProps = getPanelChromeProps ( { ...this . props , data } ) ;
@@ -590,6 +593,7 @@ export class PanelStateWrapper extends PureComponent<Props, State> {
590
593
onFocus = { ( ) => this . setPanelAttention ( ) }
591
594
onMouseEnter = { ( ) => this . setPanelAttention ( ) }
592
595
onMouseMove = { ( ) => this . debouncedSetPanelAttention ( ) }
596
+ isFNPanel = { isFnDashboard }
593
597
>
594
598
{ ( innerWidth , innerHeight ) => (
595
599
< >
@@ -611,3 +615,11 @@ export class PanelStateWrapper extends PureComponent<Props, State> {
611
615
) ;
612
616
}
613
617
}
618
+
619
+ function mapStateToProps ( ) {
620
+ return ( state : StoreState ) => ( {
621
+ isFnDashboard : state . fnGlobalState . FNDashboard ,
622
+ } ) ;
623
+ }
624
+
625
+ export const PanelStateWrapper = connect ( mapStateToProps ) ( PanelStateWrapperDisConnected ) ;
0 commit comments