Commit 075fb8e9 by Johannes Schill

chore: Rename isDataPanel to noQueries

parent b7b1a794
...@@ -145,7 +145,7 @@ func (hs *HTTPServer) getFrontendSettingsMap(c *m.ReqContext) (map[string]interf ...@@ -145,7 +145,7 @@ func (hs *HTTPServer) getFrontendSettingsMap(c *m.ReqContext) (map[string]interf
"info": panel.Info, "info": panel.Info,
"hideFromList": panel.HideFromList, "hideFromList": panel.HideFromList,
"sort": getPanelSort(panel.Id), "sort": getPanelSort(panel.Id),
"isDataPanel": panel.IsDataPanel, "noQueries": panel.NoQueries,
} }
} }
......
...@@ -47,7 +47,7 @@ type PluginBase struct { ...@@ -47,7 +47,7 @@ type PluginBase struct {
BaseUrl string `json:"baseUrl"` BaseUrl string `json:"baseUrl"`
HideFromList bool `json:"hideFromList,omitempty"` HideFromList bool `json:"hideFromList,omitempty"`
State PluginState `json:"state,omitempty"` State PluginState `json:"state,omitempty"`
IsDataPanel bool `json:"isDataPanel"` NoQueries bool `json:"noQueries"`
IncludedInAppId string `json:"-"` IncludedInAppId string `json:"-"`
PluginDir string `json:"-"` PluginDir string `json:"-"`
......
...@@ -131,8 +131,11 @@ export class PanelChrome extends PureComponent<Props, State> { ...@@ -131,8 +131,11 @@ export class PanelChrome extends PureComponent<Props, State> {
this.renderPanelPlugin(LoadingState.Done, snapshotDataToPanelData(panel), width, height) 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} panelId={panel.id}
datasource={datasource} datasource={datasource}
queries={targets} queries={targets}
...@@ -146,8 +149,6 @@ export class PanelChrome extends PureComponent<Props, State> { ...@@ -146,8 +149,6 @@ export class PanelChrome extends PureComponent<Props, State> {
return this.renderPanelPlugin(loading, panelData, width, height); return this.renderPanelPlugin(loading, panelData, width, height);
}} }}
</DataPanel> </DataPanel>
: (
this.renderPanelPlugin(LoadingState.Done, null, width, height)
)} )}
</> </>
)} )}
......
...@@ -107,7 +107,7 @@ export class PanelEditor extends PureComponent<PanelEditorProps> { ...@@ -107,7 +107,7 @@ export class PanelEditor extends PureComponent<PanelEditorProps> {
]; ];
// handle panels that do not have queries tab // handle panels that do not have queries tab
if (!plugin.isDataPanel) { if (plugin.noQueries === true) {
// remove queries tab // remove queries tab
tabs.shift(); tabs.shift();
// switch tab // switch tab
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
"type": "panel", "type": "panel",
"name": "Gauge", "name": "Gauge",
"id": "gauge", "id": "gauge",
"isDataPanel": true,
"info": { "info": {
"author": { "author": {
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
"type": "panel", "type": "panel",
"name": "React Graph", "name": "React Graph",
"id": "graph2", "id": "graph2",
"isDataPanel": true,
"state": "alpha", "state": "alpha",
"info": { "info": {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"name": "Text v2", "name": "Text v2",
"id": "text2", "id": "text2",
"state": "alpha", "state": "alpha",
"isDataPanel": false, "noQueries": true,
"info": { "info": {
"author": { "author": {
......
...@@ -9,7 +9,7 @@ export interface PanelPlugin { ...@@ -9,7 +9,7 @@ export interface PanelPlugin {
info: any; info: any;
sort: number; sort: number;
exports?: PluginExports; exports?: PluginExports;
isDataPanel?: boolean; noQueries?: boolean;
} }
export interface Plugin { export interface Plugin {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment