mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
rename to pluginlistitem
This commit is contained in:
parent
cabc4c4bfe
commit
fede5e6c74
@ -1,11 +1,11 @@
|
|||||||
import React, { SFC } from 'react';
|
import React, { SFC } from 'react';
|
||||||
import classNames from 'classnames/bind';
|
import classNames from 'classnames/bind';
|
||||||
import PluginListItem from './PluginListItem';
|
import PluginListItem from './PluginListItem';
|
||||||
import { Plugin } from 'app/types';
|
import { PluginListItem } from 'app/types';
|
||||||
import { LayoutMode, LayoutModes } from '../../core/components/LayoutSelector/LayoutSelector';
|
import { LayoutMode, LayoutModes } from '../../core/components/LayoutSelector/LayoutSelector';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
plugins: Plugin[];
|
plugins: PluginListItem[];
|
||||||
layoutMode: LayoutMode;
|
layoutMode: LayoutMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import React, { SFC } from 'react';
|
import React, { SFC } from 'react';
|
||||||
import { Plugin } from 'app/types';
|
import { PluginListItem } from 'app/types';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
plugin: Plugin;
|
plugin: PluginListItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
const PluginListItem: SFC<Props> = props => {
|
const PluginListItem: SFC<Props> = props => {
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
import { PluginListPage, Props } from './PluginListPage';
|
import { PluginListPage, Props } from './PluginListPage';
|
||||||
import { NavModel, Plugin } from '../../types';
|
import { NavModel, PluginListItem } from '../../types';
|
||||||
import { LayoutModes } from '../../core/components/LayoutSelector/LayoutSelector';
|
import { LayoutModes } from '../../core/components/LayoutSelector/LayoutSelector';
|
||||||
|
|
||||||
const setup = (propOverrides?: object) => {
|
const setup = (propOverrides?: object) => {
|
||||||
const props: Props = {
|
const props: Props = {
|
||||||
navModel: {} as NavModel,
|
navModel: {} as NavModel,
|
||||||
plugins: [] as Plugin[],
|
plugins: [] as PluginListItem[],
|
||||||
layoutMode: LayoutModes.Grid,
|
layoutMode: LayoutModes.Grid,
|
||||||
loadPlugins: jest.fn(),
|
loadPlugins: jest.fn(),
|
||||||
};
|
};
|
||||||
|
@ -4,7 +4,7 @@ import { connect } from 'react-redux';
|
|||||||
import PageHeader from '../../core/components/PageHeader/PageHeader';
|
import PageHeader from '../../core/components/PageHeader/PageHeader';
|
||||||
import PluginActionBar from './PluginActionBar';
|
import PluginActionBar from './PluginActionBar';
|
||||||
import PluginList from './PluginList';
|
import PluginList from './PluginList';
|
||||||
import { NavModel, Plugin } from '../../types';
|
import { NavModel, PluginListItem } from '../../types';
|
||||||
import { loadPlugins } from './state/actions';
|
import { loadPlugins } from './state/actions';
|
||||||
import { getNavModel } from '../../core/selectors/navModel';
|
import { getNavModel } from '../../core/selectors/navModel';
|
||||||
import { getLayoutMode, getPlugins } from './state/selectors';
|
import { getLayoutMode, getPlugins } from './state/selectors';
|
||||||
@ -12,7 +12,7 @@ import { LayoutMode } from '../../core/components/LayoutSelector/LayoutSelector'
|
|||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
navModel: NavModel;
|
navModel: NavModel;
|
||||||
plugins: Plugin[];
|
plugins: PluginListItem[];
|
||||||
layoutMode: LayoutMode;
|
layoutMode: LayoutMode;
|
||||||
loadPlugins: typeof loadPlugins;
|
loadPlugins: typeof loadPlugins;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Plugin } from 'app/types';
|
import { PluginListItem } from 'app/types';
|
||||||
|
|
||||||
export const getMockPlugins = (amount: number): Plugin[] => {
|
export const getMockPlugins = (amount: number): PluginListItem[] => {
|
||||||
const plugins = [];
|
const plugins = [];
|
||||||
|
|
||||||
for (let i = 0; i <= amount; i++) {
|
for (let i = 0; i <= amount; i++) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Plugin, StoreState } from 'app/types';
|
import { PluginListItem, StoreState } from 'app/types';
|
||||||
import { ThunkAction } from 'redux-thunk';
|
import { ThunkAction } from 'redux-thunk';
|
||||||
import { getBackendSrv } from '../../../core/services/backend_srv';
|
import { getBackendSrv } from '../../../core/services/backend_srv';
|
||||||
import { LayoutMode } from '../../../core/components/LayoutSelector/LayoutSelector';
|
import { LayoutMode } from '../../../core/components/LayoutSelector/LayoutSelector';
|
||||||
@ -11,7 +11,7 @@ export enum ActionTypes {
|
|||||||
|
|
||||||
export interface LoadPluginsAction {
|
export interface LoadPluginsAction {
|
||||||
type: ActionTypes.LoadPlugins;
|
type: ActionTypes.LoadPlugins;
|
||||||
payload: Plugin[];
|
payload: PluginListItem[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface SetPluginsSearchQueryAction {
|
export interface SetPluginsSearchQueryAction {
|
||||||
@ -34,7 +34,7 @@ export const setPluginsSearchQuery = (query: string): SetPluginsSearchQueryActio
|
|||||||
payload: query,
|
payload: query,
|
||||||
});
|
});
|
||||||
|
|
||||||
const pluginsLoaded = (plugins: Plugin[]): LoadPluginsAction => ({
|
const pluginsLoaded = (plugins: PluginListItem[]): LoadPluginsAction => ({
|
||||||
type: ActionTypes.LoadPlugins,
|
type: ActionTypes.LoadPlugins,
|
||||||
payload: plugins,
|
payload: plugins,
|
||||||
});
|
});
|
||||||
|
@ -1,8 +1,12 @@
|
|||||||
import { Action, ActionTypes } from './actions';
|
import { Action, ActionTypes } from './actions';
|
||||||
import { Plugin, PluginsState } from 'app/types';
|
import { PluginListItem, PluginsState } from 'app/types';
|
||||||
import { LayoutModes } from '../../../core/components/LayoutSelector/LayoutSelector';
|
import { LayoutModes } from '../../../core/components/LayoutSelector/LayoutSelector';
|
||||||
|
|
||||||
export const initialState: PluginsState = { plugins: [] as Plugin[], searchQuery: '', layoutMode: LayoutModes.Grid };
|
export const initialState: PluginsState = {
|
||||||
|
plugins: [] as PluginListItem[],
|
||||||
|
searchQuery: '',
|
||||||
|
layoutMode: LayoutModes.Grid,
|
||||||
|
};
|
||||||
|
|
||||||
export const pluginsReducer = (state = initialState, action: Action): PluginsState => {
|
export const pluginsReducer = (state = initialState, action: Action): PluginsState => {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
|
@ -6,7 +6,7 @@ import { FolderDTO, FolderState, FolderInfo } from './folders';
|
|||||||
import { DashboardState } from './dashboard';
|
import { DashboardState } from './dashboard';
|
||||||
import { DashboardAcl, OrgRole, PermissionLevel } from './acl';
|
import { DashboardAcl, OrgRole, PermissionLevel } from './acl';
|
||||||
import { DataSource } from './datasources';
|
import { DataSource } from './datasources';
|
||||||
import { PluginMeta, Plugin, PluginsState } from './plugins';
|
import { PluginMeta, PluginListItem, PluginsState } from './plugins';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
Team,
|
Team,
|
||||||
@ -33,7 +33,7 @@ export {
|
|||||||
PermissionLevel,
|
PermissionLevel,
|
||||||
DataSource,
|
DataSource,
|
||||||
PluginMeta,
|
PluginMeta,
|
||||||
Plugin,
|
PluginListItem,
|
||||||
PluginsState,
|
PluginsState,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ export interface PluginMetaInfo {
|
|||||||
version: string;
|
version: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Plugin {
|
export interface PluginListItem {
|
||||||
defaultNavUrl: string;
|
defaultNavUrl: string;
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
hasUpdate: boolean;
|
hasUpdate: boolean;
|
||||||
@ -41,7 +41,7 @@ export interface Plugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface PluginsState {
|
export interface PluginsState {
|
||||||
plugins: Plugin[];
|
plugins: PluginListItem[];
|
||||||
searchQuery: string;
|
searchQuery: string;
|
||||||
layoutMode: string;
|
layoutMode: string;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user