mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Plugins: move PanelPluginMeta to grafana/ui (#16804)
This commit is contained in:
parent
7146d576e6
commit
5c2d38126d
@ -2,9 +2,28 @@ import { ComponentClass, ComponentType } from 'react';
|
|||||||
import { LoadingState, SeriesData } from './data';
|
import { LoadingState, SeriesData } from './data';
|
||||||
import { TimeRange } from './time';
|
import { TimeRange } from './time';
|
||||||
import { ScopedVars, DataQueryRequest, DataQueryError, LegacyResponseData } from './datasource';
|
import { ScopedVars, DataQueryRequest, DataQueryError, LegacyResponseData } from './datasource';
|
||||||
|
import { PluginMeta } from './plugin';
|
||||||
|
|
||||||
export type InterpolateFunction = (value: string, scopedVars?: ScopedVars, format?: string | Function) => string;
|
export type InterpolateFunction = (value: string, scopedVars?: ScopedVars, format?: string | Function) => string;
|
||||||
|
|
||||||
|
export interface PanelPluginMeta extends PluginMeta {
|
||||||
|
hideFromList?: boolean;
|
||||||
|
sort: number;
|
||||||
|
angularPlugin: AngularPanelPlugin | null;
|
||||||
|
vizPlugin: PanelPlugin | null;
|
||||||
|
hasBeenImported?: boolean;
|
||||||
|
|
||||||
|
// if length>0 the query tab will show up
|
||||||
|
// Before 6.2 this could be table and/or series, but 6.2+ supports both transparently
|
||||||
|
// so it will be deprecated soon
|
||||||
|
dataFormats?: PanelDataFormat[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export enum PanelDataFormat {
|
||||||
|
Table = 'table',
|
||||||
|
TimeSeries = 'time_series',
|
||||||
|
}
|
||||||
|
|
||||||
export interface PanelData {
|
export interface PanelData {
|
||||||
state: LoadingState;
|
state: LoadingState;
|
||||||
series: SeriesData[];
|
series: SeriesData[];
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { PanelPluginMeta } from 'app/types/plugins';
|
import { GrafanaTheme, getTheme, GrafanaThemeType, PanelPluginMeta, DataSourceInstanceSettings } from '@grafana/ui';
|
||||||
import { GrafanaTheme, getTheme, GrafanaThemeType, DataSourceInstanceSettings } from '@grafana/ui';
|
|
||||||
|
|
||||||
export interface BuildInfo {
|
export interface BuildInfo {
|
||||||
version: string;
|
version: string;
|
||||||
|
@ -9,7 +9,7 @@ import config from 'app/core/config';
|
|||||||
import { DashboardExporter } from './DashboardExporter';
|
import { DashboardExporter } from './DashboardExporter';
|
||||||
import { DashboardModel } from '../../state/DashboardModel';
|
import { DashboardModel } from '../../state/DashboardModel';
|
||||||
import { DatasourceSrv } from 'app/features/plugins/datasource_srv';
|
import { DatasourceSrv } from 'app/features/plugins/datasource_srv';
|
||||||
import { PanelPluginMeta } from 'app/types';
|
import { PanelPluginMeta } from '@grafana/ui';
|
||||||
|
|
||||||
describe('given dashboard with repeated panels', () => {
|
describe('given dashboard with repeated panels', () => {
|
||||||
let dash: any, exported: any;
|
let dash: any, exported: any;
|
||||||
|
@ -4,7 +4,7 @@ import config from 'app/core/config';
|
|||||||
import { DashboardModel } from '../../state/DashboardModel';
|
import { DashboardModel } from '../../state/DashboardModel';
|
||||||
import DatasourceSrv from 'app/features/plugins/datasource_srv';
|
import DatasourceSrv from 'app/features/plugins/datasource_srv';
|
||||||
import { PanelModel } from 'app/features/dashboard/state';
|
import { PanelModel } from 'app/features/dashboard/state';
|
||||||
import { PanelPluginMeta } from 'app/types/plugins';
|
import { PanelPluginMeta } from '@grafana/ui';
|
||||||
|
|
||||||
interface Input {
|
interface Input {
|
||||||
name: string;
|
name: string;
|
||||||
|
@ -17,8 +17,7 @@ import { PanelResizer } from './PanelResizer';
|
|||||||
|
|
||||||
// Types
|
// Types
|
||||||
import { PanelModel, DashboardModel } from '../state';
|
import { PanelModel, DashboardModel } from '../state';
|
||||||
import { PanelPluginMeta } from 'app/types';
|
import { PanelPluginMeta, AngularPanelPlugin, PanelPlugin } from '@grafana/ui/src/types/panel';
|
||||||
import { AngularPanelPlugin, PanelPlugin } from '@grafana/ui/src/types/panel';
|
|
||||||
import { AutoSizer } from 'react-virtualized';
|
import { AutoSizer } from 'react-virtualized';
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
|
@ -16,8 +16,7 @@ import config from 'app/core/config';
|
|||||||
|
|
||||||
// Types
|
// Types
|
||||||
import { DashboardModel, PanelModel } from '../state';
|
import { DashboardModel, PanelModel } from '../state';
|
||||||
import { PanelPluginMeta } from 'app/types';
|
import { PanelPluginMeta, LoadingState, PanelData } from '@grafana/ui';
|
||||||
import { LoadingState, PanelData } from '@grafana/ui';
|
|
||||||
import { ScopedVars } from '@grafana/ui';
|
import { ScopedVars } from '@grafana/ui';
|
||||||
|
|
||||||
import templateSrv from 'app/features/templating/template_srv';
|
import templateSrv from 'app/features/templating/template_srv';
|
||||||
|
@ -6,8 +6,8 @@ import React, { PureComponent } from 'react';
|
|||||||
import { AlertBox } from 'app/core/components/AlertBox/AlertBox';
|
import { AlertBox } from 'app/core/components/AlertBox/AlertBox';
|
||||||
|
|
||||||
// Types
|
// Types
|
||||||
import { PanelPluginMeta, AppNotificationSeverity } from 'app/types';
|
import { AppNotificationSeverity } from 'app/types';
|
||||||
import { PanelProps, PanelPlugin, PluginType } from '@grafana/ui';
|
import { PanelPluginMeta, PanelProps, PanelPlugin, PluginType } from '@grafana/ui';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
pluginId: string;
|
pluginId: string;
|
||||||
|
@ -13,9 +13,7 @@ import { AngularComponent } from 'app/core/services/AngularLoader';
|
|||||||
|
|
||||||
import { PanelModel } from '../state/PanelModel';
|
import { PanelModel } from '../state/PanelModel';
|
||||||
import { DashboardModel } from '../state/DashboardModel';
|
import { DashboardModel } from '../state/DashboardModel';
|
||||||
import { PanelPluginMeta } from 'app/types/plugins';
|
import { PanelPluginMeta, Tooltip } from '@grafana/ui';
|
||||||
|
|
||||||
import { Tooltip } from '@grafana/ui';
|
|
||||||
|
|
||||||
interface PanelEditorProps {
|
interface PanelEditorProps {
|
||||||
panel: PanelModel;
|
panel: PanelModel;
|
||||||
|
@ -16,9 +16,9 @@ import { FadeIn } from 'app/core/components/Animations/FadeIn';
|
|||||||
// Types
|
// Types
|
||||||
import { PanelModel } from '../state';
|
import { PanelModel } from '../state';
|
||||||
import { DashboardModel } from '../state';
|
import { DashboardModel } from '../state';
|
||||||
import { PanelPluginMeta } from 'app/types/plugins';
|
|
||||||
import { VizPickerSearch } from './VizPickerSearch';
|
import { VizPickerSearch } from './VizPickerSearch';
|
||||||
import PluginStateinfo from 'app/features/plugins/PluginStateInfo';
|
import PluginStateinfo from 'app/features/plugins/PluginStateInfo';
|
||||||
|
import { PanelPluginMeta } from '@grafana/ui';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
panel: PanelModel;
|
panel: PanelModel;
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
import React, { PureComponent } from 'react';
|
import React, { PureComponent } from 'react';
|
||||||
|
|
||||||
import { FilterInput } from 'app/core/components/FilterInput/FilterInput';
|
import { FilterInput } from 'app/core/components/FilterInput/FilterInput';
|
||||||
|
import { PanelPluginMeta } from '@grafana/ui';
|
||||||
import { PanelPluginMeta } from 'app/types';
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
plugin: PanelPluginMeta;
|
plugin: PanelPluginMeta;
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
import React, { PureComponent } from 'react';
|
import React, { PureComponent } from 'react';
|
||||||
|
|
||||||
import config from 'app/core/config';
|
import config from 'app/core/config';
|
||||||
import { PanelPluginMeta } from 'app/types/plugins';
|
|
||||||
import VizTypePickerPlugin from './VizTypePickerPlugin';
|
import VizTypePickerPlugin from './VizTypePickerPlugin';
|
||||||
import { EmptySearchResult } from '@grafana/ui';
|
import { PanelPluginMeta, EmptySearchResult } from '@grafana/ui';
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
current: PanelPluginMeta;
|
current: PanelPluginMeta;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { PanelPluginMeta } from 'app/types/plugins';
|
import { PanelPluginMeta } from '@grafana/ui';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
isCurrent: boolean;
|
isCurrent: boolean;
|
||||||
|
@ -6,8 +6,7 @@ import { Emitter } from 'app/core/utils/emitter';
|
|||||||
import { getNextRefIdChar } from 'app/core/utils/query';
|
import { getNextRefIdChar } from 'app/core/utils/query';
|
||||||
|
|
||||||
// Types
|
// Types
|
||||||
import { DataQuery, Threshold, ScopedVars, DataQueryResponseData } from '@grafana/ui';
|
import { PanelPluginMeta, DataQuery, Threshold, ScopedVars, DataQueryResponseData } from '@grafana/ui';
|
||||||
import { PanelPluginMeta } from 'app/types';
|
|
||||||
import config from 'app/core/config';
|
import config from 'app/core/config';
|
||||||
|
|
||||||
import { PanelQueryRunner } from './PanelQueryRunner';
|
import { PanelQueryRunner } from './PanelQueryRunner';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Plugin, PanelPluginMeta, PanelDataFormat } from 'app/types';
|
import { Plugin } from 'app/types';
|
||||||
import { PluginType } from '@grafana/ui';
|
import { PanelPluginMeta, PluginType, PanelDataFormat } from '@grafana/ui';
|
||||||
|
|
||||||
export const getMockPlugins = (amount: number): Plugin[] => {
|
export const getMockPlugins = (amount: number): Plugin[] => {
|
||||||
const plugins = [];
|
const plugins = [];
|
||||||
|
@ -1,18 +1,4 @@
|
|||||||
import { AngularPanelPlugin, PanelPlugin, PluginMeta } from '@grafana/ui/src/types';
|
import { PluginMeta } from '@grafana/ui';
|
||||||
|
|
||||||
export interface PanelPluginMeta extends PluginMeta {
|
|
||||||
hideFromList?: boolean;
|
|
||||||
sort: number;
|
|
||||||
angularPlugin: AngularPanelPlugin | null;
|
|
||||||
vizPlugin: PanelPlugin | null;
|
|
||||||
hasBeenImported?: boolean;
|
|
||||||
dataFormats: PanelDataFormat[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export enum PanelDataFormat {
|
|
||||||
Table = 'table',
|
|
||||||
TimeSeries = 'time_series',
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Values we don't want in the public API
|
* Values we don't want in the public API
|
||||||
|
@ -3,8 +3,7 @@ import config from 'app/core/config';
|
|||||||
import * as dateMath from 'app/core/utils/datemath';
|
import * as dateMath from 'app/core/utils/datemath';
|
||||||
import { angularMocks, sinon } from '../lib/common';
|
import { angularMocks, sinon } from '../lib/common';
|
||||||
import { PanelModel } from 'app/features/dashboard/state/PanelModel';
|
import { PanelModel } from 'app/features/dashboard/state/PanelModel';
|
||||||
import { PanelPluginMeta } from 'app/types';
|
import { PanelPluginMeta, RawTimeRange } from '@grafana/ui';
|
||||||
import { RawTimeRange } from '@grafana/ui/src/types';
|
|
||||||
|
|
||||||
export function ControllerTestContext(this: any) {
|
export function ControllerTestContext(this: any) {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
Loading…
Reference in New Issue
Block a user