11import classNames from 'classnames' ;
22import React from 'react' ;
33import { Unsubscribable } from 'rxjs' ;
4+ import { connect } from "react-redux"
45
56import { selectors } from '@grafana/e2e-selectors' ;
67import { getTemplateSrv , RefreshEvent } from '@grafana/runtime' ;
@@ -11,13 +12,15 @@ import { ShowConfirmModalEvent } from '../../../../types/events';
1112import { DashboardModel } from '../../state/DashboardModel' ;
1213import { PanelModel } from '../../state/PanelModel' ;
1314import { RowOptionsButton } from '../RowOptions/RowOptionsButton' ;
15+ import { StoreState } from 'app/types' ;
1416
1517export interface DashboardRowProps {
1618 panel : PanelModel ;
1719 dashboard : DashboardModel ;
20+ isFnDashboard : boolean
1821}
1922
20- export class DashboardRow extends React . Component < DashboardRowProps > {
23+ class Component extends React . Component < DashboardRowProps > {
2124 sub ?: Unsubscribable ;
2225
2326 componentDidMount ( ) {
@@ -69,10 +72,13 @@ export class DashboardRow extends React.Component<DashboardRowProps> {
6972 'dashboard-row--collapsed' : this . props . panel . collapsed ,
7073 } ) ;
7174
75+ const { isFnDashboard} = this . props
76+
7277 const title = getTemplateSrv ( ) . replace ( this . props . panel . title , this . props . panel . scopedVars , 'text' ) ;
7378 const count = this . props . panel . panels ? this . props . panel . panels . length : 0 ;
7479 const panels = count === 1 ? 'panel' : 'panels' ;
75- const canEdit = this . props . dashboard . meta . canEdit === true ;
80+ const canEdit = this . props . dashboard . meta . canEdit === true && ! isFnDashboard ;
81+
7682
7783 return (
7884 < div className = { classes } data-testid = "dashboard-row-container" >
@@ -110,3 +116,13 @@ export class DashboardRow extends React.Component<DashboardRowProps> {
110116 ) ;
111117 }
112118}
119+
120+
121+ function mapStateToProps ( ) {
122+ return ( state : StoreState ) => ( {
123+ isFnDashboard : state . fnGlobalState . FNDashboard
124+ } ) ;
125+ }
126+
127+
128+ export const DashboardRow = connect ( mapStateToProps ) ( Component ) ;
0 commit comments