Преглед изворни кода

chore: Rename isDataPanel to noQueries

Johannes Schill пре 6 година
родитељ
комит
075fb8e91c

+ 1 - 1
pkg/api/frontendsettings.go

@@ -145,7 +145,7 @@ func (hs *HTTPServer) getFrontendSettingsMap(c *m.ReqContext) (map[string]interf
 			"info":         panel.Info,
 			"hideFromList": panel.HideFromList,
 			"sort":         getPanelSort(panel.Id),
-			"isDataPanel":  panel.IsDataPanel,
+			"noQueries":    panel.NoQueries,
 		}
 	}
 

+ 1 - 1
pkg/plugins/models.go

@@ -47,7 +47,7 @@ type PluginBase struct {
 	BaseUrl      string             `json:"baseUrl"`
 	HideFromList bool               `json:"hideFromList,omitempty"`
 	State        PluginState        `json:"state,omitempty"`
-	IsDataPanel  bool               `json:"isDataPanel"`
+	NoQueries    bool               `json:"noQueries"`
 
 	IncludedInAppId string `json:"-"`
 	PluginDir       string `json:"-"`

+ 5 - 4
public/app/features/dashboard/dashgrid/PanelChrome.tsx

@@ -131,8 +131,11 @@ export class PanelChrome extends PureComponent<Props, State> {
         this.renderPanelPlugin(LoadingState.Done, snapshotDataToPanelData(panel), width, height)
       ) : (
         <>
-        {plugin.isDataPanel === true ?
-          <DataPanel
+
+        {plugin.noQueries === true ?
+            this.renderPanelPlugin(LoadingState.Done, null, width, height)
+          : (
+            <DataPanel
             panelId={panel.id}
             datasource={datasource}
             queries={targets}
@@ -146,8 +149,6 @@ export class PanelChrome extends PureComponent<Props, State> {
               return this.renderPanelPlugin(loading, panelData, width, height);
             }}
           </DataPanel>
-          : (
-            this.renderPanelPlugin(LoadingState.Done, null, width, height)
           )}
         </>
       )}

+ 1 - 1
public/app/features/dashboard/panel_editor/PanelEditor.tsx

@@ -107,7 +107,7 @@ export class PanelEditor extends PureComponent<PanelEditorProps> {
     ];
 
     // handle panels that do not have queries tab
-    if (!plugin.isDataPanel) {
+    if (plugin.noQueries === true) {
       // remove queries tab
       tabs.shift();
       // switch tab

+ 0 - 1
public/app/plugins/panel/gauge/plugin.json

@@ -2,7 +2,6 @@
   "type": "panel",
   "name": "Gauge",
   "id": "gauge",
-  "isDataPanel": true,
 
   "info": {
     "author": {

+ 0 - 1
public/app/plugins/panel/graph2/plugin.json

@@ -2,7 +2,6 @@
   "type": "panel",
   "name": "React Graph",
   "id": "graph2",
-  "isDataPanel": true,
   "state": "alpha",
 
   "info": {

+ 1 - 1
public/app/plugins/panel/text2/plugin.json

@@ -3,7 +3,7 @@
   "name": "Text v2",
   "id": "text2",
   "state": "alpha",
-  "isDataPanel": false,
+  "noQueries": true,
 
   "info": {
     "author": {

+ 1 - 1
public/app/types/plugins.ts

@@ -9,7 +9,7 @@ export interface PanelPlugin {
   info: any;
   sort: number;
   exports?: PluginExports;
-  isDataPanel?: boolean;
+  noQueries?: boolean;
 }
 
 export interface Plugin {