Graphs: Fix threshold handle being visible in dashboards (#39270)

This commit is contained in:
Peter Holmberg 2021-09-16 08:59:36 +02:00 committed by GitHub
parent b5ed47c95c
commit 4f7e1db57c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,7 +14,6 @@ import {
PanelData,
PanelPlugin,
PanelPluginMeta,
ThresholdsConfig,
TimeRange,
toDataFrameDTO,
toUtc,
@ -85,9 +84,6 @@ export class PanelChrome extends Component<Props, State> {
onAnnotationUpdate: this.onAnnotationUpdate,
onAnnotationDelete: this.onAnnotationDelete,
canAddAnnotations: () => Boolean(props.dashboard.meta.canEdit || props.dashboard.meta.canMakeEditable),
// TODO: remove, added only for testing now
canEditThresholds: true,
onThresholdsChange: this.onThresholdsChange,
},
data: this.getInitialPanelDataState(),
};
@ -346,16 +342,6 @@ export class PanelChrome extends Component<Props, State> {
this.state.context.eventBus.publish(new AnnotationChangeEvent(anno));
};
onThresholdsChange = (thresholds: ThresholdsConfig) => {
this.onFieldConfigChange({
defaults: {
...this.props.panel.fieldConfig.defaults,
thresholds,
},
overrides: this.props.panel.fieldConfig.overrides,
});
};
get hasPanelSnapshot() {
const { panel } = this.props;
return panel.snapshotData && panel.snapshotData.length;