Просмотр исходного кода

TestDataDatasource: Add config editor (#16861)

Ryan McKinley 6 лет назад
Родитель
Сommit
3e6104f45a

+ 15 - 0
public/app/plugins/datasource/testdata/ConfigEditor.tsx

@@ -0,0 +1,15 @@
+// Libraries
+import React, { PureComponent } from 'react';
+
+import { DataSourcePluginOptionsEditorProps } from '@grafana/ui';
+
+type Props = DataSourcePluginOptionsEditorProps<any>;
+
+/**
+ * Empty Config Editor -- settings to save
+ */
+export class ConfigEditor extends PureComponent<Props> {
+  render() {
+    return <div />;
+  }
+}

+ 2 - 0
public/app/plugins/datasource/testdata/module.tsx

@@ -1,6 +1,7 @@
 import { DataSourcePlugin } from '@grafana/ui';
 import { TestDataDatasource } from './datasource';
 import { TestDataQueryCtrl } from './query_ctrl';
+import { ConfigEditor } from './ConfigEditor';
 
 class TestDataAnnotationsQueryCtrl {
   annotation: any;
@@ -9,5 +10,6 @@ class TestDataAnnotationsQueryCtrl {
 }
 
 export const plugin = new DataSourcePlugin(TestDataDatasource)
+  .setConfigEditor(ConfigEditor)
   .setQueryCtrl(TestDataQueryCtrl)
   .setAnnotationQueryCtrl(TestDataAnnotationsQueryCtrl);