瀏覽代碼

fixing types

Peter Holmberg 7 年之前
父節點
當前提交
cabc4c4bfe
共有 3 個文件被更改,包括 8 次插入12 次删除
  1. 2 1
      public/app/features/plugins/PluginListPage.test.tsx
  2. 1 2
      public/app/types/index.ts
  3. 5 9
      public/app/types/plugins.ts

+ 2 - 1
public/app/features/plugins/PluginListPage.test.tsx

@@ -2,12 +2,13 @@ import React from 'react';
 import { shallow } from 'enzyme';
 import { PluginListPage, Props } from './PluginListPage';
 import { NavModel, Plugin } from '../../types';
+import { LayoutModes } from '../../core/components/LayoutSelector/LayoutSelector';
 
 const setup = (propOverrides?: object) => {
   const props: Props = {
     navModel: {} as NavModel,
     plugins: [] as Plugin[],
-    layoutMode: 'grid',
+    layoutMode: LayoutModes.Grid,
     loadPlugins: jest.fn(),
   };
 

+ 1 - 2
public/app/types/index.ts

@@ -6,7 +6,7 @@ import { FolderDTO, FolderState, FolderInfo } from './folders';
 import { DashboardState } from './dashboard';
 import { DashboardAcl, OrgRole, PermissionLevel } from './acl';
 import { DataSource } from './datasources';
-import { PluginMeta, Plugin, PluginInfo, PluginsState } from './plugins';
+import { PluginMeta, Plugin, PluginsState } from './plugins';
 
 export {
   Team,
@@ -33,7 +33,6 @@ export {
   PermissionLevel,
   DataSource,
   PluginMeta,
-  PluginInfo,
   Plugin,
   PluginsState,
 };

+ 5 - 9
public/app/types/plugins.ts

@@ -12,20 +12,16 @@ export interface PluginInclude {
 }
 
 export interface PluginMetaInfo {
-  logos: {
-    large: string;
-    small: string;
-  };
-}
-
-export interface PluginInfo {
   author: {
     name: string;
     url: string;
   };
   description: string;
   links: string[];
-  logos: { small: string; large: string };
+  logos: {
+    large: string;
+    small: string;
+  };
   screenshots: string;
   updated: string;
   version: string;
@@ -36,7 +32,7 @@ export interface Plugin {
   enabled: boolean;
   hasUpdate: boolean;
   id: string;
-  info: PluginInfo;
+  info: PluginMetaInfo;
   latestVersion: string;
   name: string;
   pinned: boolean;