mirror of
https://github.com/grafana/grafana.git
synced 2025-09-22 22:52:53 +08:00
Chore: Remove unused properties in explore (#17359)
This removes unused properties in explore and datasource meta data (tables and explore properties in plugin.json).
This commit is contained in:

committed by
GitHub

parent
a0bb01103e
commit
1497f3d79a
@ -75,9 +75,7 @@ export class DataSourcePlugin<
|
|||||||
export interface DataSourcePluginMeta extends PluginMeta {
|
export interface DataSourcePluginMeta extends PluginMeta {
|
||||||
builtIn?: boolean; // Is this for all
|
builtIn?: boolean; // Is this for all
|
||||||
metrics?: boolean;
|
metrics?: boolean;
|
||||||
tables?: boolean;
|
|
||||||
logs?: boolean;
|
logs?: boolean;
|
||||||
explore?: boolean;
|
|
||||||
annotations?: boolean;
|
annotations?: boolean;
|
||||||
alerting?: boolean;
|
alerting?: boolean;
|
||||||
mixed?: boolean;
|
mixed?: boolean;
|
||||||
|
@ -144,7 +144,6 @@ describe('Explore item reducer', () => {
|
|||||||
meta: {
|
meta: {
|
||||||
metrics: true,
|
metrics: true,
|
||||||
logs: true,
|
logs: true,
|
||||||
tables: true,
|
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
ExploreStartPage: StartPage,
|
ExploreStartPage: StartPage,
|
||||||
@ -154,9 +153,6 @@ describe('Explore item reducer', () => {
|
|||||||
const queryKeys: string[] = [];
|
const queryKeys: string[] = [];
|
||||||
const initalState: Partial<ExploreItemState> = {
|
const initalState: Partial<ExploreItemState> = {
|
||||||
datasourceInstance: null,
|
datasourceInstance: null,
|
||||||
supportsGraph: false,
|
|
||||||
supportsLogs: false,
|
|
||||||
supportsTable: false,
|
|
||||||
StartPage: null,
|
StartPage: null,
|
||||||
showingStartPage: false,
|
showingStartPage: false,
|
||||||
queries,
|
queries,
|
||||||
@ -164,9 +160,6 @@ describe('Explore item reducer', () => {
|
|||||||
};
|
};
|
||||||
const expectedState = {
|
const expectedState = {
|
||||||
datasourceInstance,
|
datasourceInstance,
|
||||||
supportsGraph: true,
|
|
||||||
supportsLogs: true,
|
|
||||||
supportsTable: true,
|
|
||||||
StartPage,
|
StartPage,
|
||||||
showingStartPage: true,
|
showingStartPage: true,
|
||||||
queries,
|
queries,
|
||||||
|
@ -103,9 +103,6 @@ export const makeExploreItemState = (): ExploreItemState => ({
|
|||||||
graphIsLoading: false,
|
graphIsLoading: false,
|
||||||
logIsLoading: false,
|
logIsLoading: false,
|
||||||
tableIsLoading: false,
|
tableIsLoading: false,
|
||||||
supportsGraph: null,
|
|
||||||
supportsLogs: null,
|
|
||||||
supportsTable: null,
|
|
||||||
queryKeys: [],
|
queryKeys: [],
|
||||||
urlState: null,
|
urlState: null,
|
||||||
update: makeInitialUpdateState(),
|
update: makeInitialUpdateState(),
|
||||||
@ -246,7 +243,6 @@ export const itemReducer = reducerFactory<ExploreItemState>({} as ExploreItemSta
|
|||||||
// Capabilities
|
// Capabilities
|
||||||
const supportsGraph = datasourceInstance.meta.metrics;
|
const supportsGraph = datasourceInstance.meta.metrics;
|
||||||
const supportsLogs = datasourceInstance.meta.logs;
|
const supportsLogs = datasourceInstance.meta.logs;
|
||||||
const supportsTable = datasourceInstance.meta.tables;
|
|
||||||
|
|
||||||
let mode = ExploreMode.Metrics;
|
let mode = ExploreMode.Metrics;
|
||||||
const supportedModes: ExploreMode[] = [];
|
const supportedModes: ExploreMode[] = [];
|
||||||
@ -274,9 +270,6 @@ export const itemReducer = reducerFactory<ExploreItemState>({} as ExploreItemSta
|
|||||||
graphIsLoading: false,
|
graphIsLoading: false,
|
||||||
logIsLoading: false,
|
logIsLoading: false,
|
||||||
tableIsLoading: false,
|
tableIsLoading: false,
|
||||||
supportsGraph,
|
|
||||||
supportsLogs,
|
|
||||||
supportsTable,
|
|
||||||
StartPage,
|
StartPage,
|
||||||
showingStartPage: Boolean(StartPage),
|
showingStartPage: Boolean(StartPage),
|
||||||
queryKeys: getQueryKeys(state.queries, datasourceInstance),
|
queryKeys: getQueryKeys(state.queries, datasourceInstance),
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
"metrics": true,
|
"metrics": true,
|
||||||
"alerting": true,
|
"alerting": true,
|
||||||
"annotations": true,
|
"annotations": true,
|
||||||
"tables": false,
|
|
||||||
|
|
||||||
"queryOptions": {
|
"queryOptions": {
|
||||||
"maxDataPoints": true,
|
"maxDataPoints": true,
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
"metrics": true,
|
"metrics": true,
|
||||||
"annotations": true,
|
"annotations": true,
|
||||||
"alerting": true,
|
"alerting": true,
|
||||||
"tables": true,
|
|
||||||
|
|
||||||
"queryOptions": {
|
"queryOptions": {
|
||||||
"minInterval": true
|
"minInterval": true
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
"alerting": false,
|
"alerting": false,
|
||||||
"annotations": false,
|
"annotations": false,
|
||||||
"logs": false,
|
"logs": false,
|
||||||
"explore": false,
|
|
||||||
|
|
||||||
"info": {
|
"info": {
|
||||||
"description": "Data source that supports manual table & CSV input",
|
"description": "Data source that supports manual table & CSV input",
|
||||||
|
@ -8,8 +8,6 @@
|
|||||||
"alerting": false,
|
"alerting": false,
|
||||||
"annotations": false,
|
"annotations": false,
|
||||||
"logs": true,
|
"logs": true,
|
||||||
"explore": true,
|
|
||||||
"tables": false,
|
|
||||||
|
|
||||||
"info": {
|
"info": {
|
||||||
"description": "Like Prometheus but for logs. OSS logging solution from Grafana Labs",
|
"description": "Like Prometheus but for logs. OSS logging solution from Grafana Labs",
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
"alerting": true,
|
"alerting": true,
|
||||||
"annotations": true,
|
"annotations": true,
|
||||||
"metrics": true,
|
"metrics": true,
|
||||||
"tables": true,
|
|
||||||
|
|
||||||
"queryOptions": {
|
"queryOptions": {
|
||||||
"minInterval": true
|
"minInterval": true
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
"alerting": true,
|
"alerting": true,
|
||||||
"annotations": true,
|
"annotations": true,
|
||||||
"metrics": true,
|
"metrics": true,
|
||||||
"tables": true,
|
|
||||||
|
|
||||||
"queryOptions": {
|
"queryOptions": {
|
||||||
"minInterval": true
|
"minInterval": true
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
"defaultMatchFormat": "pipe",
|
"defaultMatchFormat": "pipe",
|
||||||
"annotations": true,
|
"annotations": true,
|
||||||
"alerting": true,
|
"alerting": true,
|
||||||
"tables": false,
|
|
||||||
|
|
||||||
"info": {
|
"info": {
|
||||||
"description": "Open source time series database",
|
"description": "Open source time series database",
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
"alerting": true,
|
"alerting": true,
|
||||||
"annotations": true,
|
"annotations": true,
|
||||||
"metrics": true,
|
"metrics": true,
|
||||||
"tables": true,
|
|
||||||
|
|
||||||
"queryOptions": {
|
"queryOptions": {
|
||||||
"minInterval": true
|
"minInterval": true
|
||||||
|
@ -24,8 +24,6 @@
|
|||||||
"metrics": true,
|
"metrics": true,
|
||||||
"alerting": true,
|
"alerting": true,
|
||||||
"annotations": true,
|
"annotations": true,
|
||||||
"explore": true,
|
|
||||||
"tables": true,
|
|
||||||
"queryOptions": {
|
"queryOptions": {
|
||||||
"minInterval": true
|
"minInterval": true
|
||||||
},
|
},
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
"metrics": true,
|
"metrics": true,
|
||||||
"alerting": true,
|
"alerting": true,
|
||||||
"annotations": true,
|
"annotations": true,
|
||||||
"tables": false,
|
|
||||||
"queryOptions": {
|
"queryOptions": {
|
||||||
"maxDataPoints": true,
|
"maxDataPoints": true,
|
||||||
"cacheTimeout": true
|
"cacheTimeout": true
|
||||||
|
@ -214,18 +214,6 @@ export interface ExploreItemState {
|
|||||||
* True if table result viewer is expanded. Query runs will contain table queries.
|
* True if table result viewer is expanded. Query runs will contain table queries.
|
||||||
*/
|
*/
|
||||||
showingTable: boolean;
|
showingTable: boolean;
|
||||||
/**
|
|
||||||
* True if `datasourceInstance` supports graph queries.
|
|
||||||
*/
|
|
||||||
supportsGraph: boolean | null;
|
|
||||||
/**
|
|
||||||
* True if `datasourceInstance` supports logs queries.
|
|
||||||
*/
|
|
||||||
supportsLogs: boolean | null;
|
|
||||||
/**
|
|
||||||
* True if `datasourceInstance` supports table queries.
|
|
||||||
*/
|
|
||||||
supportsTable: boolean | null;
|
|
||||||
|
|
||||||
graphIsLoading: boolean;
|
graphIsLoading: boolean;
|
||||||
logIsLoading: boolean;
|
logIsLoading: boolean;
|
||||||
|
Reference in New Issue
Block a user