chore: Rename isDataPanel to noQueries

This commit is contained in:
Johannes Schill 2019-02-12 09:48:46 +01:00
parent 0019e0ffc9
commit 2db9cb3d93
8 changed files with 9 additions and 11 deletions

View File

@ -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,
} }
} }

View File

@ -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:"-"`

View File

@ -131,7 +131,9 @@ 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 ? {plugin.noQueries === true ?
this.renderPanelPlugin(LoadingState.Done, null, width, height)
: (
<DataPanel <DataPanel
datasource={datasource} datasource={datasource}
queries={targets} queries={targets}
@ -145,8 +147,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)
)} )}
</> </>
)} )}

View File

@ -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

View File

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

View File

@ -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": {

View File

@ -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": {

View File

@ -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 {