Dashboard: Annotations - Fix issue of angularEditorLoader when angular is not supported (#93583)

Dashboard: Annotations - Fix issue of angularEditorLoader when angular is not supported
This commit is contained in:
Alexa V 2024-09-23 16:17:59 +02:00 committed by GitHub
parent 1a13e7fd95
commit 067ea66cbb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,7 +1,7 @@
import { PureComponent } from 'react';
import { AnnotationQuery, DataSourceApi } from '@grafana/data';
import { AngularComponent, getAngularLoader } from '@grafana/runtime';
import { AngularComponent, config, getAngularLoader } from '@grafana/runtime';
export interface Props {
annotation: AnnotationQuery;
@ -29,7 +29,9 @@ export class AngularEditorLoader extends PureComponent<Props> {
}
componentDidMount() {
if (this.ref) {
// check if angular support is enabled in the instance
const isAngularEnabled = config.angularSupportEnabled;
if (this.ref && isAngularEnabled) {
this.loadAngular();
}
}